JMAT project has ended and is forked in JMATHTOOLS toolbox

Goals

JMAT allows to design and to develop linear algebra algorithms in JAVA.

Description

JMAT is a JAVA package for matrix manipulation and visualization.
JMAT implements common matrix algorithms (Eig, SVD, Cholesky, QR, LU), so you can easily manipulate matrix objects within your java classes.
JMAT needs the Java Virtual Machine 1.4.1.

In order to simplify migration from MATLAB to JMAT, a special class (MatlabSyntax) provides a syntax very close to MATLAB.

Example of use

This java source code uses JMAT to compute the Principal Component Analysis :
package org.jmat.test;

import org.jmat.data.*;
import org.jmat.data.matrixDecompositions.*;
import org.jmat.gui.*;

/**
* <p>Description : Principal Component Analysis</p>
* <p>Copyright : GPL</p>
* @author Yann RICHET
*/

public class PCA {

private AbstractMatrix covariance;
private AbstractMatrix EigenVectors;
private AbstractMatrix EigenValues;

public PCA(AbstractMatrix X) {
covariance = new RandomMatrix(X).covariance();
EigenvalueDecomposition e = covariance.eig();
EigenVectors = e.getV();
EigenValues = e.getD();
}

public AbstractMatrix getVectors() {
return EigenVectors;
}

public AbstractMatrix getValues() {
return EigenValues;
}

public static void main(String[] arg) {
//construct the matrix X
AbstractMatrix x1 = RandomMatrix.normal(100, 1, 0, 1);
AbstractMatrix x2 = RandomMatrix.normal(100, 1, 0, 1);
AbstractMatrix X = x1.plus(x2).mergeColumns(x2);

PCA pca = new PCA(X);

//display a Frame with data in a 2D-Plot and EigenValues and EigenVectors in the command line.
new FrameView(X.toPlot2DPanel("[x1+x2,x2]", PlotPanel.SCATTER));
pca.getValues().toCommandLine("EigenValues");
pca.getVectors().toCommandLine("EigenVectors");
}
}

Features

Matrix construction & manipulations
Matrix linear algebra functions
Matrix decompositions & tools
I/O
Statistical tools
from double[][]
identity
random
increment

get / set element
get / set SubMatrix
get / set Diagonal(s)
get / set row(s) / column(s)

resize
merge
reshape

plus, minux, uminus
times, ebeTimes
divide, ebeDivide
solve, inverse
ebeLog, ebePow, ebeExp, ebeSin, ebeCos

norm1, norm2, normInf, normFrobenius
condition, determinant, trace, rank
min, max, sum, product
mean, variance, covariance, correlation
Cholesky
SVD
QR
Eigenvectors / EigenValues
LU

sort rows / columns
find elements:
== <= >= < > !=
shuffle rows / columns
slice as a sample (for histogram)
Plots 2D / 3D :
- ScatterPlot
- Histogram
- LinePlot
- BoxPlot
- StairCasePlot
- BarPlot

XML / MathML

ASCII

Binary Little / Big endian

random generators:
- uniform
- normal
- lognormal
- exponential
- triangular
- cauchy
- beta
- weibull
- bootstrap
- rejection



SourceForge Logo