Scippy

SCIP

Solving Constraint Integer Programs

type_cons.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-2019 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 scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file type_cons.h
17  * @ingroup TYPEDEFINITIONS
18  * @brief type definitions for constraints and constraint handlers
19  * @author Tobias Achterberg
20  * @author Stefan Heinz
21  *
22  * This file defines the interface for constraint handlers implemented in C.
23  *
24  * - \ref CONS "Instructions for implementing a constraint handler"
25  * - \ref CONSHDLRS "List of available constraint handlers"
26  * - \ref scip::ObjConshdlr "C++ wrapper class"
27  */
28 
29 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
30 
31 #ifndef __SCIP_TYPE_CONS_H__
32 #define __SCIP_TYPE_CONS_H__
33 
34 #include "scip/def.h"
35 #include "scip/type_lp.h"
36 #include "scip/type_retcode.h"
37 #include "scip/type_result.h"
38 #include "scip/type_var.h"
39 #include "scip/type_sol.h"
40 #include "scip/type_scip.h"
41 #include "scip/type_timing.h"
42 #include "scip/type_heur.h"
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 typedef struct SCIP_Conshdlr SCIP_CONSHDLR; /**< constraint handler for a specific constraint type */
49 typedef struct SCIP_Cons SCIP_CONS; /**< constraint data structure */
50 typedef struct SCIP_ConshdlrData SCIP_CONSHDLRDATA; /**< constraint handler data */
51 typedef struct SCIP_ConsData SCIP_CONSDATA; /**< locally defined constraint type specific data */
52 typedef struct SCIP_ConsSetChg SCIP_CONSSETCHG; /**< tracks additions and removals of the set of active constraints */
53 typedef struct SCIP_LinConsStats SCIP_LINCONSSTATS; /**< linear constraint classification statistics used for MIPLIB */
54 
55 /** linear constraint types recognizable */
57 {
58  SCIP_LINCONSTYPE_EMPTY = 0, /**< linear constraints with no variables */
59  SCIP_LINCONSTYPE_FREE = 1, /**< linear constraints with no finite side */
60  SCIP_LINCONSTYPE_SINGLETON = 2, /**< linear constraints with a single variable */
61  SCIP_LINCONSTYPE_AGGREGATION = 3, /**< linear constraints of the type \f$ ax + by = c\f$ */
62  SCIP_LINCONSTYPE_PRECEDENCE = 4, /**< linear constraints of the type \f$ a x - a y \leq b\f$ where \f$x\f$ and \f$y\f$ must have the same type */
63  SCIP_LINCONSTYPE_VARBOUND = 5, /**< linear constraints of the form \f$ ax + by \leq c \, x \in \{0,1\} \f$ */
64  SCIP_LINCONSTYPE_SETPARTITION = 6, /**< linear constraints of the form \f$ \sum x_i = 1\, x_i \in \{0,1\} \forall i \f$ */
65  SCIP_LINCONSTYPE_SETPACKING = 7, /**< linear constraints of the form \f$ \sum x_i \leq 1\, x_i \in \{0,1\} \forall i \f$ */
66  SCIP_LINCONSTYPE_SETCOVERING = 8, /**< linear constraints of the form \f$ \sum x_i \geq 1\, x_i \in \{0,1\} \forall i \f$ */
67  SCIP_LINCONSTYPE_CARDINALITY = 9, /**< linear constraints of the form \f$ \sum x_i = k\, x_i \in \{0,1\} \forall i, \, k\geq 2 \f$ */
68  SCIP_LINCONSTYPE_INVKNAPSACK = 10, /**< linear constraints of the form \f$ \sum x_i \leq b\, x_i \in \{0,1\} \forall i, \, b\in \mathbb{n} \geq 2 \f$ */
69  SCIP_LINCONSTYPE_EQKNAPSACK = 11, /**< linear constraints of the form \f$ \sum a_i x_i = b\, x_i \in \{0,1\} \forall i, \, b\in \mathbb{n} \geq 2 \f$ */
70  SCIP_LINCONSTYPE_BINPACKING = 12, /**< linear constraints of the form \f$ \sum a_i x_i + a x \leq a\, x, x_i \in \{0,1\} \forall i, \, a\in \mathbb{n} \geq 2 \f$ */
71  SCIP_LINCONSTYPE_KNAPSACK = 13, /**< linear constraints of the form \f$ \sum a_k x_k \leq b\, x_i \in \{0,1\} \forall i, \, b\in \mathbb{n} \geq 2 \f$ */
72  SCIP_LINCONSTYPE_INTKNAPSACK = 14, /**< linear constraints of the form \f$ \sum a_k x_k \leq b\, x_i \in \mathbb{Z} \forall i, \, b\in \mathbb{n} \f$ */
73  SCIP_LINCONSTYPE_MIXEDBINARY = 15, /**< linear constraints of the form \f$ \sum a_k x_k + \sum p_j s_j \leq/= b\, x_i \in \{0,1\} \forall i, s_j \in \text{ cont. } \forall j\f$ */
74  SCIP_LINCONSTYPE_GENERAL = 16 /**< general linear constraints with no special structure */
75 };
77 
78 #define SCIP_NLINCONSTYPES ((int)SCIP_LINCONSTYPE_GENERAL+1)
79 
80 /** copy method for constraint handler plugins (called when SCIP copies plugins)
81  *
82  * If the copy process was one to one, the valid pointer can be set to TRUE. Otherwise, this pointer has to be set to
83  * FALSE. If all problem defining objects (constraint handlers and variable pricers) return valid = TRUE for all
84  * their copying calls, SCIP assumes that it is an overall one to one copy of the original instance. In this case any
85  * reductions made in the copied SCIP instance can be transfered to the original SCIP instance. If the valid pointer is
86  * set to TRUE and it was not a one to one copy, it might happen that optimal solutions are cut off.
87  *
88  * input:
89  * - scip : SCIP main data structure
90  * - conshdlr : the constraint handler itself
91  * - valid : was the copying process valid?
92  */
93 #define SCIP_DECL_CONSHDLRCOPY(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_Bool* valid)
94 
95 /** destructor of constraint handler to free constraint handler data (called when SCIP is exiting)
96  *
97  * input:
98  * - scip : SCIP main data structure
99  * - conshdlr : the constraint handler itself
100  */
101 #define SCIP_DECL_CONSFREE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr)
102 
103 /** initialization method of constraint handler (called after problem was transformed)
104  *
105  * input:
106  * - scip : SCIP main data structure
107  * - conshdlr : the constraint handler itself
108  * - conss : array of constraints in transformed problem
109  * - nconss : number of constraints in transformed problem
110  */
111 #define SCIP_DECL_CONSINIT(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss)
112 
113 /** deinitialization method of constraint handler (called before transformed problem is freed)
114  *
115  * input:
116  * - scip : SCIP main data structure
117  * - conshdlr : the constraint handler itself
118  * - conss : array of constraints in transformed problem
119  * - nconss : number of constraints in transformed problem
120  */
121 #define SCIP_DECL_CONSEXIT(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss)
122 
123 /** presolving initialization method of constraint handler (called when presolving is about to begin)
124  *
125  * This method is called when the presolving process is about to begin, even if presolving is turned off.
126  * The constraint handler may use this call to initialize its data structures.
127  *
128  * Necessary modifications that have to be performed even if presolving is turned off should be done here or in the
129  * presolving deinitialization call (SCIP_DECL_CONSEXITPRE()).
130  *
131  * @note Note that the constraint array might contain constraints that were created but not added to the problem.
132  * Constraints that are not added, i.e., for which SCIPconsIsAdded() returns FALSE, cannot be used for problem
133  * reductions.
134  *
135  * input:
136  * - scip : SCIP main data structure
137  * - conshdlr : the constraint handler itself
138  * - conss : array of constraints in transformed problem
139  * - nconss : number of constraints in transformed problem
140  */
141 #define SCIP_DECL_CONSINITPRE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss)
142 
143 /** presolving deinitialization method of constraint handler (called after presolving has been finished)
144  *
145  * This method is called after the presolving has been finished, even if presolving is turned off.
146  * The constraint handler may use this call e.g. to clean up or modify its data structures.
147  *
148  * Necessary modifications that have to be performed even if presolving is turned off should be done here or in the
149  * presolving initialization call (SCIP_DECL_CONSINITPRE()).
150  *
151  * Besides necessary modifications and clean up, no time consuming operations should be performed, especially if the
152  * problem has already been solved. Use the method SCIPgetStatus(), which in this case returns SCIP_STATUS_OPTIMAL,
153  * SCIP_STATUS_INFEASIBLE, SCIP_STATUS_UNBOUNDED, or SCIP_STATUS_INFORUNBD.
154  *
155  * @note Note that the constraint array might contain constraints that were created but not added to the problem.
156  * Constraints that are not added, i.e., for which SCIPconsIsAdded() returns FALSE, cannot be used for problem
157  * reductions.
158  *
159  * input:
160  * - scip : SCIP main data structure
161  * - conshdlr : the constraint handler itself
162  * - conss : final array of constraints in transformed problem
163  * - nconss : final number of constraints in transformed problem
164  */
165 #define SCIP_DECL_CONSEXITPRE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss)
166 
167 /** solving process initialization method of constraint handler (called when branch and bound process is about to begin)
168  *
169  * This method is called when the presolving was finished and the branch and bound process is about to begin.
170  * The constraint handler may use this call to initialize its branch and bound specific data.
171  *
172  * Besides necessary modifications and clean up, no time consuming operations should be performed, especially if the
173  * problem has already been solved. Use the method SCIPgetStatus(), which in this case returns SCIP_STATUS_OPTIMAL,
174  * SCIP_STATUS_INFEASIBLE, SCIP_STATUS_UNBOUNDED, or SCIP_STATUS_INFORUNBD.
175  *
176  * @note Note that the constraint array might contain constraints that were created but not added to the problem.
177  * Constraints that are not added, i.e., for which SCIPconsIsAdded() returns FALSE, cannot be used for problem
178  * reductions.
179  *
180  * input:
181  * - scip : SCIP main data structure
182  * - conshdlr : the constraint handler itself
183  * - conss : array of constraints of the constraint handler
184  * - nconss : number of constraints of the constraint handler
185  */
186 #define SCIP_DECL_CONSINITSOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss)
187 
188 /** solving process deinitialization method of constraint handler (called before branch and bound process data is freed)
189  *
190  * This method is called before the branch and bound process is freed.
191  * The constraint handler should use this call to clean up its branch and bound data, in particular to release
192  * all LP rows that he has created or captured.
193  *
194  * input:
195  * - scip : SCIP main data structure
196  * - conshdlr : the constraint handler itself
197  * - conss : array of constraints of the constraint handler
198  * - nconss : number of constraints of the constraint handler
199  * - restart : was this exit solve call triggered by a restart?
200  */
201 #define SCIP_DECL_CONSEXITSOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, SCIP_Bool restart)
202 
203 /** frees specific constraint data
204  *
205  * @warning There may exist unprocessed events. For example, a variable's bound may have been already changed, but the
206  * corresponding bound change event was not yet processed.
207  *
208  * input:
209  * - scip : SCIP main data structure
210  * - conshdlr : the constraint handler itself
211  * - cons : the constraint belonging to the constraint data
212  * - consdata : pointer to the constraint data to free
213  */
214 #define SCIP_DECL_CONSDELETE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons, SCIP_CONSDATA** consdata)
215 
216 /** transforms constraint data into data belonging to the transformed problem
217  *
218  * input:
219  * - scip : SCIP main data structure
220  * - conshdlr : the constraint handler itself
221  * - sourcecons : source constraint to transform
222  * - targetcons : pointer to store created target constraint
223  */
224 #define SCIP_DECL_CONSTRANS(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* sourcecons, SCIP_CONS** targetcons)
225 
226 /** LP initialization method of constraint handler (called before the initial LP relaxation at a node is solved)
227  *
228  * Puts the LP relaxations of all "initial" constraints into the LP. The method should put a canonic LP relaxation
229  * of all given constraints to the LP with calls to SCIPaddRow().
230  *
231  * @warning It is not guaranteed that the problem is going to be declared infeasible if the infeasible pointer is set
232  * to TRUE. Therefore, it is recommended that users do not end this method prematurely when an infeasiblity
233  * is detected.
234  *
235  * input:
236  * - scip : SCIP main data structure
237  * - conshdlr : the constraint handler itself
238  * - conss : array of constraints to process
239  * - nconss : number of constraints to process
240  *
241  * output:
242  * - infeasible : pointer to store whether an infeasibility was detected while building the LP
243  */
244 #define SCIP_DECL_CONSINITLP(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, SCIP_Bool* infeasible)
245 
246 /** separation method of constraint handler for LP solution
247  *
248  * Separates all constraints of the constraint handler. The method is called in the LP solution loop,
249  * which means that a valid LP solution exists.
250  *
251  * The first nusefulconss constraints are the ones, that are identified to likely be violated. The separation
252  * method should process only the useful constraints in most runs, and only occasionally the remaining
253  * nconss - nusefulconss constraints.
254  *
255  * input:
256  * - scip : SCIP main data structure
257  * - conshdlr : the constraint handler itself
258  * - conss : array of constraints to process
259  * - nconss : number of constraints to process
260  * - nusefulconss : number of useful (non-obsolete) constraints to process
261  * - result : pointer to store the result of the separation call
262  *
263  * possible return values for *result (if more than one applies, the first in the list should be used):
264  * - SCIP_CUTOFF : the node is infeasible in the variable's bounds and can be cut off
265  * - SCIP_CONSADDED : an additional constraint was generated
266  * - SCIP_REDUCEDDOM : a variable's domain was reduced
267  * - SCIP_SEPARATED : a cutting plane was generated
268  * - SCIP_NEWROUND : a cutting plane was generated and a new separation round should immediately start
269  * - SCIP_DIDNOTFIND : the separator searched, but did not find domain reductions, cutting planes, or cut constraints
270  * - SCIP_DIDNOTRUN : the separator was skipped
271  * - SCIP_DELAYED : the separator was skipped, but should be called again
272  */
273 #define SCIP_DECL_CONSSEPALP(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, \
274  int nconss, int nusefulconss, SCIP_RESULT* result)
275 
276 /** separation method of constraint handler for arbitrary primal solution
277  *
278  * Separates all constraints of the constraint handler. The method is called outside the LP solution loop (e.g., by
279  * a relaxator or a primal heuristic), which means that there is no valid LP solution.
280  * Instead, the method should produce cuts that separate the given solution.
281  *
282  * The first nusefulconss constraints are the ones, that are identified to likely be violated. The separation
283  * method should process only the useful constraints in most runs, and only occasionally the remaining
284  * nconss - nusefulconss constraints.
285  *
286  * input:
287  * - scip : SCIP main data structure
288  * - conshdlr : the constraint handler itself
289  * - conss : array of constraints to process
290  * - nconss : number of constraints to process
291  * - nusefulconss : number of useful (non-obsolete) constraints to process
292  * - sol : primal solution that should be separated
293  * - result : pointer to store the result of the separation call
294  *
295  * possible return values for *result (if more than one applies, the first in the list should be used):
296  * - SCIP_CUTOFF : the node is infeasible in the variable's bounds and can be cut off
297  * - SCIP_CONSADDED : an additional constraint was generated
298  * - SCIP_REDUCEDDOM : a variable's domain was reduced
299  * - SCIP_SEPARATED : a cutting plane was generated
300  * - SCIP_NEWROUND : a cutting plane was generated and a new separation round should immediately start
301  * - SCIP_DIDNOTFIND : the separator searched, but did not find domain reductions, cutting planes, or cut constraints
302  * - SCIP_DIDNOTRUN : the separator was skipped
303  * - SCIP_DELAYED : the separator was skipped, but should be called again
304  */
305 #define SCIP_DECL_CONSSEPASOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, \
306  int nconss, int nusefulconss, SCIP_SOL* sol, SCIP_RESULT* result)
307 
308 /** constraint enforcing method of constraint handler for LP solutions
309  *
310  * The method is called at the end of the node processing loop for a node where the LP was solved.
311  * The LP solution has to be checked for feasibility. If possible, an infeasibility should be resolved by
312  * branching, reducing a variable's domain to exclude the solution or separating the solution with a valid
313  * cutting plane.
314  *
315  * The enforcing methods of the active constraint handlers are called in decreasing order of their enforcing
316  * priorities until the first constraint handler returned with the value SCIP_CUTOFF, SCIP_SEPARATED,
317  * SCIP_REDUCEDDOM, SCIP_CONSADDED, or SCIP_BRANCHED.
318  * The integrality constraint handler has an enforcing priority of zero. A constraint handler which can
319  * (or wants) to enforce its constraints only for integral solutions should have a negative enforcing priority
320  * (e.g. the alldiff-constraint can only operate on integral solutions).
321  * A constraint handler which wants to incorporate its own branching strategy even on non-integral
322  * solutions must have an enforcing priority greater than zero (e.g. the SOS-constraint incorporates
323  * SOS-branching on non-integral solutions).
324  *
325  * The first nusefulconss constraints are the ones, that are identified to likely be violated. The enforcing
326  * method should process the useful constraints first. The other nconss - nusefulconss constraints should only
327  * be enforced, if no violation was found in the useful constraints.
328  *
329  * input:
330  * - scip : SCIP main data structure
331  * - conshdlr : the constraint handler itself
332  * - conss : array of constraints to process
333  * - nconss : number of constraints to process
334  * - nusefulconss : number of useful (non-obsolete) constraints to process
335  * - solinfeasible : was the solution already declared infeasible by a constraint handler?
336  * - result : pointer to store the result of the enforcing call
337  *
338  * possible return values for *result (if more than one applies, the first in the list should be used):
339  * - SCIP_CUTOFF : the node is infeasible in the variable's bounds and can be cut off
340  * - SCIP_CONSADDED : an additional constraint was generated
341  * - SCIP_REDUCEDDOM : a variable's domain was reduced
342  * - SCIP_SEPARATED : a cutting plane was generated
343  * - SCIP_BRANCHED : no changes were made to the problem, but a branching was applied to resolve an infeasibility
344  * - SCIP_INFEASIBLE : at least one constraint is infeasible, but it was not resolved
345  * - SCIP_FEASIBLE : all constraints of the handler are feasible
346  */
347 #define SCIP_DECL_CONSENFOLP(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, int nusefulconss, \
348  SCIP_Bool solinfeasible, SCIP_RESULT* result)
349 
350 /** constraint enforcing method of constraint handler for relaxation solutions
351  *
352  * input:
353  * - scip : SCIP main data structure
354  * - sol : relaxation solution
355  * - conshdlr : the constraint handler itself
356  * - conss : array of constraints to process
357  * - nconss : number of constraints to process
358  * - nusefulconss : number of useful (non-obsolete) constraints to process
359  * - solinfeasible : was the solution already declared infeasible by a constraint handler?
360  * - result : pointer to store the result of the enforcing call
361  *
362  * possible return values for *result (if more than one applies, the first in the list should be used):
363  * - SCIP_CUTOFF : the node is infeasible in the variable's bounds and can be cut off
364  * - SCIP_CONSADDED : an additional constraint was generated
365  * - SCIP_REDUCEDDOM : a variable's domain was reduced
366  * - SCIP_SEPARATED : a cutting plane was generated
367  * - SCIP_BRANCHED : no changes were made to the problem, but a branching was applied to resolve an infeasibility
368  * - SCIP_SOLVELP : at least one constraint is infeasible, and this can only be resolved by solving the LP
369  * - SCIP_INFEASIBLE : at least one constraint is infeasible, but it was not resolved
370  * - SCIP_FEASIBLE : all constraints of the handler are feasible
371  * - SCIP_DIDNOTRUN : the enforcement was skipped (only possible, if objinfeasible is true)
372  */
373 #define SCIP_DECL_CONSENFORELAX(x) SCIP_RETCODE x (SCIP* scip, SCIP_SOL* sol, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, int nusefulconss, \
374  SCIP_Bool solinfeasible, SCIP_RESULT* result)
375 
376 /** constraint enforcing method of constraint handler for pseudo solutions
377  *
378  * The method is called at the end of the node processing loop for a node where the LP was not solved.
379  * The pseudo solution has to be checked for feasibility. If possible, an infeasibility should be resolved by
380  * branching, reducing a variable's domain to exclude the solution or adding an additional constraint.
381  * Separation is not possible, since the LP is not processed at the current node. All LP informations like
382  * LP solution, slack values, or reduced costs are invalid and must not be accessed.
383  *
384  * Like in the enforcing method for LP solutions, the enforcing methods of the active constraint handlers are
385  * called in decreasing order of their enforcing priorities until the first constraint handler returned with
386  * the value SCIP_CUTOFF, SCIP_REDUCEDDOM, SCIP_CONSADDED, SCIP_BRANCHED, or SCIP_SOLVELP.
387  *
388  * The first nusefulconss constraints are the ones, that are identified to likely be violated. The enforcing
389  * method should process the useful constraints first. The other nconss - nusefulconss constraints should only
390  * be enforced, if no violation was found in the useful constraints.
391  *
392  * If the pseudo solution's objective value is lower than the lower bound of the node, it cannot be feasible
393  * and the enforcing method may skip it's check and set *result to SCIP_DIDNOTRUN. However, it can also process
394  * its constraints and return any other possible result code.
395  *
396  * input:
397  * - scip : SCIP main data structure
398  * - conshdlr : the constraint handler itself
399  * - conss : array of constraints to process
400  * - nconss : number of constraints to process
401  * - nusefulconss : number of useful (non-obsolete) constraints to process
402  * - solinfeasible : was the solution already declared infeasible by a constraint handler?
403  * - objinfeasible : is the solution infeasible anyway due to violating lower objective bound?
404  * - result : pointer to store the result of the enforcing call
405  *
406  * possible return values for *result (if more than one applies, the first in the list should be used):
407  * - SCIP_CUTOFF : the node is infeasible in the variable's bounds and can be cut off
408  * - SCIP_CONSADDED : an additional constraint was generated
409  * - SCIP_REDUCEDDOM : a variable's domain was reduced
410  * - SCIP_BRANCHED : no changes were made to the problem, but a branching was applied to resolve an infeasibility
411  * - SCIP_SOLVELP : at least one constraint is infeasible, and this can only be resolved by solving the LP
412  * - SCIP_INFEASIBLE : at least one constraint is infeasible, but it was not resolved
413  * - SCIP_FEASIBLE : all constraints of the handler are feasible
414  * - SCIP_DIDNOTRUN : the enforcement was skipped (only possible, if objinfeasible is true)
415  */
416 #define SCIP_DECL_CONSENFOPS(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, int nusefulconss, \
417  SCIP_Bool solinfeasible, SCIP_Bool objinfeasible, SCIP_RESULT* result)
418 
419 /** feasibility check method of constraint handler for integral solutions
420  *
421  * The given solution has to be checked for feasibility.
422  *
423  * The check methods of the active constraint handlers are called in decreasing order of their check
424  * priorities until the first constraint handler returned with the result SCIP_INFEASIBLE.
425  * The integrality constraint handler has a check priority of zero. A constraint handler which can
426  * (or wants) to check its constraints only for integral solutions should have a negative check priority
427  * (e.g. the alldiff-constraint can only operate on integral solutions).
428  * A constraint handler which wants to check feasibility even on non-integral solutions must have a
429  * check priority greater than zero (e.g. if the check is much faster than testing all variables for
430  * integrality).
431  *
432  * In some cases, integrality conditions or rows of the current LP don't have to be checked, because their
433  * feasibility is already checked or implicitly given. In these cases, 'checkintegrality' or
434  * 'checklprows' is FALSE.
435  *
436  * If the solution is not NULL, SCIP should also be informed about the constraint violation with a call to
437  * SCIPupdateSolConsViolation() and additionally SCIPupdateSolLPRowViolation() for every row of the constraint's current
438  * representation in the LP relaxation, if any such rows exist.
439  * As a convenience method, SCIPupdateSolLPConsViolation() can be used if the constraint
440  * is represented completely by a set of LP rows, meaning that the current constraint violation is equal to the maximum
441  * of the contraint violations of the corresponding LP rows.
442  *
443  * input:
444  * - scip : SCIP main data structure
445  * - conshdlr : the constraint handler itself
446  * - conss : array of constraints to process
447  * - nconss : number of constraints to process
448  * - sol : the solution to check feasibility for
449  * - checkintegrality: Has integrality to be checked?
450  * - checklprows : Do constraints represented by rows in the current LP have to be checked?
451  * - printreason : Should the reason for the violation be printed?
452  * - completely : Should all violations be checked?
453  * - result : pointer to store the result of the feasibility checking call
454  *
455  * possible return values for *result:
456  * - SCIP_INFEASIBLE : at least one constraint of the handler is infeasible
457  * - SCIP_FEASIBLE : all constraints of the handler are feasible
458  */
459 #define SCIP_DECL_CONSCHECK(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, SCIP_SOL* sol, \
460  SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_Bool completely, SCIP_RESULT* result)
461 
462 /** domain propagation method of constraint handler
463  *
464  * The first nusefulconss constraints are the ones, that are identified to likely be violated. The propagation
465  * method should process only the useful constraints in most runs, and only occasionally the remaining
466  * nconss - nusefulconss constraints.
467  *
468  * @note if the constraint handler uses dual information in propagation it is nesassary to check via calling
469  * SCIPallowDualReds and SCIPallowObjProp if dual reductions and propgation with the current cutoff bound, resp.,
470  * are allowed.
471  *
472  * input:
473  * - scip : SCIP main data structure
474  * - conshdlr : the constraint handler itself
475  * - conss : array of constraints to process
476  * - nconss : number of constraints to process
477  * - nusefulconss : number of useful (non-obsolete) constraints to process
478  * - nmarkedconss : number of constraints which are marked to be definitely propagated
479  * - proptiming : current point in the node solving loop
480  * - result : pointer to store the result of the propagation call
481  *
482  * possible return values for *result:
483  * - SCIP_CUTOFF : the node is infeasible in the variable's bounds and can be cut off
484  * - SCIP_REDUCEDDOM : at least one domain reduction was found
485  * - SCIP_DIDNOTFIND : the propagator searched but did not find any domain reductions
486  * - SCIP_DIDNOTRUN : the propagator was skipped
487  * - SCIP_DELAYED : the propagator was skipped, but should be called again
488  * - SCIP_DELAYNODE : the current node should be postponed (return value only valid for BEFORELP propagation)
489  */
490 #define SCIP_DECL_CONSPROP(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, int nusefulconss, \
491  int nmarkedconss, SCIP_PROPTIMING proptiming, SCIP_RESULT* result)
492 
493 /** presolving method of constraint handler
494  *
495  * The presolver should go through the variables and constraints and tighten the domains or
496  * constraints. Each tightening should increase the given total number of changes.
497  *
498  * input:
499  * - scip : SCIP main data structure
500  * - conshdlr : the constraint handler itself
501  * - conss : array of constraints to process
502  * - nconss : number of constraints to process
503  * - nrounds : number of presolving rounds already done
504  * - presoltiming : current presolving timing
505  * - nnewfixedvars : number of variables fixed since the last call to the presolving method
506  * - nnewaggrvars : number of variables aggregated since the last call to the presolving method
507  * - nnewchgvartypes : number of variable type changes since the last call to the presolving method
508  * - nnewchgbds : number of variable bounds tightened since the last call to the presolving method
509  * - nnewholes : number of domain holes added since the last call to the presolving method
510  * - nnewdelconss : number of deleted constraints since the last call to the presolving method
511  * - nnewaddconss : number of added constraints since the last call to the presolving method
512  * - nnewupgdconss : number of upgraded constraints since the last call to the presolving method
513  * - nnewchgcoefs : number of changed coefficients since the last call to the presolving method
514  * - nnewchgsides : number of changed left or right hand sides since the last call to the presolving method
515  *
516  * @note the counters state the changes since the last call including the changes of this presolving method during its
517  * call
518  *
519  * @note if the constraint handler performs dual presolving it is nesassary to check via calling SCIPallowDualReds
520  * if dual reductions are allowed.
521  *
522  * input/output:
523  * - nfixedvars : pointer to count total number of variables fixed of all presolvers
524  * - naggrvars : pointer to count total number of variables aggregated of all presolvers
525  * - nchgvartypes : pointer to count total number of variable type changes of all presolvers
526  * - nchgbds : pointer to count total number of variable bounds tightened of all presolvers
527  * - naddholes : pointer to count total number of domain holes added of all presolvers
528  * - ndelconss : pointer to count total number of deleted constraints of all presolvers
529  * - naddconss : pointer to count total number of added constraints of all presolvers
530  * - nupgdconss : pointer to count total number of upgraded constraints of all presolvers
531  * - nchgcoefs : pointer to count total number of changed coefficients of all presolvers
532  * - nchgsides : pointer to count total number of changed left/right hand sides of all presolvers
533  *
534  * output:
535  * - result : pointer to store the result of the presolving call
536  *
537  * possible return values for *result:
538  * - SCIP_UNBOUNDED : at least one variable is not bounded by any constraint in obj. direction -> problem is unbounded
539  * - SCIP_CUTOFF : at least one constraint is infeasible in the variable's bounds -> problem is infeasible
540  * - SCIP_SUCCESS : the presolving method found a reduction
541  * - SCIP_DIDNOTFIND : the presolving method searched, but did not find a presolving change
542  * - SCIP_DIDNOTRUN : the presolving method was skipped
543  * - SCIP_DELAYED : the presolving method was skipped, but should be called again
544  */
545 #define SCIP_DECL_CONSPRESOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, int nrounds, \
546  SCIP_PRESOLTIMING presoltiming, int nnewfixedvars, int nnewaggrvars, int nnewchgvartypes, int nnewchgbds, int nnewholes, \
547  int nnewdelconss, int nnewaddconss, int nnewupgdconss, int nnewchgcoefs, int nnewchgsides, \
548  int* nfixedvars, int* naggrvars, int* nchgvartypes, int* nchgbds, int* naddholes, \
549  int* ndelconss, int* naddconss, int* nupgdconss, int* nchgcoefs, int* nchgsides, SCIP_RESULT* result)
550 
551 /** propagation conflict resolving method of constraint handler
552  *
553  * This method is called during conflict analysis. If the constraint handler wants to support conflict analysis,
554  * it should call SCIPinferVarLbCons() or SCIPinferVarUbCons() in domain propagation instead of SCIPchgVarLb() or
555  * SCIPchgVarUb() in order to deduce bound changes on variables.
556  * In the SCIPinferVarLbCons() and SCIPinferVarUbCons() calls, the handler provides the constraint, that deduced the
557  * variable's bound change, and an integer value "inferinfo" that can be arbitrarily chosen.
558  * The propagation conflict resolving method can then be implemented, to provide a "reason" for the bound
559  * changes, i.e., the bounds of variables at the time of the propagation, that forced the constraint to set the
560  * conflict variable's bound to its current value. It can use the "inferinfo" tag to identify its own propagation
561  * rule and thus identify the "reason" bounds. The bounds that form the reason of the assignment must then be provided
562  * by calls to SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(), SCIPaddConflictRelaxedLb(),
563  * SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), and/or SCIPaddConflictBinvar() in the propagation conflict
564  * resolving method.
565  *
566  * For example, the logicor constraint c = "x or y or z" fixes variable z to TRUE (i.e. changes the lower bound of z
567  * to 1.0), if both, x and y, are assigned to FALSE (i.e. if the upper bounds of these variables are 0.0). It uses
568  * SCIPinferVarLbCons(scip, z, 1.0, c, 0) to apply this assignment (an inference information tag is not needed by the
569  * constraint handler and is set to 0).
570  * In the conflict analysis, the constraint handler may be asked to resolve the lower bound change on z with
571  * constraint c, that was applied at a time given by a bound change index "bdchgidx".
572  * With a call to SCIPgetVarLbAtIndex(scip, z, bdchgidx, TRUE), the handler can find out, that the lower bound of
573  * variable z was set to 1.0 at the given point of time, and should call SCIPaddConflictUb(scip, x, bdchgidx) and
574  * SCIPaddConflictUb(scip, y, bdchgidx) to tell SCIP, that the upper bounds of x and y at this point of time were
575  * the reason for the deduction of the lower bound of z.
576  *
577  * input:
578  * - scip : SCIP main data structure
579  * - conshdlr : the constraint handler itself
580  * - cons : the constraint that deduced the bound change of the conflict variable
581  * - infervar : the conflict variable whose bound change has to be resolved
582  * - inferinfo : the user information passed to the corresponding SCIPinferVarLbCons() or SCIPinferVarUbCons() call
583  * - boundtype : the type of the changed bound (lower or upper bound)
584  * - bdchgidx : the index of the bound change, representing the point of time where the change took place
585  * - relaxedbd : the relaxed bound which is sufficient to be explained
586  *
587  * output:
588  * - result : pointer to store the result of the propagation conflict resolving call
589  *
590  * possible return values for *result:
591  * - SCIP_SUCCESS : the conflicting bound change has been successfully resolved by adding all reason bounds
592  * - SCIP_DIDNOTFIND : the conflicting bound change could not be resolved and has to be put into the conflict set
593  *
594  * @note it is sufficient to explain/resolve the relaxed bound
595  */
596 #define SCIP_DECL_CONSRESPROP(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons, \
597  SCIP_VAR* infervar, int inferinfo, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX* bdchgidx, SCIP_Real relaxedbd, \
598  SCIP_RESULT* result)
599 
600 /** variable rounding lock method of constraint handler
601  *
602  * This method is called, after a constraint is added or removed from the transformed problem.
603  * It should update the rounding locks of the given type of all associated variables with calls to
604  * SCIPaddVarLocksType(), depending on the way, the variable is involved in the constraint:
605  * - If the constraint may get violated by decreasing the value of a variable, it should call
606  * SCIPaddVarLocksType(scip, var, locktype, nlockspos, nlocksneg), saying that rounding down is
607  * potentially rendering the (positive) constraint infeasible and rounding up is potentially rendering the
608  * negation of the constraint infeasible.
609  * - If the constraint may get violated by increasing the value of a variable, it should call
610  * SCIPaddVarLocksType(scip, var, locktype, nlocksneg, nlockspos), saying that rounding up is
611  * potentially rendering the constraint's negation infeasible and rounding up is potentially rendering the
612  * constraint itself infeasible.
613  * - If the constraint may get violated by changing the variable in any direction, it should call
614  * SCIPaddVarLocksType(scip, var, locktype, nlockspos + nlocksneg, nlockspos + nlocksneg).
615  *
616  * Consider the linear constraint "3x -5y +2z <= 7" as an example. The variable rounding lock method of the
617  * linear constraint handler should call SCIPaddVarLocksType(scip, x, locktype, nlocksneg, nlockspos),
618  * SCIPaddVarLocksType(scip, y, locktype, nlockspos, nlocksneg) and
619  * SCIPaddVarLocksType(scip, z, type, nlocksneg, nlockspos) to tell SCIP, that rounding up of x and z and rounding
620  * down of y can destroy the feasibility of the constraint, while rounding down of x and z and rounding up of y can
621  * destroy the feasibility of the constraint's negation "3x -5y +2z > 7".
622  * A linear constraint "2 <= 3x -5y +2z <= 7" should call
623  * SCIPaddVarLocksType(scip, ..., nlockspos + nlocksneg, nlockspos + nlocksneg) on all variables, since rounding in both
624  * directions of each variable can destroy both the feasibility of the constraint and it's negation
625  * "3x -5y +2z < 2 or 3x -5y +2z > 7".
626  *
627  * If the constraint itself contains other constraints as sub constraints (e.g. the "or" constraint concatenation
628  * "c(x) or d(x)"), the rounding lock methods of these constraints should be called in a proper way.
629  * - If the constraint may get violated by the violation of the sub constraint c, it should call
630  * SCIPaddConsLocksType(scip, c, locktype, nlockspos, nlocksneg), saying that infeasibility of c may lead to
631  * infeasibility of the (positive) constraint, and infeasibility of c's negation (i.e. feasibility of c) may lead
632  * to infeasibility of the constraint's negation (i.e. feasibility of the constraint).
633  * - If the constraint may get violated by the feasibility of the sub constraint c, it should call
634  * SCIPaddConsLocksType(scip, c, locktype, nlocksneg, nlockspos), saying that infeasibility of c may lead to
635  * infeasibility of the constraint's negation (i.e. feasibility of the constraint), and infeasibility of c's negation
636  * (i.e. feasibility of c) may lead to infeasibility of the (positive) constraint.
637  * - If the constraint may get violated by any change in the feasibility of the sub constraint c, it should call
638  * SCIPaddConsLocksType(scip, c, locktype, nlockspos + nlocksneg, nlockspos + nlocksneg).
639  *
640  * Consider the or concatenation "c(x) or d(x)". The variable rounding lock method of the or constraint handler
641  * should call SCIPaddConsLocksType(scip, c, locktype, nlockspos, nlocksneg) and
642  * SCIPaddConsLocksType(scip, d, locktype, nlockspos, nlocksneg) to tell SCIP, that infeasibility of c and d can lead
643  * to infeasibility of "c(x) or d(x)".
644  *
645  * As a second example, consider the equivalence constraint "y <-> c(x)" with variable y and constraint c. The
646  * constraint demands, that y == 1 if and only if c(x) is satisfied. The variable lock method of the corresponding
647  * constraint handler should call SCIPaddVarLocksType(scip, y, locktype, nlockspos + nlocksneg, nlockspos + nlocksneg) and
648  * SCIPaddConsLocksType(scip, c, locktype, nlockspos + nlocksneg, nlockspos + nlocksneg), because any modification to the
649  * value of y or to the feasibility of c can alter the feasibility of the equivalence constraint.
650  *
651  * input:
652  * - scip : SCIP main data structure
653  * - conshdlr : the constraint handler itself
654  * - cons : the constraint that should lock rounding of its variables, or NULL if the constraint handler
655  * does not need constraints
656  * - locktype : type of rounding locks, i.e., SCIP_LOCKTYPE_MODEL or SCIP_LOCKTYPE_CONFLICT
657  * - nlockspos : number of times, the roundings should be locked for the constraint (may be negative)
658  * - nlocksneg : number of times, the roundings should be locked for the constraint's negation (may be negative)
659  */
660 #define SCIP_DECL_CONSLOCK(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons, SCIP_LOCKTYPE locktype, int nlockspos, int nlocksneg)
661 
662 /** constraint activation notification method of constraint handler
663  *
664  * WARNING! There may exist unprocessed events. For example, a variable's bound may have been already changed, but
665  * the corresponding bound change event was not yet processed.
666  *
667  * This method is always called after a constraint of the constraint handler was activated. The constraint
668  * handler may use this call to update his own (statistical) data.
669  *
670  * input:
671  * - scip : SCIP main data structure
672  * - conshdlr : the constraint handler itself
673  * - cons : the constraint that has been activated
674  */
675 #define SCIP_DECL_CONSACTIVE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons)
676 
677 /** constraint deactivation notification method of constraint handler
678  *
679  * WARNING! There may exist unprocessed events. For example, a variable's bound may have been already changed, but
680  * the corresponding bound change event was not yet processed.
681  *
682  * This method is always called before a constraint of the constraint handler is deactivated. The constraint
683  * handler may use this call to update his own (statistical) data.
684  *
685  * input:
686  * - scip : SCIP main data structure
687  * - conshdlr : the constraint handler itself
688  * - cons : the constraint that will be deactivated
689  */
690 #define SCIP_DECL_CONSDEACTIVE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons)
691 
692 /** constraint enabling notification method of constraint handler
693  *
694  * WARNING! There may exist unprocessed events. For example, a variable's bound may have been already changed, but
695  * the corresponding bound change event was not yet processed.
696  *
697  * This method is always called after a constraint of the constraint handler was enabled. The constraint
698  * handler may use this call to update his own (statistical) data.
699  *
700  * input:
701  * - scip : SCIP main data structure
702  * - conshdlr : the constraint handler itself
703  * - cons : the constraint that has been enabled
704  */
705 #define SCIP_DECL_CONSENABLE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons)
706 
707 /** constraint disabling notification method of constraint handler
708  *
709  * WARNING! There may exist unprocessed events. For example, a variable's bound may have been already changed, but
710  * the corresponding bound change event was not yet processed.
711  *
712  * This method is always called before a constraint of the constraint handler is disabled. The constraint
713  * handler may use this call to update his own (statistical) data.
714  *
715  * input:
716  * - scip : SCIP main data structure
717  * - conshdlr : the constraint handler itself
718  * - cons : the constraint that will be disabled
719  */
720 #define SCIP_DECL_CONSDISABLE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons)
721 
722 /** variable deletion method of constraint handler
723  *
724  * This method is optinal and only of interest if you are using SCIP as a branch-and-price framework. That means, you
725  * are generating new variables during the search. If you are not doing that just define the function pointer to be
726  * NULL.
727  *
728  * If this method gets implemented you should iterate over all constraints of the constraint handler and delete all
729  * variables that were marked for deletion by SCIPdelVar().
730  *
731  * input:
732  * - scip : SCIP main data structure
733  * - conshdlr : the constraint handler itself
734  * - conss : array of constraints in transformed problem
735  * - nconss : number of constraints in transformed problem
736  */
737 #define SCIP_DECL_CONSDELVARS(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss)
738 
739 /** constraint display method of constraint handler
740  *
741  * The constraint handler can store a representation of the constraint into the given text file. Use the method
742  * SCIPinfoMessage() to push a string into the file stream.
743  *
744  * @note There are several methods which help to display variables. These are SCIPwriteVarName(), SCIPwriteVarsList(),
745  * SCIPwriteVarsLinearsum(), and SCIPwriteVarsPolynomial().
746  *
747  * input:
748  * - scip : SCIP main data structure
749  * - conshdlr : the constraint handler itself
750  * - cons : the constraint that should be displayed
751  * - file : the text file to store the information into
752  */
753 #define SCIP_DECL_CONSPRINT(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons, FILE* file)
754 
755 /** constraint copying method of constraint handler
756  *
757  * The constraint handler can provide a copy method which copies a constraint from one SCIP data structure into an other
758  * SCIP data structure. If a copy of a constraint is created, the constraint has to be captured. (The capture is usually
759  * already done due to the creation of the constraint).
760  *
761  * If the copy process was one to one, the valid pointer can be set to TRUE. Otherwise, you have to set this pointer to
762  * FALSE. In case all problem defining objects (constraint handlers and variable pricers) return a TRUE valid for all
763  * their copying calls, SCIP assumes that it is a overall one to one copy of the original instance. In this case any
764  * reductions made in the copied SCIP instance can be transfered to the original SCIP instance. If the valid pointer is
765  * set to TRUE and it was not a one to one copy, it might happen that optimal solutions are cut off.
766  *
767  * To get a copy of a variable in the target SCIP you should use the function SCIPgetVarCopy().
768  *
769  * input:
770  * - scip : target SCIP data structure
771  * - cons : pointer to store the created target constraint
772  * - name : name of constraint, or NULL if the name of the source constraint should be used
773  * - sourcescip : source SCIP data structure
774  * - sourceconshdlr : source constraint handler of the source SCIP
775  * - sourcecons : source constraint of the source SCIP
776  * - varmap : a SCIP_HASHMAP mapping variables of the source SCIP to corresponding variables of the target SCIP
777  * - consmap : a SCIP_HASHMAP mapping constraints of the source SCIP to corresponding constraints of the target SCIP
778  * - initial : should the LP relaxation of constraint be in the initial LP?
779  * - separate : should the constraint be separated during LP processing?
780  * - enforce : should the constraint be enforced during node processing?
781  * - check : should the constraint be checked for feasibility?
782  * - propagate : should the constraint be propagated during node processing?
783  * - local : is constraint only valid locally?
784  * - modifiable : is constraint modifiable (subject to column generation)?
785  * - dynamic : is constraint subject to aging?
786  * - removable : should the relaxation be removed from the LP due to aging or cleanup?
787  * - stickingatnode : should the constraint always be kept at the node where it was added, even
788  * if it may be moved to a more global node?
789  * - global : should a global or a local copy be created?
790  *
791  * output:
792  * - valid : pointer to store whether the copying was valid or not
793  */
794 #define SCIP_DECL_CONSCOPY(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONS** cons, const char* name, \
795  SCIP* sourcescip, SCIP_CONSHDLR* sourceconshdlr, SCIP_CONS* sourcecons, SCIP_HASHMAP* varmap, SCIP_HASHMAP* consmap, \
796  SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, \
797  SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode, \
798  SCIP_Bool global, SCIP_Bool* valid)
799 
800 /** constraint parsing method of constraint handler
801  *
802  * The constraint handler can provide a callback to parse the output created by the display method
803  * (\ref SCIP_DECL_CONSPRINT) and to create a constraint out of it.
804  *
805  * @note For parsing there are several methods which are handy. Have a look at: SCIPparseVarName(),
806  * SCIPparseVarsList(), SCIPparseVarsLinearsum(), SCIPparseVarsPolynomial(), SCIPstrToRealValue(), and
807  * SCIPstrCopySection().
808  *
809  * input:
810  * - scip : SCIP main data structure
811  * - conshdlr : the constraint handler itself
812  * - cons : pointer to store the created constraint
813  * - name : name of the constraint
814  * - str : string to parse
815  * - initial : should the LP relaxation of constraint be in the initial LP?
816  * - separate : should the constraint be separated during LP processing?
817  * - enforce : should the constraint be enforced during node processing?
818  * - check : should the constraint be checked for feasibility?
819  * - propagate : should the constraint be propagated during node processing?
820  * - local : is constraint only valid locally?
821  * - modifiable : is constraint modifiable (subject to column generation)?
822  * - dynamic : is constraint subject to aging?
823  * - removable : should the relaxation be removed from the LP due to aging or cleanup?
824  * - stickingatnode : should the constraint always be kept at the node where it was added, even
825  * if it may be moved to a more global node?
826  * output:
827  * - success : pointer to store whether the parsing was successful or not
828  */
829 #define SCIP_DECL_CONSPARSE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** cons, \
830  const char* name, const char* str, \
831  SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, \
832  SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode, SCIP_Bool* success)
833 
834 /** constraint method of constraint handler which returns the variables (if possible)
835  *
836  * The constraint handler can (this callback is optional) provide this callback to return the variables which are
837  * involved in that particular constraint. If this is possible, the variables should be copyied into the variables
838  * array and the success pointers has to be set to TRUE. Otherwise the success has to be set FALSE or the callback
839  * should not be implemented.
840  *
841  * input:
842  * - scip : SCIP main data structure
843  * - conshdlr : the constraint handler itself
844  * - cons : the constraint that should return its variable data
845  * - varssize : available slots in vars array which is needed to check if the array is large enough
846  *
847  * output:
848  * - vars : array to store/copy the involved variables of the constraint
849  * - success : pointer to store whether the variables are successfully copied
850  */
851 #define SCIP_DECL_CONSGETVARS(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons, \
852  SCIP_VAR** vars, int varssize, SCIP_Bool* success)
853 
854 /** constraint method of constraint handler which returns the number of variables (if possible)
855  *
856  * The constraint handler can (this callback is optional) provide this callback to return the number variable which are
857  * involved in that particular constraint. If this is not possible, the success pointers has to be set to FALSE or the
858  * callback should not be implemented.
859  *
860  * input:
861  * - scip : SCIP main data structure
862  * - conshdlr : the constraint handler itself
863  * - cons : constraint for which the number of variables is wanted
864  *
865  * output:
866  * - nvars : pointer to store the number of variables
867  * - success : pointer to store whether the constraint successfully returned the number of variables
868  */
869 #define SCIP_DECL_CONSGETNVARS(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons, \
870  int* nvars, SCIP_Bool* success)
871 
872 /** constraint handler method to suggest dive bound changes during the generic diving algorithm
873  *
874  * This callback is used inside the various diving heuristics of SCIP and does not affect the normal branching of the
875  * actual search. The constraint handler can provide this callback to render the current solution (even more)
876  * infeasible by suggesting one or several variable bound changes. In fact, since diving heuristics do not necessarily
877  * solve LP relaxations at every probing depth, some of the variable local bounds might already be conflicting with the
878  * solution values. The solution is rendered infeasible by determining bound changes that should be applied to the
879  * next explored search node via SCIPaddDiveBoundChange(). An alternative in case that the preferred bound change(s)
880  * were detected infeasible must be provided.
881  *
882  * The constraint handler must take care to only add bound changes that further shrink the variable domain.
883  *
884  * The success pointer must be used to indicate whether the constraint handler succeeded in selecting diving bound
885  * changes. The infeasible pointer should be set to TRUE if the constraint handler found a local infeasibility. If the
886  * constraint handler needs to select between several candidates, it may use the scoring mechanism of the diveset
887  * argument to control its choice.
888  *
889  * This callback is optional.
890  *
891  * @note: @p sol is usually the LP relaxation solution unless the caller of the method, usually a diving heuristic,
892  * does not solve LP relaxations at every depth
893  *
894  * input:
895  * - scip : SCIP main data structure
896  * - conshdlr : the constraint handler itself
897  * - diveset : diving settings for scoring
898  * - sol : current diving solution, usually the LP relaxation solution
899  *
900  * output:
901  * - success : pointer to store whether the constraint handler succeeded to determine dive bound changes
902  * - infeasible : pointer to store whether the constraint handler detected an infeasibility in the local node
903  */
904 #define SCIP_DECL_CONSGETDIVEBDCHGS(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_DIVESET* diveset, \
905  SCIP_SOL* sol, SCIP_Bool* success, SCIP_Bool* infeasible)
906 
907 #ifdef __cplusplus
908 }
909 #endif
910 
911 #endif
enum SCIP_LinConstype SCIP_LINCONSTYPE
Definition: type_cons.h:76
timing definitions for SCIP
type definitions for return codes for SCIP methods
SCIP_LinConstype
Definition: type_cons.h:56
type definitions for LP management
type definitions for primal heuristics
type definitions for SCIP&#39;s main datastructure
type definitions for problem variables
struct SCIP_ConsData SCIP_CONSDATA
Definition: type_cons.h:51
type definitions for storing primal CIP solutions
result codes for SCIP callback methods
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
Definition: type_cons.h:50
common defines and data types used in all packages of SCIP