31 if(strncmp(solution,
"+infinity", 9) == 0)
33 else if(strncmp(solution,
"-infinity", 9) == 0)
38 strtod(solution, &tailptr);
72 bool passedValidation =
true;
73 std::string reason =
"";
74 Real objViolation = 0.0;
75 Real maxBoundViolation = 0.0;
76 Real maxRowViolation = 0.0;
77 Real maxRedCostViolation = 0.0;
78 Real maxDualViolation = 0.0;
79 Real sumBoundViolation = 0.0;
80 Real sumRowViolation = 0.0;
81 Real sumRedCostViolation = 0.0;
82 Real sumDualViolation = 0.0;
105 passedValidation =
false;
106 reason +=
"Objective Violation; ";
118 passedValidation =
false;
119 reason +=
"Bound Violation; ";
124 passedValidation =
false;
125 reason +=
"Row Violation; ";
130 passedValidation =
false;
131 reason +=
"Reduced Cost Violation; ";
136 passedValidation =
false;
137 reason +=
"Dual Violation; ";
142 os <<
"Validation :";
148 reason[reason.length() - 2] =
']';
149 os <<
" Fail [" + reason +
"\n";
152 os <<
" Objective : " << std::scientific << std::setprecision(
153 8) << objViolation << std::fixed <<
"\n";
154 os <<
" Bound : " << std::scientific << std::setprecision(
155 8) << maxBoundViolation << std::fixed <<
"\n";
156 os <<
" Row : " << std::scientific << std::setprecision(
157 8) << maxRowViolation << std::fixed <<
"\n";
158 os <<
" Reduced Cost : " << std::scientific << std::setprecision(
159 8) << maxRedCostViolation << std::fixed <<
"\n";
160 os <<
" Dual : " << std::scientific << std::setprecision(
161 8) << maxDualViolation << std::fixed <<
"\n";
Rational spxAbs(const Rational &r)
Absolute.
bool LE(Real a, Real b, Real eps=Param::epsilon())
returns true iff a <= b + eps
bool getRowViolationReal(Real &maxviol, Real &sumviol)
gets violation of constraints; returns true on success
bool updateExternalSolution(char *solution)
updates the external solution used for validation
std::ostream & getStream(const Verbosity &verbosity) const
Returns the stream for the specified verbosity level.
LP is primal infeasible or unbounded.
void validateSolveReal(SoPlex &soplex)
validates the soplex solution using the external solution
LP has been solved to optimality.
bool getDualViolationReal(Real &maxviol, Real &sumviol)
gets violation of dual multipliers; returns true on success
Real realParam(const RealParam param) const
returns real parameter value
double validatetolerance
tolerance used for validation
bool EQ(Real a, Real b, Real eps=Param::epsilon())
returns true iff |a-b| <= eps
bool validate
should the soplex solution be validated?
Everything should be within this namespace.
Preconfigured SoPlex LP-solver.
bool getBoundViolationReal(Real &maxviol, Real &sumviol)
gets violation of bounds; returns true on success
char * validatesolution
external solution used for validation
SPxSolver::Status status() const
returns the current solver status
Validation object for soplex solutions.
bool getRedCostViolationReal(Real &maxviol, Real &sumviol)
gets violation of reduced costs; returns true on success
Real objValueReal()
returns the objective value if a primal solution is available
bool updateValidationTolerance(char *tolerance)
updates the tolerance used for validation