diff --git a/src/Simplex.java b/src/Simplex.java index d98829f7b2975fd141e03e59e309ce4b01029d15..6cc64912b2518aebd24911ed9daa2c51b1f4e769 100644 --- a/src/Simplex.java +++ b/src/Simplex.java @@ -163,12 +163,16 @@ public class Simplex { * @return la colonne du premier négatif rencontré */ int getFirstNeg(Matrix mat) { + // Méthode 1 : premier négatif + /*for (int j = 0; j < mat.getCol() - 1; j++) { + if (signe(mat.getData(mat.getLine() - 1, j))) return j; + } + return -1;*/ + + // Méthode 2 : plus petit négatif int id = -1; double tmpVal = 0; double val = 0; - /*for (int j = 0; j < mat.getCol() - 1; j++) { - if (signe(mat.getData(mat.getLine() - 1, j))) return j; - }*/ for (int j = 0; j < mat.getCol() - 1; j++) { tmpVal = mat.getData(mat.getLine() - 1, j); if (signe(tmpVal)) {