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