You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documentation of jblas is a bit sparse at it is. A good starting point are the Javadoc pages and main classes like DoubleMatrix.
A minimal example which constructs a matrix and a vector and multiplies them looks like this:
import org.jblas.DoubleMatrix;
public class Example {
public static void main(String[] args) {
DoubleMatrix A = new DoubleMatrix(new double[][]{
{1.0, 2.0, 3.0},
{4.0, 5.0, 6.0},
{7.0, 8.0, 9.0}
});
DoubleMatrix x = new DoubleMatrix(new double[][] {
{1.0, 2.0, 3.0},
{1.0, 2.0, 3.0},
{1.0, 2.0, 3.0}
});
DoubleMatrix y;
y = A.mmul(x);
}
}
Operators are mapped to short names, “+” becomes “add”, “-” becomes “sub”, and so on. jblas only support two-dimensional matrices, and also considers vectors as two-dimensional matrices (having only one row or column).