Loading...
Searching...
No Matches
heur_gcgpscostdiving.c
Go to the documentation of this file.
35/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
59#define DEFAULT_USEMASTERPSCOSTS FALSE /**< shall pseudocosts be calculated w.r.t. the master problem? */
103 SCIP_CALL( SCIPsetSolVal(masterprob, masterrootsol, mastervars[i], SCIPvarGetRootSol(mastervars[i])) );
224/** calculates the down-pseudocost for a given original variable w.r.t. the master variables in which it is contained */
251 SCIP_CALL( SCIPgetVarsData(masterprob, &mastervars, NULL, &nbinmastervars, &nintmastervars, NULL, NULL) );
298/** calculates the up-pseudocost for a given original variable w.r.t. the master variables in which it is contained */
325 SCIP_CALL( SCIPgetVarsData(masterprob, &mastervars, NULL, &nbinmastervars, &nintmastervars, NULL, NULL) );
372/** calculates the pseudocost score for a given variable w.r.t. a given solution value and a given rounding direction */
409 SCIPdebugMessage("Pseudocosts of variable %s: %g down, %g up\n", SCIPvarGetName(var), pscostdown, pscostup);
510/** execution initialization method of diving heuristic (called when execution of diving heuristic is about to begin) */
537/** execution deinitialization method of diving heuristic (called when execution data is freed) */
560 * - of these variables, round variable with largest rel. difference of pseudo cost values in corresponding
592 SCIP_CALL( SCIPgetExternBranchCands(origprob, &lpcands, &lpcandssol, NULL, &nlpcands, NULL, NULL, NULL, NULL) );
632 /* the candidate may be rounded: choose this candidate only, if the best candidate may also be rounded */
636 * - if variable may be rounded in both directions, round corresponding to the pseudo cost values
637 * - otherwise, round in the infeasible direction, because feasible direction is tried by rounding
643 SCIP_CALL( calcPscostQuot(gcg, divingdata, var, primsol, rootsolval, frac, 0, &pscostquot, &roundup) );
647 SCIP_CALL( calcPscostQuot(gcg, divingdata, var, primsol, rootsolval, frac, +1, &pscostquot, &roundup) );
651 SCIP_CALL( calcPscostQuot(gcg, divingdata, var, primsol, rootsolval, frac, -1, &pscostquot, &roundup) );
668 SCIP_CALL( calcPscostQuot(gcg, divingdata, var, primsol, rootsolval, frac, 0, &pscostquot, &roundup) );
707 HEUR_MAXDEPTH, heurFreeGcgpscostdiving, heurInitGcgpscostdiving, heurExitGcgpscostdiving, NULL, NULL,
708 heurInitexecGcgpscostdiving, heurExitexecGcgpscostdiving, heurSelectVarGcgpscostdiving, divingdata) );
#define SCIP_Bool
#define MIN(x, y)
#define SCIP_Real
#define MAX(x, y)
#define TRUE
#define FALSE
GCG interface methods.
SCIP_VAR ** GCGoriginalVarGetMastervars(SCIP_VAR *var)
Definition gcgvar.c:666
SCIP_Real * GCGoriginalVarGetMastervals(SCIP_VAR *var)
Definition gcgvar.c:684
SCIP_Bool GCGisLinkingVarInBlock(SCIP_VAR *var, int block)
Definition gcgvar.c:1149
SCIP_RETCODE GCGtransformMastersolToOrigsol(GCG *gcg, SCIP_SOL *mastersol, SCIP_SOL **origsol, SCIP_Bool ignorelocalvarbnds, SCIP_Bool *violatesvarbnds)
Definition misc.c:135
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPgetExternBranchCands(SCIP *scip, SCIP_VAR ***externcands, SCIP_Real **externcandssol, SCIP_Real **externcandsscore, int *nexterncands, int *nprioexterncands, int *nprioexternbins, int *nprioexternints, int *nprioexternimpls)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPallocMemory(scip, ptr)
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
SCIP_RETCODE SCIPfreeSol(SCIP *scip, SCIP_SOL **sol)
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPfeasFrac(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasPositive(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPvarMayRoundUp(SCIP_VAR *var)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
SCIP_Bool SCIPvarMayRoundDown(SCIP_VAR *var)
int SCIPvarGetProbindex(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Real SCIPvarGetRootSol(SCIP_VAR *var)
SCIP_Real SCIPgetVarPseudocostVal(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta)
SCIP_Real SCIPgetRelaxSolVal(SCIP *scip, SCIP_VAR *var)
SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
SCIPfreeMemory(GCGgetOrigprob(gcg), &divingdata)
static assert(heur !=NULL)
SCIP_CALL(SCIPgetExternBranchCands(origprob, &lpcands, &lpcandssol, NULL, &nlpcands, NULL, NULL, NULL, NULL))
GCGheurSetDivingDataOrig(heur, NULL)
static SCIP_Bool areVarsInSameBlock(SCIP_VAR *origvar, SCIP_VAR *mastervar)
Definition heur_gcgcoefdiving.c:74
static SCIP_RETCODE getRootRelaxSol(GCG *gcg, SCIP_SOL **rootsol)
Definition heur_gcgdins.c:360
SCIPdebugMessage("feasibility pump finished [%d iterations done].\n", nloops)
SCIPfreeBufferArray(scip, &cycles)
SCIP_RETCODE GCGincludeHeurGcgpscostdiving(GCG *gcg)
Definition heur_gcgpscostdiving.c:693
static SCIP_RETCODE calcMasterPscosts(GCG *gcg, SCIP_Real **masterpscosts)
Definition heur_gcgpscostdiving.c:116
static SCIP_RETCODE calcPscostDownMaster(GCG *gcg, SCIP_VAR *var, SCIP_Real *masterpscosts, SCIP_Real *pscostdown)
Definition heur_gcgpscostdiving.c:226
static SCIP_RETCODE calcPscostQuot(GCG *gcg, GCG_DIVINGDATA *divingdata, SCIP_VAR *var, SCIP_Real primsol, SCIP_Real rootsolval, SCIP_Real frac, int rounddir, SCIP_Real *pscostquot, SCIP_Bool *roundup)
Definition heur_gcgpscostdiving.c:374
static SCIP_RETCODE calcPscostUpMaster(GCG *gcg, SCIP_VAR *var, SCIP_Real *masterpscosts, SCIP_Real *pscostup)
Definition heur_gcgpscostdiving.c:300
LP diving heuristic that chooses fixings w.r.t. the pseudo cost values.
SCIP_RETCODE GCGincludeDivingHeurOrig(GCG *gcg, SCIP_HEUR **heur, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, GCG_DECL_DIVINGFREE((*divingfree)), GCG_DECL_DIVINGINIT((*divinginit)), GCG_DECL_DIVINGEXIT((*divingexit)), GCG_DECL_DIVINGINITSOL((*divinginitsol)), GCG_DECL_DIVINGEXITSOL((*divingexitsol)), GCG_DECL_DIVINGINITEXEC((*divinginitexec)), GCG_DECL_DIVINGEXITEXEC((*divingexitexec)), GCG_DECL_DIVINGSELECTVAR((*divingselectvar)), GCG_DIVINGDATA *divingdata)
Definition heur_origdiving.c:1125
GCG_DIVINGDATA * GCGheurGetDivingDataOrig(SCIP_HEUR *heur)
Definition heur_origdiving.c:1092
primal heuristic interface for LP diving heuristics on the original variables
#define NULL
Definition class_conspartition.cpp:44
GCG variable pricer.
Definition heur_gcgcoefdiving.c:63
struct SCIP_Heur SCIP_HEUR
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP
struct SCIP_Sol SCIP_SOL
struct SCIP_Var SCIP_VAR