question: public static double [ ] [ ] truncateRows ( double [ ] [ ] matrix , int nCols ) { final int nRows = matrix . length ; final double [ ] [ ] result = new double [ nRows ] [ nCols ] ; for ( int row = 0 ; row < nRows ; row ++ ) { System . arraycopy ( matrix [ row ] , 0 , result [ row ] , 0 , nCols ) ; } return result ; }
target:  copy only first nCols of matrix