public static DMatrixRMaj stripReal ( ZMatrixD1 input , DMatrixRMaj output ) { if ( output == null ) { output = new DMatrixRMaj ( input . numRows , input . numCols ) ; } else if ( input . numCols != output . numCols || input . numRows != output . numRows ) { throw new IllegalArgumentException ( "The matrices are not all the same dimension." ) ; } final int length = input . getDataLength ( ) ; for ( int i = 0 ; i < length ; i += 2 ) { output . data [ i / 2 ] = input . data [ i ] ; } return output ; }
Places the real component of the input matrix into the output matrix .