diff --git a/src/Main.java b/src/Main.java index 368b2da61a5cd0a9eea6124fff518f525ceef94b..c2c14d58823378c6e6d4cce235400fb5c8617659 100644 --- a/src/Main.java +++ b/src/Main.java @@ -80,7 +80,7 @@ public class Main { spx.tabAux(); else spx.pivot(0); - + spx.printSimplex("pivot"); sc.close(); } catch (FileNotFoundException e) { throw new RuntimeException(e); diff --git a/src/Simplex.java b/src/Simplex.java index 78733e0854228b866c949aace6b4ac36ed577e5e..18f7af21d390dd6db1b70a5f917c88b4f7283669 100644 --- a/src/Simplex.java +++ b/src/Simplex.java @@ -18,9 +18,9 @@ public class Simplex { for (int i = 0; i < x; i++) { for (int j = 0; j < y; j++) { if (matEcart[i][j] < 0.0) - System.out.print(matEcart[i][j] + " "); + System.out.printf("%.2f ", matEcart[i][j]); else - System.out.print(" " + matEcart[i][j] + " "); + System.out.printf(" %.2f ", matEcart[i][j]); } System.out.println(); } @@ -82,7 +82,6 @@ public class Simplex { } } } - printSimplex("pivot"); for (int j = 0; j < this.y; j++) if (!signe(this.matEcart[x - 1][j])) { has_neg = true;