1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /*                                                                           */
3 /*                  This file is part of the program and library             */
4 /*         SCIP --- Solving Constraint Integer Programs                      */
5 /*                                                                           */
6 /*    Copyright (C) 2002-2021 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_branch.h
17  * @ingroup PUBLICCOREAPI
18  * @brief  public methods for branching rules
19  * @author Tobias Achterberg
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_PUB_BRANCH_H__
25 #define __SCIP_PUB_BRANCH_H__
26 
27 
28 #include "scip/def.h"
29 #include "scip/type_misc.h"
30 #include "scip/type_branch.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /**@addtogroup PublicBranchRuleMethods
37  *
38  * @{
39  */
40 
41 /** compares two branching rules w. r. to their priority */
42 SCIP_EXPORT
43 SCIP_DECL_SORTPTRCOMP(SCIPbranchruleComp);
44 
45 /** comparison method for sorting branching rules w.r.t. to their name */
46 SCIP_EXPORT
47 SCIP_DECL_SORTPTRCOMP(SCIPbranchruleCompName);
48 
49 /** gets user data of branching rule */
50 SCIP_EXPORT
51 SCIP_BRANCHRULEDATA* SCIPbranchruleGetData(
52    SCIP_BRANCHRULE*      branchrule          /**< branching rule */
53    );
54 
55 /** sets user data of branching rule; user has to free old data in advance! */
56 SCIP_EXPORT
57 void SCIPbranchruleSetData(
58    SCIP_BRANCHRULE*      branchrule,         /**< branching rule */
59    SCIP_BRANCHRULEDATA*  branchruledata      /**< new branching rule user data */
60    );
61 
62 /** gets name of branching rule */
63 SCIP_EXPORT
64 const char* SCIPbranchruleGetName(
65    SCIP_BRANCHRULE*      branchrule          /**< branching rule */
66    );
67 
68 /** gets description of branching rule */
69 SCIP_EXPORT
70 const char* SCIPbranchruleGetDesc(
71    SCIP_BRANCHRULE*      branchrule          /**< branching rule */
72    );
73 
74 /** gets priority of branching rule */
75 SCIP_EXPORT
76 int SCIPbranchruleGetPriority(
77    SCIP_BRANCHRULE*      branchrule          /**< branching rule */
78    );
79 
80 /** gets maximal depth level, up to which this branching rule should be used (-1 for no limit) */
81 SCIP_EXPORT
82 int SCIPbranchruleGetMaxdepth(
83    SCIP_BRANCHRULE*      branchrule          /**< branching rule */
84    );
85 
86 /** gets maximal relative distance from current node's dual bound to primal bound for applying branching rule */
87 SCIP_EXPORT
88 SCIP_Real SCIPbranchruleGetMaxbounddist(
89    SCIP_BRANCHRULE*      branchrule          /**< branching rule */
90    );
91 
92 /** gets time in seconds used in this branching rule for setting up for next stages */
93 SCIP_EXPORT
94 SCIP_Real SCIPbranchruleGetSetupTime(
95    SCIP_BRANCHRULE*      branchrule          /**< branching rule */
96    );
97 
98 /** gets time in seconds used in this branching rule */
99 SCIP_EXPORT
100 SCIP_Real SCIPbranchruleGetTime(
101    SCIP_BRANCHRULE*      branchrule          /**< branching rule */
102    );
103 
104 /** gets the total number of times, the branching rule was called on an LP solution */
105 SCIP_EXPORT
106 SCIP_Longint SCIPbranchruleGetNLPCalls(
107    SCIP_BRANCHRULE*      branchrule          /**< branching rule */
108    );
109 
110 /** gets the total number of times, the branching rule was called on external candidates */
111 SCIP_EXPORT
112 SCIP_Longint SCIPbranchruleGetNExternCalls(
113    SCIP_BRANCHRULE*      branchrule          /**< branching rule */
114    );
115 
116 /** gets the total number of times, the branching rule was called on a pseudo solution */
117 SCIP_EXPORT
118 SCIP_Longint SCIPbranchruleGetNPseudoCalls(
119    SCIP_BRANCHRULE*      branchrule          /**< branching rule */
120    );
121 
122 /** gets the total number of times, the branching rule detected a cutoff */
123 SCIP_EXPORT
124 SCIP_Longint SCIPbranchruleGetNCutoffs(
125    SCIP_BRANCHRULE*      branchrule          /**< branching rule */
126    );
127 
128 /** gets the total number of cuts, the branching rule separated */
129 SCIP_EXPORT
130 SCIP_Longint SCIPbranchruleGetNCutsFound(
131    SCIP_BRANCHRULE*      branchrule          /**< branching rule */
132    );
133 
134 /** gets the total number of constraints, the branching rule added to the respective local nodes (not counting constraints
135  *  that were added to the child nodes as branching decisions)
136  */
137 SCIP_EXPORT
138 SCIP_Longint SCIPbranchruleGetNConssFound(
139    SCIP_BRANCHRULE*      branchrule          /**< branching rule */
140    );
141 
142 /** gets the total number of domain reductions, the branching rule found */
143 SCIP_EXPORT
144 SCIP_Longint SCIPbranchruleGetNDomredsFound(
145    SCIP_BRANCHRULE*      branchrule          /**< branching rule */
146    );
147 
148 /** gets the total number of children, the branching rule created */
149 SCIP_EXPORT
150 SCIP_Longint SCIPbranchruleGetNChildren(
151    SCIP_BRANCHRULE*      branchrule          /**< branching rule */
152    );
153 
154 /** is branching rule initialized? */
155 SCIP_EXPORT
156 SCIP_Bool SCIPbranchruleIsInitialized(
157    SCIP_BRANCHRULE*      branchrule          /**< branching rule */
158    );
159 
160 /** @} */
161 
162 #ifdef __cplusplus
163 }
164 #endif
165 
166 #endif
167