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

change sign

parent abf31903
No related branches found
No related tags found
No related merge requests found
...@@ -61,7 +61,7 @@ public class Simplex { ...@@ -61,7 +61,7 @@ public class Simplex {
int which_phase(){ int which_phase(){
int res = -1; int res = -1;
for (int i = 0; i < x; i++) { for (int i = 0; i < x; i++) {
if(!signe(matEcart[i][y - 1])) if(signe(matEcart[i][y - 1]))
res = i; res = i;
} }
return res; return res;
...@@ -78,7 +78,7 @@ public class Simplex { ...@@ -78,7 +78,7 @@ public class Simplex {
int getFirstNeg() { int getFirstNeg() {
for (int j = 0; j < this.y; j++) { for (int j = 0; j < this.y; j++) {
if(!signe(matEcart[x-1][j])) return j; if(signe(matEcart[x - 1][j])) return j;
} }
return -1; return -1;
} }
...@@ -101,7 +101,7 @@ public class Simplex { ...@@ -101,7 +101,7 @@ public class Simplex {
} }
} }
for (int j = 0; j < this.y; j++) for (int j = 0; j < this.y; j++)
if (!signe(this.matEcart[x - 1][j])) { if (signe(this.matEcart[x - 1][j])) {
has_neg = true; has_neg = true;
} }
if (has_neg) pivot(); if (has_neg) pivot();
...@@ -122,6 +122,6 @@ public class Simplex { ...@@ -122,6 +122,6 @@ public class Simplex {
} }
boolean signe(Double x) { boolean signe(Double x) {
return x >= 0; return x < 0;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment