SCIP Doxygen Documentation
Loading...
Searching...
No Matches

Detailed Description

methods for storing priced variables

Author
Tobias Achterberg

Definition in file pricestore.c.

#include "scip/clock.h"
#include "scip/lp.h"
#include "scip/pricestore.h"
#include "scip/pub_lp.h"
#include "scip/pub_message.h"
#include "scip/pub_var.h"
#include "scip/set.h"
#include "scip/struct_lp.h"
#include "scip/struct_pricestore.h"
#include "scip/struct_prob.h"
#include "scip/struct_set.h"
#include "scip/struct_var.h"
#include "scip/tree.h"
#include "scip/var.h"

Go to the source code of this file.

Functions

static SCIP_RETCODE pricestoreEnsureVarsMem (SCIP_PRICESTORE *pricestore, SCIP_SET *set, int num)
static SCIP_RETCODE pricestoreEnsureBdviolvarsMem (SCIP_PRICESTORE *pricestore, SCIP_SET *set, int num)
SCIP_RETCODE SCIPpricestoreCreate (SCIP_PRICESTORE **pricestore)
SCIP_RETCODE SCIPpricestoreFree (SCIP_PRICESTORE **pricestore)
void SCIPpricestoreStartInitialLP (SCIP_PRICESTORE *pricestore)
void SCIPpricestoreEndInitialLP (SCIP_PRICESTORE *pricestore)
SCIP_RETCODE SCIPpricestoreAddVar (SCIP_PRICESTORE *pricestore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp, SCIP_VAR *var, SCIP_Real score, SCIP_Bool root)
SCIP_RETCODE SCIPpricestoreAddBdviolvar (SCIP_PRICESTORE *pricestore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_VAR *var)
static SCIP_RETCODE addBoundViolated (SCIP_PRICESTORE *pricestore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_VAR *var, SCIP_Bool *added)
SCIP_RETCODE SCIPpricestoreAddProbVars (SCIP_PRICESTORE *pricestore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue)
SCIP_RETCODE SCIPpricestoreApplyVars (SCIP_PRICESTORE *pricestore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_LP *lp)
SCIP_RETCODE SCIPpricestoreResetBounds (SCIP_PRICESTORE *pricestore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue)
int SCIPpricestoreGetNVars (SCIP_PRICESTORE *pricestore)
int SCIPpricestoreGetNBoundResets (SCIP_PRICESTORE *pricestore)
SCIP_Real SCIPpricestoreGetProbPricingTime (SCIP_PRICESTORE *pricestore)
int SCIPpricestoreGetNProbPricings (SCIP_PRICESTORE *pricestore)
int SCIPpricestoreGetNProbvarsFound (SCIP_PRICESTORE *pricestore)
int SCIPpricestoreGetNVarsFound (SCIP_PRICESTORE *pricestore)
int SCIPpricestoreGetNVarsApplied (SCIP_PRICESTORE *pricestore)

Function Documentation

◆ pricestoreEnsureVarsMem()

SCIP_RETCODE pricestoreEnsureVarsMem ( SCIP_PRICESTORE * pricestore,
SCIP_SET * set,
int num )
static

resizes vars and score arrays to be able to store at least num entries

Parameters
pricestorepricing storage
setglobal SCIP settings
numminimal number of slots in array

Definition at line 56 of file pricestore.c.

References assert(), BMSreallocMemoryArray, NULL, SCIP_ALLOC, SCIP_OKAY, SCIPsetCalcMemGrowSize(), SCIP_Pricestore::scores, SCIP_Pricestore::vars, and SCIP_Pricestore::varssize.

Referenced by SCIPpricestoreAddVar().

◆ pricestoreEnsureBdviolvarsMem()

SCIP_RETCODE pricestoreEnsureBdviolvarsMem ( SCIP_PRICESTORE * pricestore,
SCIP_SET * set,
int num )
static

resizes bdviolvars arrays to be able to store at least num entries

Parameters
pricestorepricing storage
setglobal SCIP settings
numminimal number of slots in array

Definition at line 81 of file pricestore.c.

References assert(), SCIP_Pricestore::bdviolvars, SCIP_Pricestore::bdviolvarslb, SCIP_Pricestore::bdviolvarssize, SCIP_Pricestore::bdviolvarsub, BMSreallocMemoryArray, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPsetCalcMemGrowSize().

Referenced by SCIPpricestoreAddBdviolvar().

◆ SCIPpricestoreCreate()

SCIP_RETCODE SCIPpricestoreCreate ( SCIP_PRICESTORE ** pricestore)

creates pricing storage

Parameters
pricestorepointer to store pricing storage

Definition at line 107 of file pricestore.c.

References assert(), BMSallocMemory, FALSE, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_CLOCKTYPE_DEFAULT, SCIP_OKAY, and SCIPclockCreate().

Referenced by initSolve().

◆ SCIPpricestoreFree()

SCIP_RETCODE SCIPpricestoreFree ( SCIP_PRICESTORE ** pricestore)

frees pricing storage

Parameters
pricestorepointer to store pricing storage

Definition at line 136 of file pricestore.c.

References assert(), BMSfreeMemory, BMSfreeMemoryArrayNull, NULL, SCIP_OKAY, and SCIPclockFree().

Referenced by freeReoptSolve(), and freeSolve().

◆ SCIPpricestoreStartInitialLP()

void SCIPpricestoreStartInitialLP ( SCIP_PRICESTORE * pricestore)

informs pricing storage, that the setup of the initial LP starts now

Parameters
pricestorepricing storage

Definition at line 157 of file pricestore.c.

References assert(), SCIP_Pricestore::initiallp, NULL, SCIP_Pricestore::nvars, and TRUE.

Referenced by initLP().

◆ SCIPpricestoreEndInitialLP()

void SCIPpricestoreEndInitialLP ( SCIP_PRICESTORE * pricestore)

informs pricing storage, that the setup of the initial LP is now finished

Parameters
pricestorepricing storage

Definition at line 169 of file pricestore.c.

References assert(), FALSE, SCIP_Pricestore::initiallp, NULL, and SCIP_Pricestore::nvars.

Referenced by initLP().

◆ SCIPpricestoreAddVar()

SCIP_RETCODE SCIPpricestoreAddVar ( SCIP_PRICESTORE * pricestore,
BMS_BLKMEM * blkmem,
SCIP_SET * set,
SCIP_EVENTQUEUE * eventqueue,
SCIP_LP * lp,
SCIP_VAR * var,
SCIP_Real score,
SCIP_Bool root )

adds variable to pricing storage and capture it

Parameters
pricestorepricing storage
blkmemblock memory
setglobal SCIP settings
eventqueueevent queue
lpLP data
varpriced variable
scorepricing score of variable (the larger, the better the variable)
rootare we at the root node?

Definition at line 181 of file pricestore.c.

References assert(), SCIP_Pricestore::initiallp, NULL, SCIP_Pricestore::nvars, SCIP_Pricestore::nvarsfound, pricestoreEnsureVarsMem(), SCIP_Bool, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, SCIPerrorMessage, SCIPsetDebugMsg, SCIPsetGetPriceMaxvars(), SCIPvarCapture(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), SCIPvarRelease(), SCIP_Pricestore::scores, var, SCIP_Pricestore::vars, and SCIP_Pricestore::varssize.

Referenced by addBoundViolated(), initLP(), SCIPaddPricedVar(), and SCIPpricestoreAddProbVars().

◆ SCIPpricestoreAddBdviolvar()

SCIP_RETCODE SCIPpricestoreAddBdviolvar ( SCIP_PRICESTORE * pricestore,
BMS_BLKMEM * blkmem,
SCIP_SET * set,
SCIP_STAT * stat,
SCIP_LP * lp,
SCIP_BRANCHCAND * branchcand,
SCIP_EVENTQUEUE * eventqueue,
SCIP_VAR * var )

adds variable where zero violates the bounds to pricing storage, capture it

Parameters
pricestorepricing storage
blkmemblock memory
setglobal SCIP settings
statproblem statistics
lpLP data
branchcandbranching candidate storage
eventqueueevent queue
varvariable, where zero violates the bounds

Definition at line 254 of file pricestore.c.

References assert(), SCIP_Pricestore::bdviolvars, SCIP_Pricestore::bdviolvarslb, SCIP_Pricestore::bdviolvarssize, SCIP_Pricestore::bdviolvarsub, SCIP_Pricestore::initiallp, SCIP_Pricestore::naddedbdviolvars, SCIP_Pricestore::nbdviolvars, NULL, SCIP_Pricestore::nvarsfound, pricestoreEnsureBdviolvarsMem(), SCIP_CALL, SCIP_OKAY, SCIPsetDebugMsg, SCIPsetIsNegative(), SCIPsetIsPositive(), SCIPvarCapture(), SCIPvarChgLbLocal(), SCIPvarChgUbLocal(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), and var.

Referenced by addBoundViolated().

◆ addBoundViolated()

SCIP_RETCODE addBoundViolated ( SCIP_PRICESTORE * pricestore,
BMS_BLKMEM * blkmem,
SCIP_SET * set,
SCIP_STAT * stat,
SCIP_TREE * tree,
SCIP_LP * lp,
SCIP_BRANCHCAND * branchcand,
SCIP_EVENTQUEUE * eventqueue,
SCIP_VAR * var,
SCIP_Bool * added )
static

adds given problem variable to pricing storage, if zero is not best bound w.r.t. objective function

Parameters
pricestorepricing storage
blkmemblock memory buffers
setglobal SCIP settings
statdynamic problem statistics
treebranch and bound tree
lpLP data
branchcandbranching candidate storage
eventqueueevent queue
varproblem variable
addedpointer to store whether variable was added to pricing storage

Definition at line 309 of file pricestore.c.

References assert(), FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPpricestoreAddBdviolvar(), SCIPpricestoreAddVar(), SCIPsetDebugMsg, SCIPsetIsNegative(), SCIPsetIsPositive(), SCIPsetIsZero(), SCIPtreeGetCurrentDepth(), SCIPvarGetBestBoundLocal(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetObj(), SCIPvarGetUbLocal(), TRUE, and var.

Referenced by SCIPpricestoreAddProbVars().

◆ SCIPpricestoreAddProbVars()

SCIP_RETCODE SCIPpricestoreAddProbVars ( SCIP_PRICESTORE * pricestore,
BMS_BLKMEM * blkmem,
SCIP_SET * set,
SCIP_STAT * stat,
SCIP_PROB * prob,
SCIP_TREE * tree,
SCIP_LP * lp,
SCIP_BRANCHCAND * branchcand,
SCIP_EVENTQUEUE * eventqueue )

◆ SCIPpricestoreApplyVars()

SCIP_RETCODE SCIPpricestoreApplyVars ( SCIP_PRICESTORE * pricestore,
BMS_BLKMEM * blkmem,
SCIP_SET * set,
SCIP_STAT * stat,
SCIP_EVENTQUEUE * eventqueue,
SCIP_PROB * prob,
SCIP_TREE * tree,
SCIP_LP * lp )

◆ SCIPpricestoreResetBounds()

SCIP_RETCODE SCIPpricestoreResetBounds ( SCIP_PRICESTORE * pricestore,
BMS_BLKMEM * blkmem,
SCIP_SET * set,
SCIP_STAT * stat,
SCIP_LP * lp,
SCIP_BRANCHCAND * branchcand,
SCIP_EVENTQUEUE * eventqueue )

reset variables' bounds violated by zero to its original value

Parameters
pricestorepricing storage
blkmemblock memory
setglobal SCIP settings
statproblem statistics
lpLP data
branchcandbranching candidate storage
eventqueueevent queue

Definition at line 569 of file pricestore.c.

References assert(), SCIP_Pricestore::bdviolvars, SCIP_Pricestore::bdviolvarslb, SCIP_Pricestore::bdviolvarsub, SCIP_Pricestore::naddedbdviolvars, SCIP_Pricestore::nbdviolvars, NULL, SCIP_Pricestore::nvars, SCIP_CALL, SCIP_OKAY, SCIPsetDebugMsg, SCIPvarChgLbLocal(), SCIPvarChgUbLocal(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), SCIPvarRelease(), and var.

Referenced by SCIPpriceLoop().

◆ SCIPpricestoreGetNVars()

int SCIPpricestoreGetNVars ( SCIP_PRICESTORE * pricestore)

gets number of variables in pricing storage

Parameters
pricestorepricing storage

Definition at line 609 of file pricestore.c.

References assert(), SCIP_Pricestore::naddedbdviolvars, SCIP_Pricestore::nbdviolvars, NULL, and SCIP_Pricestore::nvars.

Referenced by SCIPgetNPricevars(), SCIPpriceLoop(), SCIPpricerExec(), and SCIPpricestoreApplyVars().

◆ SCIPpricestoreGetNBoundResets()

int SCIPpricestoreGetNBoundResets ( SCIP_PRICESTORE * pricestore)

gets number of variables in pricing storage whose bounds must be reset

Parameters
pricestorepricing storage

Definition at line 620 of file pricestore.c.

References assert(), SCIP_Pricestore::naddedbdviolvars, SCIP_Pricestore::nbdviolvars, and NULL.

Referenced by SCIPpriceLoop().

◆ SCIPpricestoreGetProbPricingTime()

SCIP_Real SCIPpricestoreGetProbPricingTime ( SCIP_PRICESTORE * pricestore)

gets time needed to price existing problem variables

Parameters
pricestorepricing storage

Definition at line 631 of file pricestore.c.

References assert(), NULL, SCIP_Pricestore::probpricingtime, SCIP_Real, and SCIPclockGetTime().

Referenced by SCIPprintPricerStatistics().

◆ SCIPpricestoreGetNProbPricings()

int SCIPpricestoreGetNProbPricings ( SCIP_PRICESTORE * pricestore)

gets total number of calls to problem variable pricing

Parameters
pricestorepricing storage

Definition at line 641 of file pricestore.c.

References assert(), SCIP_Pricestore::nprobpricings, and NULL.

Referenced by SCIPprintPricerStatistics().

◆ SCIPpricestoreGetNProbvarsFound()

int SCIPpricestoreGetNProbvarsFound ( SCIP_PRICESTORE * pricestore)

gets total number of times, a problem variable was priced in

Parameters
pricestorepricing storage

Definition at line 651 of file pricestore.c.

References assert(), SCIP_Pricestore::nprobvarsfound, and NULL.

Referenced by SCIPprintPricerStatistics().

◆ SCIPpricestoreGetNVarsFound()

int SCIPpricestoreGetNVarsFound ( SCIP_PRICESTORE * pricestore)

get total number of variables found so far in pricing

Parameters
pricestorepricing storage

Definition at line 661 of file pricestore.c.

References assert(), NULL, and SCIP_Pricestore::nvarsfound.

Referenced by SCIPgetNPricevarsFound().

◆ SCIPpricestoreGetNVarsApplied()

int SCIPpricestoreGetNVarsApplied ( SCIP_PRICESTORE * pricestore)

get total number of variables priced into the LP so far

Parameters
pricestorepricing storage

Definition at line 671 of file pricestore.c.

References assert(), NULL, and SCIP_Pricestore::nvarsapplied.

Referenced by SCIPgetNPricevarsApplied().