30 if( strncmp(solution,
"+infinity", 9 ) == 0 )
32 else if ( strncmp(solution,
"-infinity", 9) == 0 )
37 strtod(solution, &tailptr);
66 bool passedValidation =
true;
67 std::string reason =
"";
68 Real objViolation = 0.0;
69 Real maxBoundViolation = 0.0;
70 Real maxRowViolation = 0.0;
71 Real maxRedCostViolation = 0.0;
72 Real maxDualViolation = 0.0;
73 Real sumBoundViolation = 0.0;
74 Real sumRowViolation = 0.0;
75 Real sumRedCostViolation = 0.0;
76 Real sumDualViolation = 0.0;
93 passedValidation =
false;
94 reason +=
"Objective Violation; ";
104 passedValidation =
false;
105 reason +=
"Bound Violation; ";
109 passedValidation =
false;
110 reason +=
"Row Violation; ";
114 passedValidation =
false;
115 reason +=
"Reduced Cost Violation; ";
119 passedValidation =
false;
120 reason +=
"Dual Violation; ";
125 os <<
"Validation :";
130 reason[reason.length()-2] =
']';
131 os <<
" Fail [" + reason +
"\n";
133 os <<
" Objective : " << std::scientific << std::setprecision(8) << objViolation << std::fixed <<
"\n";
134 os <<
" Bound : " << std::scientific << std::setprecision(8) << maxBoundViolation << std::fixed <<
"\n";
135 os <<
" Row : " << std::scientific << std::setprecision(8) << maxRowViolation << std::fixed <<
"\n";
136 os <<
" Reduced Cost : " << std::scientific << std::setprecision(8) << maxRedCostViolation << std::fixed <<
"\n";
137 os <<
" Dual : " << std::scientific << std::setprecision(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.
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