code: public static DMatrixRMaj convert(DMatrix2 input , DMatrixRMaj output ) {
          if( output == null)
              output = new DMatrixRMaj(2,1);
  
          if( output.getNumRows() != 1 && output.getNumCols() != 1 )
              throw new IllegalArgumentException("One row or column must have a length of 1 for it to be a vector");
          int length = Math.max(output.getNumRows(),output.getNumCols());
          if( length != 2 )
              throw new IllegalArgumentException("Length of input vector is not 2.  It is "+length);
  
          output.data[0] = input.a1;
          output.data[1] = input.a2;
  
          return output;
      }
docs: Converts {@link DMatrix2} into {@link DMatrixRMaj}.
  
  @param input Input matrix.
  @param output Output matrix.  If null a new matrix will be declared.
  @return Converted matrix.