Talk:Reduced row echelon form: Difference between revisions

(→‎New test cases: new section)
Line 125:
::
:: edit: looking into it, the lead-- line seems to deviate from the original algorithm, replacing that with a "return matrix;" seems to fix it.
 
== New test cases ==
 
Recently, I found that the earlier Java version did not work as expected due to floating point errors.
 
I recommend including these in your respecting languages:
double matrix_2 [][] = {
{2, 0, -1, 0, 0},
{1, 0, 0, -1, 0},
{3, 0, 0, -2, -1},
{0, 1, 0, 0, -2},
{0, 1, -1, 0, 0}
};
 
solution:
[[1, 0, 0, 0, -1]
[0, 1, 0, 0, -2]
[0, 0, 1, 0, -2]
[0, 0, 0, 1, -1]
[0, 0, 0, 0, 0]]
 
double matrix_3 [][] = {
{1, 2, 3, 4, 3, 1},
{2, 4, 6, 2, 6, 2},
{3, 6, 18, 9, 9, -6},
{4, 8, 12, 10, 12, 4},
{5, 10, 24, 11, 15, -4}
};
 
solution:
[[1, 2, 0, 0, 3, 4]
[0, 0, 1, 0, 0, -1]
[0, 0, 0, 1, 0, 0]
[0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0]]
 
double matrix_4 [][] = {
{0, 1},
{1, 2},
{0,5}
};
 
solution:
[[1, 0]
[0, 1]
[0, 0]]
Anonymous user