Scippy

SCIP

Solving Constraint Integer Programs

pub_reopt.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-2023 Zuse Institute Berlin (ZIB) */
7 /* */
8 /* Licensed under the Apache License, Version 2.0 (the "License"); */
9 /* you may not use this file except in compliance with the License. */
10 /* You may obtain a copy of the License at */
11 /* */
12 /* http://www.apache.org/licenses/LICENSE-2.0 */
13 /* */
14 /* Unless required by applicable law or agreed to in writing, software */
15 /* distributed under the License is distributed on an "AS IS" BASIS, */
16 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17 /* See the License for the specific language governing permissions and */
18 /* limitations under the License. */
19 /* */
20 /* You should have received a copy of the Apache-2.0 license */
21 /* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22 /* */
23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24 
25 /**@file pub_reopt.h
26  * @ingroup PUBLICCOREAPI
27  * @brief public methods for reoptimization
28  * @author Jakob Witzig
29  */
30 
31 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32 
33 #ifndef __SCIP_PUB_REOPT_H__
34 #define __SCIP_PUB_REOPT_H__
35 
36 #include "scip/def.h"
37 #include "scip/type_lp.h"
38 #include "scip/type_reopt.h"
39 #include "scip/type_var.h"
40 
41 #ifdef NDEBUG
42 #include "scip/struct_reopt.h"
43 #endif
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 /*
50  * ReoptNode methods
51  */
52 
53 /** returns the number of bound changes stored in the reoptnode */
54 SCIP_EXPORT
56  SCIP_REOPTNODE* reoptnode /**< node of the reoptimization tree */
57  );
58 
59 /** returns the number of bound changes at the node stored at ID id */
60 SCIP_EXPORT
62  SCIP_REOPTNODE* reoptnode /**< node of the reoptimization tree */
63  );
64 
65 /** returns the number of stored bound changes based on dual information in the reopttree at ID id */
66 SCIP_EXPORT
68  SCIP_REOPTNODE* reoptnode /**< node of the reoptimization tree */
69  );
70 
71 /** returns the number of child nodes of @p reoptnode */
72 SCIP_EXPORT
74  SCIP_REOPTNODE* reoptnode /**< node of the reoptimizzation tree */
75  );
76 
77 /* return the lower bound stored at @p ID id */
78 SCIP_EXPORT
80  SCIP_REOPTNODE* reoptnode /**< node of the reoptimization tree */
81  );
82 
83 /** returns the type of the @p reoptnode */
84 SCIP_EXPORT
86  SCIP_REOPTNODE* reoptnode /**< node of the reoptimization tree */
87  );
88 
89 /** create the constraint which splits the node stored at ID id on the basis of the stored dual information. */
90 SCIP_EXPORT
92  SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
93  SCIP_VAR** vars, /**< array to store the variables of the constraint */
94  SCIP_Real* vals, /**< array to store the coefficients of the variables */
95  REOPT_CONSTYPE* constype, /**< type of the constraint */
96  int conssize, /**< size of the arrays */
97  int* nvars /**< pointer to store the size of the constraints */
98  );
99 
100 /** returns all added constraints at ID id */
101 SCIP_EXPORT
103  SCIP_REOPTNODE* reoptnode, /**< reoptimization data structure */
104  SCIP_VAR*** vars, /**< 2-dim array of variables */
105  SCIP_Real** bounds, /**< 2-dim array of bounds */
106  SCIP_BOUNDTYPE** boundtypes, /**< 2-dim array of boundtypes */
107  int mem, /**< allocated memory for constraints */
108  int* nconss, /**< pointer to store the number of constraints */
109  int* nvars /**< pointer to store the number of variables */
110  );
111 
112 /** set the parent id */
113 SCIP_EXPORT
115  SCIP_REOPTNODE* reoptnode, /**< node of the reopttree */
116  unsigned int parentid /**< id of the parent node */
117  );
118 
119 /*
120  * Reopt methods
121  */
122 
123 /** returns the number of global restarts */
124 SCIP_EXPORT
126  SCIP_REOPT* reopt /**< reoptimization data */
127  );
128 
129 /** returns the number of local restarts in the current run */
131  SCIP_REOPT* reopt /**< reoptimization data structure */
132  );
133 
134 /** returns the number of local restarts over all runs */
136  SCIP_REOPT* reopt /**< reoptimization data structure */
137  );
138 
139 /** returns the number of iteration with the first global restarts */
140 SCIP_EXPORT
142  SCIP_REOPT* reopt /**< reoptimization data structure */
143  );
144 
145 /** returns the number of iteration with the last global restarts */
146 SCIP_EXPORT
148  SCIP_REOPT* reopt /**< reoptimization data structure */
149  );
150 
151 /** returns the number of nodes providing an improving feasible LP solution in the current run */
152 SCIP_EXPORT
154  SCIP_REOPT* reopt /**< reoptimization data structure */
155  );
156 
157 /** returns the number of nodes providing an improving feasible LP solution over all runs */
158 SCIP_EXPORT
160  SCIP_REOPT* reopt /**< reoptimization data structure */
161  );
162 
163 /** returns the number of nodes that exceeded the cutoff bound in the current run */
164 SCIP_EXPORT
166  SCIP_REOPT* reopt /**< reoptimization data structure */
167  );
168 
169 /** returns the number of nodes that exceeded the cutoff bound over all runs */
170 SCIP_EXPORT
172  SCIP_REOPT* reopt /**< reoptimization data structure */
173  );
174 
175 /** returns the number of reoptimized nodes that were cut off in the current run */
176 SCIP_EXPORT
178  SCIP_REOPT* reopt /*< reoptimization data structure */
179  );
180 
181 /** returns the number of reoptimized nodes that were cut off over all runs */
182 SCIP_EXPORT
184  SCIP_REOPT* reopt /*< reoptimization data structure */
185  );
186 
187 /** returns the number of stored nodes with an infeasible LP in the current run */
188 SCIP_EXPORT
190  SCIP_REOPT* reopt /*< reoptimization data structure */
191  );
192 
193 /** returns the number of stored nodes with an infeasible LP over all runs */
194 SCIP_EXPORT
196  SCIP_REOPT* reopt /*< reoptimization data structure */
197  );
198 
199 #ifdef NDEBUG
200 
201 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
202  * speed up the algorithms.
203  */
204 
205 #define SCIPreoptnodeGetNVars(reoptnode) (reoptnode->nvars)
206 #define SCIPreoptnodeGetNConss(reoptnode) (reoptnode->nconss)
207 #define SCIPreoptnodeGetNDualBoundChgs(reoptnode) (reoptnode->dualconscur->nvars)
208 #define SCIPreoptnodeGetNChildren(reoptnode) (reoptnode->nchilds)
209 #define SCIPreoptnodeGetLowerbound(reoptnode) (reoptnode->lowerbound)
210 #define SCIPreoptnodeGetType(reoptnode) (reoptnode->reopttype)
211 
212 #define SCIPreoptGetNRestartsGlobal(reopt) (reopt->nglbrestarts)
213 #define SCIPreoptGetNRestartsLocal(reopt) (reopt->nlocrestarts)
214 #define SCIPreoptGetNTotalRestartsLocal(reopt) (reopt->ntotallocrestarts)
215 #define SCIPreoptGetFirstRestarts(reopt) (reopt->firstrestart)
216 #define SCIPreoptGetLastRestarts(reopt) (reopt->lastrestart)
217 #define SCIPreoptGetNFeasNodes(reopt) (reopt->reopttree->nfeasnodes)
218 #define SCIPreoptGetNTotalFeasNodes(reopt) (reopt->reopttree->ntotalfeasnodes)
219 #define SCIPreoptGetNPrunedNodes(reopt) (reopt->reopttree->nprunednodes)
220 #define SCIPreoptGetNTotalPrunedNodes(reopt) (reopt->reopttree->ntotalprunednodes)
221 #define SCIPreoptGetNCutoffReoptnodes(reopt) (reopt->reopttree->ncutoffreoptnodes)
222 #define SCIPreoptGetNTotalCutoffReoptnodes(reopt) (reopt->reopttree->ntotalcutoffreoptnodes)
223 #define SCIPreoptGetNInfNodes(reopt) (reopt->reopttree->ninfsubtrees)
224 #define SCIPreoptGetNTotalInfNodes(reopt) (reopt->reopttree->ntotalinfnodes)
225 
226 #endif
227 
228 #ifdef __cplusplus
229 }
230 #endif
231 
232 #endif
enum SCIP_BoundType SCIP_BOUNDTYPE
Definition: type_lp.h:59
int SCIPreoptGetNInfNodes(SCIP_REOPT *reopt)
Definition: reopt.c:5023
type definitions for collecting reoptimization information
int SCIPreoptGetLastRestarts(SCIP_REOPT *reopt)
Definition: reopt.c:4953
int SCIPreoptGetNTotalInfNodes(SCIP_REOPT *reopt)
Definition: reopt.c:5033
type definitions for LP management
int SCIPreoptnodeGetNDualBoundChgs(SCIP_REOPTNODE *reoptnode)
Definition: reopt.c:5841
void SCIPreoptnodeGetSplitCons(SCIP_REOPTNODE *reoptnode, SCIP_VAR **vars, SCIP_Real *vals, REOPT_CONSTYPE *constype, int conssize, int *nvars)
int SCIPreoptGetFirstRestarts(SCIP_REOPT *reopt)
Definition: reopt.c:4943
int SCIPreoptGetNRestartsGlobal(SCIP_REOPT *reopt)
Definition: reopt.c:4913
void SCIPreoptnodeSetParentID(SCIP_REOPTNODE *reoptnode, unsigned int parentid)
Definition: reopt.c:5919
enum SCIP_ReoptType SCIP_REOPTTYPE
Definition: type_reopt.h:67
type definitions for problem variables
int SCIPreoptGetNTotalFeasNodes(SCIP_REOPT *reopt)
Definition: reopt.c:4973
int SCIPreoptnodeGetNVars(SCIP_REOPTNODE *reoptnode)
Definition: reopt.c:5821
data structures for collecting reoptimization information
int SCIPreoptnodeGetNChildren(SCIP_REOPTNODE *reoptnode)
Definition: reopt.c:5854
SCIP_Real SCIPreoptnodeGetLowerbound(SCIP_REOPTNODE *reoptnode)
Definition: reopt.c:5864
int SCIPreoptGetNTotalCutoffReoptnodes(SCIP_REOPT *reopt)
Definition: reopt.c:5013
int SCIPreoptGetNCutoffReoptnodes(SCIP_REOPT *reopt)
Definition: reopt.c:5003
int SCIPreoptGetNFeasNodes(SCIP_REOPT *reopt)
Definition: reopt.c:4963
void SCIPreoptnodeGetConss(SCIP_REOPTNODE *reoptnode, SCIP_VAR ***vars, SCIP_Real **bounds, SCIP_BOUNDTYPE **boundtypes, int mem, int *nconss, int *nvars)
Definition: reopt.c:5884
#define SCIP_Real
Definition: def.h:186
int SCIPreoptGetNRestartsLocal(SCIP_REOPT *reopt)
Definition: reopt.c:4923
int SCIPreoptGetNPrunedNodes(SCIP_REOPT *reopt)
Definition: reopt.c:4983
enum Reopt_ConsType REOPT_CONSTYPE
Definition: type_reopt.h:76
SCIP_REOPTTYPE SCIPreoptnodeGetType(SCIP_REOPTNODE *reoptnode)
Definition: reopt.c:5874
common defines and data types used in all packages of SCIP
int SCIPreoptGetNTotalRestartsLocal(SCIP_REOPT *reopt)
Definition: reopt.c:4933
int SCIPreoptGetNTotalPrunedNodes(SCIP_REOPT *reopt)
Definition: reopt.c:4993
int SCIPreoptnodeGetNConss(SCIP_REOPTNODE *reoptnode)
Definition: reopt.c:5831