Skip to content

Commit

Permalink
bland's rule fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Francois Schwarzentruber committed Nov 17, 2023
1 parent 3ac33a2 commit b5555c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,8 @@
function chooseLeavingVariableSmallestSubscript(T, j) {
let min = Infinity;
let vI = undefined
for (let i in T.A) if (T.A[i][j] < 0 && -T.b[i] / T.A[i][j] < min) {
// in order to have the smallest index, we reverse the array of keys
for (let i of Object.keys(T.A).reverse()) if (T.A[i][j] < 0 && -T.b[i] / T.A[i][j] < min) {
vI = i;
min = -T.b[i] / T.A[i][j];
}
Expand Down

0 comments on commit b5555c3

Please sign in to comment.