Schabby's Blog
Reserve Orbital Defence Commander

I just downloaded the latest jBLAS version, added it to my classpath and ... it worked! That was easier than expected, because at the time I was involved, we had to compile the native fortran stuff manually for each target OS. Mikio Braun did hell of a job on packing everything in a single JAR.

Here's a little code snipped that I got to work out of the box (note that it uses ATLAS under the hood)

public static void main(String[] args)
	double[][] data = new double[][]
                   {{ 1,  2,  3,   4,   5},
                    { 6,  7,  8,   9,  10},
                    {11, 12, 13, 14, 15}};
	DoubleMatrix matrix = new DoubleMatrix(data);
	DoubleMatrix vector = new DoubleMatrix(new double[]{3, 3, 3, 3,3});
	DoubleMatrix result = matrix.mmul(vector);
	System.out.println(result.rows+"x"+result.columns+": "+result);

Eine Antwort

  1. Sonam says:

    Dear Johannes,

    Would you mind to describe how you add jBLAS jar to the classpath? Please help me, I am in badly need to use DobuleMatrix class.

    Thanks in advance. If you can send me to my email

Post Comment

Please notice: Comments are moderated by an Admin.