GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
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 assert(), GCGmastersepacutGetVarHistory(), and GCG_Mastersepacut::knownvarhistory.

Referenced by addMissedVariables(), ObjPricerGcg::addVariableToMastersepacuts(), eventRowAddedToLP(), GCGmastersepacutGetVarHistory(), 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 assert(), GCGmastersepacutGetSeparator(), and GCG_Mastersepacut::sepa.

Referenced by GCGmastersepacutGetExtendedmasterconsCoeff(), and GCGmastersepacutGetSeparator().

◆ 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 assert(), GCG_Mastersepacut::data, and GCGmastersepacutGetData().

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

◆ 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 assert(), GCGgetCurrentVarhistoryReference(), GCGgetMasterprob(), GCGmastersepacutSetVarHistory(), GCGvarhistoryCopyReference(), GCG_Mastersepacut::knownvarhistory, and SCIP_CALL().

Referenced by eventRowAddedToLP(), and GCGmastersepacutSetVarHistory().

◆ 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 assert(), GCG_MastersepacutData::conssindices, GCGcreateChvatalGomoryCut(), GCGcreateMastersepacut(), GCGgetMasterprob(), GCG_MastersepacutData::nconssindices, SCIP_CALL(), and GCG_MastersepacutData::weights.

Referenced by GCGcreateChvatalGomoryCut(), and 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 assert(), GCGfreeChvatalGomoryCutData(), and GCGgetMasterprob().

Referenced by GCG_DECL_SEPAMASTERCUTDELETE(), and GCGfreeChvatalGomoryCutData().

◆ 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 assert(), GCGchvatalGomoryCutGetNWeights(), GCGmastersepacutGetData(), and GCG_MastersepacutData::nconssindices.

Referenced by GCGchvatalGomoryCutGetColumnCoefficient(), and GCGchvatalGomoryCutGetNWeights().

◆ 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 assert(), GCGchvatalGomoryCutGetWeights(), GCGmastersepacutGetData(), and GCG_MastersepacutData::weights.

Referenced by GCGchvatalGomoryCutGetColumnCoefficient(), and GCGchvatalGomoryCutGetWeights().

◆ 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 assert(), GCG_MastersepacutData::conssindices, GCGchvatalGomoryCutGetConssIndices(), and GCGmastersepacutGetData().

Referenced by GCGchvatalGomoryCutGetColumnCoefficient(), and GCGchvatalGomoryCutGetConssIndices().

◆ 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 assert(), GCGchvatalGomoryCutGetColumnCoefficient(), GCGchvatalGomoryCutGetConssIndices(), GCGchvatalGomoryCutGetNWeights(), GCGchvatalGomoryCutGetWeights(), GCGcolGetInitializedCoefs(), GCGcolGetMastercoefs(), GCGextendedmasterconsGetMastersepacut(), GCGgetMasterprob(), i, and SCIPdebugMessage().

Referenced by GCG_DECL_SEPAGETCOLCOEFFICIENT(), and GCGchvatalGomoryCutGetColumnCoefficient().

◆ 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 assert(), GCGchvatalGomoryCutGetVariableCoefficient(), GCGextendedmasterconsGetPricingModification(), GCGgetMasterprob(), GCGgetPricingprob(), GCGpricingmodificationGetAdditionalConss(), GCGvarIsInferredPricing(), i, nvars, SCIP_CALL(), SCIPdebugMessage(), SCIPfreeBufferArray(), success, and vars.

Referenced by GCG_DECL_SEPAGETCOLCOEFFICIENT(), and GCGchvatalGomoryCutGetVariableCoefficient().

◆ 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 assert(), GCG_Mastersepacut::data, freeMastersepacut(), GCG_EXTENDEDMASTERCONSTYPE_SEPA_ROW, GCGextendedmasterconsFree(), GCGextendedmasterconsGetType(), GCGreleaseMastersepacut(), GCG_Mastersepacut::nuses, and SCIP_CALL().

Referenced by eventRowDeletedFromLP(), GCGclearGeneratedMastersepacuts(), GCGeventmastersepacutRemoveNewInactiveMastersepacuts(), GCGeventmastersepacutShrinkActiveMastersepacuts(), GCGreleaseMastersepacut(), 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 assert(), GCGcreateMastersepacut(), GCGgetMasterprob(), and SCIP_CALL().

Referenced by GCGcreateChvatalGomoryCut(), and GCGcreateMastersepacut().

◆ 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 assert(), GCG_EXTENDEDMASTERCONSTYPE_SEPA_ROW, GCGextendedmasterconsCreateForSepamastercut(), GCGextendedmasterconsCreateFromRow(), and SCIP_CALL().

Referenced by createMastercutData(), and GCGextendedmasterconsCreateForSepamastercut().

◆ 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(), GCGmastersepacutGetExtendedmasterconsCoeff(), GCGmastersepacutGetSeparator(), and SCIP_CALL().

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

◆ 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 assert(), GCGeventmastersepacutRemoveNewInactiveMastersepacuts(), GCGgetMastersepacutEventhdlr(), GCGremoveNewInactiveMastersepacuts(), and SCIP_CALL().

Referenced by GCGremoveNewInactiveMastersepacuts(), and 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 assert(), GCGeventmastersepacutShrinkActiveMastersepacuts(), GCGgetMastersepacutEventhdlr(), GCGshrinkActiveMastersepacuts(), and SCIP_CALL().

Referenced by GCGshrinkActiveMastersepacuts(), and 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 assert(), GCGaddActiveMastersepacut(), GCGeventmastersepacutAddActiveMastersepacut(), GCGgetMastersepacutEventhdlr(), and SCIP_CALL().

Referenced by addStoredCutsToActiveCuts(), and GCGaddActiveMastersepacut().