reduced-row-echelon-form.java returns wrong result #13

Open
opened 2018-05-02 13:17:14 -04:00 by axkr · 0 comments
axkr commented 2018-05-02 13:17:14 -04:00 (Migrated from github.com)

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}})
The [reduced-row-echelon-form.java](https://github.com/acmeism/RosettaCodeData/blob/master/Task/Reduced-row-echelon-form/Java/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](http://www.wolframalpha.com) for the input: ``` RowReduce({{1,0,-1,0},{0,1,0,-1},{1,-2,-1,0},{-1,0,3,1}}) ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: aparler/RosettaCodeData#13
No description provided.