private Matrix < Double > generateRandomMatrix ( final int nRows , final int nColumns ) { final List < List < Double > > rows = new ArrayList <> ( nRows ) ; final Random random = new Random ( ) ; for ( int i = 0 ; i < nRows ; i ++ ) { final List < Double > row = new ArrayList <> ( nColumns ) ; for ( int j = 0 ; j < nColumns ; j ++ ) { row . add ( random . nextDouble ( ) ) ; } rows . add ( row ) ; } return new RowMatrix ( rows ) ; }
Generate a matrix with random values .