34#ifndef __SCIP_HISTORY_H__
35#define __SCIP_HISTORY_H__
73 SCIP_Bool switcheddirs
82 SCIP_Real solvaldelta,
132 SCIP_Real solvaldelta
278#define SCIPbranchdirOpposite(dir) \
279 ((dir) == SCIP_BRANCHDIR_DOWNWARDS ? SCIP_BRANCHDIR_UPWARDS \
280 : ((dir) == SCIP_BRANCHDIR_UPWARDS ? SCIP_BRANCHDIR_DOWNWARDS : SCIP_BRANCHDIR_AUTO))
281#define SCIPhistoryGetPseudocost(history,solvaldelta) \
282 ( (solvaldelta) >= 0.0 ? (solvaldelta) * ((history)->pscostcount[1] > 0.0 \
283 ? (history)->pscostweightedmean[1] : 1.0) \
284 : -(solvaldelta) * ((history)->pscostcount[0] > 0.0 \
285 ? (history)->pscostweightedmean[0] : 1.0) )
286#define SCIPhistoryGetPseudocostVariance(history, dir) \
287 ( (history)->pscostcount[dir] >= 1.9 ? 1 / ((history)->pscostcount[dir] - 1) \
288 * ((history)->pscostvariance[dir]) \
290#define SCIPhistoryGetPseudocostCount(history,dir) ((history)->pscostcount[dir])
291#define SCIPhistoryIsPseudocostEmpty(history,dir) ((history)->pscostcount[dir] == 0.0)
292#define SCIPhistoryIncVSIDS(history,dir,weight) (history)->vsids[dir] += (weight)
293#define SCIPhistoryScaleVSIDS(history,scalar) { (history)->vsids[0] *= (scalar); \
294 (history)->vsids[1] *= (scalar); }
295#define SCIPhistoryIncNActiveConflicts(history,dir,length) { (history)->nactiveconflicts[dir]++; \
296 (history)->conflengthsum[dir] += length; }
297#define SCIPhistoryGetNActiveConflicts(history,dir) ((history)->nactiveconflicts[dir])
298#define SCIPhistoryIncNBranchings(history,dir,depth) { (history)->nbranchings[dir]++; \
299 (history)->branchdepthsum[dir] += depth; }
300#define SCIPhistoryIncInferenceSum(history,dir,weight) (history)->inferencesum[dir] += (weight)
301#define SCIPhistoryIncCutoffSum(history,dir,weight) (history)->cutoffsum[dir] += (weight)
302#define SCIPhistoryGetNBranchings(history,dir) ((history)->nbranchings[dir])
303#define SCIPhistoryGetAvgInferences(history,dir) ((history)->nbranchings[dir] > 0 \
304 ? (SCIP_Real)(history)->inferencesum[dir]/(SCIP_Real)(history)->nbranchings[dir] : 0.0)
305#define SCIPhistoryGetAvgCutoffs(history,dir) ((history)->nbranchings[dir] > 0 \
306 ? (SCIP_Real)(history)->cutoffsum[dir]/(SCIP_Real)(history)->nbranchings[dir] : 0.0)
307#define SCIPhistoryGetAvgBranchdepth(history,dir) ((history)->nbranchings[dir] > 0 \
308 ? (SCIP_Real)(history)->branchdepthsum[dir]/(SCIP_Real)(history)->nbranchings[dir] : 1.0)
309#define SCIPhistoryIsRatioValid(history) ((history)->ratiovalid)
310#define SCIPhistoryGetLastRatio(history) ((history)->ratio)
311#define SCIPhistorySetRatioHistory(history,newvalid,newratio,newbalance) (history)->ratiovalid = newvalid, \
312 (history)->ratio = newratio, (history)->balance = newbalance
313#define SCIPhistoryGetLastBalance(history) ((history)->balance)
314#define SCIPhistoryGetLastGMIeff(history) ((history)->gmieff)
315#define SCIPhistorySetLastGMIeff(history,newgmieff) (history)->gmieff = newgmieff
316#define SCIPhistoryGetAvgGMIeff(history) ((history)->ngmi > 0 \
317 ? (SCIP_Real)(history)->gmieffsum/(SCIP_Real)(history)->ngmi : 0.0)
318#define SCIPhistoryIncGMIeffSum(history, newgmieff) { (history)->gmieffsum += newgmieff; \
319 (history)->ngmi += 1; }
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPvaluehistoryCreate(SCIP_VALUEHISTORY **valuehistory, BMS_BLKMEM *blkmem)
SCIP_RETCODE SCIPvaluehistoryFind(SCIP_VALUEHISTORY *valuehistory, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_Real value, SCIP_HISTORY **history)
void SCIPvaluehistoryFree(SCIP_VALUEHISTORY **valuehistory, BMS_BLKMEM *blkmem)
void SCIPvaluehistoryScaleVSIDS(SCIP_VALUEHISTORY *valuehistory, SCIP_Real scalar)
void SCIPhistoryReset(SCIP_HISTORY *history)
SCIP_Real SCIPhistoryGetPseudocost(SCIP_HISTORY *history, SCIP_Real solvaldelta)
SCIP_Real SCIPhistoryGetAvgInferences(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
void SCIPhistorySetRatioHistory(SCIP_HISTORY *history, SCIP_Bool valid, SCIP_Real ratio, SCIP_Real balance)
SCIP_Longint SCIPhistoryGetNActiveConflicts(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
SCIP_Longint SCIPhistoryGetNBranchings(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
SCIP_Real SCIPhistoryGetAvgCutoffs(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
SCIP_RETCODE SCIPhistoryCreate(SCIP_HISTORY **history, BMS_BLKMEM *blkmem)
void SCIPhistorySetLastGMIeff(SCIP_HISTORY *history, SCIP_Real gmieff)
SCIP_Real SCIPhistoryGetLastRatio(SCIP_HISTORY *history)
void SCIPhistoryIncInferenceSum(SCIP_HISTORY *history, SCIP_BRANCHDIR dir, SCIP_Real weight)
SCIP_Real SCIPhistoryGetPseudocostCount(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
SCIP_Bool SCIPhistoryIsPseudocostEmpty(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
SCIP_Real SCIPhistoryGetPseudocostVariance(SCIP_HISTORY *history, SCIP_BRANCHDIR direction)
void SCIPhistoryIncNActiveConflicts(SCIP_HISTORY *history, SCIP_BRANCHDIR dir, SCIP_Real length)
void SCIPhistoryScaleVSIDS(SCIP_HISTORY *history, SCIP_Real scalar)
void SCIPhistoryIncCutoffSum(SCIP_HISTORY *history, SCIP_BRANCHDIR dir, SCIP_Real weight)
void SCIPhistoryIncNBranchings(SCIP_HISTORY *history, SCIP_BRANCHDIR dir, int depth)
void SCIPhistoryUpdatePseudocost(SCIP_HISTORY *history, SCIP_SET *set, SCIP_Real solvaldelta, SCIP_Real objdelta, SCIP_Real weight)
SCIP_Bool SCIPhistoryIsRatioValid(SCIP_HISTORY *history)
SCIP_Real SCIPhistoryGetAvgBranchdepth(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
SCIP_Real SCIPhistoryGetLastBalance(SCIP_HISTORY *history)
SCIP_Real SCIPhistoryGetLastGMIeff(SCIP_HISTORY *history)
SCIP_Real SCIPhistoryGetAvgGMIeff(SCIP_HISTORY *history)
void SCIPhistoryFree(SCIP_HISTORY **history, BMS_BLKMEM *blkmem)
void SCIPhistoryUnite(SCIP_HISTORY *history, SCIP_HISTORY *addhistory, SCIP_Bool switcheddirs)
void SCIPhistoryIncGMIeffSum(SCIP_HISTORY *history, SCIP_Real gmieff)
SCIP_BRANCHDIR SCIPbranchdirOpposite(SCIP_BRANCHDIR dir)
void SCIPhistoryIncVSIDS(SCIP_HISTORY *history, SCIP_BRANCHDIR dir, SCIP_Real weight)
memory allocation routines
struct BMS_BlkMem BMS_BLKMEM
datastructures for branching and inference history
type definitions for branching and inference history
enum SCIP_BranchDir SCIP_BRANCHDIR
type definitions for return codes for SCIP methods
enum SCIP_Retcode SCIP_RETCODE
type definitions for global SCIP settings