Skip to content

Commit

Permalink
Condensing code
Browse files Browse the repository at this point in the history
  • Loading branch information
fusion809 committed Nov 23, 2020
1 parent 9956aa0 commit 12d1c04
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions simplex.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function simplex(A, b, cj, x, xB, zc) {
var befAltSol = false;
var {minIndex, isFeas, isOptim} = isOptAndFeas(b, zc);

// Adjust algorithm used depending on whether problem is feasible or not
if (!isFeas) {
var [k, pivCol, ratio, pivEl, pivColIdx, pivRowIdx] =
findInfPivots(A, zc, minIndex, pivColIdx, m, mn);
Expand All @@ -88,8 +89,8 @@ function simplex(A, b, cj, x, xB, zc) {
isPermInf = false;

// Obtain pivot information
var arr = findPivots(A, b, zc);
var [pivEl, pivCol, pivColIdx, pivRowIdx, ratio, isUnbounded] = arr;
var [pivEl, pivCol, pivColIdx, pivRowIdx, ratio, isUnbounded] =
findPivots(A, b, zc);
}

// Tabulate previous iteration
Expand Down

0 comments on commit 12d1c04

Please sign in to comment.