Detailed Description
event handler which manages the active master separator cuts
Definition in file event_mastersepacut.c.
#include "scip/struct_scip.h"#include "scip/type_rational.h"#include "scip/struct_tree.h"#include "gcg/event_mastersepacut.h"#include "gcg/gcg.h"#include "gcg/cons_masterbranch.h"#include "gcg/mastersepacut.h"#include "gcg/pricer_gcg.h"#include "gcg/struct_gcg.h"Go to the source code of this file.
Data Structures | |
| struct | SCIP_EventhdlrData |
Macros | |
| #define | EVENTHDLR_NAME "mastersepacut" |
| #define | EVENTHDLR_DESC "event handler for keeping master cuts generated by a separators up-to-date" |
| #define | STARTMAXCUTS 50 |
Macro Definition Documentation
◆ EVENTHDLR_NAME
| #define EVENTHDLR_NAME "mastersepacut" |
Definition at line 49 of file event_mastersepacut.c.
◆ EVENTHDLR_DESC
| #define EVENTHDLR_DESC "event handler for keeping master cuts generated by a separators up-to-date" |
Definition at line 50 of file event_mastersepacut.c.
◆ STARTMAXCUTS
| #define STARTMAXCUTS 50 |
Definition at line 51 of file event_mastersepacut.c.
Function Documentation
◆ ensureGeneratedSize()
|
static |
ensures that generated cuts has enough allocated memory to store specified number of elements
- Parameters
-
masterscip SCIP data structure (master problem) eventhdlrdata event handler data size number of elements generated cuts should be able to hold
Definition at line 78 of file event_mastersepacut.c.
References SCIP_EventhdlrData::generatedcuts, SCIP_EventhdlrData::generatedcutssize, SCIP_EventhdlrData::ngeneratedcuts, NULL, SCIP_CALL, SCIP_OKAY, SCIPcalcMemGrowSize(), and SCIPreallocBlockMemoryArray.
Referenced by GCGaddGeneratedMastersepacut(), and reinsertGlobalMastersepacut().
◆ ensureActiveSize()
|
static |
ensures that active cuts has enough allocated memory to store specified number of elements
- Parameters
-
masterscip SCIP data structure eventhdlrdata event handler data data structure size number of elements active cuts should be able to hold
Definition at line 106 of file event_mastersepacut.c.
References SCIP_EventhdlrData::activecuts, SCIP_EventhdlrData::activecutssize, SCIP_EventhdlrData::nactivecuts, NULL, SCIP_CALL, SCIP_OKAY, SCIPcalcMemGrowSize(), and SCIPreallocBlockMemoryArray.
Referenced by addToActiveMastersepacuts(), and eventRowAddedToLP().
◆ addToActiveMastersepacuts()
|
static |
- Parameters
-
gcg GCG data structure mastersepacut global master separator cut eventhdlrdata event handler data
Definition at line 132 of file event_mastersepacut.c.
References SCIP_EventhdlrData::activecuts, ensureActiveSize(), GCG_EXTENDEDMASTERCONSTYPE_SEPA_ROW, GCGcaptureMastersepacut(), GCGextendedmasterconsGetRow(), GCGextendedmasterconsGetType(), GCGgetMasterprob(), SCIP_EventhdlrData::nactivecuts, NULL, SCIP_CALL, and SCIP_OKAY.
Referenced by eventRowAddedToLP(), and GCGeventmastersepacutAddActiveMastersepacut().
◆ reinsertGlobalMastersepacut()
|
static |
re-inserts the mastersepacut of a global row (in case it was re-added to the separation storage) to generated cuts transfers mastersepacut from generatedcuts to activecuts when the corresponding row is added to the LP
- Parameters
-
gcg GCG data structure mastersepacut global master separator cut eventhdlrdata event handler data
Definition at line 149 of file event_mastersepacut.c.
References ensureGeneratedSize(), GCGcaptureMastersepacut(), GCGextendedmasterconsGetRow(), GCGgetMasterprob(), SCIP_EventhdlrData::generatedcuts, SCIP_EventhdlrData::ngeneratedcuts, NULL, SCIP_EventhdlrData::rowxgeneratedmap, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPhashmapSetImageInt(), SCIProwGetName(), and SCIProwIsLocal().
Referenced by GCGeventmastersepacutShrinkActiveMastersepacuts().
◆ eventRowAddedToLP()
|
static |
- Parameters
-
gcg GCG data structure eventhdlrdata mastersepacut eventhandler event row added to LP event
Definition at line 176 of file event_mastersepacut.c.
References addToActiveMastersepacuts(), ensureActiveSize(), GCGextendedmasterconsGetMastersepacut(), GCGextendedmasterconsGetRow(), GCGgetMasterprob(), GCGmastersepacutGetVarHistory(), GCGmastersepacutSetVarHistory(), SCIP_EventhdlrData::generatedcuts, SCIP_EventhdlrData::nactivecuts, NULL, SCIP_EventhdlrData::rowxgeneratedmap, SCIP_CALL, SCIP_EVENTTYPE_ROWADDEDLP, SCIP_OKAY, SCIPdebugMessage, SCIPeventGetRow(), SCIPeventGetType(), SCIPhashmapGetImageInt(), SCIPisLPConstructed(), SCIProwGetName(), SCIProwGetOriginSepa(), and SCIPsepaGetName().
Referenced by SCIP_DECL_EVENTEXEC().
◆ eventRowDeletedFromLP()
|
static |
removes a mastersepacut from active cuts when its row is removed from the LP
In contrast to GCGeventmastersepacutShrinkActiveMastersepacuts() this may remove a cut from the middle of the active cuts (a removable row aged out of the LP within a node), so the order of the remaining cuts is preserved (shift) and the masterbranch nodes are notified to keep their firstnewcut bookkeeping consistent.
- Parameters
-
gcg GCG data structure eventhdlrdata mastersepacut eventhandler data event row deleted from LP event
Definition at line 241 of file event_mastersepacut.c.
References SCIP_EventhdlrData::activecuts, GCGconsMasterbranchActiveCutRemoved(), GCGextendedmasterconsGetRow(), GCGgetMasterprob(), GCGreleaseMastersepacut(), SCIP_EventhdlrData::nactivecuts, NULL, SCIP_CALL, SCIP_EVENTTYPE_ROWDELETEDLP, SCIP_OKAY, SCIP_STAGE_SOLVING, SCIPdebugMessage, SCIPeventGetRow(), SCIPeventGetType(), SCIPgetStage(), SCIPisLPConstructed(), SCIProwGetName(), and SCIProwGetOriginSepa().
Referenced by SCIP_DECL_EVENTEXEC().
◆ SCIP_DECL_EVENTFREE()
|
static |
destructor of event handler to free user data (called when SCIP is exiting)
Definition at line 307 of file event_mastersepacut.c.
References EVENTHDLR_NAME, NULL, SCIP_EventhdlrData::rowxgeneratedmap, SCIP_OKAY, SCIPdebugMessage, SCIPeventhdlrGetData(), SCIPeventhdlrGetName(), SCIPfreeBlockMemory, and SCIPhashmapFree().
◆ SCIP_DECL_EVENTEXIT()
|
static |
Definition at line 328 of file event_mastersepacut.c.
References SCIP_EventhdlrData::activecuts, SCIP_EventhdlrData::activecutssize, EVENTHDLR_NAME, SCIP_EventhdlrData::generatedcuts, SCIP_EventhdlrData::generatedcutssize, SCIP_EventhdlrData::nactivecuts, SCIP_EventhdlrData::ngeneratedcuts, NULL, SCIP_CALL, SCIP_EVENTTYPE_ROWADDEDLP, SCIP_EVENTTYPE_ROWDELETEDLP, SCIP_OKAY, SCIPdebugMessage, SCIPdropEvent(), SCIPeventhdlrGetData(), SCIPeventhdlrGetName(), and SCIPfreeBlockMemoryArrayNull.
◆ SCIP_DECL_EVENTINIT()
|
static |
initialization method of event handler (called after problem was transformed)
Definition at line 358 of file event_mastersepacut.c.
References SCIP_EventhdlrData::activecuts, SCIP_EventhdlrData::activecutssize, FALSE, GCGisMaster(), SCIP_EventhdlrData::generatedcuts, SCIP_EventhdlrData::generatedcutssize, SCIP_EventhdlrData::globalcutsreinserted, SCIP_EventhdlrData::nactivecuts, SCIP_EventhdlrData::ngeneratedcuts, NULL, SCIP_CALL, SCIP_EVENTTYPE_ROWADDEDLP, SCIP_EVENTTYPE_ROWDELETEDLP, SCIP_OKAY, SCIPallocBlockMemoryArray, SCIPcalcMemGrowSize(), SCIPcatchEvent(), SCIPdebugMessage, SCIPeventhdlrGetData(), and STARTMAXCUTS.
◆ SCIP_DECL_EVENTEXITSOL()
|
static |
deinitialization method of event handler (called before transformed problem is freed)
- clean up branch-and-bound specific data
Definition at line 390 of file event_mastersepacut.c.
References SCIP_EventhdlrData::activecuts, EVENTHDLR_NAME, SCIP_EventhdlrData::gcg, GCGisMaster(), GCGreleaseMastersepacut(), SCIP_EventhdlrData::generatedcuts, SCIP_EventhdlrData::nactivecuts, SCIP_EventhdlrData::ngeneratedcuts, NULL, SCIP_EventhdlrData::rowxgeneratedmap, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPeventhdlrGetData(), SCIPeventhdlrGetName(), and SCIPhashmapRemoveAll().
◆ SCIP_DECL_EVENTEXEC()
|
static |
main execution method of event handler
Definition at line 433 of file event_mastersepacut.c.
References EVENTHDLR_NAME, eventRowAddedToLP(), eventRowDeletedFromLP(), SCIP_EventhdlrData::gcg, GCGisMaster(), NULL, SCIP_CALL, SCIP_ERROR, SCIP_EVENTTYPE_ROWADDEDLP, SCIP_EVENTTYPE_ROWDELETEDLP, SCIP_OKAY, SCIPerrorMessage, SCIPeventGetType(), SCIPeventhdlrGetData(), and SCIPeventhdlrGetName().
◆ GCGincludeEventHdlrSepaCuts()
| SCIP_RETCODE GCGincludeEventHdlrSepaCuts | ( | GCG * | gcg | ) |
creates event handler for managing the additional data of the mastercuts generated by master separators
- Parameters
-
gcg GCG data structure
Definition at line 464 of file event_mastersepacut.c.
References EVENTHDLR_DESC, EVENTHDLR_NAME, SCIP_EventhdlrData::gcg, GCGgetMasterprob(), NULL, SCIP_EventhdlrData::rowxgeneratedmap, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, SCIPblkmem(), SCIPdebugMessage, SCIPhashmapCreate(), SCIPincludeEventhdlrBasic(), SCIPsetEventhdlrExit(), SCIPsetEventhdlrExitsol(), SCIPsetEventhdlrFree(), SCIPsetEventhdlrInit(), and STARTMAXCUTS.
Referenced by GCGincludeMasterPlugins().
◆ GCGaddGeneratedMastersepacut()
| SCIP_RETCODE GCGaddGeneratedMastersepacut | ( | GCG * | gcg, |
| GCG_EXTENDEDMASTERCONSDATA * | mastersepacut | ||
| ) |
adds new mastersepacut to generated cuts
- Parameters
-
gcg GCG data structure mastersepacut mastersepacut
Definition at line 498 of file event_mastersepacut.c.
References ensureGeneratedSize(), GCGcaptureMastersepacut(), GCGextendedmasterconsGetRow(), GCGgetMasterprob(), GCGgetMastersepacutEventhdlr(), SCIP_EventhdlrData::generatedcuts, SCIP_EventhdlrData::ngeneratedcuts, NULL, SCIP_EventhdlrData::rowxgeneratedmap, SCIP_CALL, SCIP_OKAY, SCIPeventhdlrGetData(), and SCIPhashmapSetImageInt().
Referenced by SCIP_DECL_SEPAEXECLP().
◆ GCGclearGeneratedMastersepacuts()
| SCIP_RETCODE GCGclearGeneratedMastersepacuts | ( | GCG * | gcg | ) |
remove all mastersepacuts from generated cuts and release them
- Parameters
-
gcg GCG data structure
Definition at line 531 of file event_mastersepacut.c.
References FALSE, GCGgetMastersepacutEventhdlr(), GCGreleaseMastersepacut(), SCIP_EventhdlrData::generatedcuts, SCIP_EventhdlrData::globalcutsreinserted, SCIP_EventhdlrData::ngeneratedcuts, NULL, SCIP_EventhdlrData::rowxgeneratedmap, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPeventhdlrGetData(), and SCIPhashmapRemoveAll().
Referenced by SCIP_DECL_CONSACTIVE().
◆ GCGeventmastersepacutRemoveNewInactiveMastersepacuts()
| SCIP_RETCODE GCGeventmastersepacutRemoveNewInactiveMastersepacuts | ( | GCG * | gcg, |
| SCIP_EVENTHDLR * | eventhdlr, | ||
| int | startidx | ||
| ) |
removes the mastersepacuts which were applied at current node, but have already been removed from the LP
- Parameters
-
gcg GCG data structure eventhdlr mastersepacut event handler startidx indicate the first new mastersepacut
Definition at line 568 of file event_mastersepacut.c.
References SCIP_EventhdlrData::activecuts, GCGextendedmasterconsGetRow(), GCGreleaseMastersepacut(), SCIP_EventhdlrData::nactivecuts, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPeventhdlrGetData(), SCIProwGetName(), and SCIProwIsInLP().
Referenced by GCGremoveNewInactiveMastersepacuts().
◆ GCGremoveNewInactiveMastersepacuts()
| SCIP_RETCODE GCGremoveNewInactiveMastersepacuts | ( | GCG * | gcg, |
| int | startidx | ||
| ) |
removes the mastersepacuts which were applied at current node, but have already been removed from the LP
- Parameters
-
gcg GCG data structure startidx index of the first new separaot mastercut
Definition at line 608 of file event_mastersepacut.c.
References GCGeventmastersepacutRemoveNewInactiveMastersepacuts(), GCGgetMastersepacutEventhdlr(), NULL, SCIP_CALL, and SCIP_OKAY.
Referenced by initializeAddedCuts().
◆ GCGeventmastersepacutShrinkActiveMastersepacuts()
| SCIP_RETCODE GCGeventmastersepacutShrinkActiveMastersepacuts | ( | GCG * | gcg, |
| SCIP_EVENTHDLR * | eventhdlr, | ||
| int | newnrows | ||
| ) |
removes all mastersepacuts after given index from active cuts
- Parameters
-
gcg GCG data structure eventhdlr mastersepacuts event handler newnrows index to which active cuts should be shrunk to
Definition at line 625 of file event_mastersepacut.c.
References SCIP_EventhdlrData::activecuts, SCIP_Tree::correctlpdepth, GCGextendedmasterconsGetRow(), GCGgetMasterprob(), GCGreleaseMastersepacut(), SCIP_EventhdlrData::globalcutsreinserted, SCIP_EventhdlrData::nactivecuts, NULL, reinsertGlobalMastersepacut(), SCIP_CALL, SCIP_OKAY, SCIP_STAGE_EXITSOLVE, SCIPeventhdlrGetData(), SCIPgetStage(), SCIProwGetAge(), SCIProwIsLocal(), Scip::tree, and TRUE.
Referenced by GCGshrinkActiveMastersepacuts().
◆ GCGshrinkActiveMastersepacuts()
| SCIP_RETCODE GCGshrinkActiveMastersepacuts | ( | GCG * | gcg, |
| int | newnrows | ||
| ) |
removes all mastersepacuts after given index from active cuts
- Parameters
-
gcg GCG data structure newnrows index to which active cuts should be shrunk to
Definition at line 680 of file event_mastersepacut.c.
References GCGeventmastersepacutShrinkActiveMastersepacuts(), GCGgetMastersepacutEventhdlr(), NULL, SCIP_CALL, and SCIP_OKAY.
Referenced by removeStoredCutsFromActiveCuts().
◆ GCGeventmastersepacutGetActiveMastersepacuts()
| GCG_EXTENDEDMASTERCONSDATA ** GCGeventmastersepacutGetActiveMastersepacuts | ( | GCG * | gcg, |
| SCIP_EVENTHDLR * | eventhdlr | ||
| ) |
returns active master separator cuts
- Parameters
-
gcg GCG data structure eventhdlr mastersepacut event handler
Definition at line 696 of file event_mastersepacut.c.
References SCIP_EventhdlrData::activecuts, NULL, and SCIPeventhdlrGetData().
Referenced by GCGgetActiveMastersepacuts().
◆ GCGgetActiveMastersepacuts()
| GCG_EXTENDEDMASTERCONSDATA ** GCGgetActiveMastersepacuts | ( | GCG * | gcg | ) |
returns active master separator cuts
- Parameters
-
gcg GCG data structure
Definition at line 712 of file event_mastersepacut.c.
References GCGeventmastersepacutGetActiveMastersepacuts(), GCGgetMastersepacutEventhdlr(), and NULL.
Referenced by ObjPricerGcg::addVariableToMastersepacuts(), ObjPricerGcg::addVariableToMastersepacutsFromGCGCol(), ObjPricerGcg::computeColMastersepacutCoeffs(), GCGcolComputeDualObjPara(), GCGcreateGcgCol(), ObjPricerGcg::getStabilizedDualObjectiveValue(), initializeAddedCuts(), ObjPricerGcg::pricingLoop(), and ObjPricerGcg::setPricingObjs().
◆ GCGeventmastersepacutGetNActiveMastersepacuts()
| int GCGeventmastersepacutGetNActiveMastersepacuts | ( | GCG * | gcg, |
| SCIP_EVENTHDLR * | eventhdlr | ||
| ) |
return number of active master separator cuts
- Parameters
-
gcg GCG data structure eventhdlr masterepacut event handler
Definition at line 725 of file event_mastersepacut.c.
References SCIP_EventhdlrData::nactivecuts, NULL, and SCIPeventhdlrGetData().
Referenced by GCGgetNActiveMastersepacuts().
◆ GCGgetNActiveMastersepacuts()
| int GCGgetNActiveMastersepacuts | ( | GCG * | gcg | ) |
return number of active mastersepacuts
- Parameters
-
gcg GCG data structure
Definition at line 741 of file event_mastersepacut.c.
References GCGeventmastersepacutGetNActiveMastersepacuts(), GCGgetMastersepacutEventhdlr(), and NULL.
Referenced by addStoredCutsToActiveCuts(), ObjPricerGcg::addVariableToMastersepacuts(), ObjPricerGcg::addVariableToMastersepacutsFromGCGCol(), ObjPricerGcg::computeColMastersepacutCoeffs(), GCGcreateGcgCol(), GCGpricestoreAddCol(), ObjPricerGcg::getStabilizedDualObjectiveValue(), initializeAddedCuts(), initializeConsdata(), ObjPricerGcg::pricingLoop(), and ObjPricerGcg::setPricingObjs().
◆ GCGeventmastersepacutAddActiveMastersepacut()
| SCIP_RETCODE GCGeventmastersepacutAddActiveMastersepacut | ( | GCG * | gcg, |
| SCIP_EVENTHDLR * | eventhdlr, | ||
| GCG_EXTENDEDMASTERCONSDATA * | mastersepacut | ||
| ) |
adds a mastercut generated by a master separator to active cuts
- Parameters
-
gcg GCG data structure eventhdlr mastersepacut event handler mastersepacut mastersepacut
Definition at line 755 of file event_mastersepacut.c.
References addToActiveMastersepacuts(), NULL, SCIP_OKAY, and SCIPeventhdlrGetData().
Referenced by GCGaddActiveMastersepacut().
◆ GCGaddActiveMastersepacut()
| SCIP_RETCODE GCGaddActiveMastersepacut | ( | GCG * | gcg, |
| GCG_EXTENDEDMASTERCONSDATA * | mastersepacut | ||
| ) |
adds a mastercut generated by a master separator to active cuts
- Parameters
-
gcg GCG data structure mastersepacut mastersepacut
Definition at line 774 of file event_mastersepacut.c.
References GCGeventmastersepacutAddActiveMastersepacut(), GCGgetMastersepacutEventhdlr(), NULL, SCIP_CALL, and SCIP_OKAY.
Referenced by addStoredCutsToActiveCuts().