Skip to content
Snippets Groups Projects
Commit 293e49d1 authored by thibault.capt's avatar thibault.capt
Browse files

régler probleme - sur une ligne

parent c7f024a4
Branches
No related tags found
No related merge requests found
...@@ -84,9 +84,8 @@ public class Main { ...@@ -84,9 +84,8 @@ public class Main {
spx.printSimplex(spx.getMatEcart(), "Tableau initial", 0); spx.printSimplex(spx.getMatEcart(), "Tableau initial", 0);
// true = phase 1 membres de droite pas admissible | false = phase 2 membres de droite admissible // true = phase 1 membres de droite pas admissible | false = phase 2 membres de droite admissible
int phase = spx.which_phase(); if (spx.which_phase()) {
if (phase != -1) { spx.tabAux(0); // TODO changer ça
spx.tabAux(phase);
} else { } else {
spx.pivot(spx.getMatEcart()); spx.pivot(spx.getMatEcart());
spx.printSimplex(spx.getMatEcart(), "Résultat", 3); spx.printSimplex(spx.getMatEcart(), "Résultat", 3);
......
...@@ -59,12 +59,11 @@ public class Simplex { ...@@ -59,12 +59,11 @@ public class Simplex {
* *
* @return true = phase 1 | false = phase 2 * @return true = phase 1 | false = phase 2
*/ */
int which_phase() { boolean which_phase() {
int res = -1;
for (int i = 0; i < this.x; i++) { for (int i = 0; i < this.x; i++) {
if (signe(this.matEcart.getData(i, this.y - 1))) res = i; if (signe(this.matEcart.getData(i, this.y - 1))) return true;
} }
return res; return false;
} }
void tabAux(int line) { void tabAux(int line) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment