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

change sign

parent a008e66b
No related branches found
No related tags found
No related merge requests found
......@@ -78,8 +78,11 @@ public class Main {
//System.out.println(Arrays.deepToString(spx.getMatEcart()));
// true = phase 1 membres de droite pas admissible | false = phase 2 membres de droite admissible
if (spx.which_phase())
spx.tabAux();
int phase = spx.which_phase();
if (phase != -1) {
spx.tabAux(phase);
spx.printSimplex("Tableau aux");
}
else {
spx.pivot();
spx.printSimplex("pivot");
......
......@@ -58,16 +58,22 @@ public class Simplex {
* Si b[i] < 0 phase 1 sinon phase 2
* @return true = phase 1 | false = phase 2
*/
boolean which_phase(){
boolean res = false;
int which_phase(){
int res = -1;
for (int i = 0; i < x; i++) {
if(!signe(matEcart[i][y - 1]))
res = true;
res = i;
}
return res;
}
void tabAux() {
void tabAux(int line) {
// TODO mettre en positif membre de droite
for (int j = 0; j < y; j ++) {
if( matEcart[line][j] != 0.0) {
double res = matEcart[line][j] * -1;
setMatEcartById(res, line, j);
}
}
}
int getFirstNeg() {
......
max;8;9;
min;-8;-9;
2;5;<=;12;
50;5;<=;150;
5;50;<=;100;
1;2;<=;-1;
\ No newline at end of file
-1;-2;<=;-1;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment