methods for storing separated cuts
Definition in file sepastore.c.
#include <assert.h>
#include "scip/def.h"
#include "scip/set.h"
#include "scip/stat.h"
#include "scip/lp.h"
#include "scip/var.h"
#include "scip/tree.h"
#include "scip/reopt.h"
#include "scip/sepastore.h"
#include "scip/event.h"
#include "scip/sepa.h"
#include "scip/cons.h"
#include "scip/debug.h"
#include "scip/struct_sepastore.h"
Go to the source code of this file.
|
static |
resizes cuts and score arrays to be able to store at least num entries
sepastore | separation storage |
set | global SCIP settings |
num | minimal number of slots in array |
Definition at line 49 of file sepastore.c.
References BMSreallocMemoryArray, SCIP_SepaStore::cuts, SCIP_SepaStore::cutssize, SCIP_ALLOC, SCIP_OKAY, SCIPsetCalcMemGrowSize(), and SCIP_SepaStore::scores.
Referenced by SCIPsepastoreAddCut().
SCIP_RETCODE SCIPsepastoreCreate | ( | SCIP_SEPASTORE ** | sepastore | ) |
creates separation storage
sepastore | pointer to store separation storage |
Definition at line 76 of file sepastore.c.
References BMSallocMemory, FALSE, SCIP_ALLOC, and SCIP_OKAY.
Referenced by initSolve().
SCIP_RETCODE SCIPsepastoreFree | ( | SCIP_SEPASTORE ** | sepastore | ) |
frees separation storage
sepastore | pointer to store separation storage |
Definition at line 99 of file sepastore.c.
References BMSfreeMemory, BMSfreeMemoryArrayNull, and SCIP_OKAY.
Referenced by freeReoptSolve(), and freeSolve().
void SCIPsepastoreStartInitialLP | ( | SCIP_SEPASTORE * | sepastore | ) |
informs separation storage, that the setup of the initial LP starts now
sepastore | separation storage |
Definition at line 115 of file sepastore.c.
References SCIP_SepaStore::initiallp, SCIP_SepaStore::ncuts, and TRUE.
Referenced by SCIPconstructCurrentLP(), and SCIPinitConssLP().
void SCIPsepastoreEndInitialLP | ( | SCIP_SEPASTORE * | sepastore | ) |
informs separation storage, that the setup of the initial LP is now finished
sepastore | separation storage |
Definition at line 127 of file sepastore.c.
References FALSE, SCIP_SepaStore::initiallp, and SCIP_SepaStore::ncuts.
Referenced by SCIPconstructCurrentLP(), and SCIPinitConssLP().
void SCIPsepastoreStartForceCuts | ( | SCIP_SEPASTORE * | sepastore | ) |
informs separation storage, that the following cuts should be used in any case
sepastore | separation storage |
Definition at line 139 of file sepastore.c.
References SCIP_SepaStore::forcecuts, and TRUE.
Referenced by enforceConstraints().
void SCIPsepastoreEndForceCuts | ( | SCIP_SEPASTORE * | sepastore | ) |
informs separation storage, that the following cuts should no longer be used in any case
sepastore | separation storage |
Definition at line 150 of file sepastore.c.
References FALSE, and SCIP_SepaStore::forcecuts.
Referenced by enforceConstraints().
|
static |
checks cut for redundancy due to activity bounds
sepastore | separation storage |
set | global SCIP settings |
stat | problem statistics data |
cut | separated cut |
Definition at line 162 of file sepastore.c.
References FALSE, SCIP_Real, SCIProwGetLhs(), SCIProwGetMaxActivity(), SCIProwGetMinActivity(), SCIProwGetName(), SCIProwGetRhs(), SCIProwIsModifiable(), SCIPsetDebugMsg, SCIPsetIsInfinity(), SCIPsetIsLE(), and TRUE.
Referenced by SCIPsepastoreAddCut().
|
static |
checks cut for redundancy or infeasibility due to activity bounds
sepastore | separation storage |
set | global SCIP settings |
stat | problem statistics data |
cut | separated cut |
infeasible | pointer to store whether the cut has been detected to be infeasible |
Definition at line 200 of file sepastore.c.
References FALSE, SCIP_Real, SCIProwGetLhs(), SCIProwGetMaxActivity(), SCIProwGetMinActivity(), SCIProwGetName(), SCIProwGetRhs(), SCIProwIsModifiable(), SCIPsetDebugMsg, SCIPsetIsFeasGT(), SCIPsetIsFeasLT(), SCIPsetIsInfinity(), SCIPsetIsLE(), and TRUE.
Referenced by SCIPsepastoreAddCut().
checks whether a cut with only one variable can be applied as boundchange
This is the case if the bound change would prove infeasibility (w.r.t feastol), or if the new bound is at least epsilon better than the old bound. In the latter case, also the opposite bound has to be taken into account.
set | global SCIP settings |
cut | cut with a single variable |
Definition at line 256 of file sepastore.c.
References FALSE, MAX, SCIP_Bool, SCIP_Real, SCIPcolGetVar(), SCIProwGetCols(), SCIProwGetConstant(), SCIProwGetLhs(), SCIProwGetNNonz(), SCIProwGetRhs(), SCIProwGetVals(), SCIProwIsLocal(), SCIProwIsModifiable(), SCIPsetIsFeasGT(), SCIPsetIsFeasLT(), SCIPsetIsFeasZero(), SCIPsetIsGT(), SCIPsetIsInfinity(), SCIPsetIsLT(), SCIPsetIsZero(), SCIPvarAdjustLb(), SCIPvarAdjustUb(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetUbGlobal(), SCIPvarGetUbLocal(), and TRUE.
Referenced by SCIPsepastoreAddCut(), SCIPsepastoreApplyCuts(), and SCIPsepastoreIsCutApplicable().
|
static |
removes a non-forced cut from the separation storage
sepastore | separation storage |
blkmem | block memory |
set | global SCIP settings |
eventqueue | event queue |
eventfilter | event filter for global events |
lp | LP data |
pos | position of cut to delete |
Definition at line 355 of file sepastore.c.
References SCIP_SepaStore::cuts, SCIP_EventFilter::eventmask, SCIP_EventFilter::len, SCIP_SepaStore::ncuts, SCIP_SepaStore::nforcedcuts, SCIP_CALL, SCIP_EVENTTYPE_ROWDELETEDSEPA, SCIP_OKAY, SCIPeventCreateRowDeletedSepa(), SCIPeventqueueAdd(), SCIProwRelease(), and SCIP_SepaStore::scores.
Referenced by SCIPsepastoreApplyCuts(), SCIPsepastoreRemoveInefficaciousCuts(), and sepastoreUpdateOrthogonalities().
SCIP_RETCODE SCIPsepastoreAddCut | ( | SCIP_SEPASTORE * | sepastore, |
BMS_BLKMEM * | blkmem, | ||
SCIP_SET * | set, | ||
SCIP_STAT * | stat, | ||
SCIP_EVENTQUEUE * | eventqueue, | ||
SCIP_EVENTFILTER * | eventfilter, | ||
SCIP_LP * | lp, | ||
SCIP_ROW * | cut, | ||
SCIP_Bool | forcecut, | ||
SCIP_Bool | root, | ||
SCIP_Bool * | infeasible | ||
) |
adds cut to separation storage and captures it; if the cut should be forced to enter the LP, an infinite score has to be used
sepastore | separation storage |
blkmem | block memory |
set | global SCIP settings |
stat | problem statistics data |
eventqueue | event queue |
eventfilter | event filter for global events |
lp | LP data |
cut | separated cut |
forcecut | should the cut be forced to enter the LP? |
root | are we at the root node? |
infeasible | pointer to store whether the cut is infeasible |
Definition at line 394 of file sepastore.c.
References SCIP_SepaStore::cuts, SCIP_SepaStore::cutssize, SCIP_EventFilter::eventmask, FALSE, SCIP_SepaStore::forcecuts, SCIP_SepaStore::initiallp, SCIP_EventFilter::len, SCIP_SepaStore::ncuts, SCIP_SepaStore::ncutsfound, SCIP_SepaStore::ncutsfoundround, SCIP_SepaStore::nforcedcuts, SCIP_Bool, SCIP_CALL, SCIP_EVENTTYPE_ROWADDEDSEPA, SCIP_EVENTTYPE_ROWDELETEDSEPA, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPdebugCheckRow, SCIPeventCreateRowAddedSepa(), SCIPeventCreateRowDeletedSepa(), SCIPeventqueueAdd(), SCIProwCapture(), SCIProwChgLocal(), SCIProwGetLhs(), SCIProwGetName(), SCIProwGetNNonz(), SCIProwGetRhs(), SCIProwIsLocal(), SCIProwIsModifiable(), SCIProwRelease(), SCIPsetDebugMsg, SCIPsetGetSepaMaxcuts(), SCIPsetInfinity(), SCIPsetIsInfinity(), SCIP_SepaStore::scores, sepastoreEnsureCutsMem(), sepastoreIsBdchgApplicable(), sepastoreIsCutRedundant(), and sepastoreIsCutRedundantOrInfeasible().
Referenced by SCIPaddRow(), SCIPconstructCurrentLP(), SCIPcutpoolSeparate(), and SCIPreoptApplyCuts().
|
static |
applies a lower bound change
sepastore | separation storage |
blkmem | block memory |
set | global SCIP settings |
stat | problem statistics |
transprob | transformed problem |
origprob | original problem |
tree | branch and bound tree |
reopt | reoptimization data structure |
lp | LP data |
branchcand | branching candidate storage |
eventqueue | event queue |
cliquetable | clique table data structure |
var | problem variable |
bound | new lower bound of variable |
local | is it a local bound change? (otherwise global) |
applied | pointer to store whether the domain change was applied |
cutoff | pointer to store TRUE, if an infeasibility has been detected |
Definition at line 531 of file sepastore.c.
References FALSE, SCIP_BOUNDTYPE_LOWER, SCIP_CALL, SCIP_OKAY, SCIPnodeAddBoundchg(), SCIPnodeCutoff(), SCIPsetDebugMsg, SCIPsetIsFeasLE(), SCIPsetIsGT(), SCIPtreeGetCurrentNode(), SCIPtreeGetRootNode(), SCIPvarAdjustLb(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), SCIPvarGetUbLocal(), and TRUE.
Referenced by sepastoreApplyBdchg().
|
static |
applies an upper bound change
sepastore | separation storage |
blkmem | block memory |
set | global SCIP settings |
stat | problem statistics |
transprob | transformed problem |
origprob | original problem |
tree | branch and bound tree |
reopt | reoptimization data structure |
lp | LP data |
branchcand | branching candidate storage |
eventqueue | event queue |
cliquetable | clique table data structure |
var | problem variable |
bound | new upper bound of variable |
local | is it a local bound change? (otherwise global) |
applied | pointer to store whether the domain change was applied |
cutoff | pointer to store TRUE, if an infeasibility has been detected |
Definition at line 616 of file sepastore.c.
References FALSE, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_OKAY, SCIPnodeAddBoundchg(), SCIPnodeCutoff(), SCIPsetDebugMsg, SCIPsetIsFeasGE(), SCIPsetIsLT(), SCIPtreeGetCurrentNode(), SCIPtreeGetRootNode(), SCIPvarAdjustUb(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), SCIPvarGetUbLocal(), and TRUE.
Referenced by sepastoreApplyBdchg().
|
static |
applies a cut that is a bound change directly as bound change instead of adding it as row to the LP
sepastore | separation storage |
blkmem | block memory |
set | global SCIP settings |
stat | problem statistics |
transprob | transformed problem |
origprob | original problem |
tree | branch and bound tree |
reopt | reoptimization data structure |
lp | LP data |
branchcand | branching candidate storage |
eventqueue | event queue |
cliquetable | clique table data structure |
cut | cut with a single variable |
applied | pointer to store whether the domain change was applied |
cutoff | pointer to store whether an empty domain was created |
Definition at line 701 of file sepastore.c.
References FALSE, SCIP_SepaStore::initiallp, SCIP_SepaStore::ncutsapplied, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPcolGetVar(), SCIProwGetCols(), SCIProwGetConstant(), SCIProwGetLhs(), SCIProwGetNNonz(), SCIProwGetRhs(), SCIProwGetVals(), SCIProwIsLocal(), SCIProwIsModifiable(), SCIPsetIsFeasZero(), SCIPsetIsInfinity(), SCIPsetIsZero(), sepastoreApplyLb(), and sepastoreApplyUb().
Referenced by SCIPsepastoreApplyCuts().
|
static |
updates the orthogonalities and scores of the non-forced cuts after the given cut was added to the LP
sepastore | separation storage |
blkmem | block memory |
set | global SCIP settings |
eventqueue | event queue |
eventfilter | event filter for global events |
lp | LP data |
cut | cut that was applied |
mincutorthogonality | minimal orthogonality of cuts to apply to LP |
bestscore | best score in this round |
Definition at line 797 of file sepastore.c.
References SCIP_SepaStore::cuts, SCIP_SepaStore::nforcedcuts, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIProwGetName(), SCIProwGetNNonz(), SCIProwGetOrthogonality(), SCIPsetDebugMsg, SCIP_SepaStore::scores, and sepastoreDelCut().
Referenced by sepastoreApplyCut().
|
static |
applies the given cut to the LP and updates the orthogonalities and scores of remaining cuts
sepastore | separation storage |
blkmem | block memory |
set | global SCIP settings |
eventqueue | event queue |
eventfilter | global event filter |
lp | LP data |
cut | cut to apply to the LP |
mincutorthogonality | minimal orthogonality of cuts to apply to LP |
bestscore | best score in this round |
depth | depth of current node |
ncutsapplied | pointer to count the number of applied cuts |
Definition at line 838 of file sepastore.c.
References SCIP_SepaStore::initiallp, SCIP_SepaStore::ncutsapplied, SCIP_Row::origin, SCIP_Row::origintype, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_ROWORIGINTYPE_CONS, SCIP_ROWORIGINTYPE_REOPT, SCIP_ROWORIGINTYPE_SEPA, SCIP_ROWORIGINTYPE_UNSPEC, SCIPconshdlrIncNAppliedCuts(), SCIPerrorMessage, SCIPlpAddRow(), SCIProwIsInLP(), SCIPsepaIncNAppliedCuts(), and sepastoreUpdateOrthogonalities().
Referenced by SCIPsepastoreApplyCuts().
|
static |
returns the position of the best non-forced cut in the cuts array
sepastore | separation storage |
Definition at line 897 of file sepastore.c.
References SCIP_SepaStore::ncuts, SCIP_SepaStore::nforcedcuts, SCIP_INVALID, SCIP_Real, and SCIP_SepaStore::scores.
Referenced by SCIPsepastoreApplyCuts().
|
static |
computes score for current LP solution and initialized orthogonalities
sepastore | separation storage |
set | global SCIP settings |
stat | problem statistics |
lp | LP data |
handlepool | whether the efficacy of cuts in the pool should be reduced |
pos | position of cut to handle |
efficiacychoice | type of solution to base efficiacy computation on |
bestscore | pointer to update best score |
Definition at line 927 of file sepastore.c.
References SCIP_SepaStore::cuts, MAX, SCIP_EFFICIACYCHOICE_LP, SCIP_EFFICIACYCHOICE_NLP, SCIP_EFFICIACYCHOICE_RELAX, SCIP_INVALIDCALL, SCIP_OKAY, SCIP_Real, SCIPerrorMessage, SCIProwGetLPEfficacy(), SCIProwGetNLPEfficacy(), SCIProwGetNNonz(), SCIProwGetNumIntCols(), SCIProwGetObjParallelism(), SCIProwGetRelaxEfficacy(), SCIProwIsInGlobalCutpool(), SCIPsetIsInfinity(), and SCIP_SepaStore::scores.
Referenced by SCIPsepastoreApplyCuts().
SCIP_RETCODE SCIPsepastoreApplyCuts | ( | SCIP_SEPASTORE * | sepastore, |
BMS_BLKMEM * | blkmem, | ||
SCIP_SET * | set, | ||
SCIP_STAT * | stat, | ||
SCIP_PROB * | transprob, | ||
SCIP_PROB * | origprob, | ||
SCIP_TREE * | tree, | ||
SCIP_REOPT * | reopt, | ||
SCIP_LP * | lp, | ||
SCIP_BRANCHCAND * | branchcand, | ||
SCIP_EVENTQUEUE * | eventqueue, | ||
SCIP_EVENTFILTER * | eventfilter, | ||
SCIP_CLIQUETABLE * | cliquetable, | ||
SCIP_Bool | root, | ||
SCIP_EFFICIACYCHOICE | efficiacychoice, | ||
SCIP_Bool * | cutoff | ||
) |
adds cuts to the LP and clears separation storage
sepastore | separation storage |
blkmem | block memory |
set | global SCIP settings |
stat | problem statistics |
transprob | transformed problem |
origprob | original problem |
tree | branch and bound tree |
reopt | reoptimization data structure |
lp | LP data |
branchcand | branching candidate storage |
eventqueue | event queue |
eventfilter | global event filter |
cliquetable | clique table data structure |
root | are we at the root node? |
efficiacychoice | type of solution to base efficiacy computation on |
cutoff | pointer to store whether an empty domain was created |
Definition at line 978 of file sepastore.c.
References computeScore(), SCIP_SepaStore::cuts, FALSE, MAX, SCIP_SepaStore::ncuts, SCIP_SepaStore::nforcedcuts, SCIP_Bool, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPnodeGetDepth(), SCIProwCapture(), SCIProwGetLPEfficacy(), SCIProwGetName(), SCIProwGetNNonz(), SCIProwGetObjParallelism(), SCIProwIsModifiable(), SCIProwRelease(), SCIPsepastoreClearCuts(), SCIPsetDebugMsg, SCIPsetGetSepaMaxcuts(), SCIPsetIsFeasPositive(), SCIPsetIsInfinity(), SCIPtreeGetCurrentNode(), SCIP_SepaStore::scores, sepastoreApplyBdchg(), sepastoreApplyCut(), sepastoreDelCut(), sepastoreGetBestCut(), sepastoreIsBdchgApplicable(), and TRUE.
Referenced by applyCuts(), priceAndCutLoop(), SCIPapplyCutsProbing(), SCIPconstructCurrentLP(), and SCIPinitConssLP().
SCIP_RETCODE SCIPsepastoreClearCuts | ( | SCIP_SEPASTORE * | sepastore, |
BMS_BLKMEM * | blkmem, | ||
SCIP_SET * | set, | ||
SCIP_EVENTQUEUE * | eventqueue, | ||
SCIP_EVENTFILTER * | eventfilter, | ||
SCIP_LP * | lp | ||
) |
clears the separation storage without adding the cuts to the LP
sepastore | separation storage |
blkmem | block memory |
set | global SCIP settings |
eventqueue | event queue |
eventfilter | event filter for global events |
lp | LP data |
Definition at line 1114 of file sepastore.c.
References BMSfreeMemoryArrayNull, SCIP_SepaStore::cuts, SCIP_SepaStore::cutssize, SCIP_EventFilter::eventmask, SCIP_SepaStore::initiallp, SCIP_EventFilter::len, SCIP_SepaStore::ncuts, SCIP_SepaStore::ncutsfoundround, SCIP_SepaStore::nforcedcuts, SCIP_CALL, SCIP_EVENTTYPE_ROWDELETEDSEPA, SCIP_OKAY, SCIPeventCreateRowDeletedSepa(), SCIPeventqueueAdd(), SCIProwRelease(), and SCIPsetDebugMsg.
Referenced by applyCuts(), priceAndCutLoop(), SCIPclearCuts(), SCIPconstructCurrentLP(), SCIPinitConssLP(), and SCIPsepastoreApplyCuts().
SCIP_RETCODE SCIPsepastoreRemoveInefficaciousCuts | ( | SCIP_SEPASTORE * | sepastore, |
BMS_BLKMEM * | blkmem, | ||
SCIP_SET * | set, | ||
SCIP_STAT * | stat, | ||
SCIP_EVENTQUEUE * | eventqueue, | ||
SCIP_EVENTFILTER * | eventfilter, | ||
SCIP_LP * | lp, | ||
SCIP_Bool | root, | ||
SCIP_EFFICIACYCHOICE | efficiacychoice | ||
) |
removes cuts that are inefficacious w.r.t. the current LP solution from separation storage without adding the cuts to the LP
sepastore | separation storage |
blkmem | block memory |
set | global SCIP settings |
stat | problem statistics data |
eventqueue | event queue |
eventfilter | event filter for global events |
lp | LP data |
root | are we at the root node? |
efficiacychoice | type of solution to base efficiacy computation on |
Definition at line 1162 of file sepastore.c.
References SCIP_SepaStore::cuts, SCIP_SepaStore::nforcedcuts, SCIP_CALL, SCIP_EFFICIACYCHOICE_LP, SCIP_EFFICIACYCHOICE_NLP, SCIP_EFFICIACYCHOICE_RELAX, SCIP_INVALIDCALL, SCIP_OKAY, SCIP_Real, SCIPerrorMessage, SCIProwGetLPEfficacy(), SCIProwGetNLPEfficacy(), SCIProwGetRelaxEfficacy(), SCIPsetDebugMsg, SCIPsetIsEfficacious(), and sepastoreDelCut().
Referenced by SCIPremoveInefficaciousCuts().
indicates whether a cut is applicable
A cut is applicable if it is modifiable, not a bound change, or a bound change that changes bounds by at least epsilon.
set | global SCIP settings |
cut | cut to check |
Definition at line 1218 of file sepastore.c.
References SCIProwGetNNonz(), SCIProwIsModifiable(), and sepastoreIsBdchgApplicable().
Referenced by SCIPisCutApplicable().
SCIP_ROW** SCIPsepastoreGetCuts | ( | SCIP_SEPASTORE * | sepastore | ) |
get cuts in the separation storage
sepastore | separation storage |
Definition at line 1227 of file sepastore.c.
References SCIP_SepaStore::cuts.
Referenced by SCIPgetCuts().
int SCIPsepastoreGetNCuts | ( | SCIP_SEPASTORE * | sepastore | ) |
get number of cuts in the separation storage
sepastore | separation storage |
Definition at line 1237 of file sepastore.c.
References SCIP_SepaStore::ncuts.
Referenced by applyCuts(), cutpoolSeparate(), enforceConstraints(), priceAndCutLoop(), propAndSolve(), SCIPbranchruleExecExternSol(), SCIPbranchruleExecLPSol(), SCIPconshdlrEnforceLPSol(), SCIPconshdlrEnforceRelaxSol(), SCIPconshdlrSeparateLP(), SCIPconshdlrSeparateSol(), SCIPcutpoolSeparate(), SCIPendProbing(), SCIPgetNCuts(), SCIPsepaExecLP(), SCIPsepaExecSol(), separationRoundLP(), separationRoundSol(), solveNode(), and solveNodeLP().
int SCIPsepastoreGetNCutsFound | ( | SCIP_SEPASTORE * | sepastore | ) |
get total number of cuts found so far
sepastore | separation storage |
Definition at line 1247 of file sepastore.c.
References SCIP_SepaStore::ncutsfound.
Referenced by SCIPgetNCutsFound().
int SCIPsepastoreGetNCutsFoundRound | ( | SCIP_SEPASTORE * | sepastore | ) |
get number of cuts found so far in current separation round
sepastore | separation storage |
Definition at line 1257 of file sepastore.c.
References SCIP_SepaStore::ncutsfoundround.
Referenced by SCIPgetNCutsFoundRound().
int SCIPsepastoreGetNCutsApplied | ( | SCIP_SEPASTORE * | sepastore | ) |
get total number of cuts applied to the LPs
sepastore | separation storage |
Definition at line 1267 of file sepastore.c.
References SCIP_SepaStore::ncutsapplied.
Referenced by applyCuts(), SCIPgetNCutsApplied(), and solveNodeLP().