Scippy

GCG

Branch-and-Price & Column Generation for Everyone

pub_mastersepacut.h File Reference

Go to the source code of this file.

Functions

GCG_EXPORT GCG_VARHISTORY * GCGmastersepacutGetVarHistory (GCG_MASTERSEPACUT *mastersepacut)
 
GCG_EXPORT GCG_SEPA * GCGmastersepacutGetSeparator (GCG_MASTERSEPACUT *mastersepacut)
 
GCG_EXPORT GCG_MASTERSEPACUTDATA * GCGmastersepacutGetData (GCG_MASTERSEPACUT *mastersepacut)
 
GCG_EXPORT SCIP_RETCODE GCGmastersepacutSetVarHistory (GCG *gcg, GCG_MASTERSEPACUT *mastersepacut)
 
GCG_EXPORT SCIP_RETCODE GCGcreateChvatalGomoryCut (GCG *gcg, GCG_MASTERSEPACUT **mastersepacut, GCG_SEPA *sepa, GCG_VARHISTORY *varhistory, SCIP_Real *weights, int *indices, int n)
 
GCG_EXPORT SCIP_RETCODE GCGfreeChvatalGomoryCutData (GCG *gcg, GCG_MASTERSEPACUTDATA **data)
 
GCG_EXPORT int GCGchvatalGomoryCutGetNWeights (GCG_MASTERSEPACUT *mastersepacut)
 
GCG_EXPORT SCIP_Real * GCGchvatalGomoryCutGetWeights (GCG_MASTERSEPACUT *mastersepacut)
 
GCG_EXPORT int * GCGchvatalGomoryCutGetConssIndices (GCG_MASTERSEPACUT *mastersepacut)
 
GCG_EXPORT SCIP_RETCODE GCGchvatalGomoryCutGetColumnCoefficient (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *mastercutdata, GCG_COL *gcgcol, SCIP_Real *coeff)
 
GCG_EXPORT SCIP_RETCODE GCGchvatalGomoryCutGetVariableCoefficient (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *mastercutdata, SCIP_VAR **vars, SCIP_Real *vals, int nvars, int probnr, SCIP_Real *coef)
 
GCG_EXPORT GCG_EXTENDEDMASTERCONSDATA ** GCGgetActiveMastersepacuts (GCG *gcg)
 
GCG_EXPORT int GCGgetNActiveMastersepacuts (GCG *gcg)
 
GCG_EXPORT GCG_MASTERSEPACUT * GCGextendedmasterconsGetMastersepacut (GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata)
 
GCG_EXPORT SCIP_RETCODE GCGcaptureMastersepacut (GCG_EXTENDEDMASTERCONSDATA *mastersepacut)
 
GCG_EXPORT SCIP_RETCODE GCGreleaseMastersepacut (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA **mastersepacut)
 
GCG_EXPORT SCIP_RETCODE GCGcreateMastersepacut (GCG *gcg, GCG_MASTERSEPACUT **mastersepacut, GCG_SEPA *sepa, GCG_VARHISTORY *varhistory, GCG_MASTERSEPACUTDATA *mastersepacutdata)
 
GCG_EXPORT SCIP_RETCODE GCGextendedmasterconsCreateForSepamastercut (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA **extendedmastercons, GCG_MASTERSEPACUT *cut, SCIP_ROW *row, GCG_PRICINGMODIFICATION **pricingmodifications, int npricingmodifications)
 
GCG_EXPORT SCIP_RETCODE GCGmastersepacutGetExtendedmasterconsCoeff (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *mastersepacut, SCIP_VAR **solvars, SCIP_Real *solvals, int nsolvars, int probnr, GCG_COL *gcgcol, SCIP_Real *coef)
 
GCG_EXPORT SCIP_RETCODE GCGremoveNewInactiveMastersepacuts (GCG *gcg, int startidx)
 
GCG_EXPORT SCIP_RETCODE GCGshrinkActiveMastersepacuts (GCG *gcg, int newnrows)
 
GCG_EXPORT SCIP_RETCODE GCGclearGeneratedMastersepacuts (GCG *gcg)
 
GCG_EXPORT SCIP_RETCODE GCGaddGeneratedMastersepacut (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *mastersepacut)
 
GCG_EXPORT SCIP_RETCODE GCGaddActiveMastersepacut (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *mastersepacut)
 

Function Documentation

◆ GCGmastersepacutGetVarHistory()

GCG_EXPORT GCG_VARHISTORY * GCGmastersepacutGetVarHistory ( GCG_MASTERSEPACUT *  mastersepacut)

returns the variable history of the separator master cut

return the separator which created the cut

Parameters
mastersepacutseparator master cut

Definition at line 151 of file mastersepacut.c.

References GCG_Mastersepacut::knownvarhistory, and NULL.

Referenced by addMissedVariables(), ObjPricerGcg::addVariableToMastersepacuts(), eventRowAddedToLP(), and ObjPricerGcg::pricingLoop().

◆ GCGmastersepacutGetSeparator()

GCG_EXPORT GCG_SEPA * GCGmastersepacutGetSeparator ( GCG_MASTERSEPACUT *  mastersepacut)

return the separator which created the cut

returns the data of the separator master cut

Parameters
mastersepacutseparator master cut

Definition at line 162 of file mastersepacut.c.

References NULL, and GCG_Mastersepacut::sepa.

Referenced by GCGmastersepacutGetExtendedmasterconsCoeff().

◆ GCGmastersepacutGetData()

GCG_EXPORT GCG_MASTERSEPACUTDATA * GCGmastersepacutGetData ( GCG_MASTERSEPACUT *  mastersepacut)

returns the data of the separator master cut

set the variable history of separator master cut

Parameters
mastersepacutseparator master cut

Definition at line 172 of file mastersepacut.c.

References GCG_Mastersepacut::data, and NULL.

Referenced by GCGchvatalGomoryCutGetConssIndices(), GCGchvatalGomoryCutGetNWeights(), and GCGchvatalGomoryCutGetWeights().

◆ GCGmastersepacutSetVarHistory()

GCG_EXPORT SCIP_RETCODE GCGmastersepacutSetVarHistory ( GCG *  gcg,
GCG_MASTERSEPACUT *  mastersepacut 
)

set the variable history of separator master cut

Parameters
gcgGCG data structure
mastersepacutpointer to separator master cut

Definition at line 182 of file mastersepacut.c.

References GCGgetCurrentVarhistoryReference(), GCGgetMasterprob(), GCGvarhistoryCopyReference(), GCG_Mastersepacut::knownvarhistory, NULL, SCIP_CALL, and SCIP_OKAY.

Referenced by eventRowAddedToLP().

◆ GCGcreateChvatalGomoryCut()

GCG_EXPORT SCIP_RETCODE GCGcreateChvatalGomoryCut ( GCG *  gcg,
GCG_MASTERSEPACUT **  mastersepacut,
GCG_SEPA *  sepa,
GCG_VARHISTORY *  varhistory,
SCIP_Real *  weights,
int *  indices,
int  n 
)

creates a Chvatal-Gomory cut

Parameters
gcgGCG data structure
mastersepacutpointer to store separator master cut
sepaseparator creating this cut
varhistoryvariables history of subset row cut
weightsweights which were used to create the cut
indicesindices of constraints used to create the cut
nnumber of constraints used to create the cut

Definition at line 53 of file gcgcgcut.c.

References GCG_MastersepacutData::conssindices, GCGcreateMastersepacut(), GCGgetMasterprob(), GCG_MastersepacutData::nconssindices, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, SCIPduplicateBlockMemoryArray, and GCG_MastersepacutData::weights.

Referenced by SCIP_DECL_SEPAEXECLP().

◆ GCGfreeChvatalGomoryCutData()

GCG_EXPORT SCIP_RETCODE GCGfreeChvatalGomoryCutData ( GCG *  gcg,
GCG_MASTERSEPACUTDATA **  data 
)

frees data of Chvatal-Gomory cut

frees data of Chvatal-Gomory cut returns the number of weights of Chvatal-Gomory cut

Parameters
gcgGCG data structure
datapointer to data of subset row cut

Definition at line 88 of file gcgcgcut.c.

References GCGgetMasterprob(), NULL, SCIP_OKAY, SCIPfreeBlockMemory, and SCIPfreeBlockMemoryArrayNull.

Referenced by GCG_DECL_SEPAMASTERCUTDELETE().

◆ GCGchvatalGomoryCutGetNWeights()

GCG_EXPORT int GCGchvatalGomoryCutGetNWeights ( GCG_MASTERSEPACUT *  mastersepacut)

returns the number of weights of Chvatal-Gomory cut

returns the weights of Chvatal-Gomory cut

Parameters
mastersepacutseparator master cut

Definition at line 116 of file gcgcgcut.c.

References GCGmastersepacutGetData(), GCG_MastersepacutData::nconssindices, and NULL.

Referenced by GCGchvatalGomoryCutGetColumnCoefficient().

◆ GCGchvatalGomoryCutGetWeights()

GCG_EXPORT SCIP_Real * GCGchvatalGomoryCutGetWeights ( GCG_MASTERSEPACUT *  mastersepacut)

returns the weights of Chvatal-Gomory cut

returns the constraint indices of Chvatal-Gomory cut

Parameters
mastersepacutseparator master cut

Definition at line 131 of file gcgcgcut.c.

References GCGmastersepacutGetData(), NULL, SCIP_Real, and GCG_MastersepacutData::weights.

Referenced by GCGchvatalGomoryCutGetColumnCoefficient().

◆ GCGchvatalGomoryCutGetConssIndices()

GCG_EXPORT int * GCGchvatalGomoryCutGetConssIndices ( GCG_MASTERSEPACUT *  mastersepacut)

returns the constraint indices of Chvatal-Gomory cut

Parameters
mastersepacutseparator master cut

Definition at line 146 of file gcgcgcut.c.

References GCG_MastersepacutData::conssindices, GCGmastersepacutGetData(), and NULL.

Referenced by GCGchvatalGomoryCutGetColumnCoefficient().

◆ GCGchvatalGomoryCutGetColumnCoefficient()

GCG_EXPORT SCIP_RETCODE GCGchvatalGomoryCutGetColumnCoefficient ( GCG *  gcg,
GCG_EXTENDEDMASTERCONSDATA *  mastercutdata,
GCG_COL *  gcgcol,
SCIP_Real *  coeff 
)

computes the coefficient of a column for a Chvatal-Gomory cut

Parameters
gcgGCG data structure
mastercutdatamaster separator cut
gcgcolgcg column
coeffpointer to store the coefficient

Definition at line 161 of file gcgcgcut.c.

References GCGchvatalGomoryCutGetConssIndices(), GCGchvatalGomoryCutGetNWeights(), GCGchvatalGomoryCutGetWeights(), GCGcolGetInitializedCoefs(), GCGcolGetMastercoefs(), GCGextendedmasterconsGetMastersepacut(), GCGgetMasterprob(), NULL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, and SCIPfeasFloor().

Referenced by GCG_DECL_SEPAGETCOLCOEFFICIENT().

◆ GCGchvatalGomoryCutGetVariableCoefficient()

GCG_EXPORT SCIP_RETCODE GCGchvatalGomoryCutGetVariableCoefficient ( GCG *  gcg,
GCG_EXTENDEDMASTERCONSDATA *  mastercutdata,
SCIP_VAR **  vars,
SCIP_Real *  vals,
int  nvars,
int  probnr,
SCIP_Real *  coef 
)

computes the coefficient of a master variable for a Chvatal-Gomory cut

Parameters
gcgGCG data structure
mastercutdatamaster separator cut
varspricing variables which define the master variable
valsvalues of the pricing variables which define the master variables
nvarsnumber of pricing variables which define the master variable
probnrindex of the pricing problem which generated the master variable
coefpointer to store the coefficient

Definition at line 204 of file gcgcgcut.c.

References GCGextendedmasterconsGetPricingModification(), GCGgetMasterprob(), GCGgetPricingprob(), GCGpricingmodificationGetAdditionalConss(), GCGvarIsInferredPricing(), NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPdebugMessage, SCIPfeasFloor(), SCIPfreeBufferArray, SCIPgetConsNVars(), SCIPgetConsVals(), SCIPgetConsVars(), SCIPsortedvecFindPtr(), and SCIPvarCompare().

Referenced by GCG_DECL_SEPAGETCOLCOEFFICIENT().

◆ GCGgetActiveMastersepacuts()

◆ GCGgetNActiveMastersepacuts()

◆ GCGextendedmasterconsGetMastersepacut()

◆ GCGcaptureMastersepacut()

◆ GCGreleaseMastersepacut()

GCG_EXPORT SCIP_RETCODE GCGreleaseMastersepacut ( GCG *  gcg,
GCG_EXTENDEDMASTERCONSDATA **  mastersepacut 
)

decreases usage counter of separator master cut, and frees memory if necessary

decreases usage counter of separator master cut, and frees memory if necessary creates separator master cut

Parameters
gcgGCG data structure
mastersepacutpointer to separator master cut

Definition at line 102 of file mastersepacut.c.

References GCG_Mastersepacut::data, freeMastersepacut(), GCG_EXTENDEDMASTERCONSTYPE_SEPA_ROW, GCGextendedmasterconsFree(), GCGextendedmasterconsGetType(), NULL, GCG_Mastersepacut::nuses, SCIP_CALL, and SCIP_OKAY.

Referenced by eventRowDeletedFromLP(), GCGclearGeneratedMastersepacuts(), GCGeventmastersepacutRemoveNewInactiveMastersepacuts(), GCGeventmastersepacutShrinkActiveMastersepacuts(), SCIP_DECL_CONSDELETE(), SCIP_DECL_CONSEXITSOL(), and SCIP_DECL_EVENTEXITSOL().

◆ GCGcreateMastersepacut()

GCG_EXPORT SCIP_RETCODE GCGcreateMastersepacut ( GCG *  gcg,
GCG_MASTERSEPACUT **  mastersepacut,
GCG_SEPA *  sepa,
GCG_VARHISTORY *  varhistory,
GCG_MASTERSEPACUTDATA *  mastersepacutdata 
)

creates separator master cut

returns the variable history of the separator master cut

Parameters
gcgGCG data structure
mastersepacutpointer to store separator master cut
sepaseparator creating this cut
varhistoryvariable history
mastersepacutdataseparator master cut data

Definition at line 129 of file mastersepacut.c.

References GCGgetMasterprob(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPallocBlockMemory.

Referenced by GCGcreateChvatalGomoryCut().

◆ GCGextendedmasterconsCreateForSepamastercut()

GCG_EXPORT SCIP_RETCODE GCGextendedmasterconsCreateForSepamastercut ( GCG *  gcg,
GCG_EXTENDEDMASTERCONSDATA **  extendedmastercons,
GCG_MASTERSEPACUT *  cut,
SCIP_ROW *  row,
GCG_PRICINGMODIFICATION **  pricingmodifications,
int  npricingmodifications 
)

creates extended master cons data for a given master cut

Parameters
gcgGCG data structure
extendedmasterconspointer to store the create extended master cons data
cutmaster cut data structure
rowcorresponding row object
pricingmodificationsrelated pricing modifications
npricingmodificationsnumber of pricing modifications

Definition at line 209 of file mastersepacut.c.

References GCG_EXTENDEDMASTERCONSTYPE_SEPA_ROW, GCGextendedmasterconsCreateFromRow(), NULL, SCIP_CALL, and SCIP_OKAY.

Referenced by createMastercutData().

◆ GCGmastersepacutGetExtendedmasterconsCoeff()

GCG_EXPORT SCIP_RETCODE GCGmastersepacutGetExtendedmasterconsCoeff ( GCG *  gcg,
GCG_EXTENDEDMASTERCONSDATA *  mastersepacut,
SCIP_VAR **  solvars,
SCIP_Real *  solvals,
int  nsolvars,
int  probnr,
GCG_COL *  gcgcol,
SCIP_Real *  coef 
)

calculate the coefficient of a column solution

Parameters
gcgGCG data structure
mastersepacutmaster cut data structure
solvarsarray of column solution variables
solvalsarray of column solution values
nsolvarsnumber of column solution variables and values
probnrthe pricing problem that the column belongs to
gcgcolgcg column if available (or NULL)
coefpointer to store the coefficient

Definition at line 226 of file mastersepacut.c.

References GCGextendedmasterconsGetMastersepacut(), GCGmastersepacutGetSeparator(), SCIP_CALL, and SCIP_OKAY.

Referenced by addMissedVariables(), ObjPricerGcg::addVariableToMastersepacuts(), ObjPricerGcg::computeColMastersepacutCoeffs(), GCGcreateGcgCol(), and GCGextendedmasterconsGetCoeff().

◆ GCGremoveNewInactiveMastersepacuts()

GCG_EXPORT 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
gcgGCG data structure
startidxindex 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().

◆ GCGshrinkActiveMastersepacuts()

GCG_EXPORT SCIP_RETCODE GCGshrinkActiveMastersepacuts ( GCG *  gcg,
int  newnrows 
)

removes all mastersepacuts after given index from active cuts

Parameters
gcgGCG data structure
newnrowsindex 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().

◆ GCGclearGeneratedMastersepacuts()

◆ GCGaddGeneratedMastersepacut()

◆ GCGaddActiveMastersepacut()

GCG_EXPORT SCIP_RETCODE GCGaddActiveMastersepacut ( GCG *  gcg,
GCG_EXTENDEDMASTERCONSDATA *  mastersepacut 
)

adds a mastercut generated by a master separator to active cuts

Parameters
gcgGCG data structure
mastersepacutmastersepacut

Definition at line 774 of file event_mastersepacut.c.

References GCGeventmastersepacutAddActiveMastersepacut(), GCGgetMastersepacutEventhdlr(), NULL, SCIP_CALL, and SCIP_OKAY.

Referenced by addStoredCutsToActiveCuts().