Scippy

SCIP

Solving Constraint Integer Programs

pub_history.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2022 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file pub_history.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for branching and inference history structure
19  * @author Stefan Heinz
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_PUB_HISTORY_H__
25 #define __SCIP_PUB_HISTORY_H__
26 
27 #include "scip/def.h"
28 #include "scip/type_history.h"
29 
30 #ifdef NDEBUG
31 #include "scip/struct_history.h"
32 #endif
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 /** gets the conflict score of the history entry */
39 SCIP_EXPORT
41  SCIP_HISTORY* history, /**< branching and inference history */
42  SCIP_BRANCHDIR dir /**< branching direction */
43  );
44 
45 /** gets the average conflict length of the history entry */
46 SCIP_EXPORT
48  SCIP_HISTORY* history, /**< branching and inference history */
49  SCIP_BRANCHDIR dir /**< branching direction */
50  );
51 
52 /** get number of cutoffs counter */
53 SCIP_EXPORT
55  SCIP_HISTORY* history, /**< branching and inference history */
56  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
57  );
58 
59 /** get number of inferences counter */
60 SCIP_EXPORT
62  SCIP_HISTORY* history, /**< branching and inference history */
63  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
64  );
65 
66 /** return the number of (domain) values for which a history exists */
67 SCIP_EXPORT
69  SCIP_VALUEHISTORY* valuehistory /**< value based history */
70  );
71 
72 /** return the array containing the histories for the individual (domain) values */
73 SCIP_EXPORT
75  SCIP_VALUEHISTORY* valuehistory /**< value based history */
76  );
77 
78 /** return the array containing the (domain) values for which a history exists */
79 SCIP_EXPORT
81  SCIP_VALUEHISTORY* valuehistory /**< value based history */
82  );
83 
84 #ifdef NDEBUG
85 
86 /* In optimized mode, the methods are implemented as defines to reduce the number of function calls and
87  * speed up the algorithms.
88  */
89 
90 #define SCIPhistoryGetVSIDS(history,dir) ((history)->vsids[dir])
91 #define SCIPhistoryGetAvgConflictlength(history,dir) ((history)->conflengthsum[dir] > 0.0 \
92  ? (SCIP_Real)(history)->nactiveconflicts[dir]/(SCIP_Real)(history)->conflengthsum[dir] : 0.0)
93 #define SCIPhistoryGetCutoffSum(history,dir) ((history)->cutoffsum[dir])
94 #define SCIPhistoryGetInferenceSum(history,dir) ((history)->inferencesum[dir])
95 #define SCIPvaluehistoryGetNValues(valuehistory) (valuehistory)->nvalues
96 #define SCIPvaluehistoryGetHistories(valuehistory) (valuehistory)->histories
97 #define SCIPvaluehistoryGetValues(valuehistory) (valuehistory)->values
98 
99 #endif
100 
101 
102 #ifdef __cplusplus
103 }
104 #endif
105 
106 #endif
SCIP_Real SCIPhistoryGetAvgConflictlength(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
Definition: history.c:562
int SCIPvaluehistoryGetNValues(SCIP_VALUEHISTORY *valuehistory)
Definition: history.c:351
SCIP_HISTORY ** SCIPvaluehistoryGetHistories(SCIP_VALUEHISTORY *valuehistory)
Definition: history.c:361
enum SCIP_BranchDir SCIP_BRANCHDIR
Definition: type_history.h:39
SCIP_Real SCIPhistoryGetVSIDS(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
Definition: history.c:520
datastructures for branching and inference history
SCIP_Real * SCIPvaluehistoryGetValues(SCIP_VALUEHISTORY *valuehistory)
Definition: history.c:371
SCIP_Real SCIPhistoryGetInferenceSum(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
Definition: history.c:636
#define SCIP_Real
Definition: def.h:177
SCIP_Real SCIPhistoryGetCutoffSum(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
Definition: history.c:662
type definitions for branching and inference history
common defines and data types used in all packages of SCIP