public static DMatrixRMaj extractColumn ( DMatrixRMaj a , int column , DMatrixRMaj out ) { if ( out == null ) out = new DMatrixRMaj ( a . numRows , 1 ) ; else if ( ! MatrixFeatures_DDRM . isVector ( out ) || out . getNumElements ( ) != a . numRows ) throw new MatrixDimensionException ( "Output must be a vector of length " + a . numRows ) ; int index = column ; for ( int i = 0 ; i < a . numRows ; i ++ , index += a . numCols ) { out . data [ i ] = a . data [ index ] ; } return out ; }
Extracts the column from a matrix .