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);
271 SCIPdebugMessage("Now handling variable <%s>, which has status %d, is of type %d, and was deleted: %d, negated: %d, transformed: %d\n",
272 SCIPvarGetName(var), SCIPvarGetStatus(var), SCIPvarGetType(var), SCIPvarIsDeleted(var), SCIPvarIsNegated(var),SCIPvarIsTransformedOrigvar(var));
276 SCIPdebugMessage("**** unknown solution value for deleted variable <%s>\n", SCIPvarGetName(var));
295 /* if no original counterpart, then maybe someone added a value for the transformed variable, so search for var (or its negation) */
330 SCIPmessagePrintWarning(SCIPgetMessagehdlr(set->scip), "invalid solution value %.15g for variable <%s>[%.15g,%.15g]\n",
372 /** returns whether the debug solution is worse as the best known solution or if the debug solution was found */
401 /* make sure a debug solution has been read, so we do not compare against the initial debugsolval == 0 */
404 if( (SCIPgetObjsense(scip) == SCIP_OBJSENSE_MINIMIZE && SCIPsetIsLE(set, solvalue, debugsolval)) || (SCIPgetObjsense(scip) == SCIP_OBJSENSE_MAXIMIZE && SCIPsetIsGE(set, solvalue, debugsolval)) )
417 SCIP_Bool* solcontained /**< pointer to store whether the solution is contained in node's subproblem */
454 /* if the solution is not contained in the parent of the node, it cannot be contained in the current node */
463 /* check whether the bound changes at the current node remove the debugging solution from the subproblem */
487 if( !(*solcontained) && SCIPboundchgGetBoundchgtype(&boundchgs[i]) != SCIP_BOUNDCHGTYPE_BRANCHING )
489 SCIPerrorMessage("debugging solution was cut off in local node %p at depth %d by inference <%s>[%.15g] %s %.15g\n",
491 SCIPboundchgGetBoundtype(&boundchgs[i]) == SCIP_BOUNDTYPE_LOWER ? ">=" : "<=", boundchgs[i].newbound);
497 /* we branched on a variable were we don't know the solution: no debugging can be applied in this subtree */
505 SCIP_CALL( SCIPhashmapSetImage(solinnode, (void*)node, *solcontained ? (void*)(&trueptr) : (void*)(&falseptr)) );
558 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
566 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug
586 /* if the cons is only locally valid, check whether the debugging solution is contained in the local subproblem */
591 SCIP_CALL( isSolutionInNode(SCIPblkmem(scip), scip->set, SCIPgetCurrentNode(scip), &solcontained) );
598 SCIPdebugMessage(" -> checking of constraint %s returned result <%d>\n", SCIPconsGetName(conss[c]), result);
629 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
637 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
641 /* if the row is only locally valid, check whether the debugging solution is contained in the local subproblem */
646 SCIP_CALL( isSolutionInNode(SCIPblkmem(set->scip), set, SCIPgetCurrentNode(set->scip), &solcontained) );
690 printf("***** debug: row <%s> violates debugging solution (lhs=%.15g, rhs=%.15g, activity=[%.15g,%.15g], local=%d)\n",
724 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
732 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
738 SCIPdebugMessage("debugging solution on lower bound of <%s>[%g] >= %g\n", SCIPvarGetName(var), varsol, lb);
743 SCIPerrorMessage("invalid global lower bound: <%s>[%.15g] >= %.15g\n", SCIPvarGetName(var), varsol, lb);
762 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
770 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
776 SCIPdebugMessage("debugging solution on upper bound of <%s>[%g] <= %g\n", SCIPvarGetName(var), varsol, ub);
781 SCIPerrorMessage("invalid global upper bound: <%s>[%.15g] <= %.15g\n", SCIPvarGetName(var), varsol, ub);
806 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
818 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
835 SCIPerrorMessage("invalid local lower bound implication: <%s>[%.15g] >= %.15g\n", SCIPvarGetName(var), varsol, newbound);
840 SCIPerrorMessage("invalid local upper bound implication: <%s>[%.15g] <= %.15g\n", SCIPvarGetName(var), varsol, newbound);
859 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
867 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
872 if( SCIPgetStage(set->scip) != SCIP_STAGE_EXITSOLVE && SCIPgetStage(set->scip) != SCIP_STAGE_EXITPRESOLVE && SCIPnodeGetType(node) != SCIP_NODETYPE_PROBINGNODE )
882 SCIPerrorMessage("debugging solution was cut off in local node #%"SCIP_LONGINT_FORMAT" (%p) at depth %d\n",
914 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
922 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
951 SCIP_Bool varfixing, /**< FALSE if y should be added in implications for x == 0, TRUE for x == 1 */
953 SCIP_BOUNDTYPE impltype, /**< type of implication y <= b (SCIP_BOUNDTYPE_UPPER) or y >= b (SCIP_BOUNDTYPE_LOWER) */
963 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
971 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
994 SCIPerrorMessage("invalid implication <%s> == %d -> <%s> >= %.15g (variable has value %.15g in solution)\n",
1003 SCIPerrorMessage("invalid implication <%s> == %d -> <%s> <= %.15g (variable has value %.15g in solution)\n",
1015 SCIP_VAR** vars, /**< binary variables in the clique: at most one can be set to the given value */
1016 SCIP_Bool* values, /**< values of the variables in the clique; NULL to use TRUE for all vars */
1028 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
1036 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
1077 SCIPerrorMessage("clique violates debugging solution, (at least) variable <%s%s> and variable <%s%s> are both one in the debugging solution\n",
1078 (values == NULL || values[pos1]) ? "" : "~", SCIPvarGetName(vars[pos1]), (values == NULL || values[pos2]) ? "" : "~", SCIPvarGetName(vars[pos2]));
1090 SCIP_Real* relaxedbds, /**< array with relaxed bounds which are efficient to create a valid conflict, or NULL */
1160 SCIP_Real relaxedbd /**< array with relaxed bounds which are efficient to create a valid conflict, or NULL */
1181 SCIP_Real* relaxedbds, /**< array with relaxed bounds which are efficient to create a valid conflict, or NULL */
1194 printBdchginfo(set, bdchginfo, relaxedbds != NULL ? relaxedbds[i] : SCIPbdchginfoGetNewbound(bdchginfo));
1206 SCIP_Real* relaxedbds, /**< array with relaxed bounds which are efficient to create a valid conflict */
1217 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
1225 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
1256 SCIP_Real* relaxedbds, /**< array with relaxed bounds which are efficient to create a valid conflict */
1273 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
1281 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
1345 /* when debugging was disabled the solution is not defined to be not valid in the current subtree */
1353 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
1358 SCIP_CALL( isSolutionInNode(SCIPblkmem(scip), scip->set, SCIPgetCurrentNode(scip), &solcontained) );
1377 /** checks whether SCIP data structure is the main SCIP (the one for which debugging is enabled) */
1431 /* check if the incumbent solution is at least as good as the debug solution, so we can stop to check the debug solution */
1462 SCIPerrorMessage("solution value %.15g of <%s> outside bounds loc=[%.15g,%.15g], glb=[%.15g,%.15g]\n",
1463 solval, SCIPvarGetName(vars[i]), lb, ub, SCIPvarGetLbGlobal(vars[i]), SCIPvarGetUbGlobal(vars[i]));
1492 /** adds a solution value for a new variable in the transformed problem that has no original counterpart
1506 /* assert that we are in the SCIP instance that we are debugging and not some different (subSCIP, auxiliary CIP, ...) */
1517 SCIPerrorMessage("adding solution values for variable that are direct counterparts of original variables is forbidden\n");
1541 SCIPerrorMessage("already have stored different debugging solution value (%g) for variable <%s>, cannot store %g\n", solvals[i-1], varname, val);
1546 SCIPdebugMessage("already have stored debugging solution value %g for variable <%s>, do not store same value again\n", val, varname);
1661 SCIPmessagePrintWarning(SCIPgetMessagehdlr(scip), "checked SCIPgetLPBInvRow() found value <%g> expected 1.0\n", vecval);
1666 SCIPmessagePrintWarning(SCIPgetMessagehdlr(scip), "checked SCIPgetLPBInvRow() found value <%g> expected 0.0\n", vecval);
|