Пример #1
0
 public void RayTerminationDump(int enter, Tableau A, LCP start) {
   output.println(
       String.format("Ray termination when trying to enter %s", A.vars().toString(enter)));
   output.println("Starting LCP:");
   output.println(start.toString());
   output.println("Final Tableau:");
   output.println(A.toString());
   output.println("Current basis, not an LCP solution:");
   WriteSolution(A);
 }
Пример #2
0
  public void WriteSolution(String message, Tableau A) {
    colpp.writeCol("basis=");
    for (int i = 0; i <= A.vars().size(); i++) /* num Z plus z0 */ {
      String s;
      if (A.vars().isBasic(A.vars().z(i))) /*  Z(i) is a basic variable        */
        s = A.vars().toString(A.vars().z(i));
      else if (i > 0
          && A.vars().isBasic(A.vars().w(i))) /*  W(i) is a basic variable, W(0) not valid        */
        s = A.vars().toString(A.vars().w(i));
      else s = "  ";
      colpp.writeCol(s);
    }
    colpp.endRow();

    colpp.writeCol("z=");
    for (int i = 0; i <= A.vars().size(); i++) {
      int var = A.vars().z(i);
      colpp.writeCol(A.result(var).toString()); /* value of Z(i)    */
    }
    colpp.endRow();

    colpp.writeCol("w=");
    colpp.writeCol(""); /* for complementarity in place of W(0)             */
    for (int i = 1; i <= A.vars().size(); i++) {
      int var = A.vars().w(i);
      colpp.writeCol(A.result(var).toString()); /* value of W(i)      */
    } /* end of  for (i=...)          */
    output.write(colpp.toString());
  } /* end of outsol                */