methods for storing cuts in a cut pool
Definition in file cutpool.c.
#include <assert.h>
#include "scip/def.h"
#include "scip/set.h"
#include "scip/stat.h"
#include "scip/clock.h"
#include "scip/lp.h"
#include "scip/cons.h"
#include "scip/sepa.h"
#include "scip/sepastore.h"
#include "scip/cutpool.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/struct_cutpool.h"
Go to the source code of this file.
|
static |
|
static |
returns TRUE iff both cuts are identical
Definition at line 65 of file cutpool.c.
References SCIP_Row::cols, SCIP_Row::cols_index, FALSE, SCIP_Row::len, SCIP_Row::lpcolssorted, SCIP_Row::maxidx, SCIP_Row::minidx, SCIP_Row::nlpcols, SCIP_Row::nonlpcolssorted, SCIP_Row::nunlinked, SCIP_Row::rhs, SCIP_Real, SCIProwGetMaxval(), SCIProwGetMinval(), SCIProwSort(), SCIPsetIsFeasEQ(), SCIPsetIsInfinity(), TRUE, SCIP_Row::validminmaxidx, and SCIP_Row::vals.
|
static |
Definition at line 245 of file cutpool.c.
References SCIP_Row::cols_index, SCIP_Row::len, SCIP_Row::rhs, SCIP_Real, SCIPhashTwo, SCIPrealHashCode(), SCIProwGetMaxval(), SCIPsetIsInfinity(), and SCIP_Row::vals.
|
static |
resizes cuts array to be able to store at least num entries
cutpool | cut pool |
set | global SCIP settings |
num | minimal number of slots in array |
Definition at line 281 of file cutpool.c.
References BMSreallocMemoryArray, SCIP_Cutpool::cuts, SCIP_Cutpool::cutssize, SCIP_ALLOC, SCIP_OKAY, and SCIPsetCalcMemGrowSize().
Referenced by SCIPcutpoolAddNewRow().
|
static |
creates a cut and captures the row
cut | pointer to store the cut |
blkmem | block memory |
row | row this cut represents |
Definition at line 311 of file cutpool.c.
References SCIP_Row::age, BMSallocBlockMemory, SCIP_ALLOC, SCIP_OKAY, and SCIProwCapture().
Referenced by SCIPcutpoolAddNewRow().
|
static |
frees a cut and releases the row
cut | pointer to store the cut |
blkmem | block memory |
set | global SCIP settings |
lp | current LP data |
Definition at line 337 of file cutpool.c.
References BMSfreeBlockMemory, SCIP_CALL, SCIP_OKAY, and SCIProwRelease().
Referenced by cutpoolDelCut(), and SCIPcutpoolClear().
returns whether the cut's age exceeds the age limit
cut | cut to check |
agelimit | maximum age a cut can reach before it is deleted from the pool, or -1 |
Definition at line 360 of file cutpool.c.
References SCIP_Cut::age.
Referenced by SCIPcutpoolSeparate().
SCIP_RETCODE SCIPcutpoolCreate | ( | SCIP_CUTPOOL ** | cutpool, |
BMS_BLKMEM * | blkmem, | ||
SCIP_SET * | set, | ||
int | agelimit, | ||
SCIP_Bool | globalcutpool | ||
) |
creates cut pool
cutpool | pointer to store cut pool |
blkmem | block memory |
set | global SCIP settings |
agelimit | maximum age a cut can reach before it is deleted from the pool |
globalcutpool | is this the global cut pool of SCIP? |
Definition at line 417 of file cutpool.c.
References BMSallocMemory, SCIP_ALLOC, SCIP_CALL, SCIP_CLOCKTYPE_DEFAULT, SCIP_HASHSIZE_CUTPOOLS, SCIP_HASHSIZE_CUTPOOLS_SMALL, SCIP_INVALID, SCIP_OKAY, SCIPclockCreate(), and SCIPhashtableCreate().
Referenced by initSolve(), and SCIPcreateCutpool().
SCIP_RETCODE SCIPcutpoolFree | ( | SCIP_CUTPOOL ** | cutpool, |
BMS_BLKMEM * | blkmem, | ||
SCIP_SET * | set, | ||
SCIP_LP * | lp | ||
) |
frees cut pool
cutpool | pointer to store cut pool |
blkmem | block memory |
set | global SCIP settings |
lp | current LP data |
Definition at line 456 of file cutpool.c.
References BMSfreeMemory, BMSfreeMemoryArrayNull, SCIP_CALL, SCIP_OKAY, SCIPclockFree(), SCIPcutpoolClear(), and SCIPhashtableFree().
Referenced by freeReoptSolve(), freeSolve(), and SCIPfreeCutpool().
SCIP_RETCODE SCIPcutpoolClear | ( | SCIP_CUTPOOL * | cutpool, |
BMS_BLKMEM * | blkmem, | ||
SCIP_SET * | set, | ||
SCIP_LP * | lp | ||
) |
removes all rows from the cut pool
cutpool | cut pool |
blkmem | block memory |
set | global SCIP settings |
lp | current LP data |
Definition at line 482 of file cutpool.c.
References cutFree(), SCIP_Cutpool::cuts, FALSE, SCIP_Cutpool::globalcutpool, SCIP_Row::inglobalcutpool, SCIP_Cutpool::ncuts, SCIP_Cutpool::nremovablecuts, SCIP_Cut::row, SCIP_CALL, SCIP_OKAY, and SCIProwUnlock().
Referenced by freeReoptSolve(), freeSolve(), and SCIPcutpoolFree().
|
static |
removes the cut from the cut pool
cutpool | cut pool |
blkmem | block memory |
set | global SCIP settings |
stat | problem statistics data |
lp | current LP data |
cut | cut to remove |
Definition at line 510 of file cutpool.c.
References cutFree(), SCIP_Cutpool::cuts, FALSE, SCIP_Cutpool::firstunprocessed, SCIP_Cutpool::firstunprocessedsol, SCIP_Cutpool::globalcutpool, SCIP_Cutpool::hashtable, SCIP_Row::inglobalcutpool, SCIP_Stat::lpcount, SCIP_Cutpool::ncuts, SCIP_Cutpool::nremovablecuts, SCIP_Cut::pos, SCIP_Cut::processedlp, SCIP_Cutpool::processedlp, SCIP_Cut::processedlpsol, SCIP_Cutpool::processedlpsol, SCIP_Cut::row, SCIP_CALL, SCIP_OKAY, SCIPhashtableExists(), SCIPhashtableRemove(), SCIProwIsRemovable(), and SCIProwUnlock().
Referenced by SCIPcutpoolAddRow(), SCIPcutpoolDelRow(), and SCIPcutpoolSeparate().
SCIP_Bool SCIPcutpoolIsCutNew | ( | SCIP_CUTPOOL * | cutpool, |
SCIP_SET * | set, | ||
SCIP_ROW * | row | ||
) |
checks if cut is already existing
cutpool | cut pool |
set | global SCIP settings |
row | cutting plane to add |
Definition at line 583 of file cutpool.c.
References SCIP_Row::constant, FALSE, SCIP_Cutpool::hashtable, SCIP_Row::len, SCIP_Row::lhs, SCIP_Row::rhs, SCIP_Cut::row, SCIP_Real, SCIPhashtableRetrieve(), SCIProwGetMaxval(), SCIPsetIsFeasGT(), SCIPsetIsFeasLT(), SCIPsetIsInfinity(), and TRUE.
Referenced by SCIPisCutNew().
SCIP_RETCODE SCIPcutpoolAddRow | ( | SCIP_CUTPOOL * | cutpool, |
BMS_BLKMEM * | blkmem, | ||
SCIP_SET * | set, | ||
SCIP_STAT * | stat, | ||
SCIP_LP * | lp, | ||
SCIP_ROW * | row | ||
) |
if not already existing, adds row to cut pool and captures it
cutpool | cut pool |
blkmem | block memory |
set | global SCIP settings |
stat | problem statistics data |
lp | current LP data |
row | cutting plane to add |
Definition at line 646 of file cutpool.c.
References SCIP_Row::constant, cutpoolDelCut(), SCIP_Cutpool::hashtable, SCIP_Row::len, SCIP_Row::lhs, SCIP_Row::rhs, SCIP_Cut::row, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPcutpoolAddNewRow(), SCIPcutpoolAddRow(), SCIPhashtableRetrieve(), SCIProwGetMaxval(), SCIPsetIsFeasLT(), and SCIPsetIsInfinity().
Referenced by SCIPaddDelayedPoolCut(), SCIPaddPoolCut(), SCIPaddRowCutpool(), SCIPcutpoolAddRow(), and SCIPreoptApplyCuts().
SCIP_RETCODE SCIPcutpoolAddNewRow | ( | SCIP_CUTPOOL * | cutpool, |
BMS_BLKMEM * | blkmem, | ||
SCIP_SET * | set, | ||
SCIP_STAT * | stat, | ||
SCIP_LP * | lp, | ||
SCIP_ROW * | row | ||
) |
adds row to cut pool and captures it; doesn't check for multiple cuts
cutpool | cut pool |
blkmem | block memory |
set | global SCIP settings |
stat | problem statistics data |
lp | current LP data |
row | cutting plane to add |
Definition at line 716 of file cutpool.c.
References SCIP_Stat::bestefficacy, cutCreate(), cutpoolEnsureCutsMem(), SCIP_Cutpool::cuts, SCIP_Cutpool::globalcutpool, SCIP_Cutpool::hashtable, SCIP_Row::inglobalcutpool, MAX, SCIP_Cutpool::maxncuts, SCIP_Cutpool::ncuts, SCIP_Cutpool::nremovablecuts, SCIP_Cut::pos, SCIP_CALL, SCIP_INVALIDDATA, SCIP_LPSOLSTAT_OPTIMAL, SCIP_OKAY, SCIP_Real, SCIPerrorMessage, SCIPhashtableExists(), SCIPhashtableInsert(), SCIPlpGetSolstat(), SCIProwGetLPEfficacy(), SCIProwGetMaxidx(), SCIProwGetName(), SCIProwIsLocal(), SCIProwIsModifiable(), SCIProwIsRemovable(), SCIProwLock(), TRUE, and SCIP_Row::validminmaxidx.
Referenced by SCIPaddNewRowCutpool(), and SCIPcutpoolAddRow().
SCIP_RETCODE SCIPcutpoolDelRow | ( | SCIP_CUTPOOL * | cutpool, |
BMS_BLKMEM * | blkmem, | ||
SCIP_SET * | set, | ||
SCIP_STAT * | stat, | ||
SCIP_LP * | lp, | ||
SCIP_ROW * | row | ||
) |
removes the LP row from the cut pool
cutpool | cut pool |
blkmem | block memory |
set | global SCIP settings |
stat | problem statistics data |
lp | current LP data |
row | row to remove |
Definition at line 785 of file cutpool.c.
References cutpoolDelCut(), SCIP_Cutpool::hashtable, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIPerrorMessage, SCIPhashtableRetrieve(), and SCIProwGetName().
Referenced by SCIPdelDelayedPoolCut(), SCIPdelPoolCut(), and SCIPdelRowCutpool().
SCIP_RETCODE SCIPcutpoolSeparate | ( | SCIP_CUTPOOL * | cutpool, |
BMS_BLKMEM * | blkmem, | ||
SCIP_SET * | set, | ||
SCIP_STAT * | stat, | ||
SCIP_EVENTQUEUE * | eventqueue, | ||
SCIP_EVENTFILTER * | eventfilter, | ||
SCIP_LP * | lp, | ||
SCIP_SEPASTORE * | sepastore, | ||
SCIP_SOL * | sol, | ||
SCIP_Bool | cutpoolisdelayed, | ||
SCIP_Bool | root, | ||
SCIP_RESULT * | result | ||
) |
separates cuts of the cut pool
cutpool | cut pool |
blkmem | block memory |
set | global SCIP settings |
stat | problem statistics data |
eventqueue | event queue |
eventfilter | event filter for global events |
lp | current LP data |
sepastore | separation storage |
sol | solution to be separated (or NULL for LP-solution) |
cutpoolisdelayed | is the cutpool delayed (count cuts found)? |
root | are we at the root node? |
result | pointer to store the result of the separation call |
Definition at line 814 of file cutpool.c.
References SCIP_Cut::age, SCIP_Stat::bestefficacy, cutIsAged(), cutpoolDelCut(), FALSE, SCIP_Cutpool::firstunprocessed, SCIP_Cutpool::firstunprocessedsol, SCIP_Stat::lpcount, MAX, SCIP_Stat::minefficacyfac, SCIP_Cutpool::ncalls, SCIP_Stat::ncutpoolfails, SCIP_Cutpool::ncuts, SCIP_Cutpool::nremovablecuts, SCIP_Cut::pos, SCIP_Cut::processedlp, SCIP_Cutpool::processedlp, SCIP_Cutpool::processedlpefficacy, SCIP_Cut::processedlpsol, SCIP_Cutpool::processedlpsol, SCIP_Cutpool::processedlpsolefficacy, SCIP_Cut::row, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_Longint, SCIP_OKAY, SCIP_Real, SCIP_SEPARATED, SCIPclockStart(), SCIPclockStop(), SCIPconshdlrIncNCutsFound(), SCIProwGetLPEfficacy(), SCIProwGetLPFeasibility(), SCIProwGetName(), SCIProwGetNNonz(), SCIProwGetOriginCons(), SCIProwGetOriginSepa(), SCIProwGetSolEfficacy(), SCIProwGetSolFeasibility(), SCIProwIsInLP(), SCIProwIsModifiable(), SCIPsepaIncNCutsFound(), SCIPsepaIncNCutsFoundAtNode(), SCIPsepastoreAddCut(), SCIPsepastoreGetNCuts(), SCIPsetDebugMsg, SCIPsetGetSepaMaxcuts(), SCIPsetIsFeasPositive(), and TRUE.
Referenced by cutpoolSeparate(), SCIPseparateCutpool(), and SCIPseparateSolCutpool().