public static DoubleMatrix getInstance ( int rows , int cols , ItemSupplier s ) { DoubleMatrix m = new DoubleMatrix ( rows , cols ) ; ItemConsumer c = m . consumer ; for ( int i = 0 ; i < rows ; i ++ ) { for ( int j = 0 ; j < cols ; j ++ ) { c . set ( i , j , s . get ( i , j ) ) ; } } return m ; }
Returns new DoubleMatrix initialized by function