diff --git a/src/Simplex.java b/src/Simplex.java
index b8c0215743e07dc3ddc2e71f7b5bac455503a71b..2dee6e96943499a17521cb3f38d1f905e4c87dda 100644
--- a/src/Simplex.java
+++ b/src/Simplex.java
@@ -61,7 +61,7 @@ public class Simplex {
int which_phase(){
int res = -1;
for (int i = 0; i < x; i++) {
- if(!signe(matEcart[i][y - 1]))
+ if(signe(matEcart[i][y - 1]))
res = i;
}
return res;
@@ -78,7 +78,7 @@ public class Simplex {
int getFirstNeg() {
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;
}
@@ -101,7 +101,7 @@ public class Simplex {
}
}
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;
}
if (has_neg) pivot();
@@ -122,6 +122,6 @@ public class Simplex {
}
boolean signe(Double x) {
- return x >= 0;
+ return x < 0;
}
}