|
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
debug.c
Go to the documentation of this file.
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
42 #define SCIP_HASHSIZE_DEBUG 131101 /**< minimum size of hash map for storing whether a solution is valid for the node */
51 static SCIP_HASHMAP* solinnode = NULL; /**< maps nodes to bools, storing whether the solution is valid for the node */
54 static SCIP_Bool solisachieved = FALSE; /**< means if current best solution is better than the given debug solution */
56 static SCIP_Bool debugsoldisabled = FALSE; /**< flag indicating if debugging of solution was disabled or not */
85 int* valssize /**< pointer to store the length of the variable names and solution values arrays */
135 /* the lines "solution status: ..." and "objective value: ..." may preceed the solution information */
153 printf("invalid input line %d in solution file <%s>: <%s>\n", *nvals + nonvalues, SCIP_DEBUG_SOLUTION, name);
272 SCIPdebugMessage("Now handling variable <%s>, which has status %d, is of type %d, and was deleted: %d, negated: %d, transformed: %d\n",
273 SCIPvarGetName(var), SCIPvarGetStatus(var), SCIPvarGetType(var), SCIPvarIsDeleted(var), SCIPvarIsNegated(var),SCIPvarIsTransformedOrigvar(var));
277 SCIPdebugMessage("**** unknown solution value for deleted variable <%s>\n", SCIPvarGetName(var));
296 /* if no original counterpart, then maybe someone added a value for the transformed variable, so search for var (or its negation) */
331 SCIPmessagePrintWarning(SCIPgetMessagehdlr(set->scip), "invalid solution value %.15g for variable <%s>[%.15g,%.15g]\n",
373 /** returns whether the debug solution is worse as the best known solution or if the debug solution was found */
402 /* make sure a debug solution has been read, so we do not compare against the initial debugsolval == 0 */
405 if( (SCIPgetObjsense(scip) == SCIP_OBJSENSE_MINIMIZE && SCIPsetIsLE(set, solvalue, debugsolval)) || (SCIPgetObjsense(scip) == SCIP_OBJSENSE_MAXIMIZE && SCIPsetIsGE(set, solvalue, debugsolval)) )
418 SCIP_Bool* solcontained /**< pointer to store whether the solution is contained in node's subproblem */
455 /* if the solution is not contained in the parent of the node, it cannot be contained in the current node */
464 /* check whether the bound changes at the current node remove the debugging solution from the subproblem */
488 if( !(*solcontained) && SCIPboundchgGetBoundchgtype(&boundchgs[i]) != SCIP_BOUNDCHGTYPE_BRANCHING )
490 SCIPerrorMessage("debugging solution was cut off in local node %p at depth %d by inference <%s>[%.15g] %s %.15g\n",
492 SCIPboundchgGetBoundtype(&boundchgs[i]) == SCIP_BOUNDTYPE_LOWER ? ">=" : "<=", boundchgs[i].newbound);
498 /* we branched on a variable were we don't know the solution: no debugging can be applied in this subtree */
506 SCIP_CALL( SCIPhashmapSetImage(solinnode, (void*)node, *solcontained ? (void*)(&trueptr) : (void*)(&falseptr)) );
538 if( debugsol != NULL && ((SCIPgetStage(set->scip) > SCIP_STAGE_PROBLEM && debugsolstage > SCIP_STAGE_PROBLEM)
560 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
568 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug
588 /* if the cons is only locally valid, check whether the debugging solution is contained in the local subproblem */
593 SCIP_CALL( isSolutionInNode(SCIPblkmem(scip), scip->set, SCIPgetCurrentNode(scip), &solcontained) );
600 SCIPdebugMessage(" -> checking of constraint %s returned result <%d>\n", SCIPconsGetName(conss[c]), result);
631 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
639 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
643 /* if the row is only locally valid, check whether the debugging solution is contained in the local subproblem */
648 SCIP_CALL( isSolutionInNode(SCIPblkmem(set->scip), set, SCIPgetCurrentNode(set->scip), &solcontained) );
692 printf("***** debug: row <%s> violates debugging solution (lhs=%.15g, rhs=%.15g, activity=[%.15g,%.15g], local=%d)\n",
726 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
734 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
740 SCIPdebugMessage("debugging solution on lower bound of <%s>[%g] >= %g\n", SCIPvarGetName(var), varsol, lb);
745 SCIPerrorMessage("invalid global lower bound: <%s>[%.15g] >= %.15g\n", SCIPvarGetName(var), varsol, lb);
764 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
772 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
778 SCIPdebugMessage("debugging solution on upper bound of <%s>[%g] <= %g\n", SCIPvarGetName(var), varsol, ub);
783 SCIPerrorMessage("invalid global upper bound: <%s>[%.15g] <= %.15g\n", SCIPvarGetName(var), varsol, ub);
808 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
820 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
837 SCIPerrorMessage("invalid local lower bound implication: <%s>[%.15g] >= %.15g\n", SCIPvarGetName(var), varsol, newbound);
842 SCIPerrorMessage("invalid local upper bound implication: <%s>[%.15g] <= %.15g\n", SCIPvarGetName(var), varsol, newbound);
861 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
869 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
874 if( SCIPgetStage(set->scip) != SCIP_STAGE_EXITSOLVE && SCIPgetStage(set->scip) != SCIP_STAGE_EXITPRESOLVE && SCIPnodeGetType(node) != SCIP_NODETYPE_PROBINGNODE )
884 SCIPerrorMessage("debugging solution was cut off in local node #%"SCIP_LONGINT_FORMAT" (%p) at depth %d\n",
916 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
924 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
953 SCIP_Bool varfixing, /**< FALSE if y should be added in implications for x == 0, TRUE for x == 1 */
955 SCIP_BOUNDTYPE impltype, /**< type of implication y <= b (SCIP_BOUNDTYPE_UPPER) or y >= b (SCIP_BOUNDTYPE_LOWER) */
965 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
973 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
996 SCIPerrorMessage("invalid implication <%s> == %d -> <%s> >= %.15g (variable has value %.15g in solution)\n",
1005 SCIPerrorMessage("invalid implication <%s> == %d -> <%s> <= %.15g (variable has value %.15g in solution)\n",
1017 SCIP_VAR** vars, /**< binary variables in the clique: at most one can be set to the given value */
1018 SCIP_Bool* values, /**< values of the variables in the clique; NULL to use TRUE for all vars */
1030 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
1038 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
1079 SCIPerrorMessage("clique violates debugging solution, (at least) variable <%s%s> and variable <%s%s> are both one in the debugging solution\n",
1080 (values == NULL || values[pos1]) ? "" : "~", SCIPvarGetName(vars[pos1]), (values == NULL || values[pos2]) ? "" : "~", SCIPvarGetName(vars[pos2]));
1092 SCIP_Real* relaxedbds, /**< array with relaxed bounds which are efficient to create a valid conflict, or NULL */
1162 SCIP_Real relaxedbd /**< array with relaxed bounds which are efficient to create a valid conflict, or NULL */
1183 SCIP_Real* relaxedbds, /**< array with relaxed bounds which are efficient to create a valid conflict, or NULL */
1196 printBdchginfo(set, bdchginfo, relaxedbds != NULL ? relaxedbds[i] : SCIPbdchginfoGetNewbound(bdchginfo));
1208 SCIP_Real* relaxedbds, /**< array with relaxed bounds which are efficient to create a valid conflict */
1219 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
1227 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
1258 SCIP_Real* relaxedbds, /**< array with relaxed bounds which are efficient to create a valid conflict */
1275 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
1283 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
1347 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
1355 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
1360 SCIP_CALL( isSolutionInNode(SCIPblkmem(scip), scip->set, SCIPgetCurrentNode(scip), &solcontained) );
1379 /** checks whether SCIP data structure is the main SCIP (the one for which debugging is enabled) */
1433 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
1464 SCIPerrorMessage("solution value %.15g of <%s> outside bounds loc=[%.15g,%.15g], glb=[%.15g,%.15g]\n",
1465 solval, SCIPvarGetName(vars[i]), lb, ub, SCIPvarGetLbGlobal(vars[i]), SCIPvarGetUbGlobal(vars[i]));
1494 /** adds a solution value for a new variable in the transformed problem that has no original counterpart
1508 /* assert that we are in the SCIP instance that we are debugging and not some different (subSCIP, auxiliary CIP, ...) */
1519 SCIPerrorMessage("adding solution values for variable that are direct counterparts of original variables is forbidden\n");
1543 SCIPerrorMessage("already have stored different debugging solution value (%g) for variable <%s>, cannot store %g\n", solvals[i-1], varname, val);
1548 SCIPdebugMessage("already have stored debugging solution value %g for variable <%s>, do not store same value again\n", val, varname);
1663 SCIPmessagePrintWarning(SCIPgetMessagehdlr(scip), "checked SCIPgetLPBInvRow() found value <%g> expected 1.0\n", vecval);
1668 SCIPmessagePrintWarning(SCIPgetMessagehdlr(scip), "checked SCIPgetLPBInvRow() found value <%g> expected 0.0\n", vecval);
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed) Definition: scip.c:20784 Definition: type_tree.h:33 SCIP_Bool SCIPsetIsLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2) Definition: set.c:4715 SCIP_RETCODE SCIPincludeProp(SCIP *scip, const char *name, const char *desc, int priority, int freq, SCIP_Bool delay, SCIP_PROPTIMING timingmask, int presolpriority, int presolmaxrounds, SCIP_Bool presoldelay, SCIP_DECL_PROPCOPY((*propcopy)), SCIP_DECL_PROPFREE((*propfree)), SCIP_DECL_PROPINIT((*propinit)), SCIP_DECL_PROPEXIT((*propexit)), SCIP_DECL_PROPINITPRE((*propinitpre)), SCIP_DECL_PROPEXITPRE((*propexitpre)), SCIP_DECL_PROPINITSOL((*propinitsol)), SCIP_DECL_PROPEXITSOL((*propexitsol)), SCIP_DECL_PROPPRESOL((*proppresol)), SCIP_DECL_PROPEXEC((*propexec)), SCIP_DECL_PROPRESPROP((*propresprop)), SCIP_PROPDATA *propdata) Definition: scip.c:6577 internal methods for branch and bound tree Definition: type_var.h:40 Definition: struct_scip.h:52 SCIP_RETCODE SCIPvarGetOrigvarSum(SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant) Definition: var.c:11962 Definition: type_prob.h:38 SCIP_Bool SCIPsetIsFeasEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2) Definition: set.c:5007 SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:38667 Definition: struct_misc.h:63 #define SCIPdebugCheckImplic(set, var, varfixing, implvar, impltype, implbound) Definition: debug.h:240 Definition: struct_var.h:196 Definition: struct_var.h:80 SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val) Definition: scip.c:31639 SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize) Definition: misc.c:1864 SCIP_Real SCIPbdchginfoGetNewbound(SCIP_BDCHGINFO *bdchginfo) Definition: var.c:16977 Definition: type_var.h:53 void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin) Definition: misc.c:1923 Definition: type_retcode.h:38 #define SCIPdebugCheckVbound(set, var, vbtype, vbvar, vbcoef, vbconstant) Definition: debug.h:239 internal methods for LP management Definition: struct_tree.h:119 Definition: struct_lp.h:123 SCIP_Bool SCIPsetIsGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2) Definition: set.c:4739 Definition: struct_sol.h:50 Definition: struct_set.h:55 #define SCIPdebugCheckConflict(blkmem, set, node, bdchginfos, relaxedbds, nliterals) Definition: debug.h:242 SCIP_BOUNDTYPE SCIPbdchginfoGetBoundtype(SCIP_BDCHGINFO *bdchginfo) Definition: var.c:17007 Definition: struct_var.h:119 SCIP_Bool SCIPsetIsLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2) Definition: set.c:4703 Definition: struct_misc.h:101 Definition: type_retcode.h:36 Definition: type_result.h:35 internal methods for storing and manipulating the main problem Definition: struct_cons.h:36 #define SCIPdebugCheckInference(blkmem, set, node, var, newbound, boundtype) Definition: debug.h:237 SCIP_RETCODE SCIPcheckCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_RESULT *result) Definition: scip.c:23568 Definition: type_lp.h:47 Definition: type_set.h:44 Definition: type_result.h:36 SCIP_BOUNDCHGTYPE SCIPboundchgGetBoundchgtype(SCIP_BOUNDCHG *boundchg) Definition: var.c:15705 SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:38648 void SCIPmessagePrintWarning(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...) Definition: message.c:411 Definition: type_retcode.h:33 internal methods for global SCIP settings SCIP main data structure. SCIP_Bool SCIPsetIsFeasGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2) Definition: set.c:5071 Definition: type_result.h:42 SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:38705 void SCIProwPrint(SCIP_ROW *row, SCIP_MESSAGEHDLR *messagehdlr, FILE *file) Definition: lp.c:4990 SCIP_Bool SCIPsetIsFeasLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2) Definition: set.c:5039 Definition: type_retcode.h:34 internal methods for problem variables Definition: struct_var.h:104 public data structures and miscellaneous methods #define SCIPdebugSolIsValidInSubtree(scip, isvalidinsubtree) Definition: debug.h:247 Definition: struct_lp.h:188 #define SCIPdebugCheckConflictFrontier(blkmem, set, node, bdchginfo, bdchginfos, relaxedbds, nliterals, bdchgqueue, forcedbdchgqueue) Definition: debug.h:243 methods for debugging Definition: type_set.h:39 SCIP_Real SCIPvarGetNegationConstant(SCIP_VAR *var) Definition: var.c:16216 SCIP_Bool SCIPsetIsFeasLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2) Definition: set.c:5023 Definition: type_set.h:34 Definition: type_set.h:33 SCIP_RETCODE SCIPhashmapRemove(SCIP_HASHMAP *hashmap, void *origin) Definition: misc.c:1984 SCIP_Bool SCIPvarIsTransformedOrigvar(SCIP_VAR *var) Definition: var.c:12049 Definition: type_lp.h:48 SCIP_RETCODE SCIPcreateOrigSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur) Definition: scip.c:31072 public methods for message output SCIP_Bool SCIPsetIsGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2) Definition: set.c:4727 SCIP_RETCODE SCIPhashmapSetImage(SCIP_HASHMAP *hashmap, void *origin, void *image) Definition: misc.c:1944 void SCIPsortPtrReal(void **ptrarray, SCIP_Real *realarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len) Definition: type_set.h:42 SCIP_RETCODE SCIPsetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals) Definition: scip.c:31679 SCIP_Bool SCIPsetIsFeasGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2) Definition: set.c:5055 common defines and data types used in all packages of SCIP SCIP_RETCODE SCIPlpiGetCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real *val) Definition: lpi_clp.cpp:1598 Definition: type_prob.h:39 SCIP_BOUNDTYPE SCIPboundchgGetBoundtype(SCIP_BOUNDCHG *boundchg) Definition: var.c:15715 Definition: type_result.h:39 SCIP callable library. Definition: type_var.h:72 memory allocation routines Definition: type_var.h:56 |