42 mysoplex.setIntParam(SoPlex::OBJSENSE, SoPlex::OBJSENSE_MINIMIZE);
59 mysoplex.writeFileReal(
"dump_real.lp", NULL, NULL, NULL);
65 stat = mysoplex.optimize();
68 if(stat == SPxSolver::OPTIMAL)
70 mysoplex.getPrimal(prim);
71 mysoplex.getDual(dual);
72 std::cout <<
"LP solved to optimality.\n";
73 std::cout <<
"Objective value is " << mysoplex.objValueReal() <<
".\n";
74 std::cout <<
"Primal solution is [" << prim[0] <<
", " << prim[1] <<
"].\n";
75 std::cout <<
"Dual solution is [" << dual[0] <<
"].\n";
79 std::cout <<
"Error: SoPlex returned with status " << stat <<
".\n";
89 mysoplex.setIntParam(SoPlex::READMODE, SoPlex::READMODE_RATIONAL);
90 mysoplex.setIntParam(SoPlex::SOLVEMODE, SoPlex::SOLVEMODE_RATIONAL);
91 mysoplex.setIntParam(SoPlex::CHECKMODE, SoPlex::CHECKMODE_RATIONAL);
92 mysoplex.setIntParam(SoPlex::SYNCMODE, SoPlex::SYNCMODE_AUTO);
93 mysoplex.setRealParam(SoPlex::FEASTOL, 0.0);
94 mysoplex.setRealParam(SoPlex::OPTTOL, 0.0);
97 mysoplex.setIntParam(SoPlex::OBJSENSE, SoPlex::OBJSENSE_MINIMIZE);
119 mysoplex.writeFileRational(
"dump_rational.lp", NULL, NULL, NULL);
125 stat = mysoplex.optimize();
128 if(stat == SPxSolver::OPTIMAL)
130 mysoplex.getPrimalRational(prim);
131 mysoplex.getDualRational(dual);
132 std::cout <<
"LP solved to optimality.\n";
133 std::cout <<
"Objective value is " << mysoplex.objValueRational() <<
".\n";
134 std::cout <<
"Primal solution is [" << prim[0] <<
", " << prim[1] <<
"].\n";
135 std::cout <<
"Dual solution is [" << dual[0] <<
"].\n";
139 std::cout <<
"Error: SoPlex returned with status " << stat <<
".\n";
146 std::cout <<
"Testing SoPlex as floating-point LP solver:\n\n";
149 std::cout <<
"\nTesting SoPlex as exact rational LP solver:\n\n";
Preconfigured SoPlex LP-solver.
void add(const SVectorBase< S > &vec)
Append nonzeros of sv.
Everything should be within this namespace.
LPColBase< Rational > LPColRational
number< gmp_rational, et_off > Rational
LPRowBase< Rational > LPRowRational
SOPLEX_THREADLOCAL const Real infinity
Preconfigured SoPlex LP solver.