scip_validation.c
Go to the documentation of this file.
43/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
63 * - checking the feasibility of the incumbent solution in the original problem (using SCIPcheckSolOrig())
65 * - checking if the objective bounds computed by SCIP agree with external primal and dual reference bounds.
69 * For infeasible problems, +/-SCIPinfinity() should be passed as reference bounds depending on the objective sense
74 SCIP_Real primalreference, /**< external primal reference value for the problem, or SCIP_UNKNOWN */
78 SCIP_Bool* feasible, /**< pointer to store if the best solution is feasible in the original problem,
80 SCIP_Bool* primalboundcheck, /**< pointer to store if the primal bound respects the given dual reference
82 SCIP_Bool* dualboundcheck /**< pointer to store if the dual bound respects the given primal reference
141 /* check the primal and dual bounds computed by SCIP against the external reference values within reference tolerance */
143 if( SCIPgetNSols(scip) > 0 && ((SCIPgetObjsense(scip) == SCIP_OBJSENSE_MINIMIZE && SCIPisInfinity(scip, dualreference))
148 /* check if reference primal bound is not better than the proven dual bound and, if SCIP claims to be optimal,
154 /* compute the relative violation between the primal bound and dual reference value, and vice versa */
190 SCIPinfoMessage(scip, NULL, " %-17s: %10.8g (reference: %16.9e)\n", "primal violation", primviol, dualreference);
191 SCIPinfoMessage(scip, NULL, " %-17s: %10.8g (reference: %16.9e)\n", "dual violation", dualviol, primalreference);
208 * - checking the feasibility of the incumbent solution in the original problem (using SCIPcheckSolOrig())
210 * - checking if the objective bounds computed by SCIP agree with external primal and dual reference bounds.
214 * For infeasible problems, +/-inf should be passed as reference bounds depending on the objective sense
219 SCIP_RATIONAL* primalreference, /**< external primal reference value for the problem, or SCIP_UNKNOWN */
220 SCIP_RATIONAL* dualreference, /**< external dual reference value for the problem, or SCIP_UNKNOWN */
222 SCIP_Bool* feasible, /**< pointer to store if the best solution is feasible in the original problem,
224 SCIP_Bool* primalboundcheck, /**< pointer to store if the primal bound respects the given dual reference
226 SCIP_Bool* dualboundcheck /**< pointer to store if the dual bound respects the given primal reference
282 /* check the primal and dual bounds computed by SCIP against the external reference values within reference tolerance */
284 if( SCIPgetNSols(scip) > 0 && ((SCIPgetObjsense(scip) == SCIP_OBJSENSE_MINIMIZE && SCIPrationalIsInfinity(dualreference))
285 || (SCIPgetObjsense(scip) == SCIP_OBJSENSE_MAXIMIZE && SCIPrationalIsNegInfinity(dualreference))) )
289 /* check if reference primal bound is not better than the proven dual bound and, if SCIP claims to be optimal,
295 /* compute the relative violation between the primal bound and dual reference value, and vice versa */
335 SCIPinfoMessage(scip, NULL, " %-17s: %s (reference: %s)\n", "primal violation", rationalstring1, rationalstring2);
346 SCIPinfoMessage(scip, NULL, " %-17s: %s (reference: %s)\n", "dual violation", rationalstring1, rationalstring2);
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
Definition: scip_message.c:208
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
Definition: scip_param.c:307
SCIP_RETCODE SCIPrationalCreate(SCIP_RATIONAL **rational)
Definition: rational.cpp:94
int SCIPrationalToString(SCIP_RATIONAL *rational, char *str, int strlen)
Definition: rational.cpp:1743
SCIP_Bool SCIPrationalIsZero(SCIP_RATIONAL *rational)
Definition: rational.cpp:1624
void SCIPrationalRelDiff(SCIP_RATIONAL *res, SCIP_RATIONAL *val1, SCIP_RATIONAL *val2)
Definition: rational.cpp:1024
void SCIPrationalSetFraction(SCIP_RATIONAL *res, SCIP_Longint nom, SCIP_Longint denom)
Definition: rational.cpp:582
SCIP_Bool SCIPrationalIsInfinity(SCIP_RATIONAL *rational)
Definition: rational.cpp:1660
SCIP_Bool SCIPrationalIsNegInfinity(SCIP_RATIONAL *rational)
Definition: rational.cpp:1670
SCIP_RETCODE SCIPcheckSolOrig(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *feasible, SCIP_Bool printreason, SCIP_Bool completely)
Definition: scip_sol.c:4380
void SCIPgetDualboundExact(SCIP *scip, SCIP_RATIONAL *result)
Definition: scip_solvingstats.c:1454
void SCIPgetPrimalboundExact(SCIP *scip, SCIP_RATIONAL *result)
Definition: scip_solvingstats.c:1709
SCIP_RETCODE SCIPchgFeastol(SCIP *scip, SCIP_Real feastol)
Definition: scip_numerics.c:240
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:436
SCIP_RETCODE SCIPvalidateSolveExact(SCIP *scip, SCIP_RATIONAL *primalreference, SCIP_RATIONAL *dualreference, SCIP_Bool quiet, SCIP_Bool *feasible, SCIP_Bool *primalboundcheck, SCIP_Bool *dualboundcheck)
Definition: scip_validation.c:217
SCIP_RETCODE SCIPvalidateSolve(SCIP *scip, SCIP_Real primalreference, SCIP_Real dualreference, SCIP_Real reftol, SCIP_Bool quiet, SCIP_Bool *feasible, SCIP_Bool *primalboundcheck, SCIP_Bool *dualboundcheck)
Definition: scip_validation.c:72
Definition: multiprecision.hpp:66
public methods for message output
public data structures and miscellaneous methods
public methods for primal CIP solutions
wrapper for rational number arithmetic
public methods for exact solving
general public methods
public methods for message handling
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for global and local (sub)problems
public methods for solutions
public methods for querying solving statistics
public methods for validation
Definition: struct_rational.h:47
Definition: struct_sol.h:74
Definition: struct_scip.h:72