25 #ifndef __SCIP_HISTORY_H__ 26 #define __SCIP_HISTORY_H__ 263 #define SCIPbranchdirOpposite(dir) \ 264 ((dir) == SCIP_BRANCHDIR_DOWNWARDS ? SCIP_BRANCHDIR_UPWARDS \ 265 : ((dir) == SCIP_BRANCHDIR_UPWARDS ? SCIP_BRANCHDIR_DOWNWARDS : SCIP_BRANCHDIR_AUTO)) 266 #define SCIPhistoryGetPseudocost(history,solvaldelta) \ 267 ( (solvaldelta) >= 0.0 ? (solvaldelta) * ((history)->pscostcount[1] > 0.0 \ 268 ? (history)->pscostweightedmean[1] : 1.0) \ 269 : -(solvaldelta) * ((history)->pscostcount[0] > 0.0 \ 270 ? (history)->pscostweightedmean[0] : 1.0) ) 271 #define SCIPhistoryGetPseudocostVariance(history, dir) \ 272 ( (history)->pscostcount[dir] >= 1.9 ? 1 / ((history)->pscostcount[dir] - 1) \ 273 * ((history)->pscostvariance[dir]) \ 275 #define SCIPhistoryGetPseudocostCount(history,dir) ((history)->pscostcount[dir]) 276 #define SCIPhistoryIsPseudocostEmpty(history,dir) ((history)->pscostcount[dir] == 0.0) 277 #define SCIPhistoryIncVSIDS(history,dir,weight) (history)->vsids[dir] += (weight) 278 #define SCIPhistoryScaleVSIDS(history,scalar) { (history)->vsids[0] *= (scalar); \ 279 (history)->vsids[1] *= (scalar); } 280 #define SCIPhistoryIncNActiveConflicts(history,dir,length) { (history)->nactiveconflicts[dir]++; \ 281 (history)->conflengthsum[dir] += length; } 282 #define SCIPhistoryGetNActiveConflicts(history,dir) ((history)->nactiveconflicts[dir]) 283 #define SCIPhistoryGetAvgConflictlength(history,dir) ((history)->conflengthsum[dir] > 0.0 \ 284 ? (SCIP_Real)(history)->nactiveconflicts[dir]/(SCIP_Real)(history)->conflengthsum[dir] : 0.0) 285 #define SCIPhistoryIncNBranchings(history,dir,depth) { (history)->nbranchings[dir]++; \ 286 (history)->branchdepthsum[dir] += depth; } 287 #define SCIPhistoryIncInferenceSum(history,dir,weight) (history)->inferencesum[dir] += (weight) 288 #define SCIPhistoryIncCutoffSum(history,dir,weight) (history)->cutoffsum[dir] += (weight) 289 #define SCIPhistoryGetNBranchings(history,dir) ((history)->nbranchings[dir]) 290 #define SCIPhistoryGetInferenceSum(history,dir) ((history)->inferencesum[dir]) 291 #define SCIPhistoryGetAvgInferences(history,dir) ((history)->nbranchings[dir] > 0 \ 292 ? (SCIP_Real)(history)->inferencesum[dir]/(SCIP_Real)(history)->nbranchings[dir] : 0.0) 293 #define SCIPhistoryGetCutoffSum(history,dir) ((history)->cutoffsum[dir]) 294 #define SCIPhistoryGetAvgCutoffs(history,dir) ((history)->nbranchings[dir] > 0 \ 295 ? (SCIP_Real)(history)->cutoffsum[dir]/(SCIP_Real)(history)->nbranchings[dir] : 0.0) 296 #define SCIPhistoryGetAvgBranchdepth(history,dir) ((history)->nbranchings[dir] > 0 \ 297 ? (SCIP_Real)(history)->branchdepthsum[dir]/(SCIP_Real)(history)->nbranchings[dir] : 1.0) void SCIPhistoryFree(SCIP_HISTORY **history, BMS_BLKMEM *blkmem)
SCIP_Real SCIPhistoryGetAvgConflictlength(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
SCIP_RETCODE SCIPvaluehistoryCreate(SCIP_VALUEHISTORY **valuehistory, BMS_BLKMEM *blkmem)
void SCIPhistoryIncVSIDS(SCIP_HISTORY *history, SCIP_BRANCHDIR dir, SCIP_Real weight)
void SCIPhistoryIncCutoffSum(SCIP_HISTORY *history, SCIP_BRANCHDIR dir, SCIP_Real weight)
SCIP_RETCODE SCIPhistoryCreate(SCIP_HISTORY **history, BMS_BLKMEM *blkmem)
void SCIPvaluehistoryScaleVSIDS(SCIP_VALUEHISTORY *valuehistory, SCIP_Real scalar)
void SCIPhistoryIncInferenceSum(SCIP_HISTORY *history, SCIP_BRANCHDIR dir, SCIP_Real weight)
enum SCIP_Retcode SCIP_RETCODE
type definitions for global SCIP settings
void SCIPhistoryReset(SCIP_HISTORY *history)
SCIP_Real SCIPhistoryGetPseudocost(SCIP_HISTORY *history, SCIP_Real solvaldelta)
type definitions for return codes for SCIP methods
SCIP_Real SCIPhistoryGetAvgCutoffs(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
enum SCIP_BranchDir SCIP_BRANCHDIR
SCIP_Real SCIPhistoryGetAvgBranchdepth(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
SCIP_RETCODE SCIPvaluehistoryFind(SCIP_VALUEHISTORY *valuehistory, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_Real value, SCIP_HISTORY **history)
void SCIPhistoryScaleVSIDS(SCIP_HISTORY *history, SCIP_Real scalar)
void SCIPvaluehistoryFree(SCIP_VALUEHISTORY **valuehistory, BMS_BLKMEM *blkmem)
void SCIPhistoryIncNActiveConflicts(SCIP_HISTORY *history, SCIP_BRANCHDIR dir, SCIP_Real length)
SCIP_Real SCIPhistoryGetPseudocostVariance(SCIP_HISTORY *history, SCIP_BRANCHDIR direction)
void SCIPhistoryUnite(SCIP_HISTORY *history, SCIP_HISTORY *addhistory, SCIP_Bool switcheddirs)
SCIP_Real SCIPhistoryGetPseudocostCount(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
SCIP_Bool SCIPhistoryIsPseudocostEmpty(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
SCIP_Longint SCIPhistoryGetNActiveConflicts(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
void SCIPhistoryUpdatePseudocost(SCIP_HISTORY *history, SCIP_SET *set, SCIP_Real solvaldelta, SCIP_Real objdelta, SCIP_Real weight)
SCIP_Longint SCIPhistoryGetNBranchings(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
datastructures for branching and inference history
SCIP_BRANCHDIR SCIPbranchdirOpposite(SCIP_BRANCHDIR dir)
SCIP_Real SCIPhistoryGetAvgInferences(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
type definitions for branching and inference history
SCIP_Real SCIPhistoryGetInferenceSum(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
void SCIPhistoryIncNBranchings(SCIP_HISTORY *history, SCIP_BRANCHDIR dir, int depth)
memory allocation routines