public static void extract ( DMatrixRMaj src , int rows [ ] , int rowsSize , int cols [ ] , int colsSize , DMatrixRMaj dst ) { if ( rowsSize != dst . numRows || colsSize != dst . numCols ) throw new MatrixDimensionException ( "Unexpected number of rows and/or columns in dst matrix" ) ; int indexDst = 0 ; for ( int i = 0 ; i < rowsSize ; i ++ ) { int indexSrcRow = src . numCols * rows [ i ] ; for ( int j = 0 ; j < colsSize ; j ++ ) { dst . data [ indexDst ++ ] = src . data [ indexSrcRow + cols [ j ] ] ; } } }
Extracts out a matrix from source given a sub matrix with arbitrary rows and columns specified in two array lists