The reduced-row-echelon-form.java of this example:
double[][] matrix_0 = {
{1,0,-1,0},
{0,1,0,-1},
{1,-2,-1,0},
{-1,0,3,1}
};
Matrix x = new Matrix(matrix_0);
System.out.println("before\n" + x.toString() + "\n");
x.RREF();
System.out.println("after\n" + x.toString() + "\n");
should return the 4x4 identity matrix.
See wolframalpha for the input:
RowReduce({{1,0,-1,0},{0,1,0,-1},{1,-2,-1,0},{-1,0,3,1}})