code: public static DMatrixRMaj rref(DMatrixRMaj A , int numUnknowns, DMatrixRMaj reduced ) {
          if( reduced == null ) {
              reduced = new DMatrixRMaj(A.numRows,A.numCols);
          }
          reduced.reshape(A.numRows,A.numCols);
  
          if( numUnknowns <= 0 )
              numUnknowns = Math.min(A.numCols,A.numRows);
  
          ReducedRowEchelonForm_F64<DMatrixRMaj> alg = new RrefGaussJordanRowPivot_DDRM();
          alg.setTolerance(elementMaxAbs(A)* UtilEjml.EPS*Math.max(A.numRows,A.numCols));
  
          reduced.set(A);
          alg.reduce(reduced, numUnknowns);
  
          return reduced;
      }
docs: <p>
  Puts the augmented system matrix into reduced row echelon form (RREF) using Gauss-Jordan
  elimination with row (partial) pivots.  A matrix is said to be in RREF is the following conditions are true:
  </p>
  
  <ol>
  <li>If a row has non-zero entries, then the first non-zero entry is 1.  This is known as the leading one.</li>
  <li>If a column contains a leading one then all other entries in that column are zero.</li>
  <li>If a row contains a leading 1, then each row above contains a leading 1 further to the left.</li>
  </ol>
  
  <p>
  [1] Page 19 in, Otter Bretscherm "Linear Algebra with Applications" Prentice-Hall Inc, 1997
  </p>
  
  @see RrefGaussJordanRowPivot_DDRM
  
  @param A Input matrix.  Unmodified.
  @param numUnknowns Number of unknowns/columns that are reduced. Set to -1 to default to
  Math.min(A.numRows,A.numCols), which works for most systems.
  @param reduced Storage for reduced echelon matrix. If null then a new matrix is returned. Modified.
  @return Reduced echelon form of A