package proof.solver;

import proof.exception.LinearProgramException;

/**
 * Wrapper class for calling the CPLEX optimization suite linear program solver.
 *
 * @author Tilo Wiedera
 */
class Cplex extends Solver {
  @Override
  protected String getCommand(String filename) {
    return "cplex -c read " + filename + " optimize quit";
  }

  @Override
  protected void handleLine(String line) throws LinearProgramException {
    if (line.contains("Dual simplex - Optimal:")) {
      setResult(parseDouble(line));
    } else if (line.contains("No problem exists.")) {
      setResult(0);
    } else if (line.contains("Infeasible.") || line.contains("CPLEX Error")) {
      returnInfeasiblity();
    }
  }
}

@@ -446,20 +446,8 @@
 ns(%22
-Dual simplex
  - O

Fix CPLEX Wrapper