Detailed Description
methods for storing priced cols (based on SCIP's separation storage)
Definition in file pricestore_gcg.c.
#include <assert.h>#include "gcg/pub_gcgcol.h"#include "gcg/pub_gcgvar.h"#include "scip/def.h"#include "scip/set.h"#include "scip/stat.h"#include "scip/lp.h"#include "scip/var.h"#include "scip/tree.h"#include "scip/reopt.h"#include "scip/event.h"#include "scip/cons.h"#include "scip/debug.h"#include "gcg/gcg.h"#include "gcg/pricestore_gcg.h"#include "gcg/struct_pricestore_gcg.h"#include "gcg/pricer_gcg.h"#include "gcg/struct_gcgcol.h"#include "gcg/struct_sepagcg.h"Go to the source code of this file.
Function Documentation
◆ pricestoreEnsureColsMem()
|
static |
resizes cols and score arrays to be able to store at least num entries
- Parameters
-
pricestore price storage arrayindex index of the arrays num minimal number of slots in array
Definition at line 70 of file pricestore_gcg.c.
References assert(), GCG_PriceStore::cols, GCG_PriceStore::colssize, GCG_SET_LOCK, GCG_UNSET_LOCK, GCG_PriceStore::masterprob, GCG_PriceStore::objparallelisms, GCG_PriceStore::orthogonalities, pricestoreEnsureColsMem(), retcode, SCIP_CALL(), and GCG_PriceStore::scores.
Referenced by GCGpricestoreAddCol(), and pricestoreEnsureColsMem().
◆ pricestoreGetArrayIndex()
|
static |
returns the index of the arrays that are used to store data of a column
- Parameters
-
pricestore price storage col column
Definition at line 106 of file pricestore_gcg.c.
References assert(), GCG_PriceStore::narrays, pricestoreGetArrayIndex(), and GCG_Col::probnr.
Referenced by GCGpricestoreAddCol(), GCGpricestoreApplyCols(), pricestoreApplyCol(), and pricestoreGetArrayIndex().
◆ GCGpricestoreCreate()
| SCIP_RETCODE GCGpricestoreCreate | ( | GCG * | gcg, |
| GCG_PRICESTORE ** | pricestore, | ||
| SCIP_Real | redcostfac, | ||
| SCIP_Real | objparalfac, | ||
| SCIP_Real | orthofac, | ||
| SCIP_Real | mincolorth, | ||
| GCG_EFFICIACYCHOICE | efficiacychoice, | ||
| int | hashtablesize ) |
creates price storage
- Parameters
-
gcg GCG data structure pricestore pointer to store price storage efficiacyfac factor of -redcost/norm in score function objparalfac factor of objective parallelism in score function orthofac factor of orthogonalities in score function mincolorth minimal orthogonality of columns to add (with respect to columns added in the current round) efficiacychoice choice to base efficiacy on hashtablesize size of hashtable
Definition at line 117 of file pricestore_gcg.c.
References assert(), GCGgetMasterprob(), GCGgetNPricingprobs(), GCGpricestoreCreate(), i, masterprob, and SCIP_CALL().
Referenced by ObjPricerGcg::createPricestore(), and GCGpricestoreCreate().
◆ GCGpricestoreFree()
| SCIP_RETCODE GCGpricestoreFree | ( | GCG_PRICESTORE ** | pricestore | ) |
frees price storage
- Parameters
-
pricestore pointer to store price storage
Definition at line 184 of file pricestore_gcg.c.
References assert(), GCGpricestoreFree(), and i.
Referenced by GCGpricestoreFree(), and SCIP_DECL_PRICEREXITSOL().
◆ GCGpricestoreStartFarkas()
| void GCGpricestoreStartFarkas | ( | GCG_PRICESTORE * | pricestore | ) |
informs price storage, that Farkas pricing starts now
- Parameters
-
pricestore price storage
Definition at line 218 of file pricestore_gcg.c.
References assert(), GCGpricestoreStartFarkas(), GCG_PriceStore::infarkas, and GCG_PriceStore::ncolstotal.
Referenced by GCGpricestoreStartFarkas(), and SCIP_DECL_PRICERFARKAS().
◆ GCGpricestoreEndFarkas()
| void GCGpricestoreEndFarkas | ( | GCG_PRICESTORE * | pricestore | ) |
informs price storage, that Farkas pricing is now finished
- Parameters
-
pricestore price storage
Definition at line 229 of file pricestore_gcg.c.
References assert(), GCGpricestoreEndFarkas(), GCG_PriceStore::infarkas, and GCG_PriceStore::ncolstotal.
Referenced by GCGpricestoreEndFarkas(), and SCIP_DECL_PRICERREDCOST().
◆ GCGpricestoreStartForceCols()
| void GCGpricestoreStartForceCols | ( | GCG_PRICESTORE * | pricestore | ) |
informs price storage, that the following cols should be used in any case
- Parameters
-
pricestore price storage
Definition at line 240 of file pricestore_gcg.c.
References assert(), GCG_PriceStore::forcecols, and GCGpricestoreStartForceCols().
Referenced by GCGpricestoreStartForceCols().
◆ GCGpricestoreEndForceCols()
| void GCGpricestoreEndForceCols | ( | GCG_PRICESTORE * | pricestore | ) |
informs price storage, that the following cols should no longer be used in any case
- Parameters
-
pricestore price storage
Definition at line 251 of file pricestore_gcg.c.
References assert(), GCG_PriceStore::forcecols, and GCGpricestoreEndForceCols().
Referenced by GCGpricestoreEndForceCols().
◆ pricestoreDelCol()
|
static |
removes a non-forced col from the price storage
- Parameters
-
pricestore price storage arrayindex index of the arrays pos position of col to delete freecol should col be freed
Definition at line 263 of file pricestore_gcg.c.
References assert(), GCG_PriceStore::cols, GCGfreeGcgCol(), GCG_PriceStore::hashtable, GCG_PriceStore::ncols, GCG_PriceStore::nforcedcols, GCG_PriceStore::objparallelisms, GCG_PriceStore::orthogonalities, GCG_Col::pos, pricestoreDelCol(), SCIP_CALL(), and GCG_PriceStore::scores.
Referenced by GCGpricestoreApplyCols(), pricestoreApplyCol(), pricestoreDelCol(), and pricestoreUpdateOrthogonalities().
◆ pricestoreFindEqualCol()
|
static |
for a given column, check if an identical column already exists in the price storage; if one exists, return its position, otherwise, return -1
- Parameters
-
pricestore price storage col column to be checked
Definition at line 298 of file pricestore_gcg.c.
References GCG_PriceStore::hashtable, GCG_Col::pos, and pricestoreFindEqualCol().
Referenced by GCGpricestoreAddCol(), and pricestoreFindEqualCol().
◆ GCGpricestoreAddCol()
| SCIP_RETCODE GCGpricestoreAddCol | ( | GCG_PRICESTORE * | pricestore, |
| GCG_COL * | col, | ||
| SCIP_Bool | forcecol, | ||
| SCIP_Bool | fromcolpool, | ||
| SCIP_Bool * | added ) |
adds col to price storage; if the col should be forced to enter the LP, an infinite score will be used
adds col to price storage; if the col should be forced to enter the LP, an infinite score has to be used
- Parameters
-
pricestore price storage col priced col forcecol should the col be forced to enter the LP? fromcolpool is column from colpool added pointer to var that indicates whether the col was added
Definition at line 314 of file pricestore_gcg.c.
References assert(), GCG_PriceStore::cols, GCG_PriceStore::colssize, GCG_PriceStore::forcecols, GCG_PriceStore::gcg, GCG_SET_LOCK, GCG_UNSET_LOCK, GCGcolComputeDualObjPara(), GCGcolComputeNorm(), GCGcolIsEq(), GCGfreeGcgCol(), GCGgetNActiveMastersepacuts(), GCGpricestoreAddCol(), GCGpricingVarGetOrigvars(), GCGvarIsInferredPricing(), GCGvarIsPricing(), GCG_PriceStore::hashtable, i, GCG_PriceStore::masterprob, GCG_PriceStore::ncols, GCG_PriceStore::ncolsfound, GCG_PriceStore::ncolsfoundround, GCG_PriceStore::ncolstotal, GCG_PriceStore::nforcedcols, GCG_Col::nvars, GCG_PriceStore::objparalfac, GCG_PriceStore::objparallelisms, GCG_PriceStore::orthogonalities, GCG_Col::pos, pricestoreEnsureColsMem(), pricestoreFindEqualCol(), pricestoreGetArrayIndex(), GCG_Col::pricingprob, SCIP_CALL(), SCIPdebugMessage(), GCG_PriceStore::scores, sol, GCG_Col::vals, var, and GCG_Col::vars.
Referenced by ObjPricerGcg::addColToPricestore(), and GCGpricestoreAddCol().
◆ pricestoreUpdateOrthogonalities()
|
static |
updates the orthogonalities and scores of the non-forced cols after the given col was added to the LP
- Parameters
-
pricestore price storage col col that was applied mincolorthogonality minimal orthogonality of cols to apply to LP
Definition at line 485 of file pricestore_gcg.c.
References assert(), GCG_PriceStore::cols, GCG_PriceStore::efficiacychoice, GCG_PriceStore::efficiacyfac, GCG_PriceStore::gcg, GCG_EFFICIACYCHOICE_DANTZIG, GCG_EFFICIACYCHOICE_LAMBDA, GCG_EFFICIACYCHOICE_STEEPESTEDGE, GCGcolComputeOrth(), GCGcolGetNorm(), GCGcolGetRedcost(), i, GCG_PriceStore::narrays, GCG_PriceStore::nforcedcols, GCG_PriceStore::objparalfac, GCG_PriceStore::objparallelisms, GCG_PriceStore::orthofac, GCG_PriceStore::orthogonalities, pricestoreDelCol(), pricestoreUpdateOrthogonalities(), SCIP_CALL(), SCIPdebugMessage(), and GCG_PriceStore::scores.
Referenced by pricestoreApplyCol(), and pricestoreUpdateOrthogonalities().
◆ pricestoreApplyCol()
|
static |
adds the given col to priced vars, updates the orthogonalities and scores of remaining cols, and frees non-forced cols
- Parameters
-
pricestore price storage col col to apply to the LP force force column mincolorthogonality minimal orthogonality of cols to apply to LP score score of column (or -1.0 if not specified) added pointer to store whether the column was added
Definition at line 556 of file pricestore_gcg.c.
References assert(), GCG_PriceStore::cols, GCG_PriceStore::gcg, GCGcreateNewMasterVarFromGcgCol(), GCGfreeGcgCol(), GCG_PriceStore::infarkas, GCG_PriceStore::masterprob, GCG_PriceStore::orthofac, GCG_Col::pos, pricestoreApplyCol(), pricestoreDelCol(), pricestoreGetArrayIndex(), pricestoreUpdateOrthogonalities(), and SCIP_CALL().
Referenced by GCGpricestoreApplyCols(), and pricestoreApplyCol().
◆ pricestoreGetBestCol()
|
static |
returns the position of the best non-forced col in the cols array
- Parameters
-
pricestore price storage ncolsapplied number of cols applied per array index maxpricecolsprob maximum number of cols allowed per array index
Definition at line 594 of file pricestore_gcg.c.
References assert(), bestscore, GCG_PriceStore::cols, i, GCG_PriceStore::narrays, GCG_PriceStore::nforcedcols, pricestoreGetBestCol(), and GCG_PriceStore::scores.
Referenced by GCGpricestoreApplyCols(), and pricestoreGetBestCol().
◆ computeScore()
|
static |
computes score for dual solution and initialized orthogonalities
- Parameters
-
pricestore price storage arrayindex index of the arrays pos position of col to handle
Definition at line 631 of file pricestore_gcg.c.
References assert(), GCG_PriceStore::cols, computeScore(), GCG_PriceStore::efficiacychoice, GCG_PriceStore::efficiacyfac, GCG_EFFICIACYCHOICE_DANTZIG, GCG_EFFICIACYCHOICE_LAMBDA, GCG_EFFICIACYCHOICE_STEEPESTEDGE, GCGcolGetNorm(), GCGcolGetRedcost(), GCG_PriceStore::masterprob, GCG_PriceStore::objparalfac, GCG_PriceStore::objparallelisms, GCG_PriceStore::orthofac, GCG_PriceStore::orthogonalities, and GCG_PriceStore::scores.
Referenced by computeScore(), and GCGpricestoreApplyCols().
◆ GCGpricestoreApplyCols()
| SCIP_RETCODE GCGpricestoreApplyCols | ( | GCG_PRICESTORE * | pricestore, |
| GCG_COLPOOL * | colpool, | ||
| SCIP_Bool | usecolpool, | ||
| int * | nfoundvars ) |
adds cols to priced vars and clears price storage
- Parameters
-
pricestore price storage colpool GCG column pool usecolpool use column pool? nfoundvars pointer to store number of variables that were added to the problem
Definition at line 675 of file pricestore_gcg.c.
References assert(), GCG_PriceStore::cols, computeScore(), GCG_PriceStore::gcg, GCGcolGetProbNr(), GCGcolGetRedcost(), GCGcolpoolAddCol(), GCGgetNPricingprobs(), GCGpricerGetMaxColsProb(), GCGpricerGetMaxColsRound(), GCGpricestoreApplyCols(), GCGpricestoreClearCols(), i, GCG_PriceStore::masterprob, masterprob, GCG_PriceStore::mincolorth, GCG_PriceStore::narrays, GCG_PriceStore::ncols, GCG_PriceStore::ncolstotal, GCG_PriceStore::nforcedcols, GCG_PriceStore::objparallelisms, GCG_PriceStore::orthogonalities, GCG_Col::pos, pricestoreApplyCol(), pricestoreDelCol(), pricestoreGetArrayIndex(), pricestoreGetBestCol(), SCIP_CALL(), SCIPdebugMessage(), SCIPfreeBufferArray(), and GCG_PriceStore::scores.
Referenced by GCGpricestoreApplyCols(), and ObjPricerGcg::pricingLoop().
◆ GCGpricestoreClearCols()
| SCIP_RETCODE GCGpricestoreClearCols | ( | GCG_PRICESTORE * | pricestore | ) |
clears the price storage without adding the cols to the LP
clears the price storage without adding the cols to priced vars
- Parameters
-
pricestore price storage
Definition at line 820 of file pricestore_gcg.c.
References assert(), c, GCG_PriceStore::cols, GCG_PriceStore::colssize, GCGfreeGcgCol(), GCGpricestoreClearCols(), GCG_PriceStore::hashtable, i, GCG_PriceStore::infarkas, GCG_PriceStore::masterprob, GCG_PriceStore::narrays, GCG_PriceStore::ncols, GCG_PriceStore::ncolsfoundround, GCG_PriceStore::ncolstotal, GCG_PriceStore::nforcedcols, GCG_PriceStore::objparallelisms, GCG_PriceStore::orthogonalities, SCIP_CALL(), SCIPdebugMessage(), and GCG_PriceStore::scores.
Referenced by GCGpricestoreApplyCols(), and GCGpricestoreClearCols().
◆ GCGpricestoreGetCols()
| GCG_COL ** GCGpricestoreGetCols | ( | GCG_PRICESTORE * | pricestore, |
| int | arrayindex ) |
get cols in the price storage
- Parameters
-
pricestore price storage arrayindex index of the arrays
Definition at line 866 of file pricestore_gcg.c.
References assert(), GCG_PriceStore::cols, and GCGpricestoreGetCols().
Referenced by GCGpricestoreGetCols(), and ObjPricerGcg::getBestCols().
◆ GCGpricestoreGetNCols()
| int GCGpricestoreGetNCols | ( | GCG_PRICESTORE * | pricestore, |
| int | arrayindex ) |
get number of cols in the price storage
- Parameters
-
pricestore price storage arrayindex index of the arrays
Definition at line 877 of file pricestore_gcg.c.
References assert(), GCGpricestoreGetNCols(), and GCG_PriceStore::ncols.
Referenced by GCGpricestoreGetNCols(), and ObjPricerGcg::getBestCols().
◆ GCGpricestoreGetNColsTotal()
| int GCGpricestoreGetNColsTotal | ( | GCG_PRICESTORE * | pricestore | ) |
get number of cols in the price storage
- Parameters
-
pricestore price storage
Definition at line 888 of file pricestore_gcg.c.
References assert(), GCGpricestoreGetNColsTotal(), and GCG_PriceStore::ncolstotal.
Referenced by GCGpricestoreGetNColsTotal(), and ObjPricerGcg::pricingLoop().
◆ GCGpricestoreGetNColsFound()
| int GCGpricestoreGetNColsFound | ( | GCG_PRICESTORE * | pricestore | ) |
get total number of cols found so far
- Parameters
-
pricestore price storage
Definition at line 898 of file pricestore_gcg.c.
References assert(), GCGpricestoreGetNColsFound(), and GCG_PriceStore::ncolsfound.
Referenced by GCGpricestoreGetNColsFound().
◆ GCGpricestoreGetNColsFoundRound()
| int GCGpricestoreGetNColsFoundRound | ( | GCG_PRICESTORE * | pricestore | ) |
get number of cols found so far in current price round
- Parameters
-
pricestore price storage
Definition at line 908 of file pricestore_gcg.c.
References assert(), GCGpricestoreGetNColsFoundRound(), and GCG_PriceStore::ncolsfoundround.
Referenced by GCGpricestoreGetNColsFoundRound().
◆ GCGpricestoreGetNColsApplied()
| int GCGpricestoreGetNColsApplied | ( | GCG_PRICESTORE * | pricestore | ) |
get total number of cols applied to the LPs
- Parameters
-
pricestore price storage
Definition at line 918 of file pricestore_gcg.c.
References assert(), GCGpricestoreGetNColsApplied(), and GCG_PriceStore::ncolsapplied.
Referenced by GCGpricestoreGetNColsApplied().