code: public static DMatrixRMaj copyChangeRow(int order[] , DMatrixRMaj src , DMatrixRMaj dst )
      {
          if( dst == null ) {
              dst = new DMatrixRMaj(src.numRows,src.numCols);
          } else if( src.numRows != dst.numRows || src.numCols != dst.numCols ) {
              throw new IllegalArgumentException("src and dst must have the same dimensions.");
          }
  
          for( int i = 0; i < src.numRows; i++ ) {
              int indexDst = i*src.numCols;
              int indexSrc = order[i]*src.numCols;
  
              System.arraycopy(src.data,indexSrc,dst.data,indexDst,src.numCols);
          }
  
          return dst;
      }
docs: Creates a copy of a matrix but swaps the rows as specified by the order array.
  
  @param order Specifies which row in the dest corresponds to a row in the src. Not modified.
  @param src The original matrix. Not modified.
  @param dst A Matrix that is a row swapped copy of src. Modified.