GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
extendedmasterconsdata.c File Reference

Detailed Description

methods for interacting with GCG_EXTENDEDMASTERCONSDATA

Author
Til Mohr
Erik Muehmer

Definition in file extendedmasterconsdata.c.

Go to the source code of this file.

Functions

static SCIP_RETCODE GCGpricingmodificationFree (GCG *gcg, GCG_PRICINGMODIFICATION **pricingmodification)
SCIP_RETCODE GCGpricingmodificationCreate (GCG *gcg, GCG_PRICINGMODIFICATION **pricingmodification, int blocknr, SCIP_VAR *coefvar, SCIP_VAR **additionalvars, int nadditionalvars, SCIP_CONS **additionalconss, int nadditionalconss)
SCIP_RETCODE GCGextendedmasterconsCreateFromCons (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA **extendedmasterconsdata, GCG_EXTENDEDMASTERCONSTYPE type, SCIP_CONS *cons, GCG_PRICINGMODIFICATION **pricingmodifications, int npricingmodifications, GCG_BRANCHCONSDATA *data)
SCIP_RETCODE GCGextendedmasterconsCreateFromRow (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA **extendedmasterconsdata, GCG_EXTENDEDMASTERCONSTYPE type, SCIP_ROW *row, GCG_PRICINGMODIFICATION **pricingmodifications, int npricingmodifications, GCG_MASTERSEPACUT *data)
SCIP_RETCODE GCGextendedmasterconsFree (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA **extendedmasterconsdata)
SCIP_Bool GCGextendedmasterconsIsActive (GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata)
SCIP_RETCODE GCGextendedmasterconsAddMasterVar (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata, SCIP_VAR *var, SCIP_Real coef)
SCIP_RETCODE GCGextendedmasterconsUpdateDualValue (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata, SCIP_Real dualvalue)
SCIP_CONS * GCGextendedmasterconsGetCons (GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata)
SCIP_ROW * GCGextendedmasterconsGetRow (GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata)
SCIP_VAR * GCGpricingmodificationGetCoefVar (GCG_PRICINGMODIFICATION *pricingmodification)
SCIP_VAR ** GCGpricingmodificationGetAdditionalVars (GCG_PRICINGMODIFICATION *pricingmodification)
int GCGpricingmodificationGetNAdditionalVars (GCG_PRICINGMODIFICATION *pricingmodification)
SCIP_CONS ** GCGpricingmodificationGetAdditionalConss (GCG_PRICINGMODIFICATION *pricingmodification)
int GCGpricingmodificationGetNAdditionalConss (GCG_PRICINGMODIFICATION *pricingmodification)
int GCGpricingmodificationGetBlock (GCG_PRICINGMODIFICATION *pricingmodification)
GCG_PRICINGMODIFICATION * GCGextendedmasterconsGetPricingModification (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata, int blocknr)
GCG_PRICINGMODIFICATION ** GCGextendedmasterconsGetPricingModifications (GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata)
int GCGextendedmasterconsGetNPricingModifications (GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata)
SCIP_RETCODE GCGpricingmodificationApply (SCIP *pricingscip, GCG_PRICINGMODIFICATION *pricingmodification)
SCIP_RETCODE GCGpricingmodificationUndo (SCIP *pricingscip, GCG_PRICINGMODIFICATION *pricingmodification)
SCIP_RETCODE GCGextendedmasterconsUndoPricingModifications (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata)
SCIP_Bool GCGpricingmodificationIsCoefVar (GCG_PRICINGMODIFICATION *pricingmodification, SCIP_VAR *var)
SCIP_Bool GCGextendedmasterconsIsCoefVar (GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata, SCIP_VAR *var)
const char * GCGextendedmasterconsGetName (GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata)
SCIP_Real GCGextendedmasterconsGetLhs (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata)
SCIP_Real GCGextendedmasterconsGetRhs (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata)
SCIP_Real GCGextendedmasterconsGetConstant (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata)
int GCGextendedmasterconsGetNNonz (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata)
SCIP_COL ** GCGextendedmasterconsGetCols (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata)
SCIP_Real * GCGextendedmasterconsGetVals (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata)
SCIP_RETCODE GCGextendedmasterconsGetCoeff (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata, SCIP_VAR **solvars, SCIP_Real *solvals, int nsolvars, int probnr, GCG_COL *gcgcol, SCIP_Real *coeff)
GCG_EXTENDEDMASTERCONSTYPE GCGextendedmasterconsGetType (GCG_EXTENDEDMASTERCONSDATA *extendedmasterconsdata)

Function Documentation

◆ GCGpricingmodificationFree()

SCIP_RETCODE GCGpricingmodificationFree ( GCG * gcg,
GCG_PRICINGMODIFICATION ** pricingmodification )
static

free a pricing modification

Parameters
gcgGCG data structure
pricingmodificationpointer to the pricing modification

Definition at line 51 of file extendedmasterconsdata.c.

References assert(), GCGgetMasterprob(), GCGgetPricingprob(), GCGisMaster(), GCGpricingmodificationFree(), i, and SCIP_CALL().

Referenced by GCGextendedmasterconsFree(), and GCGpricingmodificationFree().

◆ GCGextendedmasterconsCreateFromCons()

SCIP_RETCODE GCGextendedmasterconsCreateFromCons ( GCG * gcg,
GCG_EXTENDEDMASTERCONSDATA ** extendedmasterconsdata,
GCG_EXTENDEDMASTERCONSTYPE type,
SCIP_CONS * cons,
GCG_PRICINGMODIFICATION ** pricingmodifications,
int npricingmodifications,
GCG_BRANCHCONSDATA * data )

create an extended master cons, taking ownership over pricingmodifications

Parameters
gcgGCG data structure
extendedmasterconsdatapointer to store the extended master cons data
typetype of the extended master cons
consconstraint in the master problem that represents the extended master cons
pricingmodificationspricing modifications for the extended master cons
npricingmodificationsnumber of pricing modifications for the extended master cons
databranchconsdata that belongs to the cons

Definition at line 144 of file extendedmasterconsdata.c.

References assert(), GCG_PricingModification::blocknr, SCIP_VarData::data, GCGextendedmasterconsCreateFromCons(), GCGgetMasterprob(), GCGgetNPricingprobs(), GCGisMaster(), GCGisPricingprobRelevant(), i, j, GCG_PricingModification::nadditionalvars, SCIP_CALL(), and SCIPfreeBufferArray().

Referenced by GCGbranchCreateExtendedmastercons(), and GCGextendedmasterconsCreateFromCons().

◆ GCGextendedmasterconsCreateFromRow()

SCIP_RETCODE GCGextendedmasterconsCreateFromRow ( GCG * gcg,
GCG_EXTENDEDMASTERCONSDATA ** extendedmasterconsdata,
GCG_EXTENDEDMASTERCONSTYPE type,
SCIP_ROW * row,
GCG_PRICINGMODIFICATION ** pricingmodifications,
int npricingmodifications,
GCG_MASTERSEPACUT * data )

create an extended master cons, taking ownership over pricingmodifications

Parameters
gcgGCG data structure
extendedmasterconsdatapointer to store the extended master cons data
typetype of the extended master cons
rowrow in the master problem that represents the extended master cons cut
pricingmodificationspricing modifications for the extended master cons
npricingmodificationsnumber of pricing modifications for the extended master cons
datamastersepacut that corresponds to the row

Definition at line 209 of file extendedmasterconsdata.c.

References assert(), GCG_PricingModification::blocknr, SCIP_VarData::data, GCGextendedmasterconsCreateFromRow(), GCGgetMasterprob(), GCGgetNPricingprobs(), GCGisMaster(), GCGisPricingprobRelevant(), i, j, GCG_PricingModification::nadditionalvars, SCIP_CALL(), and SCIPfreeBufferArray().

Referenced by GCGextendedmasterconsCreateForSepamastercut(), and GCGextendedmasterconsCreateFromRow().

◆ GCGextendedmasterconsFree()

SCIP_RETCODE GCGextendedmasterconsFree ( GCG * gcg,
GCG_EXTENDEDMASTERCONSDATA ** extendedmasterconsdata )

free an extended master cons

Parameters
gcgGCG data structure
extendedmasterconsdatapointer to the extended master cons data

Definition at line 274 of file extendedmasterconsdata.c.

References assert(), GCG_EXTENDEDMASTERCONSTYPE_BRANCH_CONS, GCG_EXTENDEDMASTERCONSTYPE_SEPA_ROW, GCGextendedmasterconsFree(), GCGgetMasterprob(), GCGisMaster(), GCGpricingmodificationFree(), i, and SCIP_CALL().

Referenced by GCGbranchFreeExtendedmasterconsBranchData(), GCGextendedmasterconsFree(), and GCGreleaseMastersepacut().

◆ GCGextendedmasterconsIsActive()

◆ GCGextendedmasterconsAddMasterVar()

SCIP_RETCODE GCGextendedmasterconsAddMasterVar ( GCG * gcg,
GCG_EXTENDEDMASTERCONSDATA * extendedmasterconsdata,
SCIP_VAR * var,
SCIP_Real coef )

add a new variable along with its coefficient to the extended master cons

Parameters
gcgGCG data structure
extendedmasterconsdataextended master cons data
varvariable to add
coefcoefficient of the variable

Definition at line 338 of file extendedmasterconsdata.c.

References assert(), GCG_ExtendedMasterCons::cons, GCG_ExtendedMasterConsData::cons, GCG_EXTENDEDMASTERCONSTYPE_BRANCH_CONS, GCG_EXTENDEDMASTERCONSTYPE_SEPA_ROW, GCGextendedmasterconsAddMasterVar(), GCGgetMasterprob(), GCGisMaster(), GCG_ExtendedMasterCons::row, SCIP_CALL(), GCG_ExtendedMasterConsData::type, and var.

Referenced by addVarToMasterbranch(), and GCGextendedmasterconsAddMasterVar().

◆ GCGextendedmasterconsGetCons()

◆ GCGextendedmasterconsGetRow()

◆ GCGpricingmodificationGetCoefVar()

SCIP_VAR * GCGpricingmodificationGetCoefVar ( GCG_PRICINGMODIFICATION * pricingmodification)

get the variable that determines the coefficient of a column in the extended master cons

Parameters
pricingmodificationpricing modification

Definition at line 425 of file extendedmasterconsdata.c.

References assert(), GCG_PricingModification::coefvar, and GCGpricingmodificationGetCoefVar().

Referenced by GCGcolUpdateActiveMastersepacuts(), GCGcreateGcgCol(), and GCGpricingmodificationGetCoefVar().

◆ GCGpricingmodificationGetAdditionalVars()

SCIP_VAR ** GCGpricingmodificationGetAdditionalVars ( GCG_PRICINGMODIFICATION * pricingmodification)

get the additional variables that are inferred by the extended master cons

Parameters
pricingmodificationpricing modification

Definition at line 437 of file extendedmasterconsdata.c.

References GCG_PricingModification::additionalvars, assert(), and GCGpricingmodificationGetAdditionalVars().

Referenced by GCGpricingmodificationGetAdditionalVars().

◆ GCGpricingmodificationGetNAdditionalVars()

int GCGpricingmodificationGetNAdditionalVars ( GCG_PRICINGMODIFICATION * pricingmodification)

get the number of additional variables that are inferred by the extended master cons

Parameters
pricingmodificationpricing modification

Definition at line 449 of file extendedmasterconsdata.c.

References assert(), GCGpricingmodificationGetNAdditionalVars(), and GCG_PricingModification::nadditionalvars.

Referenced by GCGpricingmodificationGetNAdditionalVars().

◆ GCGpricingmodificationGetAdditionalConss()

SCIP_CONS ** GCGpricingmodificationGetAdditionalConss ( GCG_PRICINGMODIFICATION * pricingmodification)

get the additional constraints that are inferred by the extended master cons

Parameters
pricingmodificationpricing modification

Definition at line 461 of file extendedmasterconsdata.c.

References GCG_PricingModification::additionalconss, assert(), and GCGpricingmodificationGetAdditionalConss().

Referenced by GCGchvatalGomoryCutGetVariableCoefficient(), and GCGpricingmodificationGetAdditionalConss().

◆ GCGpricingmodificationGetNAdditionalConss()

int GCGpricingmodificationGetNAdditionalConss ( GCG_PRICINGMODIFICATION * pricingmodification)

get the number of additional constraints that are inferred by the extended master cons

Parameters
pricingmodificationpricing modification

Definition at line 473 of file extendedmasterconsdata.c.

References assert(), GCGpricingmodificationGetNAdditionalConss(), and GCG_PricingModification::nadditionalconss.

Referenced by GCGpricingmodificationGetNAdditionalConss().

◆ GCGpricingmodificationGetBlock()

int GCGpricingmodificationGetBlock ( GCG_PRICINGMODIFICATION * pricingmodification)

get the number of the block the modification belongs to

Parameters
pricingmodificationpricing modification

Definition at line 485 of file extendedmasterconsdata.c.

References assert(), GCG_PricingModification::blocknr, and GCGpricingmodificationGetBlock().

Referenced by GCGpricingmodificationGetBlock().

◆ GCGextendedmasterconsGetPricingModification()

GCG_PRICINGMODIFICATION * GCGextendedmasterconsGetPricingModification ( GCG * gcg,
GCG_EXTENDEDMASTERCONSDATA * extendedmasterconsdata,
int blocknr )

◆ GCGextendedmasterconsGetPricingModifications()

GCG_PRICINGMODIFICATION ** GCGextendedmasterconsGetPricingModifications ( GCG_EXTENDEDMASTERCONSDATA * extendedmasterconsdata)

get the pricing modifications for the extended master cons

Parameters
extendedmasterconsdataextended master cons data

Definition at line 519 of file extendedmasterconsdata.c.

References assert(), GCGextendedmasterconsGetPricingModifications(), and GCG_ExtendedMasterConsData::pricingmodifications.

Referenced by GCGextendedmasterconsGetPricingModifications().

◆ GCGextendedmasterconsGetNPricingModifications()

int GCGextendedmasterconsGetNPricingModifications ( GCG_EXTENDEDMASTERCONSDATA * extendedmasterconsdata)

get the number of pricing modifications for the extended master cons

Parameters
extendedmasterconsdataextended master cons data

Definition at line 531 of file extendedmasterconsdata.c.

References assert(), GCGextendedmasterconsGetNPricingModifications(), and GCG_ExtendedMasterConsData::npricingmodifications.

Referenced by GCGextendedmasterconsGetNPricingModifications().

◆ GCGpricingmodificationApply()

SCIP_RETCODE GCGpricingmodificationApply ( SCIP * pricingscip,
GCG_PRICINGMODIFICATION * pricingmodification )

◆ GCGpricingmodificationUndo()

◆ GCGextendedmasterconsUndoPricingModifications()

SCIP_RETCODE GCGextendedmasterconsUndoPricingModifications ( GCG * gcg,
GCG_EXTENDEDMASTERCONSDATA * extendedmasterconsdata )

◆ GCGpricingmodificationIsCoefVar()

SCIP_Bool GCGpricingmodificationIsCoefVar ( GCG_PRICINGMODIFICATION * pricingmodification,
SCIP_VAR * var )

check whether a given variable is a coefficient variable of a given pricing modification

Parameters
pricingmodificationpricing modification
varvariable to check

Definition at line 631 of file extendedmasterconsdata.c.

References assert(), GCG_PricingModification::coefvar, GCGpricingmodificationIsCoefVar(), and var.

Referenced by GCGextendedmasterconsIsCoefVar(), and GCGpricingmodificationIsCoefVar().

◆ GCGextendedmasterconsIsCoefVar()

SCIP_Bool GCGextendedmasterconsIsCoefVar ( GCG_EXTENDEDMASTERCONSDATA * extendedmasterconsdata,
SCIP_VAR * var )

check whether a given variable is a coefficient variable of a given extended master cons

Parameters
extendedmasterconsdataextended master cons data
varvariable to check

Definition at line 642 of file extendedmasterconsdata.c.

References assert(), GCGextendedmasterconsIsCoefVar(), GCGpricingmodificationIsCoefVar(), i, GCG_ExtendedMasterConsData::npricingmodifications, GCG_ExtendedMasterConsData::pricingmodifications, and var.

Referenced by GCGextendedmasterconsIsCoefVar().

◆ GCGextendedmasterconsGetName()

◆ GCGextendedmasterconsGetLhs()

◆ GCGextendedmasterconsGetRhs()

◆ GCGextendedmasterconsGetConstant()

SCIP_Real GCGextendedmasterconsGetConstant ( GCG * gcg,
GCG_EXTENDEDMASTERCONSDATA * extendedmasterconsdata )

get the constant of the extended master cons (always returns 0 if extended master cons is a constraint, returns constant of row otherwise)

Parameters
gcgGCG data structure
extendedmasterconsdataextended master cons data

Definition at line 729 of file extendedmasterconsdata.c.

References assert(), GCG_ExtendedMasterConsData::cons, GCG_EXTENDEDMASTERCONSTYPE_BRANCH_CONS, GCG_EXTENDEDMASTERCONSTYPE_SEPA_ROW, GCGextendedmasterconsGetConstant(), GCG_ExtendedMasterCons::row, and GCG_ExtendedMasterConsData::type.

Referenced by GCGextendedmasterconsGetConstant(), and ObjPricerGcg::getStabilizedDualObjectiveValue().

◆ GCGextendedmasterconsGetNNonz()

int GCGextendedmasterconsGetNNonz ( GCG * gcg,
GCG_EXTENDEDMASTERCONSDATA * extendedmasterconsdata )

get number of nonzero entries in the extended master cons

Parameters
gcgGCG data structure
extendedmasterconsdataextended master cons data

Definition at line 750 of file extendedmasterconsdata.c.

References assert(), GCG_ExtendedMasterCons::cons, GCG_ExtendedMasterConsData::cons, GCG_EXTENDEDMASTERCONSTYPE_BRANCH_CONS, GCG_EXTENDEDMASTERCONSTYPE_SEPA_ROW, GCGextendedmasterconsGetNNonz(), GCGgetMasterprob(), GCG_ExtendedMasterCons::row, and GCG_ExtendedMasterConsData::type.

Referenced by GCGextendedmasterconsGetNNonz().

◆ GCGextendedmasterconsGetCols()

SCIP_COL ** GCGextendedmasterconsGetCols ( GCG * gcg,
GCG_EXTENDEDMASTERCONSDATA * extendedmasterconsdata )

◆ GCGextendedmasterconsGetVals()

SCIP_Real * GCGextendedmasterconsGetVals ( GCG * gcg,
GCG_EXTENDEDMASTERCONSDATA * extendedmasterconsdata )

◆ GCGextendedmasterconsGetCoeff()

SCIP_RETCODE GCGextendedmasterconsGetCoeff ( GCG * gcg,
GCG_EXTENDEDMASTERCONSDATA * extendedmasterconsdata,
SCIP_VAR ** solvars,
SCIP_Real * solvals,
int nsolvars,
int probnr,
GCG_COL * gcgcol,
SCIP_Real * coeff )

calculate the coefficient of a column solution in the extended master cons

Parameters
gcgGCG data structure
extendedmasterconsdataextended master cons data
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)
coeffpointer to store the coefficient

Definition at line 819 of file extendedmasterconsdata.c.

References assert(), GCG_EXTENDEDMASTERCONSTYPE_BRANCH_CONS, GCG_EXTENDEDMASTERCONSTYPE_SEPA_ROW, GCGbranchGetExtendedmasterconsCoeff(), GCGextendedmasterconsGetCoeff(), GCGmastersepacutGetExtendedmasterconsCoeff(), SCIP_CALL(), and GCG_ExtendedMasterConsData::type.

Referenced by GCGextendedmasterconsGetCoeff().

◆ GCGextendedmasterconsGetType()