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 master
No related tags found
No related merge requests found
......@@ -84,9 +84,8 @@ public class Main {
spx.printSimplex(spx.getMatEcart(), "Tableau initial", 0);
// true = phase 1 membres de droite pas admissible | false = phase 2 membres de droite admissible
int phase = spx.which_phase();
if (phase != -1) {
spx.tabAux(phase);
if (spx.which_phase()) {
spx.tabAux(0); // TODO changer ça
} else {
spx.pivot(spx.getMatEcart());
spx.printSimplex(spx.getMatEcart(), "Résultat", 3);
......
......@@ -59,12 +59,11 @@ public class Simplex {
*
* @return true = phase 1 | false = phase 2
*/
int which_phase() {
int res = -1;
boolean which_phase() {
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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment