36#if defined(_WIN32) || defined(_WIN64)
54#ifdef WITH_DEBUG_SOLUTION
56#define SCIP_HASHSIZE_DEBUG 500
85 (*debugsoldata)->solnames =
NULL;
86 (*debugsoldata)->solvals =
NULL;
87 (*debugsoldata)->nsolvals = 0;
88 (*debugsoldata)->solsize = 0;
89 (*debugsoldata)->debugsol =
NULL;
91 (*debugsoldata)->solinnode =
NULL;
92 (*debugsoldata)->falseptr =
FALSE;
93 (*debugsoldata)->trueptr =
TRUE;
94 (*debugsoldata)->solisachieved =
FALSE;
95 (*debugsoldata)->debugsolval = 0.0;
96 (*debugsoldata)->debugsoldisabled =
TRUE;
97 (*debugsoldata)->warningprinted =
FALSE;
102#ifdef SCIP_MORE_DEBUG
124 if(
strcmp(
set->misc_debugsol,
"-") == 0 )
126 if( !debugsoldata->warningprinted )
130 debugsoldata->warningprinted =
TRUE;
136 debugsoldata->warningprinted =
FALSE;
255 SCIPerrorMessage(
"Invalid solution value <%s> for variable <%s> in line %d of solution file <%s>.\n",
263 if( *nvals >= *valssize )
265 *valssize =
MAX(2 * *valssize, (*nvals)+1);
269 assert(*nvals < *valssize);
274 (*names)[
i] = (*names)[
i-1];
275 (*vals)[
i] = (*vals)[
i-1];
291 for(
i = 0;
i < *nvals; ++
i)
305#ifdef SCIP_MORE_DEBUG
308 for(
i = 0;
i < nfound - 1; ++
i)
336 printf(
"***** debug: read %d non-zero entries (%d variables found)\n", *nvals, nfound);
357 if( debugsoldata ==
NULL || debugsoldata->nsolvals > 0 )
361 &debugsoldata->debugsolstage, &(debugsoldata->solnames), &(debugsoldata->solvals), &(debugsoldata->nsolvals),
362 &(debugsoldata->solsize)) );
404 SCIPsetDebugMsg(
set,
"Now handling variable <%s>, which has status %d, is of type %d, and was deleted: %d, negated: %d, transformed: %d\n",
448 right = debugsoldata->nsolvals-1;
449 while( left <= right )
459 *val = scalar * debugsoldata->solvals[
middle] + constant;
501 if( debugsoldata->debugsol ==
NULL )
504 *
sol = debugsoldata->debugsol;
543 if( debugsoldata->solisachieved )
553 if( bestsol !=
NULL )
568 debugsoldata->solisachieved =
TRUE;
571 return debugsoldata->solisachieved;
605 if( debugsoldata->solinnode ==
NULL )
614 if(
boolptr != &debugsoldata->falseptr &&
boolptr != &debugsoldata->trueptr )
659 SCIPerrorMessage(
"debugging solution was cut off in local node %p at depth %d by inference <%s>[%.15g] %s %.15g\n",
732 if( debugsoldata->solinnode !=
NULL )
753 for( s = debugsoldata->nsolvals - 1; s >= 0; --s )
759 debugsoldata->nsolvals = 0;
760 debugsoldata->debugsolval= 0.0;
761 debugsoldata->solisachieved =
FALSE;
763 if( debugsoldata->solinnode !=
NULL)
827 for(
c = nconss - 1;
c >= 0; --
c )
872 SCIP_Real minactivity;
873 SCIP_Real maxactivity;
909 maxactivity = minactivity;
910 for(
i = 0;
i < nnonz; ++
i )
920 minactivity += vals[
i] * solval;
921 maxactivity += vals[
i] * solval;
923 else if( vals[
i] > 0.0 )
928 else if( vals[
i] < 0.0 )
940 printf(
"***** debug: row <%s> violates debugging solution (lhs=%.15g, rhs=%.15g, activity=[%.15g,%.15g], local=%u, lpfeastol=%g)\n",
948 for(
i = 0;
i < nnonz; ++
i )
954 printf(
" <= %.15g\n", rhs);
1165 if( debugsoldata->solinnode !=
NULL )
1207 if( debugsoldata->debugsol ==
NULL )
1265 if( debugsoldata->debugsol ==
NULL )
1338 SCIPerrorMessage(
"invalid variable bound: <%s>[%.15g] %s %.15g<%s>[%.15g] %+.15g\n",
1395 SCIPerrorMessage(
"invalid implication <%s> == %d -> <%s> >= %.15g (variable has value %.15g in solution)\n",
1404 SCIPerrorMessage(
"invalid implication <%s> == %d -> <%s> <= %.15g (variable has value %.15g in solution)\n",
1453 for(
i = 0;
i < naggrvars;
i++ )
1469 if( naggrvars == 1 )
1476 SCIPerrorMessage(
"aggregation <%s>[%g] = %g<%s>[%g] + %g violates debugging solution (expected %g)\n",
1481 SCIPerrorMessage(
"multi-aggregation <%s>[%g] = ... %d vars ... + %g violates debugging solution (expected %g)\n",
1521 for( v = 0; v <
nvars; ++v )
1535 if( values !=
NULL && values[v] == 0 )
1536 solval = 1.0 - solval;
1555 SCIPerrorMessage(
"clique violates debugging solution, (at least) variable <%s%s> and variable <%s%s> are both one in the debugging solution\n",
1568 SCIP_Real* relaxedbds,
1583 for(
i = 0;
i < nbdchginfos; ++
i )
1595 if( relaxedbds !=
NULL )
1596 newbound = relaxedbds[
i];
1670 SCIP_Real* relaxedbds,
1680 for(
i = 0;
i < nbdchginfos; ++
i )
1699 SCIP_Real* relaxedbds,
1708 assert(nbdchginfos == 0 || bdchginfos !=
NULL);
1749 SCIP_Real* relaxedbds,
1764 assert(nbdchginfos == 0 || bdchginfos !=
NULL);
1807 printf(
" (after resolving bound change ");
1884 debugsoldata->debugsoldisabled =
FALSE;
1899 debugsoldata->debugsoldisabled =
TRUE;
1914 return (!debugsoldata->debugsoldisabled);
1920#ifdef WITH_DEBUG_SOLUTION
1969 SCIP_Bool infeasible;
1983 SCIPerrorMessage(
"solution value %.15g of <%s> outside bounds loc=[%.15g,%.15g], glb=[%.15g,%.15g]\n",
2007 SCIP_PROPTIMING_ALWAYS, 99999999, 0,
SCIP_PRESOLTIMING_FAST,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
2044 if( debugsoldata->debugsol ==
NULL )
2051 if( debugsoldata->nsolvals >= debugsoldata->solsize )
2053 debugsoldata->solsize =
MAX(2*debugsoldata->solsize, debugsoldata->nsolvals+1);
2057 assert(debugsoldata->nsolvals < debugsoldata->solsize);
2061 for(
i = debugsoldata->nsolvals;
i > 0 &&
strcmp(
varname, debugsoldata->solnames[
i-1]) < 0; --
i )
2063 debugsoldata->solnames[
i] = debugsoldata->solnames[
i-1];
2064 debugsoldata->solvals[
i] = debugsoldata->solvals[
i-1];
2068 if(
REALABS(debugsoldata->solvals[
i-1] - val) > 1
e-9 )
2070 SCIPerrorMessage(
"already have stored different debugging solution value (%g) for variable <%s>, cannot store %g\n", debugsoldata->solvals[
i-1],
varname, val);
2075 SCIPdebugMsg(
scip,
"already have stored debugging solution value %g for variable <%s>, do not store same value again\n", val,
varname);
2076 for( ;
i < debugsoldata->nsolvals; ++
i )
2078 debugsoldata->solnames[
i] = debugsoldata->solnames[
i+1];
2079 debugsoldata->solvals[
i] = debugsoldata->solvals[
i+1];
2087 SCIPdebugMsg(
scip,
"add variable <%s>: value <%g>\n", debugsoldata->solnames[
i], val);
2088 debugsoldata->solvals[
i] = val;
2089 debugsoldata->nsolvals++;
2093 SCIPdebugMsg(
scip,
"Debug Solution value is now %g.\n", debugsoldata->debugsolval);
2122#ifdef SCIP_DEBUG_LP_INTERFACE
2149 for(
k = 0;
k < nrows; ++
k )
2163 for(
i = 0;
i < nrows; ++
i )
2178 assert( idx >= 0 && idx < nrows );
2214 SCIP_Bool transformed,
2218 SCIP_Bool presolved,
2239 switch(
scip->set->stage )
SCIP_RETCODE SCIPcheckStage(SCIP *scip, const char *method, SCIP_Bool init, SCIP_Bool problem, SCIP_Bool transforming, SCIP_Bool transformed, SCIP_Bool initpresolve, SCIP_Bool presolving, SCIP_Bool exitpresolve, SCIP_Bool presolved, SCIP_Bool initsolve, SCIP_Bool solving, SCIP_Bool solved, SCIP_Bool exitsolve, SCIP_Bool freetrans, SCIP_Bool freescip)
void SCIPdummyDebugMethodForSun(void)
#define SCIPdebugCheckLbGlobal(scip, var, lb)
#define SCIPdebugCheckClique(set, vars, values, nvars)
#define SCIPdebugFree(set)
struct SCIP_DebugSolData SCIP_DEBUGSOLDATA
#define SCIPdebugCheckRow(set, row)
#define SCIPdebugSolDisable(scip)
#define SCIPdebugCheckConflict(blkmem, set, node, bdchginfos, relaxedbds, nliterals)
#define SCIPdebugCheckImplic(set, var, varfixing, implvar, impltype, implbound)
#define SCIPdebugGetSolVal(scip, var, val)
#define SCIPdebugFreeSol(set)
#define SCIPdebugCheckUbGlobal(scip, var, ub)
#define SCIPdebugSolEnable(scip)
#define SCIPdebugCheckGlobalLowerbound(blkmem, set)
#define SCIPdebugCheckLocalLowerbound(blkmem, set, node)
#define SCIPdebugAddSolVal(scip, var, val)
#define SCIPdebugCheckVbound(set, var, vbtype, vbvar, vbcoef, vbconstant)
#define SCIPdebugCheckConss(scip, conss, nconss)
#define SCIPdebugFreeDebugData(set)
#define SCIPdebugSolIsEnabled(scip)
#define SCIPdebugCheckAggregation(set, var, aggrvars, scalars, constant, naggrvars)
#define SCIPdebugCheckBInvRow(scip, r, coef)
#define SCIPdebugRemoveNode(blkmem, set, node)
#define SCIPdebugSolIsValidInSubtree(scip, isvalidinsubtree)
#define SCIPdebugReset(set)
#define SCIPdebugCheckConflictFrontier(blkmem, set, node, bdchginfo, bdchginfos, relaxedbds, nliterals, bdchgqueue, forcedbdchgqueue)
#define SCIPdebugIncludeProp(scip)
#define SCIPdebugCheckInference(blkmem, set, node, var, newbound, boundtype)
#define SCIPwithDebugSol(void)
#define SCIPdebugSolDataCreate(debugsoldata)
common defines and data types used in all packages of SCIP
SCIP_FILE * SCIPfopen(const char *path, const char *mode)
int SCIPfeof(SCIP_FILE *stream)
int SCIPfclose(SCIP_FILE *fp)
char * SCIPfgets(char *s, int size, SCIP_FILE *stream)
SCIP_STATUS SCIPgetStatus(SCIP *scip)
SCIP_STAGE SCIPgetStage(SCIP *scip)
SCIP_VAR ** SCIPgetOrigVars(SCIP *scip)
int SCIPgetNOrigVars(SCIP *scip)
SCIP_OBJSENSE SCIPgetObjsense(SCIP *scip)
SCIP_VAR * SCIPfindVar(SCIP *scip, const char *name)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapSetImage(SCIP_HASHMAP *hashmap, void *origin, void *image)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
SCIP_RETCODE SCIPhashmapRemoveAll(SCIP_HASHMAP *hashmap)
SCIP_RETCODE SCIPhashmapRemove(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPlpiGetCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real *val)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)
void ** SCIPpqueueElems(SCIP_PQUEUE *pqueue)
int SCIPpqueueNElems(SCIP_PQUEUE *pqueue)
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
SCIP_RETCODE SCIPcheckCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_RESULT *result)
int SCIPconsGetActiveDepth(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_RETCODE SCIPgetLPBasisInd(SCIP *scip, int *basisind)
int SCIPgetNLPRows(SCIP *scip)
SCIP_Real SCIPgetLPFeastol(SCIP *scip)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
SCIP_NODETYPE SCIPnodeGetType(SCIP_NODE *node)
SCIP_Real SCIPnodeGetLowerbound(SCIP_NODE *node)
int SCIPnodeGetNAddedConss(SCIP_NODE *node)
void SCIPnodeGetAddedConss(SCIP_NODE *node, SCIP_CONS **addedconss, int *naddedconss, int addedconsssize)
int SCIPnodeGetDepth(SCIP_NODE *node)
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_PRESOLTIMING presoltiming, 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)
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
int SCIProwGetNNonz(SCIP_ROW *row)
SCIP_COL ** SCIProwGetCols(SCIP_ROW *row)
SCIP_Real SCIProwGetRhs(SCIP_ROW *row)
SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)
const char * SCIProwGetName(SCIP_ROW *row)
SCIP_Real SCIProwGetConstant(SCIP_ROW *row)
SCIP_Real * SCIProwGetVals(SCIP_ROW *row)
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
SCIP_Real SCIPsolGetOrigObj(SCIP_SOL *sol)
SCIP_RETCODE SCIPcreateOrigSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
SCIP_RETCODE SCIPsetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
SCIP_Real SCIPgetSolOrigObj(SCIP *scip, SCIP_SOL *sol)
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
SCIP_Bool SCIPisInRestart(SCIP *scip)
SCIP_Longint SCIPgetNLPIterations(SCIP *scip)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIPgetDepth(SCIP *scip)
int SCIPgetNLeaves(SCIP *scip)
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
SCIP_RETCODE SCIPvarGetOrigvarSum(SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
SCIP_Bool SCIPvarIsDeleted(SCIP_VAR *var)
SCIP_Real SCIPvarGetNegationConstant(SCIP_VAR *var)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
SCIP_BOUNDTYPE SCIPboundchgGetBoundtype(SCIP_BOUNDCHG *boundchg)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
SCIP_BOUNDCHGTYPE SCIPboundchgGetBoundchgtype(SCIP_BOUNDCHG *boundchg)
SCIP_Bool SCIPvarIsTransformed(SCIP_VAR *var)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
int SCIPvarGetNUses(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_VAR * SCIPbdchginfoGetVar(SCIP_BDCHGINFO *bdchginfo)
SCIP_Bool SCIPvarIsTransformedOrigvar(SCIP_VAR *var)
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
SCIP_Bool SCIPvarIsRelaxationOnly(SCIP_VAR *var)
SCIP_VAR * SCIPvarGetNegationVar(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
SCIP_BOUNDTYPE SCIPbdchginfoGetBoundtype(SCIP_BDCHGINFO *bdchginfo)
SCIP_Real SCIPbdchginfoGetNewbound(SCIP_BDCHGINFO *bdchginfo)
void SCIPsortPtrReal(void **ptrarray, SCIP_Real *realarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
void SCIPprintSysError(const char *message)
SCIPfreeSol(scip, &heurdata->sol))
assert(minobj< SCIPgetCutoffbound(scip))
SCIP_Bool SCIPlpDiving(SCIP_LP *lp)
void SCIProwPrint(SCIP_ROW *row, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
static const SCIP_Real scalars[]
internal methods for LP management
memory allocation routines
#define BMSreallocMemoryArray(ptr, num)
#define BMSduplicateMemoryArray(ptr, source, num)
#define BMSfreeMemoryNull(ptr)
#define BMSallocMemoryArray(ptr, num)
#define BMSfreeMemoryArray(ptr)
struct BMS_BlkMem BMS_BLKMEM
#define BMSfreeMemoryArrayNull(ptr)
#define BMSallocMemory(ptr)
void SCIPmessagePrintWarning(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
SCIP_Real SCIPprobExternObjval(SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_SET *set, SCIP_Real objval)
internal methods for storing and manipulating the main problem
struct SCIP_File SCIP_FILE
public methods for message output
public data structures and miscellaneous methods
SCIP_Bool SCIPsetIsGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsRelEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsFeasGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsFeasLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsFeasEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsFeasZero(SCIP_SET *set, SCIP_Real val)
SCIP_STAGE SCIPsetGetStage(SCIP_SET *set)
SCIP_Bool SCIPsetIsFeasLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPsetInfinity(SCIP_SET *set)
SCIP_Bool SCIPsetIsLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_DEBUGSOLDATA * SCIPsetGetDebugSolData(SCIP_SET *set)
SCIP_Bool SCIPsetIsFeasGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
internal methods for global SCIP settings
#define SCIPsetFreeBufferArray(set, ptr)
#define SCIPsetAllocBufferArray(set, ptr, num)
SCIP_BOUNDCHG * boundchgs
SCIP main data structure.
SCIP_Bool SCIPtreeProbing(SCIP_TREE *tree)
SCIP_Real SCIPtreeGetLowerbound(SCIP_TREE *tree, SCIP_SET *set)
internal methods for branch and bound tree
enum SCIP_BoundType SCIP_BOUNDTYPE
#define SCIP_DECL_SORTPTRCOMP(x)
#define SCIP_DECL_PROPEXEC(x)
enum SCIP_Result SCIP_RESULT
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_STAGE_INITPRESOLVE
@ SCIP_STAGE_EXITPRESOLVE
@ SCIP_STAGE_TRANSFORMING
enum SCIP_Stage SCIP_STAGE
#define SCIP_PRESOLTIMING_FAST
#define SCIP_PROPTIMING_ALWAYS
@ SCIP_NODETYPE_PROBINGNODE
@ SCIP_VARTYPE_CONTINUOUS
@ SCIP_BOUNDCHGTYPE_BRANCHING
@ SCIP_VARSTATUS_ORIGINAL
SCIP_DOMCHGBOUND domchgbound
internal methods for problem variables