Logo Search packages:      
Sourcecode: jblas version File versions  Download package

org::jblas::la::FloatMatrix::FloatMatrix ( float  data[][]  )  [inline]

Creates a new n times m FloatMatrix from the given n times m 2D data array. The first dimension of the array makes the rows (n) and the second dimension the columns (m). For example, the given code

new FloatMatrix(new float[][]{{1d, 2d, 3d}, {4d, 5d, 6d}, {7d, 8d, 9d}}).print();

will constructs the following matrix:

 1.0f	2.0f	3.0f
 4.0f	5.0f	6.0f
 7.0f	8.0f	9.0f
data n times m data array

Definition at line 360 of file FloatMatrix.java.

References columns, length, put(), and rows.

        this(data.length, data[0].length);

        for (int r = 0; r < rows; r++) {
            assert (data[r].length == columns);

        for (int r = 0; r < rows; r++) {
            for (int c = 0; c < columns; c++) {
                put(r, c, data[r][c]);

Generated by  Doxygen 1.6.0   Back to index