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

static FloatMatrix org::jblas::la::FloatMatrix::rand ( int  rows,
int  columns 
) [inline, static]

Create matrix with random values uniformly in 0..1.

Definition at line 375 of file FloatMatrix.java.

References data, and FloatMatrix().

Referenced by rand().

                                                          {
        FloatMatrix m = new FloatMatrix(rows, columns);

        java.util.Random r = new java.util.Random();
        for (int i = 0; i < rows * columns; i++) {
            m.data[i] = r.nextFloat();
        }

        return m;
    }


Generated by  Doxygen 1.6.0   Back to index