34#ifndef __SCIP_HISTORY_H__
35#define __SCIP_HISTORY_H__
309#define SCIPbranchdirOpposite(dir) \
310 ((dir) == SCIP_BRANCHDIR_DOWNWARDS ? SCIP_BRANCHDIR_UPWARDS \
311 : ((dir) == SCIP_BRANCHDIR_UPWARDS ? SCIP_BRANCHDIR_DOWNWARDS : SCIP_BRANCHDIR_AUTO))
312#define SCIPhistoryGetPseudocost(history,solvaldelta) \
313 ( (solvaldelta) >= 0.0 ? (solvaldelta) * ((history)->pscostcount[1] > 0.0 \
314 ? (history)->pscostweightedmean[1] : 1.0) \
315 : -(solvaldelta) * ((history)->pscostcount[0] > 0.0 \
316 ? (history)->pscostweightedmean[0] : 1.0) )
317#define SCIPhistoryGetAncPseudocost(history,solvaldelta) \
318 ( (solvaldelta) >= 0.0 ? (solvaldelta) * ((history)->ancpscostcount[1] > 0.0 \
319 ? (history)->ancpscostweightedmean[1] : 1.0) \
320 : -(solvaldelta) * ((history)->ancpscostcount[0] > 0.0 \
321 ? (history)->ancpscostweightedmean[0] : 1.0) )
322#define SCIPhistoryGetPseudocostVariance(history, dir) \
323 ( (history)->pscostcount[dir] >= 1.9 ? 1 / ((history)->pscostcount[dir] - 1) \
324 * ((history)->pscostvariance[dir]) \
326#define SCIPhistoryGetPseudocostCount(history,dir) ((history)->pscostcount[dir])
327#define SCIPhistoryGetAncPseudocostCount(history,dir) ((history)->ancpscostcount[dir])
328#define SCIPhistoryIsPseudocostEmpty(history,dir) ((history)->pscostcount[dir] == 0.0)
329#define SCIPhistoryIsAncPseudocostEmpty(history,dir) ((history)->ancpscostcount[dir] == 0.0)
330#define SCIPhistoryIncVSIDS(history,dir,weight) (history)->vsids[dir] += (weight)
331#define SCIPhistoryScaleVSIDS(history,scalar) { (history)->vsids[0] *= (scalar); \
332 (history)->vsids[1] *= (scalar); }
333#define SCIPhistoryIncNActiveConflicts(history,dir,length) { (history)->nactiveconflicts[dir]++; \
334 (history)->conflengthsum[dir] += length; }
335#define SCIPhistoryGetNActiveConflicts(history,dir) ((history)->nactiveconflicts[dir])
336#define SCIPhistoryIncNBranchings(history,dir,depth) { (history)->nbranchings[dir]++; \
337 (history)->branchdepthsum[dir] += depth; }
338#define SCIPhistoryIncInferenceSum(history,dir,weight) (history)->inferencesum[dir] += (weight)
339#define SCIPhistoryIncCutoffSum(history,dir,weight) (history)->cutoffsum[dir] += (weight)
340#define SCIPhistoryGetNBranchings(history,dir) ((history)->nbranchings[dir])
341#define SCIPhistoryGetAvgInferences(history,dir) ((history)->nbranchings[dir] > 0 \
342 ? (SCIP_Real)(history)->inferencesum[dir]/(SCIP_Real)(history)->nbranchings[dir] : 0.0)
343#define SCIPhistoryGetAvgCutoffs(history,dir) ((history)->nbranchings[dir] > 0 \
344 ? (SCIP_Real)(history)->cutoffsum[dir]/(SCIP_Real)(history)->nbranchings[dir] : 0.0)
345#define SCIPhistoryGetAvgBranchdepth(history,dir) ((history)->nbranchings[dir] > 0 \
346 ? (SCIP_Real)(history)->branchdepthsum[dir]/(SCIP_Real)(history)->nbranchings[dir] : 1.0)
347#define SCIPhistoryIsRatioValid(history) ((history)->ratiovalid)
348#define SCIPhistoryGetLastRatio(history) ((history)->ratio)
349#define SCIPhistorySetRatioHistory(history,newvalid,newratio,newbalance) (history)->ratiovalid = newvalid, \
350 (history)->ratio = newratio, (history)->balance = newbalance
351#define SCIPhistoryGetLastBalance(history) ((history)->balance)
352#define SCIPhistoryGetLastGMIeff(history) ((history)->gmieff)
353#define SCIPhistorySetLastGMIeff(history,newgmieff) (history)->gmieff = newgmieff
354#define SCIPhistoryGetAvgGMIeff(history) ((history)->ngmi > 0 \
355 ? (SCIP_Real)(history)->gmieffsum/(SCIP_Real)(history)->ngmi : 0.0)
356#define SCIPhistoryIncGMIeffSum(history, newgmieff) { (history)->gmieffsum += newgmieff; \
357 (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)
SCIP_Real SCIPhistoryGetAncPseudocostCount(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
void SCIPhistorySetLastGMIeff(SCIP_HISTORY *history, SCIP_Real gmieff)
void SCIPhistoryUpdateAncPseudocost(SCIP_HISTORY *history, SCIP_SET *set, SCIP_Real solvaldelta, SCIP_Real objdelta, SCIP_Real weight)
SCIP_Real SCIPhistoryGetLastRatio(SCIP_HISTORY *history)
void SCIPhistoryIncInferenceSum(SCIP_HISTORY *history, SCIP_BRANCHDIR dir, SCIP_Real weight)
SCIP_Real SCIPhistoryGetAncPseudocost(SCIP_HISTORY *history, SCIP_Real solvaldelta)
SCIP_Real SCIPhistoryGetPseudocostCount(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
SCIP_Bool SCIPhistoryIsPseudocostEmpty(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
SCIP_Bool SCIPhistoryIsAncPseudocostEmpty(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
struct SCIP_History SCIP_HISTORY
struct SCIP_ValueHistory SCIP_VALUEHISTORY
enum SCIP_BranchDir SCIP_BRANCHDIR
type definitions for return codes for SCIP methods
enum SCIP_Retcode SCIP_RETCODE
type definitions for global SCIP settings