All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
primal.c File Reference Detailed Descriptionmethods for collecting primal CIP solutions and primal informations Definition in file primal.c. #include <assert.h> #include "scip/def.h" #include "scip/set.h" #include "scip/stat.h" #include "scip/vbc.h" #include "scip/event.h" #include "scip/lp.h" #include "scip/var.h" #include "scip/prob.h" #include "scip/sol.h" #include "scip/primal.h" #include "scip/tree.h" #include "scip/disp.h" #include "scip/pub_message.h" Go to the source code of this file. Function Documentation
ensures, that sols array can store at least num entries
Definition at line 47 of file primal.c. References BMSreallocMemoryArray, SCIP_Primal::nsols, SCIP_ALLOC, SCIP_OKAY, SCIPsetCalcMemGrowSize(), SCIP_Primal::sols, and SCIP_Primal::solssize. Referenced by primalAddOrigSol(), and primalAddSol().
ensures, that existingsols array can store at least num entries
Definition at line 70 of file primal.c. References BMSreallocMemoryArray, SCIP_Primal::existingsols, SCIP_Primal::existingsolssize, SCIP_Primal::nexistingsols, SCIP_ALLOC, SCIP_OKAY, and SCIPsetCalcMemGrowSize(). Referenced by SCIPprimalSolCreated().
creates primal data
Definition at line 92 of file primal.c. References BMSallocMemory, NULL, SCIP_ALLOC, SCIP_INVALID, and SCIP_OKAY. Referenced by copyProb(), SCIPcreateProb(), and SCIPtransformProb().
frees primal data
Definition at line 118 of file primal.c. References BMSfreeMemory, BMSfreeMemoryArrayNull, NULL, SCIP_CALL, SCIP_OKAY, and SCIPsolFree(). Referenced by freeTransform(), and SCIPfreeProb().
sets the cutoff bound in primal data and in LP solver
Definition at line 156 of file primal.c. References SCIP_Primal::cutoffbound, MIN, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPlpSetCutoffbound(), SCIPsetInfinity(), SCIPsetIsLE(), SCIPtreeCutoff(), SCIPtreeInRepropagation(), and SCIP_Primal::upperbound. Referenced by primalSetUpperbound(), SCIPprimalSetCutoffbound(), SCIPprimalUpdateObjlimit(), and SCIPprimalUpdateObjoffset().
sets the cutoff bound in primal data and in LP solver
Definition at line 187 of file primal.c. References SCIP_Primal::cutoffbound, NULL, primalSetCutoffbound(), SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPerrorMessage, SCIPprobExternObjval(), SCIPprobGetObjlim(), SCIPprobSetObjlim(), and SCIPsetInfinity(). Referenced by initSolve(), and SCIPupdateCutoffbound().
sets upper bound in primal data and in LP solver
Definition at line 237 of file primal.c. References MIN, SCIP_Stat::nnodes, NULL, primalSetCutoffbound(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPprobIsObjIntegral(), SCIPsetCutoffbounddelta(), SCIPsetFeasCeil(), SCIPsetInfinity(), SCIPsetIsInfinity(), SCIPtreeGetCurrentDepth(), SCIPvbcUpperbound(), SCIP_Primal::upperbound, and SCIP_Stat::vbc. Referenced by SCIPprimalSetUpperbound(), SCIPprimalUpdateObjlimit(), and SCIPprimalUpdateObjoffset().
sets upper bound in primal data and in LP solver
Definition at line 290 of file primal.c. References NULL, primalSetUpperbound(), SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIPerrorMessage, SCIPsetInfinity(), and SCIP_Primal::upperbound. Referenced by primalAddSol().
updates upper bound and cutoff bound in primal data after a tightening of the problem's objective limit
Definition at line 320 of file primal.c. References MIN, NULL, primalSetCutoffbound(), primalSetUpperbound(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPprobGetObjlim(), SCIPprobInternObjval(), and SCIPsetInfinity(). Referenced by initSolve(), presolve(), SCIPsetObjlimit(), and SCIPtransformProb().
recalculates upper bound and cutoff bound in primal data after a change of the problem's objective offset
Definition at line 358 of file primal.c. References MIN, SCIP_Primal::nsols, NULL, primalSetCutoffbound(), primalSetUpperbound(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_STAGE_EXITPRESOLVE, SCIPprobGetObjlim(), SCIPprobInternObjval(), SCIPsetGetStage(), SCIPsetInfinity(), SCIPsolGetObj(), SCIPsolIsOriginal(), and SCIP_Primal::sols. Referenced by SCIPaddObjoffset(), SCIPprobCheckObjIntegral(), SCIPprobScaleObj(), and SCIPvarAddObj().
adds additional objective offset in original space to all existing solution (in original space)
Definition at line 423 of file primal.c. References SCIP_Primal::existingsols, SCIP_Primal::nexistingsols, SCIP_Primal::nsols, NULL, SCIP_SOLORIGIN_ORIGINAL, SCIP_STAGE_PROBLEM, SCIPsetGetStage(), SCIPsetIsLE(), SCIPsolGetOrigin(), SCIPsolGetOrigObj(), SCIPsolOrigAddObjval(), and SCIP_Primal::sols. Referenced by SCIPaddOrigObjoffset().
returns whether the current primal bound is justified with a feasible primal solution; if not, the primal bound was set from the user as objective limit
Definition at line 457 of file primal.c. References SCIP_Primal::nsols, NULL, SCIPsetIsEQ(), SCIPsolGetObj(), SCIP_Primal::sols, and SCIP_Primal::upperbound. Referenced by SCIPisPrimalboundSol().
adds primal solution to solution storage at given position
Definition at line 471 of file primal.c. References SCIP_Stat::bestsolnode, ensureSolsSize(), FALSE, SCIP_Stat::firstprimalbound, SCIP_Stat::firstprimaldepth, SCIP_Stat::firstprimalheur, SCIP_Stat::firstprimaltime, MIN, SCIP_Primal::nbestsolsfound, SCIP_Primal::nlimsolsfound, SCIP_Stat::nnodes, SCIP_Stat::nnodesbeforefirst, SCIP_Stat::nrunsbeforefirst, SCIP_Primal::nsols, SCIP_Primal::nsolsfound, NULL, SCIP_Bool, SCIP_CALL, SCIP_EVENTTYPE_BESTSOLFOUND, SCIP_EVENTTYPE_POORSOLFOUND, SCIP_OKAY, SCIP_Real, SCIP_STAGE_SOLVING, SCIPdebug, SCIPdebugMessage, SCIPdispPrintLine(), SCIPerrorMessage, SCIPeventChgSol(), SCIPeventChgType(), SCIPeventProcess(), SCIPprimalSetUpperbound(), SCIPprimalTransformSol(), SCIPprobExternObjval(), SCIPprobGetObjlim(), SCIPprobInternObjval(), SCIPsetGetStage(), SCIPsetIsFeasLE(), SCIPsolCheck(), SCIPsolFree(), SCIPsolGetDepth(), SCIPsolGetHeur(), SCIPsolGetNodenum(), SCIPsolGetObj(), SCIPsolGetRunnum(), SCIPsolGetTime(), SCIPsolIsOriginal(), SCIPsolPrint(), SCIPsolTransform(), SCIPsolUnlink(), SCIPsolUpdateVarsum(), SCIPtreeGetCurrentNode(), SCIPtreeInRepropagation(), SCIPvbcFoundSolution(), SCIP_Primal::sols, TRUE, and SCIP_Stat::vbc. Referenced by SCIPprimalAddSol(), SCIPprimalAddSolFree(), SCIPprimalTrySol(), and SCIPprimalTrySolFree().
adds primal solution to solution storage at given position
Definition at line 654 of file primal.c. References ensureSolsSize(), MIN, SCIP_Primal::nlimsolsfound, SCIP_Primal::nsols, SCIP_Primal::nsolsfound, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPprobGetObjlim(), SCIPsetIsFeasLE(), SCIPsolFree(), SCIPsolGetOrigObj(), and SCIP_Primal::sols. Referenced by SCIPprimalAddOrigSol(), and SCIPprimalAddOrigSolFree().
uses binary search to find position in solution storage
Definition at line 705 of file primal.c. References SCIP_Primal::nsols, NULL, SCIP_Real, SCIPsetIsEQ(), SCIPsolGetObj(), SCIPsolIsOriginal(), and SCIP_Primal::sols. Referenced by solOfInterest().
uses binary search to find position in solution storage
Definition at line 755 of file primal.c. References SCIP_Primal::nsols, NULL, SCIP_Real, SCIPsolGetOrigObj(), and SCIP_Primal::sols. Referenced by origsolOfInterest().
returns whether the given primal solution is already existent in the solution storage
Definition at line 790 of file primal.c. References FALSE, SCIP_Primal::nsols, NULL, REALABS, SCIP_Real, SCIPsetEpsilon(), SCIPsetIsFeasGE(), SCIPsetIsFeasLE(), SCIPsetIsGE(), SCIPsetIsGT(), SCIPsetIsLE(), SCIPsetIsLT(), SCIPsolGetObj(), SCIPsolIsOriginal(), SCIPsolsAreEqual(), SCIP_Primal::sols, and TRUE. Referenced by solOfInterest().
returns whether the given primal solution is already existent in the original solution candidate storage
Definition at line 872 of file primal.c. References FALSE, SCIP_Primal::nsols, NULL, SCIP_Real, SCIPsetIsGE(), SCIPsetIsGT(), SCIPsetIsLE(), SCIPsetIsLT(), SCIPsolGetOrigObj(), SCIPsolsAreEqual(), SCIP_Primal::sols, and TRUE. Referenced by origsolOfInterest().
check if we are willing to check the solution for feasibility
Definition at line 924 of file primal.c. References FALSE, primalExistsSol(), primalSearchSolPos(), SCIP_Real, SCIPsetIsInfinity(), SCIPsolGetObj(), and TRUE. Referenced by SCIPprimalAddSol(), SCIPprimalAddSolFree(), SCIPprimalTrySol(), and SCIPprimalTrySolFree().
check if we are willing to store the solution candidate for later checking
Definition at line 962 of file primal.c. References FALSE, primalExistsOrigSol(), primalSearchOrigSolPos(), SCIPsolIsOriginal(), and TRUE. Referenced by SCIPprimalAddOrigSol(), and SCIPprimalAddOrigSolFree().
adds primal solution to solution storage by copying it
Definition at line 983 of file primal.c. References FALSE, SCIP_Primal::nsols, NULL, primalAddSol(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPsetIsLE(), SCIPsolCopy(), SCIPsolGetObj(), solOfInterest(), SCIP_Primal::sols, and TRUE. Referenced by SCIPaddSol(), SCIPprimalAddCurrentSol(), SCIPtransformProb(), and SCIPtrySol().
adds primal solution to solution storage, frees the solution afterwards
Definition at line 1040 of file primal.c. References FALSE, NULL, primalAddSol(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPsolFree(), solOfInterest(), and TRUE. Referenced by addCurrentSolution(), SCIPaddSolFree(), and SCIPtrySolFree().
adds primal solution to solution candidate storage of original problem space
Definition at line 1094 of file primal.c. References FALSE, NULL, origsolOfInterest(), primalAddOrigSol(), SCIP_CALL, SCIP_OKAY, SCIPsolCopy(), SCIPsolIsOriginal(), and TRUE. Referenced by freeTransform(), and SCIPaddSol().
adds primal solution to solution candidate storage of original problem space, frees the solution afterwards
Definition at line 1134 of file primal.c. References FALSE, NULL, origsolOfInterest(), primalAddOrigSol(), SCIP_CALL, SCIP_OKAY, SCIPsolFree(), SCIPsolIsOriginal(), and TRUE. Referenced by SCIPaddSolFree().
links temporary solution of primal data to current solution
Definition at line 1180 of file primal.c. References SCIP_Primal::currentsol, NULL, SCIP_CALL, SCIP_OKAY, SCIPsolCreateCurrentSol(), SCIPsolLinkCurrentSol(), and SCIPsolSetHeur(). Referenced by SCIPprimalAddCurrentSol(), and SCIPprimalTryCurrentSol().
adds current LP/pseudo solution to solution storage
Definition at line 1207 of file primal.c. References SCIP_Primal::currentsol, NULL, primalLinkCurrentSol(), SCIP_CALL, SCIP_OKAY, and SCIPprimalAddSol(). Referenced by SCIPaddCurrentSol().
checks primal solution; if feasible, adds it to storage by copying it
Definition at line 1236 of file primal.c. References FALSE, NULL, primalAddSol(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPsolCheck(), SCIPsolCopy(), solOfInterest(), and TRUE. Referenced by SCIPprimalTryCurrentSol(), SCIPtrySol(), and solveNodeLP().
checks primal solution; if feasible, adds it to storage; solution is freed afterwards
Definition at line 1303 of file primal.c. References FALSE, NULL, primalAddSol(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPsolCheck(), SCIPsolFree(), solOfInterest(), and TRUE. Referenced by addCurrentSolution(), SCIPprimalTransformSol(), SCIPtrySolFree(), solveNode(), and solveNodeLP().
checks current LP/pseudo solution; if feasible, adds it to storage
Definition at line 1374 of file primal.c. References SCIP_Primal::currentsol, FALSE, NULL, primalLinkCurrentSol(), SCIP_CALL, SCIP_OKAY, and SCIPprimalTrySol(). Referenced by SCIPtryCurrentSol().
inserts solution into the global array of all existing primal solutions
Definition at line 1407 of file primal.c. References ensureExistingsolsSize(), SCIP_Primal::existingsols, SCIP_Primal::nexistingsols, NULL, SCIP_CALL, SCIP_OKAY, SCIPsolGetPrimalIndex(), and SCIPsolSetPrimalIndex(). Referenced by SCIPsolCopy(), SCIPsolCreate(), SCIPsolCreateOriginal(), and SCIPsolCreateUnknown().
removes solution from the global array of all existing primal solutions
Definition at line 1429 of file primal.c. References SCIP_Primal::existingsols, SCIP_Primal::nexistingsols, NULL, SCIPsolGetPrimalIndex(), and SCIPsolSetPrimalIndex(). Referenced by SCIPsolFree().
updates all existing primal solutions after a change in a variable's objective value
Definition at line 1459 of file primal.c. References SCIP_Primal::existingsols, SCIP_Primal::nexistingsols, NULL, SCIPsolIsOriginal(), and SCIPsolUpdateVarObj(). Referenced by SCIPeventProcess().
retransforms all existing solutions to original problem space
Definition at line 1478 of file primal.c. References SCIP_Primal::nsols, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_SOLORIGIN_ZERO, SCIPsolGetOrigin(), SCIPsolRetransform(), and SCIP_Primal::sols. Referenced by initPresolve().
tries to transform original solution to the transformed problem space
Definition at line 1503 of file primal.c. References BMSclearMemoryArray, FALSE, NULL, SCIP_Prob::nvars, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_VARSTATUS_FIXED, SCIP_VARSTATUS_MULTAGGR, SCIPdebugMessage, SCIPprimalTrySolFree(), SCIPsetAllocBufferArray, SCIPsetFreeBufferArray, SCIPsetIsEQ(), SCIPsetIsInfinity(), SCIPsolCreate(), SCIPsolGetHeur(), SCIPsolGetOrigObj(), SCIPsolGetVal(), SCIPsolIsOriginal(), SCIPsolSetVal(), SCIPvarGetName(), SCIPvarGetProbindex(), SCIPvarGetProbvarSum(), SCIPvarGetStatus(), SCIPvarIsActive(), TRUE, and SCIP_Prob::vars. Referenced by primalAddSol(), and transformSols(). |