public static DMatrixRMaj [ ] splitIntoVectors ( DMatrix1Row A , boolean column ) { int w = column ? A . numCols : A . numRows ; int M = column ? A . numRows : 1 ; int N = column ? 1 : A . numCols ; int o = Math . max ( M , N ) ; DMatrixRMaj [ ] ret = new DMatrixRMaj [ w ] ; for ( int i = 0 ; i < w ; i ++ ) { DMatrixRMaj a = new DMatrixRMaj ( M , N ) ; if ( column ) subvector ( A , 0 , i , o , false , 0 , a ) ; else subvector ( A , i , 0 , o , true , 0 , a ) ; ret [ i ] = a ; } return ret ; }
Takes a matrix and splits it into a set of row or column vectors .