public void set ( int numRows , int numCols , boolean rowMajor , double ... data ) { reshape ( numRows , numCols ) ; int length = numRows * numCols ; if ( length > this . data . length ) throw new IllegalArgumentException ( "The length of this matrix's data array is too small." ) ; if ( rowMajor ) { System . arraycopy ( data , 0 , this . data , 0 , length ) ; } else { int index = 0 ; for ( int i = 0 ; i < numRows ; i ++ ) { for ( int j = 0 ; j < numCols ; j ++ ) { this . data [ index ++ ] = data [ j * numRows + i ] ; } } } }
Sets this matrix equal to the matrix encoded in the array .