Scippy

SCIP

Solving Constraint Integer Programs

scip_cons.c
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2022 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file scip_cons.c
17  * @ingroup OTHER_CFILES
18  * @brief public methods for constraint handler plugins and constraints
19  * @author Tobias Achterberg
20  * @author Timo Berthold
21  * @author Gerald Gamrath
22  * @author Leona Gottwald
23  * @author Stefan Heinz
24  * @author Gregor Hendel
25  * @author Thorsten Koch
26  * @author Alexander Martin
27  * @author Marc Pfetsch
28  * @author Michael Winkler
29  * @author Kati Wolter
30  *
31  * @todo check all SCIP_STAGE_* switches, and include the new stages TRANSFORMED and INITSOLVE
32  */
33 
34 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
35 
36 #include "scip/cons.h"
37 #include "scip/debug.h"
38 #include "scip/prob.h"
39 #include "scip/pub_cons.h"
40 #include "scip/pub_message.h"
41 #include "scip/pub_misc.h"
42 #include "scip/scip_cons.h"
43 #include "scip/scip_general.h"
44 #include "scip/scip_mem.h"
45 #include "scip/set.h"
46 #include "scip/struct_cons.h"
47 #include "scip/struct_mem.h"
48 #include "scip/struct_scip.h"
49 #include "scip/struct_set.h"
50 
51 /* In debug mode, the following methods are implemented as function calls to ensure
52  * type validity.
53  * In optimized mode, the methods are implemented as defines to improve performance.
54  * However, we want to have them in the library anyways, so we have to undef the defines.
55  */
56 
57 #undef SCIPmarkConsPropagate
58 
59 /** creates a constraint handler and includes it in SCIP.
60  *
61  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
62  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
63  *
64  * @pre This method can be called if SCIP is in one of the following stages:
65  * - \ref SCIP_STAGE_INIT
66  * - \ref SCIP_STAGE_PROBLEM
67  *
68  * @note method has all constraint handler callbacks as arguments and is thus changed every time a new
69  * callback is added
70  * in future releases; consider using SCIPincludeConshdlrBasic() and setter functions
71  * if you seek for a method which is less likely to change in future releases
72  */
74  SCIP* scip, /**< SCIP data structure */
75  const char* name, /**< name of constraint handler */
76  const char* desc, /**< description of constraint handler */
77  int sepapriority, /**< priority of the constraint handler for separation */
78  int enfopriority, /**< priority of the constraint handler for constraint enforcing */
79  int chckpriority, /**< priority of the constraint handler for checking feasibility (and propagation) */
80  int sepafreq, /**< frequency for separating cuts; zero means to separate only in the root node */
81  int propfreq, /**< frequency for propagating domains; zero means only preprocessing propagation */
82  int eagerfreq, /**< frequency for using all instead of only the useful constraints in separation,
83  * propagation and enforcement, -1 for no eager evaluations, 0 for first only */
84  int maxprerounds, /**< maximal number of presolving rounds the constraint handler participates in (-1: no limit) */
85  SCIP_Bool delaysepa, /**< should separation method be delayed, if other separators found cuts? */
86  SCIP_Bool delayprop, /**< should propagation method be delayed, if other propagators found reductions? */
87  SCIP_Bool needscons, /**< should the constraint handler be skipped, if no constraints are available? */
88  SCIP_PROPTIMING proptiming, /**< positions in the node solving loop where propagation method of constraint handlers should be executed */
89  SCIP_PRESOLTIMING presoltiming, /**< timing mask of the constraint handler's presolving method */
90  SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), /**< copy method of constraint handler or NULL if you don't want to copy your plugin into sub-SCIPs */
91  SCIP_DECL_CONSFREE ((*consfree)), /**< destructor of constraint handler */
92  SCIP_DECL_CONSINIT ((*consinit)), /**< initialize constraint handler */
93  SCIP_DECL_CONSEXIT ((*consexit)), /**< deinitialize constraint handler */
94  SCIP_DECL_CONSINITPRE ((*consinitpre)), /**< presolving initialization method of constraint handler */
95  SCIP_DECL_CONSEXITPRE ((*consexitpre)), /**< presolving deinitialization method of constraint handler */
96  SCIP_DECL_CONSINITSOL ((*consinitsol)), /**< solving process initialization method of constraint handler */
97  SCIP_DECL_CONSEXITSOL ((*consexitsol)), /**< solving process deinitialization method of constraint handler */
98  SCIP_DECL_CONSDELETE ((*consdelete)), /**< free specific constraint data */
99  SCIP_DECL_CONSTRANS ((*constrans)), /**< transform constraint data into data belonging to the transformed problem */
100  SCIP_DECL_CONSINITLP ((*consinitlp)), /**< initialize LP with relaxations of "initial" constraints */
101  SCIP_DECL_CONSSEPALP ((*conssepalp)), /**< separate cutting planes for LP solution */
102  SCIP_DECL_CONSSEPASOL ((*conssepasol)), /**< separate cutting planes for arbitrary primal solution */
103  SCIP_DECL_CONSENFOLP ((*consenfolp)), /**< enforcing constraints for LP solutions */
104  SCIP_DECL_CONSENFORELAX ((*consenforelax)), /**< enforcing constraints for relaxation solutions */
105  SCIP_DECL_CONSENFOPS ((*consenfops)), /**< enforcing constraints for pseudo solutions */
106  SCIP_DECL_CONSCHECK ((*conscheck)), /**< check feasibility of primal solution */
107  SCIP_DECL_CONSPROP ((*consprop)), /**< propagate variable domains */
108  SCIP_DECL_CONSPRESOL ((*conspresol)), /**< presolving method */
109  SCIP_DECL_CONSRESPROP ((*consresprop)), /**< propagation conflict resolving method */
110  SCIP_DECL_CONSLOCK ((*conslock)), /**< variable rounding lock method */
111  SCIP_DECL_CONSACTIVE ((*consactive)), /**< activation notification method */
112  SCIP_DECL_CONSDEACTIVE((*consdeactive)), /**< deactivation notification method */
113  SCIP_DECL_CONSENABLE ((*consenable)), /**< enabling notification method */
114  SCIP_DECL_CONSDISABLE ((*consdisable)), /**< disabling notification method */
115  SCIP_DECL_CONSDELVARS ((*consdelvars)), /**< variable deletion method */
116  SCIP_DECL_CONSPRINT ((*consprint)), /**< constraint display method */
117  SCIP_DECL_CONSCOPY ((*conscopy)), /**< constraint copying method */
118  SCIP_DECL_CONSPARSE ((*consparse)), /**< constraint parsing method */
119  SCIP_DECL_CONSGETVARS ((*consgetvars)), /**< constraint get variables method */
120  SCIP_DECL_CONSGETNVARS((*consgetnvars)), /**< constraint get number of variable method */
121  SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)), /**< constraint handler diving solution enforcement method */
122  SCIP_CONSHDLRDATA* conshdlrdata /**< constraint handler data */
123  )
124 {
125  SCIP_CONSHDLR* conshdlr;
126 
127  SCIP_CALL( SCIPcheckStage(scip, "SCIPincludeConshdlr", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
128 
129  /* check whether constraint handler is already present */
130  if( SCIPfindConshdlr(scip, name) != NULL )
131  {
132  SCIPerrorMessage("constraint handler <%s> already included.\n", name);
133  return SCIP_INVALIDDATA;
134  }
135 
136  SCIP_CALL( SCIPconshdlrCreate(&conshdlr, scip->set, scip->messagehdlr, scip->mem->setmem,
137  name, desc, sepapriority, enfopriority, chckpriority, sepafreq, propfreq, eagerfreq, maxprerounds,
138  delaysepa, delayprop, needscons, proptiming, presoltiming, conshdlrcopy,
139  consfree, consinit, consexit, consinitpre, consexitpre, consinitsol, consexitsol,
140  consdelete, constrans, consinitlp, conssepalp, conssepasol, consenfolp, consenforelax, consenfops, conscheck, consprop,
141  conspresol, consresprop, conslock, consactive, consdeactive, consenable, consdisable, consdelvars, consprint,
142  conscopy, consparse, consgetvars, consgetnvars, consgetdivebdchgs, conshdlrdata) );
143  SCIP_CALL( SCIPsetIncludeConshdlr(scip->set, conshdlr) );
144 
145  return SCIP_OKAY;
146 }
147 
148 /** creates a constraint handler and includes it in SCIP. All non-fundamental (or optional) callbacks will be set to NULL.
149  * Optional callbacks can be set via specific setter functions, see SCIPsetConshdlrInit(), SCIPsetConshdlrExit(),
150  * SCIPsetConshdlrCopy(), SCIPsetConshdlrFree(), SCIPsetConshdlrInitsol(), SCIPsetConshdlrExitsol(),
151  * SCIPsetConshdlrInitpre(), SCIPsetConshdlrExitpre(), SCIPsetConshdlrPresol(), SCIPsetConshdlrDelete(),
152  * SCIPsetConshdlrDelvars(), SCIPsetConshdlrInitlp(), SCIPsetConshdlrActive(), SCIPsetConshdlrDeactive(),
153  * SCIPsetConshdlrEnable(), SCIPsetConshdlrDisable(), SCIPsetConshdlrResprop(), SCIPsetConshdlrTrans(),
154  * SCIPsetConshdlrPrint(), SCIPsetConshdlrParse(), SCIPsetConshdlrGetVars(), SCIPsetConshdlrGetNVars(), and
155  * SCIPsetConshdlrGetDiveBdChgs().
156  *
157  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
158  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
159  *
160  * @pre This method can be called if SCIP is in one of the following stages:
161  * - \ref SCIP_STAGE_INIT
162  * - \ref SCIP_STAGE_PROBLEM
163  *
164  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeConshdlr() instead
165  */
167  SCIP* scip, /**< SCIP data structure */
168  SCIP_CONSHDLR** conshdlrptr, /**< reference to a constraint handler pointer, or NULL */
169  const char* name, /**< name of constraint handler */
170  const char* desc, /**< description of constraint handler */
171  int enfopriority, /**< priority of the constraint handler for constraint enforcing */
172  int chckpriority, /**< priority of the constraint handler for checking feasibility (and propagation) */
173  int eagerfreq, /**< frequency for using all instead of only the useful constraints in separation,
174  * propagation and enforcement, -1 for no eager evaluations, 0 for first only */
175  SCIP_Bool needscons, /**< should the constraint handler be skipped, if no constraints are available? */
176  SCIP_DECL_CONSENFOLP ((*consenfolp)), /**< enforcing constraints for LP solutions */
177  SCIP_DECL_CONSENFOPS ((*consenfops)), /**< enforcing constraints for pseudo solutions */
178  SCIP_DECL_CONSCHECK ((*conscheck)), /**< check feasibility of primal solution */
179  SCIP_DECL_CONSLOCK ((*conslock)), /**< variable rounding lock method */
180  SCIP_CONSHDLRDATA* conshdlrdata /**< constraint handler data */
181  )
182 {
183  SCIP_CONSHDLR* conshdlr;
184 
185  SCIP_CALL( SCIPcheckStage(scip, "SCIPincludeConshdlrBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
186 
187  /* check whether constraint handler is already present */
188  if( SCIPfindConshdlr(scip, name) != NULL )
189  {
190  SCIPerrorMessage("constraint handler <%s> already included.\n", name);
191  return SCIP_INVALIDDATA;
192  }
193 
194  SCIP_CALL( SCIPconshdlrCreate(&conshdlr, scip->set, scip->messagehdlr, scip->mem->setmem,
195  name, desc, 0, enfopriority, chckpriority, -1, -1, eagerfreq, 0,
196  FALSE, FALSE, needscons,
198  NULL,
199  NULL, NULL, NULL, NULL, NULL, NULL, NULL,
200  NULL, NULL, NULL, NULL, NULL, consenfolp, NULL, consenfops, conscheck, NULL,
201  NULL, NULL, conslock, NULL, NULL, NULL, NULL, NULL, NULL,
202  NULL, NULL, NULL, NULL, NULL, conshdlrdata) );
203  SCIP_CALL( SCIPsetIncludeConshdlr(scip->set, conshdlr) );
204 
205  if( conshdlrptr != NULL )
206  *conshdlrptr = conshdlr;
207 
208  return SCIP_OKAY;
209 }
210 
211 /** sets all separation related callbacks/parameters of the constraint handler
212  *
213  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
214  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
215  *
216  * @pre This method can be called if SCIP is in one of the following stages:
217  * - \ref SCIP_STAGE_INIT
218  * - \ref SCIP_STAGE_PROBLEM
219  */
221  SCIP* scip, /**< SCIP data structure */
222  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
223  SCIP_DECL_CONSSEPALP ((*conssepalp)), /**< separate cutting planes for LP solution */
224  SCIP_DECL_CONSSEPASOL ((*conssepasol)), /**< separate cutting planes for arbitrary primal solution */
225  int sepafreq, /**< frequency for separating cuts; zero means to separate only in the root node */
226  int sepapriority, /**< priority of the constraint handler for separation */
227  SCIP_Bool delaysepa /**< should separation method be delayed, if other separators found cuts? */
228  )
229 {
230  int oldsepapriority;
231  const char* name;
233 
234  assert(scip != NULL);
235  assert(conshdlr != NULL);
236 
237  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrSepa", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
238 
239  oldsepapriority = SCIPconshdlrGetSepaPriority(conshdlr);
240  SCIPconshdlrSetSepa(conshdlr, conssepalp, conssepasol, sepafreq, sepapriority, delaysepa);
241 
242  /* change the position of the constraint handler in the constraint handler array w.r.t. its new sepa priority */
243  if( oldsepapriority != sepapriority )
244  SCIPsetReinsertConshdlrSepaPrio(scip->set, conshdlr, oldsepapriority);
245 
246  name = SCIPconshdlrGetName(conshdlr);
247 
248  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/sepafreq", name);
249  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, sepafreq) );
250 
251  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/delaysepa", name);
252  SCIP_CALL( SCIPsetSetDefaultBoolParam(scip->set, paramname, delaysepa) );
253 
254  return SCIP_OKAY;
255 }
256 
257 /** sets both the propagation callback and the propagation frequency of the constraint handler
258  *
259  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
260  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
261  *
262  * @pre This method can be called if SCIP is in one of the following stages:
263  * - \ref SCIP_STAGE_INIT
264  * - \ref SCIP_STAGE_PROBLEM
265  */
267  SCIP* scip, /**< SCIP data structure */
268  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
269  SCIP_DECL_CONSPROP ((*consprop)), /**< propagate variable domains */
270  int propfreq, /**< frequency for propagating domains; zero means only preprocessing propagation */
271  SCIP_Bool delayprop, /**< should propagation method be delayed, if other propagators found reductions? */
272  SCIP_PROPTIMING proptiming /**< positions in the node solving loop where propagation should be executed */
273  )
274 {
275  const char* name;
277 
278  assert(scip != NULL);
279  assert(conshdlr != NULL);
280 
281  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrProp", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
282 
283  SCIPconshdlrSetProp(conshdlr, consprop, propfreq, delayprop, proptiming);
284 
285  name = SCIPconshdlrGetName(conshdlr);
286 
287  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/propfreq", name);
288  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, propfreq) );
289 
290  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/proptiming", name);
291  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, (int) proptiming) );
292 
293  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/delayprop", name);
294  SCIP_CALL( SCIPsetSetDefaultBoolParam(scip->set, paramname, delayprop) );
295 
296  return SCIP_OKAY;
297 }
298 
299 /** sets relaxation enforcement method of the constraint handler
300  *
301  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
302  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
303  *
304  * @pre This method can be called if SCIP is in one of the following stages:
305  * - \ref SCIP_STAGE_INIT
306  * - \ref SCIP_STAGE_PROBLEM
307  */
309  SCIP* scip, /**< SCIP data structure */
310  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
311  SCIP_DECL_CONSENFORELAX ((*consenforelax)) /**< enforcement method for relaxation solution of constraint handler (might be NULL) */
312  )
313 {
314  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrEnforelax", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
315 
316  assert(conshdlr != NULL);
317 
318  SCIPconshdlrSetEnforelax(conshdlr, consenforelax);
319 
320  return SCIP_OKAY;
321 }
322 
323 /** sets copy method of both the constraint handler and each associated constraint
324  *
325  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
326  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
327  *
328  * @pre This method can be called if SCIP is in one of the following stages:
329  * - \ref SCIP_STAGE_INIT
330  * - \ref SCIP_STAGE_PROBLEM
331  */
333  SCIP* scip, /**< SCIP data structure */
334  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
335  SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), /**< copy method of constraint handler or NULL if you don't want to copy your plugin into sub-SCIPs */
336  SCIP_DECL_CONSCOPY ((*conscopy)) /**< constraint copying method */
337  )
338 {
339  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
340 
341  assert(conshdlr != NULL);
342 
343  SCIPconshdlrSetCopy(conshdlr, conshdlrcopy, conscopy);
344 
345  return SCIP_OKAY;
346 }
347 
348 /** sets destructor method of constraint handler
349  *
350  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
351  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
352  *
353  * @pre This method can be called if SCIP is in one of the following stages:
354  * - \ref SCIP_STAGE_INIT
355  * - \ref SCIP_STAGE_PROBLEM
356  */
358  SCIP* scip, /**< SCIP data structure */
359  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
360  SCIP_DECL_CONSFREE ((*consfree)) /**< destructor of constraint handler */
361  )
362 {
363  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
364 
365  assert(conshdlr != NULL);
366 
367  SCIPconshdlrSetFree(conshdlr, consfree);
368 
369  return SCIP_OKAY;
370 }
371 
372 /** sets initialization method of constraint handler
373  *
374  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
375  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
376  *
377  * @pre This method can be called if SCIP is in one of the following stages:
378  * - \ref SCIP_STAGE_INIT
379  * - \ref SCIP_STAGE_PROBLEM
380  */
382  SCIP* scip, /**< SCIP data structure */
383  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
384  SCIP_DECL_CONSINIT ((*consinit)) /**< initialize constraint handler */
385  )
386 {
387  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
388 
389  assert(conshdlr != NULL);
390 
391  SCIPconshdlrSetInit(conshdlr, consinit);
392 
393  return SCIP_OKAY;
394 }
395 
396 /** sets deinitialization method of constraint handler
397  *
398  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
399  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
400  *
401  * @pre This method can be called if SCIP is in one of the following stages:
402  * - \ref SCIP_STAGE_INIT
403  * - \ref SCIP_STAGE_PROBLEM
404  */
406  SCIP* scip, /**< SCIP data structure */
407  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
408  SCIP_DECL_CONSEXIT ((*consexit)) /**< deinitialize constraint handler */
409  )
410 {
411  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
412 
413  assert(conshdlr != NULL);
414 
415  SCIPconshdlrSetExit(conshdlr, consexit);
416 
417  return SCIP_OKAY;
418 }
419 
420 /** sets solving process initialization method of constraint handler
421  *
422  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
423  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
424  *
425  * @pre This method can be called if SCIP is in one of the following stages:
426  * - \ref SCIP_STAGE_INIT
427  * - \ref SCIP_STAGE_PROBLEM
428  */
430  SCIP* scip, /**< SCIP data structure */
431  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
432  SCIP_DECL_CONSINITSOL((*consinitsol)) /**< solving process initialization method of constraint handler */
433  )
434 {
435  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
436 
437  assert(conshdlr != NULL);
438 
439  SCIPconshdlrSetInitsol(conshdlr, consinitsol);
440 
441  return SCIP_OKAY;
442 }
443 
444 /** sets solving process deinitialization method of constraint handler
445  *
446  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
447  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
448  *
449  * @pre This method can be called if SCIP is in one of the following stages:
450  * - \ref SCIP_STAGE_INIT
451  * - \ref SCIP_STAGE_PROBLEM
452  */
454  SCIP* scip, /**< SCIP data structure */
455  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
456  SCIP_DECL_CONSEXITSOL ((*consexitsol))/**< solving process deinitialization method of constraint handler */
457  )
458 {
459  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
460 
461  assert(conshdlr != NULL);
462 
463  SCIPconshdlrSetExitsol(conshdlr, consexitsol);
464 
465  return SCIP_OKAY;
466 }
467 
468 /** sets preprocessing initialization method of constraint handler
469  *
470  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
471  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
472  *
473  * @pre This method can be called if SCIP is in one of the following stages:
474  * - \ref SCIP_STAGE_INIT
475  * - \ref SCIP_STAGE_PROBLEM
476  */
478  SCIP* scip, /**< SCIP data structure */
479  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
480  SCIP_DECL_CONSINITPRE((*consinitpre)) /**< preprocessing initialization method of constraint handler */
481  )
482 {
483  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrInitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
484 
485  assert(conshdlr != NULL);
486 
487  SCIPconshdlrSetInitpre(conshdlr, consinitpre);
488 
489  return SCIP_OKAY;
490 }
491 
492 /** sets preprocessing deinitialization method of constraint handler
493  *
494  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
495  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
496  *
497  * @pre This method can be called if SCIP is in one of the following stages:
498  * - \ref SCIP_STAGE_INIT
499  * - \ref SCIP_STAGE_PROBLEM
500  */
502  SCIP* scip, /**< SCIP data structure */
503  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
504  SCIP_DECL_CONSEXITPRE((*consexitpre)) /**< preprocessing deinitialization method of constraint handler */
505  )
506 {
507  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrExitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
508 
509  assert(conshdlr != NULL);
510 
511  SCIPconshdlrSetExitpre(conshdlr, consexitpre);
512 
513  return SCIP_OKAY;
514 }
515 
516 /** sets presolving method of constraint handler
517  *
518  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
519  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
520  *
521  * @pre This method can be called if SCIP is in one of the following stages:
522  * - \ref SCIP_STAGE_INIT
523  * - \ref SCIP_STAGE_PROBLEM
524  */
526  SCIP* scip, /**< SCIP data structure */
527  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
528  SCIP_DECL_CONSPRESOL ((*conspresol)), /**< presolving method of constraint handler */
529  int maxprerounds, /**< maximal number of presolving rounds the constraint handler participates in (-1: no limit) */
530  SCIP_PRESOLTIMING presoltiming /**< timing mask of the constraint handler's presolving method */
531  )
532 {
533  const char* name;
535 
536  assert(scip != NULL);
537  assert(conshdlr != NULL);
538 
539  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrPresol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
540 
541  SCIP_CALL( SCIPconshdlrSetPresol(conshdlr, conspresol, maxprerounds, presoltiming) );
542 
543  name = SCIPconshdlrGetName(conshdlr);
544 
545  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/maxprerounds", name);
546  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, maxprerounds) );
547 
548  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/presoltiming", name);
549  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, (int) presoltiming) );
550 
551  return SCIP_OKAY;
552 }
553 
554 /** sets method of constraint handler to free specific constraint data
555  *
556  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
557  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
558  *
559  * @pre This method can be called if SCIP is in one of the following stages:
560  * - \ref SCIP_STAGE_INIT
561  * - \ref SCIP_STAGE_PROBLEM
562  */
564  SCIP* scip, /**< SCIP data structure */
565  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
566  SCIP_DECL_CONSDELETE ((*consdelete)) /**< free specific constraint data */
567  )
568 {
569  assert(scip != NULL);
570  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrDelete", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
571 
572  SCIPconshdlrSetDelete(conshdlr, consdelete);
573 
574  return SCIP_OKAY;
575 }
576 
577 /** sets method of constraint handler to transform constraint data into data belonging to the transformed problem
578  *
579  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
580  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
581  *
582  * @pre This method can be called if SCIP is in one of the following stages:
583  * - \ref SCIP_STAGE_INIT
584  * - \ref SCIP_STAGE_PROBLEM
585  */
587  SCIP* scip, /**< SCIP data structure */
588  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
589  SCIP_DECL_CONSTRANS ((*constrans)) /**< transform constraint data into data belonging to the transformed problem */
590  )
591 {
592  assert(scip != NULL);
593  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrTrans", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
594 
595  SCIPconshdlrSetTrans(conshdlr, constrans);
596 
597  return SCIP_OKAY;
598 }
599 
600 /** sets method of constraint handler to initialize LP with relaxations of "initial" constraints
601  *
602  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
603  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
604  *
605  * @pre This method can be called if SCIP is in one of the following stages:
606  * - \ref SCIP_STAGE_INIT
607  * - \ref SCIP_STAGE_PROBLEM
608  */
610  SCIP* scip, /**< SCIP data structure */
611  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
612  SCIP_DECL_CONSINITLP ((*consinitlp)) /**< initialize LP with relaxations of "initial" constraints */
613  )
614 {
615  assert(scip != NULL);
616  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrInitlp", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
617 
618  SCIPconshdlrSetInitlp(conshdlr, consinitlp);
619 
620  return SCIP_OKAY;
621 }
622 
623 /** sets propagation conflict resolving method of constraint handler
624  *
625  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
626  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
627  *
628  * @pre This method can be called if SCIP is in one of the following stages:
629  * - \ref SCIP_STAGE_INIT
630  * - \ref SCIP_STAGE_PROBLEM
631  */
633  SCIP* scip, /**< SCIP data structure */
634  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
635  SCIP_DECL_CONSRESPROP ((*consresprop)) /**< propagation conflict resolving method */
636  )
637 {
638  assert(scip != NULL);
639  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrResprop", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
640 
641  SCIPconshdlrSetResprop(conshdlr, consresprop);
642 
643  return SCIP_OKAY;
644 }
645 
646 /** sets activation notification method of constraint handler
647  *
648  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
649  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
650  *
651  * @pre This method can be called if SCIP is in one of the following stages:
652  * - \ref SCIP_STAGE_INIT
653  * - \ref SCIP_STAGE_PROBLEM
654  */
656  SCIP* scip, /**< SCIP data structure */
657  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
658  SCIP_DECL_CONSACTIVE ((*consactive)) /**< activation notification method */
659  )
660 {
661  assert(scip != NULL);
662  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrActive", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
663 
664  SCIPconshdlrSetActive(conshdlr, consactive);
665 
666  return SCIP_OKAY;
667 }
668 
669 /** sets deactivation notification method of constraint handler
670  *
671  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
672  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
673  *
674  * @pre This method can be called if SCIP is in one of the following stages:
675  * - \ref SCIP_STAGE_INIT
676  * - \ref SCIP_STAGE_PROBLEM
677  */
679  SCIP* scip, /**< SCIP data structure */
680  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
681  SCIP_DECL_CONSDEACTIVE((*consdeactive)) /**< deactivation notification method */
682  )
683 {
684  assert(scip != NULL);
685  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrDeactive", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
686 
687  SCIPconshdlrSetDeactive(conshdlr, consdeactive);
688 
689  return SCIP_OKAY;
690 }
691 
692 /** sets enabling notification method of constraint handler
693  *
694  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
695  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
696  *
697  * @pre This method can be called if SCIP is in one of the following stages:
698  * - \ref SCIP_STAGE_INIT
699  * - \ref SCIP_STAGE_PROBLEM
700  */
702  SCIP* scip, /**< SCIP data structure */
703  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
704  SCIP_DECL_CONSENABLE ((*consenable)) /**< enabling notification method */
705  )
706 {
707  assert(scip != NULL);
708  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrEnable", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
709 
710  SCIPconshdlrSetEnable(conshdlr, consenable);
711 
712  return SCIP_OKAY;
713 }
714 
715 /** sets disabling notification method of constraint handler
716  *
717  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
718  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
719  *
720  * @pre This method can be called if SCIP is in one of the following stages:
721  * - \ref SCIP_STAGE_INIT
722  * - \ref SCIP_STAGE_PROBLEM
723  */
725  SCIP* scip, /**< SCIP data structure */
726  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
727  SCIP_DECL_CONSDISABLE ((*consdisable)) /**< disabling notification method */
728  )
729 {
730  assert(scip != NULL);
731  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrDisable", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
732 
733  SCIPconshdlrSetDisable(conshdlr, consdisable);
734 
735  return SCIP_OKAY;
736 }
737 
738 /** sets variable deletion method of constraint handler
739  *
740  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
741  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
742  *
743  * @pre This method can be called if SCIP is in one of the following stages:
744  * - \ref SCIP_STAGE_INIT
745  * - \ref SCIP_STAGE_PROBLEM
746  */
748  SCIP* scip, /**< SCIP data structure */
749  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
750  SCIP_DECL_CONSDELVARS ((*consdelvars)) /**< variable deletion method */
751  )
752 {
753  assert(scip != NULL);
754  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrDelvars", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
755 
756  SCIPconshdlrSetDelvars(conshdlr, consdelvars);
757 
758  return SCIP_OKAY;
759 }
760 
761 /** sets constraint display method of constraint handler
762  *
763  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
764  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
765  *
766  * @pre This method can be called if SCIP is in one of the following stages:
767  * - \ref SCIP_STAGE_INIT
768  * - \ref SCIP_STAGE_PROBLEM
769  */
771  SCIP* scip, /**< SCIP data structure */
772  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
773  SCIP_DECL_CONSPRINT ((*consprint)) /**< constraint display method */
774  )
775 {
776  assert(scip != NULL);
777  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrPrint", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
778 
779  SCIPconshdlrSetPrint(conshdlr, consprint);
780 
781  return SCIP_OKAY;
782 }
783 
784 /** sets constraint parsing method of constraint handler
785  *
786  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
787  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
788  *
789  * @pre This method can be called if SCIP is in one of the following stages:
790  * - \ref SCIP_STAGE_INIT
791  * - \ref SCIP_STAGE_PROBLEM
792  */
794  SCIP* scip, /**< SCIP data structure */
795  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
796  SCIP_DECL_CONSPARSE ((*consparse)) /**< constraint parsing method */
797  )
798 {
799  assert(scip != NULL);
800  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrParse", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
801 
802  SCIPconshdlrSetParse(conshdlr, consparse);
803 
804  return SCIP_OKAY;
805 }
806 
807 /** sets constraint variable getter method of constraint handler
808  *
809  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
810  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
811  *
812  * @pre This method can be called if SCIP is in one of the following stages:
813  * - \ref SCIP_STAGE_INIT
814  * - \ref SCIP_STAGE_PROBLEM
815  */
817  SCIP* scip, /**< SCIP data structure */
818  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
819  SCIP_DECL_CONSGETVARS ((*consgetvars)) /**< constraint variable getter method */
820  )
821 {
822  assert(scip != NULL);
823  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrGetVars", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
824 
825  SCIPconshdlrSetGetVars(conshdlr, consgetvars);
826 
827  return SCIP_OKAY;
828 }
829 
830 /** sets constraint variable number getter method of constraint handler
831  *
832  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
833  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
834  *
835  * @pre This method can be called if SCIP is in one of the following stages:
836  * - \ref SCIP_STAGE_INIT
837  * - \ref SCIP_STAGE_PROBLEM
838  */
840  SCIP* scip, /**< SCIP data structure */
841  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
842  SCIP_DECL_CONSGETNVARS((*consgetnvars)) /**< constraint variable number getter method */
843  )
844 {
845  assert(scip != NULL);
846  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrGetNVars", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
847 
848  SCIPconshdlrSetGetNVars(conshdlr, consgetnvars);
849 
850  return SCIP_OKAY;
851 }
852 
853 /** sets diving bound change method of constraint handler
854  *
855  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
856  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
857  *
858  * @pre This method can be called if SCIP is in one of the following stages:
859  * - \ref SCIP_STAGE_INIT
860  * - \ref SCIP_STAGE_PROBLEM
861  */
863  SCIP* scip, /**< SCIP data structure */
864  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
865  SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)) /**< constraint handler diving solution enforcement method */
866  )
867 {
868  assert(scip != NULL);
869  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConshdlrGetDiveBdChgs", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
870 
871  SCIPconshdlrSetGetDiveBdChgs(conshdlr, consgetdivebdchgs);
872 
873  return SCIP_OKAY;
874 }
875 /** returns the constraint handler of the given name, or NULL if not existing */
876 /** returns the constraint handler of the given name, or NULL if not existing */
878  SCIP* scip, /**< SCIP data structure */
879  const char* name /**< name of constraint handler */
880  )
881 {
882  assert(scip != NULL);
883  assert(scip->set != NULL);
884  assert(name != NULL);
885 
886  return SCIPsetFindConshdlr(scip->set, name);
887 }
888 
889 /** returns the array of currently available constraint handlers */
891  SCIP* scip /**< SCIP data structure */
892  )
893 {
894  assert(scip != NULL);
895  assert(scip->set != NULL);
896 
897  return scip->set->conshdlrs;
898 }
899 
900 /** returns the number of currently available constraint handlers */
902  SCIP* scip /**< SCIP data structure */
903  )
904 {
905  assert(scip != NULL);
906  assert(scip->set != NULL);
907 
908  return scip->set->nconshdlrs;
909 }
910 
911 /** creates and captures a constraint of the given constraint handler
912  *
913  * @warning If a constraint is marked to be checked for feasibility but not to be enforced, a LP or pseudo solution may
914  * be declared feasible even if it violates this particular constraint. This constellation should only be
915  * used, if no LP or pseudo solution can violate the constraint -- e.g. if a local constraint is redundant due
916  * to the variable's local bounds.
917  *
918  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
919  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
920  *
921  * @pre This method can be called if @p scip is in one of the following stages:
922  * - \ref SCIP_STAGE_PROBLEM
923  * - \ref SCIP_STAGE_TRANSFORMING
924  * - \ref SCIP_STAGE_INITPRESOLVE
925  * - \ref SCIP_STAGE_PRESOLVING
926  * - \ref SCIP_STAGE_EXITPRESOLVE
927  * - \ref SCIP_STAGE_PRESOLVED
928  * - \ref SCIP_STAGE_INITSOLVE
929  * - \ref SCIP_STAGE_SOLVING
930  * - \ref SCIP_STAGE_EXITSOLVE
931  *
932  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
933  */
935  SCIP* scip, /**< SCIP data structure */
936  SCIP_CONS** cons, /**< pointer to constraint */
937  const char* name, /**< name of constraint */
938  SCIP_CONSHDLR* conshdlr, /**< constraint handler for this constraint */
939  SCIP_CONSDATA* consdata, /**< data for this specific constraint */
940  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
941  * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
942  SCIP_Bool separate, /**< should the constraint be separated during LP processing?
943  * Usually set to TRUE. */
944  SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
945  * TRUE for model constraints, FALSE for additional, redundant constraints. */
946  SCIP_Bool check, /**< should the constraint be checked for feasibility?
947  * TRUE for model constraints, FALSE for additional, redundant constraints. */
948  SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
949  * Usually set to TRUE. */
950  SCIP_Bool local, /**< is constraint only valid locally?
951  * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
952  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
953  * Usually set to FALSE. In column generation applications, set to TRUE if pricing
954  * adds coefficients to this constraint. */
955  SCIP_Bool dynamic, /**< is constraint subject to aging?
956  * Usually set to FALSE. Set to TRUE for own cuts which
957  * are separated as constraints. */
958  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
959  * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
960  SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
961  * if it may be moved to a more global node?
962  * Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
963  )
964 {
965  assert(cons != NULL);
966  assert(name != NULL);
967  assert(conshdlr != NULL);
968 
969  SCIP_CALL( SCIPcheckStage(scip, "SCIPcreateCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
970 
971  switch( scip->set->stage )
972  {
973  case SCIP_STAGE_PROBLEM:
974  SCIP_CALL( SCIPconsCreate(cons, scip->mem->probmem, scip->set, name, conshdlr, consdata,
975  initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, TRUE, TRUE) );
976  return SCIP_OKAY;
977 
985  case SCIP_STAGE_SOLVING:
987  SCIP_CALL( SCIPconsCreate(cons, scip->mem->probmem, scip->set, name, conshdlr, consdata,
988  initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, FALSE, TRUE) );
989  return SCIP_OKAY;
990 
991  default:
992  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
993  return SCIP_INVALIDCALL;
994  } /*lint !e788*/
995 }
996 
997 /** parses constraint information (in cip format) out of a string; if the parsing process was successful a constraint is
998  * creates and captures;
999  *
1000  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1001  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1002  *
1003  * @pre This method can be called if @p scip is in one of the following stages:
1004  * - \ref SCIP_STAGE_PROBLEM
1005  * - \ref SCIP_STAGE_TRANSFORMING
1006  * - \ref SCIP_STAGE_INITPRESOLVE
1007  * - \ref SCIP_STAGE_PRESOLVING
1008  * - \ref SCIP_STAGE_EXITPRESOLVE
1009  * - \ref SCIP_STAGE_PRESOLVED
1010  * - \ref SCIP_STAGE_SOLVING
1011  * - \ref SCIP_STAGE_EXITSOLVE
1012  *
1013  * @warning If a constraint is marked to be checked for feasibility but not to be enforced, a LP or pseudo solution may
1014  * be declared feasible even if it violates this particular constraint. This constellation should only be
1015  * used, if no LP or pseudo solution can violate the constraint -- e.g. if a local constraint is redundant due
1016  * to the variable's local bounds.
1017  */
1019  SCIP* scip, /**< SCIP data structure */
1020  SCIP_CONS** cons, /**< pointer to store constraint */
1021  const char* str, /**< string to parse for constraint */
1022  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
1023  * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
1024  SCIP_Bool separate, /**< should the constraint be separated during LP processing?
1025  * Usually set to TRUE. */
1026  SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
1027  * TRUE for model constraints, FALSE for additional, redundant constraints. */
1028  SCIP_Bool check, /**< should the constraint be checked for feasibility?
1029  * TRUE for model constraints, FALSE for additional, redundant constraints. */
1030  SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
1031  * Usually set to TRUE. */
1032  SCIP_Bool local, /**< is constraint only valid locally?
1033  * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
1034  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
1035  * Usually set to FALSE. In column generation applications, set to TRUE if pricing
1036  * adds coefficients to this constraint. */
1037  SCIP_Bool dynamic, /**< is constraint subject to aging?
1038  * Usually set to FALSE. Set to TRUE for own cuts which
1039  * are separated as constraints. */
1040  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
1041  * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
1042  SCIP_Bool stickingatnode, /**< should the constraint always be kept at the node where it was added, even
1043  * if it may be moved to a more global node?
1044  * Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
1045  SCIP_Bool* success /**< pointer to store if the paring process was successful */
1046  )
1047 {
1048  assert(cons != NULL);
1049 
1050  SCIP_CALL( SCIPcheckStage(scip, "SCIPparseCons", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
1051 
1052  SCIP_CALL( SCIPconsParse(cons, scip->set, scip->messagehdlr, str,
1053  initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, success) );
1054 
1055  return SCIP_OKAY;
1056 }
1057 
1058 /** increases usage counter of constraint
1059  *
1060  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1061  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1062  *
1063  * @pre This method can be called if @p scip is in one of the following stages:
1064  * - \ref SCIP_STAGE_PROBLEM
1065  * - \ref SCIP_STAGE_TRANSFORMING
1066  * - \ref SCIP_STAGE_TRANSFORMED
1067  * - \ref SCIP_STAGE_INITPRESOLVE
1068  * - \ref SCIP_STAGE_PRESOLVING
1069  * - \ref SCIP_STAGE_EXITPRESOLVE
1070  * - \ref SCIP_STAGE_PRESOLVED
1071  * - \ref SCIP_STAGE_INITSOLVE
1072  * - \ref SCIP_STAGE_SOLVING
1073  * - \ref SCIP_STAGE_SOLVED
1074  */
1076  SCIP* scip, /**< SCIP data structure */
1077  SCIP_CONS* cons /**< constraint to capture */
1078  )
1079 {
1080  SCIP_CALL( SCIPcheckStage(scip, "SCIPcaptureCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1081 
1082  assert( cons->scip == scip );
1083 
1084  SCIPconsCapture(cons);
1085 
1086  return SCIP_OKAY;
1087 }
1088 
1089 /** decreases usage counter of constraint, if the usage pointer reaches zero the constraint gets freed
1090  *
1091  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1092  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1093  *
1094  * @pre This method can be called if @p scip is in one of the following stages:
1095  * - \ref SCIP_STAGE_PROBLEM
1096  * - \ref SCIP_STAGE_TRANSFORMING
1097  * - \ref SCIP_STAGE_TRANSFORMED
1098  * - \ref SCIP_STAGE_INITPRESOLVE
1099  * - \ref SCIP_STAGE_PRESOLVING
1100  * - \ref SCIP_STAGE_EXITPRESOLVE
1101  * - \ref SCIP_STAGE_PRESOLVED
1102  * - \ref SCIP_STAGE_INITSOLVE
1103  * - \ref SCIP_STAGE_SOLVING
1104  * - \ref SCIP_STAGE_SOLVED
1105  * - \ref SCIP_STAGE_EXITSOLVE
1106  * - \ref SCIP_STAGE_FREETRANS
1107  *
1108  * @note the pointer of the constraint will be NULLed
1109  */
1111  SCIP* scip, /**< SCIP data structure */
1112  SCIP_CONS** cons /**< pointer to constraint */
1113  )
1114 {
1115  assert(cons != NULL);
1116  assert(*cons != NULL);
1117 
1118  SCIP_CALL( SCIPcheckStage(scip, "SCIPreleaseCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
1119 
1120  switch( scip->set->stage )
1121  {
1122  case SCIP_STAGE_PROBLEM:
1123  SCIP_CALL( SCIPconsRelease(cons, scip->mem->probmem, scip->set) );
1124  return SCIP_OKAY;
1125 
1129  case SCIP_STAGE_PRESOLVING:
1131  case SCIP_STAGE_PRESOLVED:
1132  case SCIP_STAGE_INITSOLVE:
1133  case SCIP_STAGE_SOLVING:
1134  case SCIP_STAGE_SOLVED:
1135  case SCIP_STAGE_EXITSOLVE:
1136  case SCIP_STAGE_FREETRANS:
1137  if( SCIPconsIsOriginal(*cons) && (*cons)->nuses == 1 && (*cons)->transorigcons != NULL )
1138  {
1139  SCIPerrorMessage("cannot release last use of original constraint while an associated transformed constraint exists\n");
1140  return SCIP_INVALIDCALL;
1141  }
1142  SCIP_CALL( SCIPconsRelease(cons, scip->mem->probmem, scip->set) );
1143  return SCIP_OKAY;
1144 
1145  default:
1146  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
1147  return SCIP_INVALIDCALL;
1148  } /*lint !e788*/
1149 }
1150 
1151 /** change constraint name
1152  *
1153  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1154  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1155  *
1156  * @pre This method can be called if @p scip is in one of the following stages:
1157  * - \ref SCIP_STAGE_PROBLEM
1158  *
1159  * @note to get the current name of a constraint, use SCIPconsGetName() from pub_cons.h
1160  */
1162  SCIP* scip, /**< SCIP data structure */
1163  SCIP_CONS* cons, /**< constraint */
1164  const char* name /**< new name of constraint */
1165  )
1166 {
1167  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgConsName", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE , FALSE, FALSE, FALSE) );
1168 
1169  assert( cons->scip == scip );
1170 
1171  if( SCIPgetStage(scip) != SCIP_STAGE_PROBLEM )
1172  {
1173  SCIPerrorMessage("constraint names can only be changed in problem creation stage\n");
1174  SCIPABORT();
1175  return SCIP_INVALIDCALL; /*lint !e527*/
1176  }
1177 
1178  /* remove constraint's name from the namespace if the constraint was already added */
1179  if( SCIPconsIsAdded(cons) )
1180  {
1181  SCIP_CALL( SCIPprobRemoveConsName(scip->origprob, cons) );
1182  }
1183 
1184  /* change constraint name */
1185  SCIP_CALL( SCIPconsChgName(cons, SCIPblkmem(scip), name) );
1186 
1187  /* add constraint's name to the namespace if the constraint was already added */
1188  if( SCIPconsIsAdded(cons) )
1189  {
1190  SCIP_CALL( SCIPprobAddConsName(scip->origprob, cons) );
1191  }
1192 
1193  return SCIP_OKAY;
1194 }
1195 
1196 /** sets the initial flag of the given constraint
1197  *
1198  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1199  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1200  *
1201  * @pre This method can be called if @p scip is in one of the following stages:
1202  * - \ref SCIP_STAGE_PROBLEM
1203  * - \ref SCIP_STAGE_TRANSFORMING
1204  * - \ref SCIP_STAGE_PRESOLVING
1205  * - \ref SCIP_STAGE_PRESOLVED
1206  * - \ref SCIP_STAGE_SOLVING
1207  */
1209  SCIP* scip, /**< SCIP data structure */
1210  SCIP_CONS* cons, /**< constraint */
1211  SCIP_Bool initial /**< new value */
1212  )
1213 {
1214  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConsInitial", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1215 
1216  SCIP_CALL( SCIPconsSetInitial(cons, scip->set, scip->stat, initial) );
1217 
1218  return SCIP_OKAY;
1219 }
1220 
1221 /** sets the separate flag of the given constraint
1222  *
1223  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1224  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1225  *
1226  * @pre This method can be called if @p scip is in one of the following stages:
1227  * - \ref SCIP_STAGE_PROBLEM
1228  * - \ref SCIP_STAGE_TRANSFORMING
1229  * - \ref SCIP_STAGE_PRESOLVING
1230  * - \ref SCIP_STAGE_PRESOLVED
1231  * - \ref SCIP_STAGE_SOLVING
1232  */
1234  SCIP* scip, /**< SCIP data structure */
1235  SCIP_CONS* cons, /**< constraint */
1236  SCIP_Bool separate /**< new value */
1237  )
1238 {
1239  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConsSeparated", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1240 
1241  SCIP_CALL( SCIPconsSetSeparated(cons, scip->set, separate) );
1242 
1243  return SCIP_OKAY;
1244 }
1245 
1246 /** sets the enforce flag of the given constraint
1247  *
1248  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1249  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1250  *
1251  * @pre This method can be called if @p scip is in one of the following stages:
1252  * - \ref SCIP_STAGE_PROBLEM
1253  * - \ref SCIP_STAGE_TRANSFORMING
1254  * - \ref SCIP_STAGE_PRESOLVING
1255  * - \ref SCIP_STAGE_PRESOLVED
1256  * - \ref SCIP_STAGE_SOLVING
1257  */
1259  SCIP* scip, /**< SCIP data structure */
1260  SCIP_CONS* cons, /**< constraint */
1261  SCIP_Bool enforce /**< new value */
1262  )
1263 {
1264  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConsEnforced", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1265 
1266  SCIP_CALL( SCIPconsSetEnforced(cons, scip->set, enforce) );
1267 
1268  return SCIP_OKAY;
1269 }
1270 
1271 /** sets the check flag of the given constraint
1272  *
1273  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1274  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1275  *
1276  * @pre This method can be called if @p scip is in one of the following stages:
1277  * - \ref SCIP_STAGE_PROBLEM
1278  * - \ref SCIP_STAGE_TRANSFORMING
1279  * - \ref SCIP_STAGE_PRESOLVING
1280  * - \ref SCIP_STAGE_PRESOLVED
1281  * - \ref SCIP_STAGE_SOLVING
1282  */
1284  SCIP* scip, /**< SCIP data structure */
1285  SCIP_CONS* cons, /**< constraint */
1286  SCIP_Bool check /**< new value */
1287  )
1288 {
1289  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConsChecked", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1290 
1291  SCIP_CALL( SCIPconsSetChecked(cons, scip->set, check) );
1292 
1293  return SCIP_OKAY;
1294 }
1295 
1296 /** sets the propagate flag of the given constraint
1297  *
1298  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1299  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1300  *
1301  * @pre This method can be called if @p scip is in one of the following stages:
1302  * - \ref SCIP_STAGE_PROBLEM
1303  * - \ref SCIP_STAGE_TRANSFORMING
1304  * - \ref SCIP_STAGE_PRESOLVING
1305  * - \ref SCIP_STAGE_PRESOLVED
1306  * - \ref SCIP_STAGE_SOLVING
1307  */
1309  SCIP* scip, /**< SCIP data structure */
1310  SCIP_CONS* cons, /**< constraint */
1311  SCIP_Bool propagate /**< new value */
1312  )
1313 {
1314  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConsPropagated", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1315 
1316  SCIP_CALL( SCIPconsSetPropagated(cons, scip->set, propagate) );
1317 
1318  return SCIP_OKAY;
1319 }
1320 
1321 /** sets the local flag of the given constraint
1322  *
1323  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1324  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1325  *
1326  * @pre This method can be called if @p scip is in one of the following stages:
1327  * - \ref SCIP_STAGE_PROBLEM
1328  * - \ref SCIP_STAGE_TRANSFORMING
1329  * - \ref SCIP_STAGE_INITPRESOLVE
1330  * - \ref SCIP_STAGE_PRESOLVING
1331  * - \ref SCIP_STAGE_PRESOLVED
1332  * - \ref SCIP_STAGE_INITSOLVE
1333  * - \ref SCIP_STAGE_SOLVING
1334  */
1336  SCIP* scip, /**< SCIP data structure */
1337  SCIP_CONS* cons, /**< constraint */
1338  SCIP_Bool local /**< new value */
1339  )
1340 {
1341  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConsLocal", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1342 
1343  SCIPconsSetLocal(cons, local);
1344 
1345  return SCIP_OKAY;
1346 }
1347 
1348 /** sets the modifiable flag of the given constraint
1349  *
1350  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1351  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1352  *
1353  * @pre This method can be called if @p scip is in one of the following stages:
1354  * - \ref SCIP_STAGE_PROBLEM
1355  * - \ref SCIP_STAGE_TRANSFORMING
1356  * - \ref SCIP_STAGE_PRESOLVING
1357  * - \ref SCIP_STAGE_PRESOLVED
1358  * - \ref SCIP_STAGE_SOLVING
1359  * - \ref SCIP_STAGE_EXITSOLVE
1360  */
1362  SCIP* scip, /**< SCIP data structure */
1363  SCIP_CONS* cons, /**< constraint */
1364  SCIP_Bool modifiable /**< new value */
1365  )
1366 {
1367  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConsModifiable", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
1368 
1369  SCIPconsSetModifiable(cons, modifiable);
1370 
1371  return SCIP_OKAY;
1372 }
1373 
1374 /** sets the dynamic flag of the given constraint
1375  *
1376  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1377  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1378  *
1379  * @pre This method can be called if @p scip is in one of the following stages:
1380  * - \ref SCIP_STAGE_PROBLEM
1381  * - \ref SCIP_STAGE_TRANSFORMING
1382  * - \ref SCIP_STAGE_PRESOLVING
1383  * - \ref SCIP_STAGE_PRESOLVED
1384  * - \ref SCIP_STAGE_SOLVING
1385  */
1387  SCIP* scip, /**< SCIP data structure */
1388  SCIP_CONS* cons, /**< constraint */
1389  SCIP_Bool dynamic /**< new value */
1390  )
1391 {
1392  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConsDynamic", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1393 
1394  SCIPconsSetDynamic(cons, dynamic);
1395 
1396  return SCIP_OKAY;
1397 }
1398 
1399 /** sets the removable flag of the given constraint
1400  *
1401  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1402  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1403  *
1404  * @pre This method can be called if @p scip is in one of the following stages:
1405  * - \ref SCIP_STAGE_PROBLEM
1406  * - \ref SCIP_STAGE_TRANSFORMING
1407  * - \ref SCIP_STAGE_PRESOLVING
1408  * - \ref SCIP_STAGE_PRESOLVED
1409  * - \ref SCIP_STAGE_SOLVING
1410  */
1412  SCIP* scip, /**< SCIP data structure */
1413  SCIP_CONS* cons, /**< constraint */
1414  SCIP_Bool removable /**< new value */
1415  )
1416 {
1417  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConsRemovable", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1418 
1419  SCIPconsSetRemovable(cons, removable);
1420 
1421  return SCIP_OKAY;
1422 }
1423 
1424 /** sets the stickingatnode flag of the given constraint
1425  *
1426  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1427  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1428  *
1429  * @pre This method can be called if @p scip is in one of the following stages:
1430  * - \ref SCIP_STAGE_PROBLEM
1431  * - \ref SCIP_STAGE_TRANSFORMING
1432  * - \ref SCIP_STAGE_PRESOLVING
1433  * - \ref SCIP_STAGE_PRESOLVED
1434  * - \ref SCIP_STAGE_SOLVING
1435  */
1437  SCIP* scip, /**< SCIP data structure */
1438  SCIP_CONS* cons, /**< constraint */
1439  SCIP_Bool stickingatnode /**< new value */
1440  )
1441 {
1442  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetConsStickingAtNode", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1443 
1444  SCIPconsSetStickingAtNode(cons, stickingatnode);
1445 
1446  return SCIP_OKAY;
1447 }
1448 
1449 /** updates the flags of the first constraint according to the ones of the second constraint
1450  *
1451  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1452  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1453  *
1454  * @pre This method can be called if @p scip is in one of the following stages:
1455  * - \ref SCIP_STAGE_PROBLEM
1456  * - \ref SCIP_STAGE_TRANSFORMING
1457  * - \ref SCIP_STAGE_PRESOLVING
1458  * - \ref SCIP_STAGE_PRESOLVED
1459  * - \ref SCIP_STAGE_SOLVING
1460  */
1462  SCIP* scip, /**< SCIP data structure */
1463  SCIP_CONS* cons0, /**< constraint that should stay */
1464  SCIP_CONS* cons1 /**< constraint that should be deleted */
1465  )
1466 {
1467  SCIP_CALL( SCIPcheckStage(scip, "SCIPupdateConsFlags", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1468 
1469  if( SCIPconsIsInitial(cons1) )
1470  {
1471  SCIP_CALL( SCIPsetConsInitial(scip, cons0, TRUE) );
1472  }
1473  if( SCIPconsIsSeparated(cons1) )
1474  {
1475  SCIP_CALL( SCIPsetConsSeparated(scip, cons0, TRUE) );
1476  }
1477  if( SCIPconsIsEnforced(cons1) )
1478  {
1479  SCIP_CALL( SCIPsetConsEnforced(scip, cons0, TRUE) );
1480  }
1481  if( SCIPconsIsChecked(cons1) )
1482  {
1483  SCIP_CALL( SCIPsetConsChecked(scip, cons0, TRUE) );
1484  }
1485  if( SCIPconsIsPropagated(cons1) )
1486  {
1487  SCIP_CALL( SCIPsetConsPropagated(scip, cons0, TRUE) );
1488  }
1489  if( !SCIPconsIsDynamic(cons1) )
1490  {
1491  SCIP_CALL( SCIPsetConsDynamic(scip, cons0, FALSE) );
1492  }
1493  if( !SCIPconsIsRemovable(cons1) )
1494  {
1495  SCIP_CALL( SCIPsetConsRemovable(scip, cons0, FALSE) );
1496  }
1497  if( SCIPconsIsStickingAtNode(cons1) )
1498  {
1499  SCIP_CALL( SCIPsetConsStickingAtNode(scip, cons0, TRUE) );
1500  }
1501 
1502  return SCIP_OKAY;
1503 }
1504 
1505 /** gets and captures transformed constraint of a given constraint; if the constraint is not yet transformed,
1506  * a new transformed constraint for this constraint is created
1507  *
1508  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1509  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1510  *
1511  * @pre This method can be called if @p scip is in one of the following stages:
1512  * - \ref SCIP_STAGE_TRANSFORMING
1513  * - \ref SCIP_STAGE_TRANSFORMED
1514  * - \ref SCIP_STAGE_INITPRESOLVE
1515  * - \ref SCIP_STAGE_PRESOLVING
1516  * - \ref SCIP_STAGE_EXITPRESOLVE
1517  * - \ref SCIP_STAGE_PRESOLVED
1518  * - \ref SCIP_STAGE_INITSOLVE
1519  * - \ref SCIP_STAGE_SOLVING
1520  */
1522  SCIP* scip, /**< SCIP data structure */
1523  SCIP_CONS* cons, /**< constraint to get/create transformed constraint for */
1524  SCIP_CONS** transcons /**< pointer to store the transformed constraint */
1525  )
1526 {
1527  assert(transcons != NULL);
1528  assert(cons->scip == scip);
1529 
1530  SCIP_CALL( SCIPcheckStage(scip, "SCIPtransformCons", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1531 
1532  if( SCIPconsIsTransformed(cons) )
1533  {
1534  *transcons = cons;
1535  SCIPconsCapture(*transcons);
1536  }
1537  else
1538  {
1539  SCIP_CALL( SCIPconsTransform(cons, scip->mem->probmem, scip->set, transcons) );
1540  }
1541 
1542  return SCIP_OKAY;
1543 }
1544 
1545 /** gets and captures transformed constraints for an array of constraints;
1546  * if a constraint in the array is not yet transformed, a new transformed constraint for this constraint is created;
1547  * it is possible to call this method with conss == transconss
1548  *
1549  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1550  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1551  *
1552  * @pre This method can be called if @p scip is in one of the following stages:
1553  * - \ref SCIP_STAGE_TRANSFORMING
1554  * - \ref SCIP_STAGE_TRANSFORMED
1555  * - \ref SCIP_STAGE_INITPRESOLVE
1556  * - \ref SCIP_STAGE_PRESOLVING
1557  * - \ref SCIP_STAGE_EXITPRESOLVE
1558  * - \ref SCIP_STAGE_PRESOLVED
1559  * - \ref SCIP_STAGE_INITSOLVE
1560  * - \ref SCIP_STAGE_SOLVING
1561  */
1563  SCIP* scip, /**< SCIP data structure */
1564  int nconss, /**< number of constraints to get/create transformed constraints for */
1565  SCIP_CONS** conss, /**< array with constraints to get/create transformed constraints for */
1566  SCIP_CONS** transconss /**< array to store the transformed constraints */
1567  )
1568 {
1569  int c;
1570 
1571  assert(nconss == 0 || conss != NULL);
1572  assert(nconss == 0 || transconss != NULL);
1573 
1574  SCIP_CALL( SCIPcheckStage(scip, "SCIPtransformConss", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1575 
1576  for( c = 0; c < nconss; ++c )
1577  {
1578  if( SCIPconsIsTransformed(conss[c]) )
1579  {
1580  transconss[c] = conss[c];
1581  SCIPconsCapture(transconss[c]);
1582  }
1583  else
1584  {
1585  SCIP_CALL( SCIPconsTransform(conss[c], scip->mem->probmem, scip->set, &transconss[c]) );
1586  }
1587  }
1588 
1589  return SCIP_OKAY;
1590 }
1591 
1592 /** gets corresponding transformed constraint of a given constraint;
1593  * returns NULL as transcons, if transformed constraint is not yet existing
1594  *
1595  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1596  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1597  *
1598  * @pre This method can be called if @p scip is in one of the following stages:
1599  * - \ref SCIP_STAGE_TRANSFORMING
1600  * - \ref SCIP_STAGE_TRANSFORMED
1601  * - \ref SCIP_STAGE_INITPRESOLVE
1602  * - \ref SCIP_STAGE_PRESOLVING
1603  * - \ref SCIP_STAGE_EXITPRESOLVE
1604  * - \ref SCIP_STAGE_PRESOLVED
1605  * - \ref SCIP_STAGE_INITSOLVE
1606  * - \ref SCIP_STAGE_SOLVING
1607  * - \ref SCIP_STAGE_SOLVED
1608  * - \ref SCIP_STAGE_EXITSOLVE
1609  * - \ref SCIP_STAGE_FREETRANS
1610  */
1612  SCIP* scip, /**< SCIP data structure */
1613  SCIP_CONS* cons, /**< constraint to get the transformed constraint for */
1614  SCIP_CONS** transcons /**< pointer to store the transformed constraint */
1615  )
1616 {
1617  assert(transcons != NULL);
1618  assert(cons->scip == scip);
1619 
1620  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetTransformedCons", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
1621 
1622  if( SCIPconsIsTransformed(cons) )
1623  *transcons = cons;
1624  else
1625  *transcons = SCIPconsGetTransformed(cons);
1626 
1627  return SCIP_OKAY;
1628 }
1629 
1630 /** gets corresponding transformed constraints for an array of constraints;
1631  * stores NULL in a transconss slot, if the transformed constraint is not yet existing;
1632  * it is possible to call this method with conss == transconss, but remember that constraints that are not
1633  * yet transformed will be replaced with NULL
1634  *
1635  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1636  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1637  *
1638  * @pre This method can be called if @p scip is in one of the following stages:
1639  * - \ref SCIP_STAGE_TRANSFORMING
1640  * - \ref SCIP_STAGE_TRANSFORMED
1641  * - \ref SCIP_STAGE_INITPRESOLVE
1642  * - \ref SCIP_STAGE_PRESOLVING
1643  * - \ref SCIP_STAGE_EXITPRESOLVE
1644  * - \ref SCIP_STAGE_PRESOLVED
1645  * - \ref SCIP_STAGE_INITSOLVE
1646  * - \ref SCIP_STAGE_SOLVING
1647  * - \ref SCIP_STAGE_SOLVED
1648  * - \ref SCIP_STAGE_EXITSOLVE
1649  * - \ref SCIP_STAGE_FREETRANS
1650  */
1652  SCIP* scip, /**< SCIP data structure */
1653  int nconss, /**< number of constraints to get the transformed constraints for */
1654  SCIP_CONS** conss, /**< constraints to get the transformed constraints for */
1655  SCIP_CONS** transconss /**< array to store the transformed constraints */
1656  )
1657 {
1658  int c;
1659 
1660  assert(nconss == 0 || conss != NULL);
1661  assert(nconss == 0 || transconss != NULL);
1662 
1663  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetTransformedConss", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
1664 
1665  for( c = 0; c < nconss; ++c )
1666  {
1667  if( SCIPconsIsTransformed(conss[c]) )
1668  transconss[c] = conss[c];
1669  else
1670  transconss[c] = SCIPconsGetTransformed(conss[c]);
1671  }
1672 
1673  return SCIP_OKAY;
1674 }
1675 
1676 /** adds given value to age of constraint, but age can never become negative;
1677  * should be called
1678  * - in constraint separation, if no cut was found for this constraint,
1679  * - in constraint enforcing, if constraint was feasible, and
1680  * - in constraint propagation, if no domain reduction was deduced;
1681  *
1682  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1683  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1684  *
1685  * @pre This method can be called if @p scip is in one of the following stages:
1686  * - \ref SCIP_STAGE_TRANSFORMED
1687  * - \ref SCIP_STAGE_PRESOLVING
1688  * - \ref SCIP_STAGE_PRESOLVED
1689  * - \ref SCIP_STAGE_SOLVING
1690  * - \ref SCIP_STAGE_SOLVED
1691  */
1693  SCIP* scip, /**< SCIP data structure */
1694  SCIP_CONS* cons, /**< constraint */
1695  SCIP_Real deltaage /**< value to add to the constraint's age */
1696  )
1697 {
1698  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddConsAge", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1699 
1700  SCIP_CALL( SCIPconsAddAge(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, deltaage, scip->reopt) );
1701 
1702  return SCIP_OKAY;
1703 }
1704 
1705 /** increases age of constraint by 1.0;
1706  * should be called
1707  * - in constraint separation, if no cut was found for this constraint,
1708  * - in constraint enforcing, if constraint was feasible, and
1709  * - in constraint propagation, if no domain reduction was deduced;
1710  *
1711  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1712  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1713  *
1714  * @pre This method can be called if @p scip is in one of the following stages:
1715  * - \ref SCIP_STAGE_TRANSFORMED
1716  * - \ref SCIP_STAGE_PRESOLVING
1717  * - \ref SCIP_STAGE_PRESOLVED
1718  * - \ref SCIP_STAGE_SOLVING
1719  * - \ref SCIP_STAGE_SOLVED
1720  */
1722  SCIP* scip, /**< SCIP data structure */
1723  SCIP_CONS* cons /**< constraint */
1724  )
1725 {
1726  SCIP_CALL( SCIPcheckStage(scip, "SCIPincConsAge", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1727 
1728  SCIP_CALL( SCIPconsIncAge(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->reopt) );
1729 
1730  return SCIP_OKAY;
1731 }
1732 
1733 /** resets age of constraint to zero;
1734  * should be called
1735  * - in constraint separation, if a cut was found for this constraint,
1736  * - in constraint enforcing, if the constraint was violated, and
1737  * - in constraint propagation, if a domain reduction was deduced;
1738  *
1739  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1740  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1741  *
1742  * @pre This method can be called if @p scip is in one of the following stages:
1743  * - \ref SCIP_STAGE_TRANSFORMED
1744  * - \ref SCIP_STAGE_PRESOLVING
1745  * - \ref SCIP_STAGE_PRESOLVED
1746  * - \ref SCIP_STAGE_SOLVING
1747  * - \ref SCIP_STAGE_SOLVED
1748  */
1750  SCIP* scip, /**< SCIP data structure */
1751  SCIP_CONS* cons /**< constraint */
1752  )
1753 {
1754  SCIP_CALL( SCIPcheckStage(scip, "SCIPresetConsAge", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1755 
1756  SCIP_CALL( SCIPconsResetAge(cons, scip->set) );
1757 
1758  return SCIP_OKAY;
1759 }
1760 
1761 /** enables constraint's separation, propagation, and enforcing capabilities
1762  *
1763  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1764  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1765  *
1766  * @pre This method can be called if @p scip is in one of the following stages:
1767  * - \ref SCIP_STAGE_TRANSFORMED
1768  * - \ref SCIP_STAGE_PRESOLVING
1769  * - \ref SCIP_STAGE_PRESOLVED
1770  * - \ref SCIP_STAGE_INITSOLVE
1771  * - \ref SCIP_STAGE_SOLVING
1772  * - \ref SCIP_STAGE_SOLVED
1773  */
1775  SCIP* scip, /**< SCIP data structure */
1776  SCIP_CONS* cons /**< constraint */
1777  )
1778 {
1779  SCIP_CALL( SCIPcheckStage(scip, "SCIPenableCons", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1780 
1781  SCIP_CALL( SCIPconsEnable(cons, scip->set, scip->stat) );
1782 
1783  return SCIP_OKAY;
1784 }
1785 
1786 /** disables constraint's separation, propagation, and enforcing capabilities, s.t. the constraint is not propagated,
1787  * separated, and enforced anymore until it is enabled again with a call to SCIPenableCons();
1788  * in contrast to SCIPdelConsLocal() and SCIPdelConsNode(), the disabling is not associated to a node in the tree and
1789  * does not consume memory; therefore, the constraint is neither automatically enabled on leaving the node nor
1790  * automatically disabled again on entering the node again;
1791  * note that the constraints enforcing capabilities are necessary for the solution's feasibility, if the constraint
1792  * is a model constraint; that means, you must be sure that the constraint cannot be violated in the current subtree,
1793  * and you have to enable it again manually by calling SCIPenableCons(), if this subtree is left (e.g. by using
1794  * an appropriate event handler that watches the corresponding variables' domain changes)
1795  *
1796  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1797  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1798  *
1799  * @pre This method can be called if @p scip is in one of the following stages:
1800  * - \ref SCIP_STAGE_TRANSFORMED
1801  * - \ref SCIP_STAGE_INITPRESOLVE
1802  * - \ref SCIP_STAGE_PRESOLVING
1803  * - \ref SCIP_STAGE_PRESOLVED
1804  * - \ref SCIP_STAGE_INITSOLVE
1805  * - \ref SCIP_STAGE_SOLVING
1806  * - \ref SCIP_STAGE_SOLVED
1807  */
1809  SCIP* scip, /**< SCIP data structure */
1810  SCIP_CONS* cons /**< constraint */
1811  )
1812 {
1813  SCIP_CALL( SCIPcheckStage(scip, "SCIPdisableCons", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1814 
1815  SCIP_CALL( SCIPconsDisable(cons, scip->set, scip->stat) );
1816 
1817  return SCIP_OKAY;
1818 }
1819 
1820 /** enables constraint's separation capabilities
1821  *
1822  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1823  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1824  *
1825  * @pre This method can be called if @p scip is in one of the following stages:
1826  * - \ref SCIP_STAGE_TRANSFORMED
1827  * - \ref SCIP_STAGE_PRESOLVING
1828  * - \ref SCIP_STAGE_PRESOLVED
1829  * - \ref SCIP_STAGE_INITSOLVE
1830  * - \ref SCIP_STAGE_SOLVING
1831  * - \ref SCIP_STAGE_SOLVED
1832  */
1834  SCIP* scip, /**< SCIP data structure */
1835  SCIP_CONS* cons /**< constraint */
1836  )
1837 {
1838  SCIP_CALL( SCIPcheckStage(scip, "SCIPenableConsSeparation", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1839 
1840  SCIP_CALL( SCIPconsEnableSeparation(cons, scip->set) );
1841 
1842  return SCIP_OKAY;
1843 }
1844 
1845 /** disables constraint's separation capabilities s.t. the constraint is not separated anymore until the separation
1846  * is enabled again with a call to SCIPenableConsSeparation(); in contrast to SCIPdelConsLocal() and SCIPdelConsNode(),
1847  * the disabling is not associated to a node in the tree and does not consume memory; therefore, the constraint
1848  * is neither automatically enabled on leaving the node nor automatically disabled again on entering the node again
1849  *
1850  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1851  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1852  *
1853  * @pre This method can be called if @p scip is in one of the following stages:
1854  * - \ref SCIP_STAGE_TRANSFORMED
1855  * - \ref SCIP_STAGE_PRESOLVING
1856  * - \ref SCIP_STAGE_PRESOLVED
1857  * - \ref SCIP_STAGE_INITSOLVE
1858  * - \ref SCIP_STAGE_SOLVING
1859  * - \ref SCIP_STAGE_SOLVED
1860  */
1862  SCIP* scip, /**< SCIP data structure */
1863  SCIP_CONS* cons /**< constraint */
1864  )
1865 {
1866  SCIP_CALL( SCIPcheckStage(scip, "SCIPdisableConsSeparation", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1867 
1868  SCIP_CALL( SCIPconsDisableSeparation(cons, scip->set) );
1869 
1870  return SCIP_OKAY;
1871 }
1872 
1873 /** enables constraint's propagation capabilities
1874  *
1875  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1876  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1877  *
1878  * @pre This method can be called if @p scip is in one of the following stages:
1879  * - \ref SCIP_STAGE_TRANSFORMED
1880  * - \ref SCIP_STAGE_INITPRESOLVE
1881  * - \ref SCIP_STAGE_PRESOLVING
1882  * - \ref SCIP_STAGE_EXITPRESOLVE
1883  * - \ref SCIP_STAGE_PRESOLVED
1884  * - \ref SCIP_STAGE_INITSOLVE
1885  * - \ref SCIP_STAGE_SOLVING
1886  * - \ref SCIP_STAGE_SOLVED
1887  */
1889  SCIP* scip, /**< SCIP data structure */
1890  SCIP_CONS* cons /**< constraint */
1891  )
1892 {
1893  SCIP_CALL( SCIPcheckStage(scip, "SCIPenableConsPropagation", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1894 
1895  SCIP_CALL( SCIPconsEnablePropagation(cons, scip->set) );
1896 
1897  return SCIP_OKAY;
1898 }
1899 
1900 /** disables constraint's propagation capabilities s.t. the constraint is not propagated anymore until the propagation
1901  * is enabled again with a call to SCIPenableConsPropagation(); in contrast to SCIPdelConsLocal() and SCIPdelConsNode(),
1902  * the disabling is not associated to a node in the tree and does not consume memory; therefore, the constraint
1903  * is neither automatically enabled on leaving the node nor automatically disabled again on entering the node again
1904  *
1905  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1906  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1907  *
1908  * @pre This method can be called if @p scip is in one of the following stages:
1909  * - \ref SCIP_STAGE_TRANSFORMED
1910  * - \ref SCIP_STAGE_INITPRESOLVE
1911  * - \ref SCIP_STAGE_PRESOLVING
1912  * - \ref SCIP_STAGE_EXITPRESOLVE
1913  * - \ref SCIP_STAGE_PRESOLVED
1914  * - \ref SCIP_STAGE_INITSOLVE
1915  * - \ref SCIP_STAGE_SOLVING
1916  * - \ref SCIP_STAGE_SOLVED
1917  */
1919  SCIP* scip, /**< SCIP data structure */
1920  SCIP_CONS* cons /**< constraint */
1921  )
1922 {
1923  SCIP_CALL( SCIPcheckStage(scip, "SCIPdisableConsPropagation", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1924 
1925  SCIP_CALL( SCIPconsDisablePropagation(cons, scip->set) );
1926 
1927  return SCIP_OKAY;
1928 }
1929 
1930 #undef SCIPmarkConsPropagate
1931 
1932 /** marks constraint to be propagated
1933  *
1934  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1935  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1936  *
1937  * @pre This method can be called if @p scip is in one of the following stages:
1938  * - \ref SCIP_STAGE_TRANSFORMING
1939  * - \ref SCIP_STAGE_TRANSFORMED
1940  * - \ref SCIP_STAGE_INITPRESOLVE
1941  * - \ref SCIP_STAGE_PRESOLVING
1942  * - \ref SCIP_STAGE_EXITPRESOLVE
1943  * - \ref SCIP_STAGE_PRESOLVED
1944  * - \ref SCIP_STAGE_INITSOLVE
1945  * - \ref SCIP_STAGE_SOLVING
1946  * - \ref SCIP_STAGE_SOLVED
1947  * - \ref SCIP_STAGE_EXITSOLVE
1948  *
1949  * @note if a constraint is marked to be propagated, the age of the constraint will be ignored for propagation
1950  */
1952  SCIP* scip, /**< SCIP data structure */
1953  SCIP_CONS* cons /**< constraint */
1954  )
1955 {
1956  SCIP_CALL( SCIPcheckStage(scip, "SCIPmarkConsPropagate", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
1957 
1958  SCIP_CALL( SCIPconsMarkPropagate(cons, scip->set) );
1959 
1960  assert(!SCIPconsIsEnabled(cons) || SCIPconsIsMarkedPropagate(cons));
1961 
1962  return SCIP_OKAY;
1963 }
1964 
1965 /** unmarks the constraint to be propagated
1966  *
1967  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1968  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1969  *
1970  * @pre This method can be called if @p scip is in one of the following stages:
1971  * - \ref SCIP_STAGE_TRANSFORMED
1972  * - \ref SCIP_STAGE_PRESOLVING
1973  * - \ref SCIP_STAGE_EXITPRESOLVE
1974  * - \ref SCIP_STAGE_PRESOLVED
1975  * - \ref SCIP_STAGE_INITSOLVE
1976  * - \ref SCIP_STAGE_SOLVING
1977  * - \ref SCIP_STAGE_SOLVED
1978  */
1980  SCIP* scip, /**< SCIP data structure */
1981  SCIP_CONS* cons /**< constraint */
1982  )
1983 {
1984  SCIP_CALL( SCIPcheckStage(scip, "SCIPunmarkConsPropagate", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1985 
1986  SCIP_CALL( SCIPconsUnmarkPropagate(cons, scip->set) );
1987 
1988  assert(!SCIPconsIsEnabled(cons) || !SCIPconsIsMarkedPropagate(cons));
1989 
1990  return SCIP_OKAY;
1991 }
1992 
1993 /** adds given values to lock status of type @p locktype of the constraint and updates the rounding locks of the involved variables
1994  *
1995  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1996  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1997  *
1998  * @pre This method can be called if @p scip is in one of the following stages:
1999  * - \ref SCIP_STAGE_PROBLEM
2000  * - \ref SCIP_STAGE_TRANSFORMING
2001  * - \ref SCIP_STAGE_INITPRESOLVE
2002  * - \ref SCIP_STAGE_PRESOLVING
2003  * - \ref SCIP_STAGE_EXITPRESOLVE
2004  * - \ref SCIP_STAGE_INITSOLVE
2005  * - \ref SCIP_STAGE_SOLVING
2006  * - \ref SCIP_STAGE_EXITSOLVE
2007  * - \ref SCIP_STAGE_FREETRANS
2008  */
2010  SCIP* scip, /**< SCIP data structure */
2011  SCIP_CONS* cons, /**< constraint */
2012  SCIP_LOCKTYPE locktype, /**< type of the variable locks */
2013  int nlockspos, /**< increase in number of rounding locks for constraint */
2014  int nlocksneg /**< increase in number of rounding locks for constraint's negation */
2015  )
2016 {
2017  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddConsLocksType", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE) );
2018 
2019  SCIP_CALL( SCIPconsAddLocks(cons, scip->set, locktype, nlockspos, nlocksneg) );
2020 
2021  return SCIP_OKAY;
2022 }
2023 
2024 /** adds given values to lock status of the constraint and updates the rounding locks of the involved variables
2025  *
2026  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2027  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2028  *
2029  * @pre This method can be called if @p scip is in one of the following stages:
2030  * - \ref SCIP_STAGE_PROBLEM
2031  * - \ref SCIP_STAGE_TRANSFORMING
2032  * - \ref SCIP_STAGE_INITPRESOLVE
2033  * - \ref SCIP_STAGE_PRESOLVING
2034  * - \ref SCIP_STAGE_EXITPRESOLVE
2035  * - \ref SCIP_STAGE_INITSOLVE
2036  * - \ref SCIP_STAGE_SOLVING
2037  * - \ref SCIP_STAGE_EXITSOLVE
2038  * - \ref SCIP_STAGE_FREETRANS
2039  *
2040  * @note This methods always adds locks of type model
2041  */
2043  SCIP* scip, /**< SCIP data structure */
2044  SCIP_CONS* cons, /**< constraint */
2045  int nlockspos, /**< increase in number of rounding locks for constraint */
2046  int nlocksneg /**< increase in number of rounding locks for constraint's negation */
2047  )
2048 {
2049  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddConsLocks", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE) );
2050 
2051  SCIP_CALL( SCIPaddConsLocksType(scip, cons, SCIP_LOCKTYPE_MODEL, nlockspos, nlocksneg) );
2052 
2053  return SCIP_OKAY;
2054 }
2055 
2056 /** checks single constraint for feasibility of the given solution
2057  *
2058  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2059  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2060  *
2061  * @pre This method can be called if @p scip is in one of the following stages:
2062  * - \ref SCIP_STAGE_PROBLEM
2063  * - \ref SCIP_STAGE_TRANSFORMED
2064  * - \ref SCIP_STAGE_INITPRESOLVE
2065  * - \ref SCIP_STAGE_PRESOLVING
2066  * - \ref SCIP_STAGE_EXITPRESOLVE
2067  * - \ref SCIP_STAGE_PRESOLVED
2068  * - \ref SCIP_STAGE_INITSOLVE
2069  * - \ref SCIP_STAGE_SOLVING
2070  * - \ref SCIP_STAGE_SOLVED
2071  */
2073  SCIP* scip, /**< SCIP data structure */
2074  SCIP_CONS* cons, /**< constraint to check */
2075  SCIP_SOL* sol, /**< primal CIP solution */
2076  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
2077  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
2078  SCIP_Bool printreason, /**< Should the reason for the violation be printed? */
2079  SCIP_RESULT* result /**< pointer to store the result of the callback method */
2080  )
2081 {
2082  SCIP_CALL( SCIPcheckStage(scip, "SCIPcheckCons", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2083 
2084  SCIP_CALL( SCIPconsCheck(cons, scip->set, sol, checkintegrality, checklprows, printreason, result) );
2085 
2086  return SCIP_OKAY;
2087 }
2088 
2089 /** enforces single constraint for a given pseudo solution
2090  *
2091  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2092  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2093  *
2094  * @pre This method can be called if @p scip is in one of the following stages:
2095  * - \ref SCIP_STAGE_SOLVING
2096  *
2097  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
2098  * added to SCIP beforehand.
2099  */
2101  SCIP* scip, /**< SCIP data structure */
2102  SCIP_CONS* cons, /**< constraint to enforce */
2103  SCIP_Bool solinfeasible, /**< was the solution already declared infeasible by a constraint handler? */
2104  SCIP_Bool objinfeasible, /**< is the solution infeasible anyway due to violating lower objective bound? */
2105  SCIP_RESULT* result /**< pointer to store the result of the callback method */
2106  )
2107 {
2108  assert(scip != NULL);
2109  assert(cons != NULL);
2110  assert(!SCIPconsIsAdded(cons));
2111  assert(result != NULL);
2112 
2113  SCIP_CALL( SCIPcheckStage(scip, "SCIPenfopsCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2114 
2115  SCIP_CALL( SCIPconsEnfops(cons, scip->set, solinfeasible, objinfeasible, result) );
2116 
2117  return SCIP_OKAY;
2118 }
2119 
2120 /** enforces single constraint for a given LP solution
2121  *
2122  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2123  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2124  *
2125  * @pre This method can be called if @p scip is in one of the following stages:
2126  * - \ref SCIP_STAGE_SOLVING
2127  *
2128  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
2129  * added to SCIP beforehand.
2130  */
2132  SCIP* scip, /**< SCIP data structure */
2133  SCIP_CONS* cons, /**< constraint to enforce */
2134  SCIP_Bool solinfeasible, /**< was the solution already declared infeasible by a constraint handler? */
2135  SCIP_RESULT* result /**< pointer to store the result of the callback method */
2136  )
2137 {
2138  assert(scip != NULL);
2139  assert(cons != NULL);
2140  assert(!SCIPconsIsAdded(cons));
2141  assert(result != NULL);
2142 
2143  SCIP_CALL( SCIPcheckStage(scip, "SCIPenfolpCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2144 
2145  SCIP_CALL( SCIPconsEnfolp(cons, scip->set, solinfeasible, result) );
2146 
2147  return SCIP_OKAY;
2148 }
2149 
2150 /** enforces single constraint for a given relaxation solution
2151  *
2152  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2153  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2154  *
2155  * @pre This method can be called if @p scip is in one of the following stages:
2156  * - \ref SCIP_STAGE_SOLVING
2157  *
2158  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
2159  * added to SCIP beforehand.
2160  */
2162  SCIP* scip, /**< SCIP data structure */
2163  SCIP_CONS* cons, /**< constraint to enforce */
2164  SCIP_SOL* sol, /**< solution to enforce */
2165  SCIP_Bool solinfeasible, /**< was the solution already declared infeasible by a constraint handler? */
2166  SCIP_RESULT* result /**< pointer to store the result of the callback method */
2167  )
2168 {
2169  assert(scip != NULL);
2170  assert(cons != NULL);
2171  assert(!SCIPconsIsAdded(cons));
2172  assert(sol != NULL);
2173  assert(result != NULL);
2174 
2175  SCIP_CALL( SCIPcheckStage(scip, "SCIPenforelaxCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2176 
2177  SCIP_CALL( SCIPconsEnforelax(cons, scip->set, sol, solinfeasible, result) );
2178 
2179  return SCIP_OKAY;
2180 }
2181 
2182 /** calls LP initialization method for single constraint
2183  *
2184  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2185  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2186  *
2187  * @pre This method can be called if @p scip is in one of the following stages:
2188  * - \ref SCIP_STAGE_SOLVING
2189  *
2190  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
2191  * added to SCIP beforehand.
2192  */
2194  SCIP* scip, /**< SCIP data structure */
2195  SCIP_CONS* cons, /**< constraint to initialize */
2196  SCIP_Bool* infeasible /**< pointer to store whether infeasibility was detected while building the LP */
2197  )
2198 {
2199  assert(scip != NULL);
2200  assert(cons != NULL);
2201  assert(!SCIPconsIsAdded(cons));
2202 
2203  SCIP_CALL( SCIPcheckStage(scip, "SCIPinitlpCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2204 
2205  SCIP_CALL( SCIPconsInitlp(cons, scip->set, infeasible) );
2206 
2207  return SCIP_OKAY;
2208 }
2209 
2210 /** calls separation method of single constraint for LP solution
2211  *
2212  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2213  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2214  *
2215  * @pre This method can be called if @p scip is in one of the following stages:
2216  * - \ref SCIP_STAGE_SOLVING
2217  *
2218  * @note This is an advanced method and should be used with caution.
2219  */
2221  SCIP* scip, /**< SCIP data structure */
2222  SCIP_CONS* cons, /**< constraint to separate */
2223  SCIP_RESULT* result /**< pointer to store the result of the separation call */
2224  )
2225 {
2226  assert(scip != NULL);
2227  assert(cons != NULL);
2228  assert(result != NULL);
2229 
2230  SCIP_CALL( SCIPcheckStage(scip, "SCIPsepalpCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2231 
2232  SCIP_CALL( SCIPconsSepalp(cons, scip->set, result) );
2233 
2234  return SCIP_OKAY;
2235 }
2236 
2237 /** calls separation method of single constraint for given primal solution
2238  *
2239  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2240  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2241  *
2242  * @pre This method can be called if @p scip is in one of the following stages:
2243  * - \ref SCIP_STAGE_SOLVING
2244  *
2245  * @note This is an advanced method and should be used with caution.
2246  */
2248  SCIP* scip, /**< SCIP data structure */
2249  SCIP_CONS* cons, /**< constraint to separate */
2250  SCIP_SOL* sol, /**< primal solution that should be separated*/
2251  SCIP_RESULT* result /**< pointer to store the result of the separation call */
2252  )
2253 {
2254  assert(scip != NULL);
2255  assert(cons != NULL);
2256  assert(sol != NULL);
2257  assert(result != NULL);
2258 
2259  SCIP_CALL( SCIPcheckStage(scip, "SCIPsepasolCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2260 
2261  SCIP_CALL( SCIPconsSepasol(cons, scip->set, sol, result) );
2262 
2263  return SCIP_OKAY;
2264 }
2265 
2266 /** calls domain propagation method of single constraint
2267  *
2268  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2269  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2270  *
2271  * @pre This method can be called if @p scip is in one of the following stages:
2272  * - \ref SCIP_STAGE_PRESOLVING
2273  * - \ref SCIP_STAGE_SOLVING
2274  *
2275  * @note This is an advanced method and should be used with caution.
2276  */
2278  SCIP* scip, /**< SCIP data structure */
2279  SCIP_CONS* cons, /**< constraint to propagate */
2280  SCIP_PROPTIMING proptiming, /**< current point in the node solving loop */
2281  SCIP_RESULT* result /**< pointer to store the result of the callback method */
2282  )
2283 {
2284  assert(scip != NULL);
2285  assert(cons != NULL);
2286  assert(result != NULL);
2287 
2288  SCIP_CALL( SCIPcheckStage(scip, "SCIPpropCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2289 
2290  SCIP_CALL( SCIPconsProp(cons, scip->set, proptiming, result) );
2291 
2292  return SCIP_OKAY;
2293 }
2294 
2295 /** resolves propagation conflict of single constraint
2296  *
2297  *
2298  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2299  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2300  *
2301  * @pre This method can be called if @p scip is in one of the following stages:
2302  * - \ref SCIP_STAGE_PRESOLVING
2303  * - \ref SCIP_STAGE_SOLVING
2304  *
2305  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
2306  * added to SCIP beforehand.
2307  */
2309  SCIP* scip, /**< SCIP data structure */
2310  SCIP_CONS* cons, /**< constraint to resolve conflict for */
2311  SCIP_VAR* infervar, /**< the conflict variable whose bound change has to be resolved */
2312  int inferinfo, /**< the user information passed to the corresponding SCIPinferVarLbCons() or SCIPinferVarUbCons() call */
2313  SCIP_BOUNDTYPE boundtype, /**< the type of the changed bound (lower or upper bound) */
2314  SCIP_BDCHGIDX* bdchgidx, /**< the index of the bound change, representing the point of time where the change took place */
2315  SCIP_Real relaxedbd, /**< the relaxed bound which is sufficient to be explained */
2316  SCIP_RESULT* result /**< pointer to store the result of the callback method */
2317  )
2318 {
2319  assert(scip != NULL);
2320  assert(cons != NULL);
2321  assert(!SCIPconsIsAdded(cons));
2322  assert(infervar != NULL);
2323  assert(bdchgidx != NULL);
2324  assert(result != NULL);
2325 
2326  SCIP_CALL( SCIPcheckStage(scip, "SCIPrespropCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2327 
2328  SCIP_CALL( SCIPconsResprop(cons, scip->set, infervar, inferinfo, boundtype, bdchgidx, relaxedbd, result) );
2329 
2330  return SCIP_OKAY;
2331 }
2332 
2333 /** presolves of single constraint
2334  *
2335  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2336  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2337  *
2338  * @pre This method can be called if @p scip is in one of the following stages:
2339  * - \ref SCIP_STAGE_PRESOLVING
2340  *
2341  * @note This is an advanced method and should be used with caution.
2342  */
2344  SCIP* scip, /**< SCIP data structure */
2345  SCIP_CONS* cons, /**< constraint to presolve */
2346  int nrounds, /**< number of presolving rounds already done */
2347  SCIP_PRESOLTIMING presoltiming, /**< presolving timing(s) to be performed */
2348  int nnewfixedvars, /**< number of variables fixed since the last call to the presolving method */
2349  int nnewaggrvars, /**< number of variables aggregated since the last call to the presolving method */
2350  int nnewchgvartypes, /**< number of variable type changes since the last call to the presolving method */
2351  int nnewchgbds, /**< number of variable bounds tightened since the last call to the presolving method */
2352  int nnewholes, /**< number of domain holes added since the last call to the presolving method */
2353  int nnewdelconss, /**< number of deleted constraints since the last call to the presolving method */
2354  int nnewaddconss, /**< number of added constraints since the last call to the presolving method */
2355  int nnewupgdconss, /**< number of upgraded constraints since the last call to the presolving method */
2356  int nnewchgcoefs, /**< number of changed coefficients since the last call to the presolving method */
2357  int nnewchgsides, /**< number of changed left or right hand sides since the last call to the presolving method */
2358  int* nfixedvars, /**< pointer to count total number of variables fixed of all presolvers */
2359  int* naggrvars, /**< pointer to count total number of variables aggregated of all presolvers */
2360  int* nchgvartypes, /**< pointer to count total number of variable type changes of all presolvers */
2361  int* nchgbds, /**< pointer to count total number of variable bounds tightened of all presolvers */
2362  int* naddholes, /**< pointer to count total number of domain holes added of all presolvers */
2363  int* ndelconss, /**< pointer to count total number of deleted constraints of all presolvers */
2364  int* naddconss, /**< pointer to count total number of added constraints of all presolvers */
2365  int* nupgdconss, /**< pointer to count total number of upgraded constraints of all presolvers */
2366  int* nchgcoefs, /**< pointer to count total number of changed coefficients of all presolvers */
2367  int* nchgsides, /**< pointer to count total number of changed left/right hand sides of all presolvers */
2368  SCIP_RESULT* result /**< pointer to store the result of the callback method */
2369  )
2370 {
2371  assert(scip != NULL);
2372  assert(cons != NULL);
2373  assert(nfixedvars != NULL);
2374  assert(naggrvars != NULL);
2375  assert(nchgvartypes != NULL);
2376  assert(nchgbds != NULL);
2377  assert(naddholes != NULL);
2378  assert(ndelconss != NULL);
2379  assert(naddconss != NULL);
2380  assert(nupgdconss != NULL);
2381  assert(nchgcoefs != NULL);
2382  assert(nchgsides != NULL);
2383  assert(result != NULL);
2384 
2385  SCIP_CALL( SCIPcheckStage(scip, "SCIPpresolCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
2386 
2387  SCIP_CALL( SCIPconsPresol(cons, scip->set, nrounds, presoltiming, nnewfixedvars, nnewaggrvars, nnewchgvartypes, nnewchgbds, nnewholes,
2388  nnewdelconss, nnewaddconss, nnewupgdconss, nnewchgcoefs, nnewchgsides, nfixedvars, naggrvars, nchgvartypes,
2389  nchgbds, naddholes, ndelconss, naddconss, nupgdconss, nchgcoefs, nchgsides , result) );
2390 
2391  return SCIP_OKAY;
2392 }
2393 
2394 /** calls constraint activation notification method of single constraint
2395  *
2396  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2397  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2398  *
2399  * @pre This method can be called if @p scip is in one of the following stages:
2400  * - \ref SCIP_STAGE_TRANSFORMING
2401  *
2402  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
2403  * added to SCIP beforehand.
2404  */
2406  SCIP* scip, /**< SCIP data structure */
2407  SCIP_CONS* cons /**< constraint to notify */
2408  )
2409 {
2410  assert(scip != NULL);
2411  assert(cons != NULL);
2412  assert(!SCIPconsIsAdded(cons));
2413  assert(!SCIPconsIsDeleted(cons));
2414 
2415  SCIP_CALL( SCIPcheckStage(scip, "SCIPactiveCons", FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
2416 
2417  SCIP_CALL( SCIPconsActive(cons, scip->set) );
2418 
2419  return SCIP_OKAY;
2420 }
2421 
2422 /** calls constraint deactivation notification method of single constraint
2423  *
2424  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2425  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2426  *
2427  * @pre This method can be called if @p scip is in one of the following stages:
2428  * - \ref SCIP_STAGE_PRESOLVING
2429  * - \ref SCIP_STAGE_SOLVING
2430  *
2431  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
2432  * added to SCIP beforehand.
2433  */
2435  SCIP* scip, /**< SCIP data structure */
2436  SCIP_CONS* cons /**< constraint to notify */
2437  )
2438 {
2439  assert(scip != NULL);
2440  assert(cons != NULL);
2441  assert(!SCIPconsIsAdded(cons));
2442 
2443  SCIP_CALL( SCIPcheckStage(scip, "SCIPdeactiveCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2444 
2445  SCIP_CALL( SCIPconsDeactive(cons, scip->set) );
2446 
2447  return SCIP_OKAY;
2448 }
2449 
2450 /** outputs constraint information to file stream via the message handler system
2451  *
2452  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2453  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2454  *
2455  * @pre This method can be called if @p scip is in one of the following stages:
2456  * - \ref SCIP_STAGE_PROBLEM
2457  * - \ref SCIP_STAGE_TRANSFORMING
2458  * - \ref SCIP_STAGE_TRANSFORMED
2459  * - \ref SCIP_STAGE_INITPRESOLVE
2460  * - \ref SCIP_STAGE_PRESOLVING
2461  * - \ref SCIP_STAGE_EXITPRESOLVE
2462  * - \ref SCIP_STAGE_PRESOLVED
2463  * - \ref SCIP_STAGE_INITSOLVE
2464  * - \ref SCIP_STAGE_SOLVING
2465  * - \ref SCIP_STAGE_SOLVED
2466  * - \ref SCIP_STAGE_EXITSOLVE
2467  * - \ref SCIP_STAGE_FREETRANS
2468  *
2469  * @note If the message handler is set to a NULL pointer nothing will be printed.
2470  * @note The file stream will not be flushed directly, this can be achieved by calling SCIPinfoMessage() printing a
2471  * newline character.
2472  */
2474  SCIP* scip, /**< SCIP data structure */
2475  SCIP_CONS* cons, /**< constraint */
2476  FILE* file /**< output file (or NULL for standard output) */
2477  )
2478 {
2479  SCIP_CALL( SCIPcheckStage(scip, "SCIPprintCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
2480 
2481  SCIP_CALL( SCIPconsPrint(cons, scip->set, scip->messagehdlr, file) );
2482 
2483  return SCIP_OKAY;
2484 }
2485 
2486 /** method to collect the variables of a constraint
2487  *
2488  * If the number of variables is greater than the available slots in the variable array, nothing happens except that
2489  * the success point is set to FALSE. With the method SCIPgetConsNVars() it is possible to get the number of variables
2490  * a constraint has in its scope.
2491  *
2492  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2493  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2494  *
2495  * @pre This method can be called if @p scip is in one of the following stages:
2496  * - \ref SCIP_STAGE_PROBLEM
2497  * - \ref SCIP_STAGE_TRANSFORMING
2498  * - \ref SCIP_STAGE_TRANSFORMED
2499  * - \ref SCIP_STAGE_INITPRESOLVE
2500  * - \ref SCIP_STAGE_PRESOLVING
2501  * - \ref SCIP_STAGE_EXITPRESOLVE
2502  * - \ref SCIP_STAGE_PRESOLVED
2503  * - \ref SCIP_STAGE_INITSOLVE
2504  * - \ref SCIP_STAGE_SOLVING
2505  * - \ref SCIP_STAGE_SOLVED
2506  * - \ref SCIP_STAGE_EXITSOLVE
2507  * - \ref SCIP_STAGE_FREETRANS
2508  *
2509  * @note The success pointer indicates if all variables were copied into the vars arrray.
2510  *
2511  * @note It might be that a constraint handler does not support this functionality, in that case the success pointer is
2512  * set to FALSE.
2513  */
2515  SCIP* scip, /**< SCIP data structure */
2516  SCIP_CONS* cons, /**< constraint for which the variables are wanted */
2517  SCIP_VAR** vars, /**< array to store the involved variable of the constraint */
2518  int varssize, /**< available slots in vars array which is needed to check if the array is large enough */
2519  SCIP_Bool* success /**< pointer to store whether the variables are successfully copied */
2520  )
2521 {
2522  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetConsVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
2523 
2524  assert(scip != NULL);
2525  assert(cons != NULL);
2526  assert(vars != NULL);
2527  assert(success != NULL);
2528 
2529  SCIP_CALL( SCIPconsGetVars(cons, scip->set, vars, varssize, success) );
2530 
2531  return SCIP_OKAY;
2532 }
2533 
2534 /** method to collect the number of variables of a constraint
2535  *
2536  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2537  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2538  *
2539  * @pre This method can be called if @p scip is in one of the following stages:
2540  * - \ref SCIP_STAGE_PROBLEM
2541  * - \ref SCIP_STAGE_TRANSFORMING
2542  * - \ref SCIP_STAGE_TRANSFORMED
2543  * - \ref SCIP_STAGE_INITPRESOLVE
2544  * - \ref SCIP_STAGE_PRESOLVING
2545  * - \ref SCIP_STAGE_EXITPRESOLVE
2546  * - \ref SCIP_STAGE_PRESOLVED
2547  * - \ref SCIP_STAGE_INITSOLVE
2548  * - \ref SCIP_STAGE_SOLVING
2549  * - \ref SCIP_STAGE_SOLVED
2550  * - \ref SCIP_STAGE_EXITSOLVE
2551  * - \ref SCIP_STAGE_FREETRANS
2552  *
2553  * @note The success pointer indicates if the contraint handler was able to return the number of variables
2554  *
2555  * @note It might be that a constraint handler does not support this functionality, in that case the success pointer is
2556  * set to FALSE
2557  */
2559  SCIP* scip, /**< SCIP data structure */
2560  SCIP_CONS* cons, /**< constraint for which the number of variables is wanted */
2561  int* nvars, /**< pointer to store the number of variables */
2562  SCIP_Bool* success /**< pointer to store whether the constraint successfully returned the number of variables */
2563  )
2564 {
2565  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetConsNVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
2566 
2567  assert(scip != NULL);
2568  assert(cons != NULL);
2569  assert(nvars != NULL);
2570  assert(success != NULL);
2571 
2572  SCIP_CALL( SCIPconsGetNVars(cons, scip->set, nvars, success) );
2573 
2574  return SCIP_OKAY;
2575 }
SCIP_RETCODE SCIPrespropCons(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *infervar, int inferinfo, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedbd, SCIP_RESULT *result)
Definition: scip_cons.c:2308
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
SCIP_RETCODE SCIPconsSetChecked(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool check)
Definition: cons.c:6564
SCIP_STAT * stat
Definition: struct_scip.h:70
enum SCIP_BoundType SCIP_BOUNDTYPE
Definition: type_lp.h:50
SCIP_RETCODE SCIPincConsAge(SCIP *scip, SCIP_CONS *cons)
Definition: scip_cons.c:1721
SCIP_RETCODE SCIPaddConsAge(SCIP *scip, SCIP_CONS *cons, SCIP_Real deltaage)
Definition: scip_cons.c:1692
SCIP_RETCODE SCIPconsUnmarkPropagate(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:7031
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
Definition: scip_cons.c:563
SCIP_RETCODE SCIPconsIncAge(SCIP_CONS *cons, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_REOPT *reopt)
Definition: cons.c:7127
SCIP_RETCODE SCIPdisableConsSeparation(SCIP *scip, SCIP_CONS *cons)
Definition: scip_cons.c:1861
SCIP_Bool SCIPconsIsEnabled(SCIP_CONS *cons)
Definition: cons.c:8182
SCIP_STAGE SCIPgetStage(SCIP *scip)
Definition: scip_general.c:356
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
Definition: cons.c:8344
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
Definition: scip_cons.c:586
void SCIPconshdlrSetPrint(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint)))
Definition: cons.c:4487
public methods for memory management
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
Definition: scip_cons.c:877
void SCIPconsSetDynamic(SCIP_CONS *cons, SCIP_Bool dynamic)
Definition: cons.c:6671
void SCIPconsSetStickingAtNode(SCIP_CONS *cons, SCIP_Bool stickingatnode)
Definition: cons.c:6693
SCIP_DECL_CONSSEPALP(ConshdlrSubtour::scip_sepalp)
SCIP_RETCODE SCIPconsSepasol(SCIP_CONS *cons, SCIP_SET *set, SCIP_SOL *sol, SCIP_RESULT *result)
Definition: cons.c:7530
SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars)))
Definition: scip_cons.c:816
#define SCIP_MAXSTRLEN
Definition: def.h:293
#define SCIP_DECL_CONSINITPRE(x)
Definition: type_cons.h:146
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENFORELAX((*consenforelax)))
Definition: scip_cons.c:308
SCIP_RETCODE SCIPresetConsAge(SCIP *scip, SCIP_CONS *cons)
Definition: scip_cons.c:1749
SCIP_RETCODE SCIPchgConsName(SCIP *scip, SCIP_CONS *cons, const char *name)
Definition: scip_cons.c:1161
#define SCIP_DECL_CONSGETDIVEBDCHGS(x)
Definition: type_cons.h:909
#define SCIP_DECL_CONSPRESOL(x)
Definition: type_cons.h:550
void SCIPconshdlrSetDeactive(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDEACTIVE((*consdeactive)))
Definition: cons.c:4443
void SCIPconshdlrSetInitpre(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITPRE((*consinitpre)))
Definition: cons.c:4337
SCIP_RETCODE SCIPsetConsPropagated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool propagate)
Definition: scip_cons.c:1308
SCIP_RETCODE SCIPconsParse(SCIP_CONS **cons, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *str, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode, SCIP_Bool *success)
Definition: cons.c:6009
void SCIPconshdlrSetInitsol(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITSOL((*consinitsol)))
Definition: cons.c:4315
SCIP_RETCODE SCIPsetIncludeConshdlr(SCIP_SET *set, SCIP_CONSHDLR *conshdlr)
Definition: set.c:3861
SCIP_RETCODE SCIPdisableConsPropagation(SCIP *scip, SCIP_CONS *cons)
Definition: scip_cons.c:1918
SCIP_RETCODE SCIPsetConshdlrDeactive(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDEACTIVE((*consdeactive)))
Definition: scip_cons.c:678
SCIP_Bool SCIPconsIsAdded(SCIP_CONS *cons)
Definition: cons.c:8514
SCIP_RETCODE SCIPupdateConsFlags(SCIP *scip, SCIP_CONS *cons0, SCIP_CONS *cons1)
Definition: scip_cons.c:1461
SCIP_RETCODE SCIPsetConshdlrInitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITPRE((*consinitpre)))
Definition: scip_cons.c:477
SCIP_DECL_CONSENFOPS(ConshdlrSubtour::scip_enfops)
SCIP_RETCODE SCIPtransformConss(SCIP *scip, int nconss, SCIP_CONS **conss, SCIP_CONS **transconss)
Definition: scip_cons.c:1562
#define SCIP_DECL_CONSRESPROP(x)
Definition: type_cons.h:601
SCIP_RETCODE SCIPconsGetVars(SCIP_CONS *cons, SCIP_SET *set, SCIP_VAR **vars, int varssize, SCIP_Bool *success)
Definition: cons.c:6282
datastructures for constraints and constraint handlers
SCIP_RETCODE SCIPconsSetSeparated(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool separate)
Definition: cons.c:6494
#define FALSE
Definition: def.h:87
SCIP_RETCODE SCIPincludeConshdlrBasic(SCIP *scip, SCIP_CONSHDLR **conshdlrptr, const char *name, const char *desc, int enfopriority, int chckpriority, int eagerfreq, SCIP_Bool needscons, SCIP_DECL_CONSENFOLP((*consenfolp)), SCIP_DECL_CONSENFOPS((*consenfops)), SCIP_DECL_CONSCHECK((*conscheck)), SCIP_DECL_CONSLOCK((*conslock)), SCIP_CONSHDLRDATA *conshdlrdata)
Definition: scip_cons.c:166
SCIP_RETCODE SCIPparseCons(SCIP *scip, SCIP_CONS **cons, const char *str, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode, SCIP_Bool *success)
Definition: scip_cons.c:1018
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:10755
SCIP_STAGE stage
Definition: struct_set.h:65
SCIP_RETCODE SCIPenableConsSeparation(SCIP *scip, SCIP_CONS *cons)
Definition: scip_cons.c:1833
#define TRUE
Definition: def.h:86
SCIP_RETCODE SCIPunmarkConsPropagate(SCIP *scip, SCIP_CONS *cons)
Definition: scip_cons.c:1979
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
#define SCIP_DECL_CONSGETNVARS(x)
Definition: type_cons.h:874
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
Definition: cons.c:8364
void SCIPconshdlrSetFree(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree)))
Definition: cons.c:4282
SCIP_RETCODE SCIPconsEnableSeparation(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:6873
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
Definition: cons.c:8394
#define SCIP_DECL_CONSEXITSOL(x)
Definition: type_cons.h:206
void SCIPconshdlrSetCopy(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
Definition: cons.c:4267
SCIP_RETCODE SCIPconsSetPropagated(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool propagate)
Definition: cons.c:6612
SCIP_RETCODE SCIPenableConsPropagation(SCIP *scip, SCIP_CONS *cons)
Definition: scip_cons.c:1888
SCIP_RETCODE SCIPsetConshdlrSepa(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa)
Definition: scip_cons.c:220
SCIP_DECL_CONSSEPASOL(ConshdlrSubtour::scip_sepasol)
SCIP_PROB * transprob
Definition: struct_scip.h:89
SCIP_DECL_CONSDELETE(ConshdlrSubtour::scip_delete)
void SCIPconshdlrSetProp(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING timingmask)
Definition: cons.c:4237
SCIP_RETCODE SCIPsetConshdlrDelvars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELVARS((*consdelvars)))
Definition: scip_cons.c:747
SCIP_CONS * SCIPconsGetTransformed(SCIP_CONS *cons)
Definition: cons.c:6719
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
Definition: cons.c:8354
SCIP_RETCODE SCIPsetConshdlrInitlp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp)))
Definition: scip_cons.c:609
SCIP_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
Definition: scip_cons.c:793
#define SCIP_DECL_CONSINITLP(x)
Definition: type_cons.h:249
SCIP_RETCODE SCIPconsAddLocks(SCIP_CONS *cons, SCIP_SET *set, SCIP_LOCKTYPE locktype, int nlockspos, int nlocksneg)
Definition: cons.c:7249
SCIP_RETCODE SCIPactiveCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip_cons.c:2405
SCIP_PROB * origprob
Definition: struct_scip.h:71
SCIP_RETCODE SCIPcreateCons(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_CONSHDLR *conshdlr, SCIP_CONSDATA *consdata, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
Definition: scip_cons.c:934
int SCIPconshdlrGetSepaPriority(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:5054
SCIP_DECL_CONSENFOLP(ConshdlrSubtour::scip_enfolp)
SCIP_RETCODE SCIPconsResetAge(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:7148
SCIP_RETCODE SCIPconsActive(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:7729
SCIP_Bool SCIPconsIsOriginal(SCIP_CONS *cons)
Definition: cons.c:8384
int SCIPgetNConshdlrs(SCIP *scip)
Definition: scip_cons.c:901
SCIP_DECL_CONSCHECK(ConshdlrSubtour::scip_check)
#define SCIP_DECL_CONSINITSOL(x)
Definition: type_cons.h:191
SCIP_RETCODE SCIPenableCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip_cons.c:1774
SCIP_RETCODE SCIPsetConsSeparated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool separate)
Definition: scip_cons.c:1233
SCIP_RETCODE SCIPconsDisableSeparation(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:6903
SCIP_RETCODE SCIPprobAddConsName(SCIP_PROB *prob, SCIP_CONS *cons)
Definition: prob.c:1240
SCIP_RETCODE SCIPsetConshdlrInitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITSOL((*consinitsol)))
Definition: scip_cons.c:429
SCIP_MEM * mem
Definition: struct_scip.h:62
public methods for managing constraints
SCIP_CONSHDLR * SCIPsetFindConshdlr(SCIP_SET *set, const char *name)
Definition: set.c:4000
void SCIPconshdlrSetExitsol(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol)))
Definition: cons.c:4326
SCIP_RETCODE SCIPsetConshdlrGetDiveBdChgs(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)))
Definition: scip_cons.c:862
void SCIPconshdlrSetEnforelax(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENFORELAX((*consenforelax)))
Definition: cons.c:4256
SCIP_RETCODE SCIPsetConsRemovable(SCIP *scip, SCIP_CONS *cons, SCIP_Bool removable)
Definition: scip_cons.c:1411
SCIP_RETCODE SCIPconsEnablePropagation(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:6931
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
Definition: scip_cons.c:332
void SCIPsetReinsertConshdlrSepaPrio(SCIP_SET *set, SCIP_CONSHDLR *conshdlr, int oldpriority)
Definition: set.c:3917
enum SCIP_LockType SCIP_LOCKTYPE
Definition: type_var.h:87
internal methods for storing and manipulating the main problem
SCIP_RETCODE SCIPconsResprop(SCIP_CONS *cons, SCIP_SET *set, SCIP_VAR *infervar, int inferinfo, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedbd, SCIP_RESULT *result)
Definition: cons.c:7613
#define SCIPerrorMessage
Definition: pub_message.h:55
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4175
SCIP_RETCODE SCIPconsTransform(SCIP_CONS *origcons, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_CONS **transcons)
Definition: cons.c:6410
SCIP_RETCODE SCIPgetConsNVars(SCIP *scip, SCIP_CONS *cons, int *nvars, SCIP_Bool *success)
Definition: scip_cons.c:2558
SCIP_CONSHDLR ** SCIPgetConshdlrs(SCIP *scip)
Definition: scip_cons.c:890
SCIP_RETCODE SCIPconshdlrCreate(SCIP_CONSHDLR **conshdlr, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int sepapriority, int enfopriority, int checkpriority, int sepafreq, int propfreq, int eagerfreq, int maxprerounds, SCIP_Bool delaysepa, SCIP_Bool delayprop, SCIP_Bool needscons, SCIP_PROPTIMING proptiming, SCIP_PRESOLTIMING presoltiming, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSFREE((*consfree)), SCIP_DECL_CONSINIT((*consinit)), SCIP_DECL_CONSEXIT((*consexit)), SCIP_DECL_CONSINITPRE((*consinitpre)), SCIP_DECL_CONSEXITPRE((*consexitpre)), SCIP_DECL_CONSINITSOL((*consinitsol)), SCIP_DECL_CONSEXITSOL((*consexitsol)), SCIP_DECL_CONSDELETE((*consdelete)), SCIP_DECL_CONSTRANS((*constrans)), SCIP_DECL_CONSINITLP((*consinitlp)), SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), SCIP_DECL_CONSENFOLP((*consenfolp)), SCIP_DECL_CONSENFORELAX((*consenforelax)), SCIP_DECL_CONSENFOPS((*consenfops)), SCIP_DECL_CONSCHECK((*conscheck)), SCIP_DECL_CONSPROP((*consprop)), SCIP_DECL_CONSPRESOL((*conspresol)), SCIP_DECL_CONSRESPROP((*consresprop)), SCIP_DECL_CONSLOCK((*conslock)), SCIP_DECL_CONSACTIVE((*consactive)), SCIP_DECL_CONSDEACTIVE((*consdeactive)), SCIP_DECL_CONSENABLE((*consenable)), SCIP_DECL_CONSDISABLE((*consdisable)), SCIP_DECL_CONSDELVARS((*consdelvars)), SCIP_DECL_CONSPRINT((*consprint)), SCIP_DECL_CONSCOPY((*conscopy)), SCIP_DECL_CONSPARSE((*consparse)), SCIP_DECL_CONSGETVARS((*consgetvars)), SCIP_DECL_CONSGETNVARS((*consgetnvars)), SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)), SCIP_CONSHDLRDATA *conshdlrdata)
Definition: cons.c:2269
#define SCIP_DECL_CONSPARSE(x)
Definition: type_cons.h:834
#define SCIP_DECL_CONSDEACTIVE(x)
Definition: type_cons.h:695
SCIP_RETCODE SCIPconsProp(SCIP_CONS *cons, SCIP_SET *set, SCIP_PROPTIMING proptiming, SCIP_RESULT *result)
Definition: cons.c:7573
SCIP_RETCODE SCIPpresolCons(SCIP *scip, SCIP_CONS *cons, int nrounds, SCIP_PRESOLTIMING presoltiming, int nnewfixedvars, int nnewaggrvars, int nnewchgvartypes, int nnewchgbds, int nnewholes, int nnewdelconss, int nnewaddconss, int nnewupgdconss, int nnewchgcoefs, int nnewchgsides, int *nfixedvars, int *naggrvars, int *nchgvartypes, int *nchgbds, int *naddholes, int *ndelconss, int *naddconss, int *nupgdconss, int *nchgcoefs, int *nchgsides, SCIP_RESULT *result)
Definition: scip_cons.c:2343
SCIP_RETCODE SCIPconsDeactive(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:7753
SCIP_RETCODE SCIPcheckStage(SCIP *scip, const char *method, SCIP_Bool init, SCIP_Bool problem, SCIP_Bool transforming, SCIP_Bool transformed, SCIP_Bool initpresolve, SCIP_Bool presolving, SCIP_Bool exitpresolve, SCIP_Bool presolved, SCIP_Bool initsolve, SCIP_Bool solving, SCIP_Bool solved, SCIP_Bool exitsolve, SCIP_Bool freetrans, SCIP_Bool freescip)
Definition: debug.c:2177
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip_mem.c:48
SCIP_RETCODE SCIPcheckCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_RESULT *result)
Definition: scip_cons.c:2072
SCIP_CONSHDLR ** conshdlrs
Definition: struct_set.h:72
SCIP_RETCODE SCIPsetConsChecked(SCIP *scip, SCIP_CONS *cons, SCIP_Bool check)
Definition: scip_cons.c:1283
SCIP_RETCODE SCIPsetConsDynamic(SCIP *scip, SCIP_CONS *cons, SCIP_Bool dynamic)
Definition: scip_cons.c:1386
SCIP_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
Definition: cons.c:8304
SCIP_REOPT * reopt
Definition: struct_scip.h:76
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree)))
Definition: scip_cons.c:357
SCIP_DECL_CONSTRANS(ConshdlrSubtour::scip_trans)
SCIP_RETCODE SCIPenforelaxCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool solinfeasible, SCIP_RESULT *result)
Definition: scip_cons.c:2161
void SCIPconshdlrSetEnable(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENABLE((*consenable)))
Definition: cons.c:4454
SCIP_RETCODE SCIPconsChgName(SCIP_CONS *cons, BMS_BLKMEM *blkmem, const char *name)
Definition: cons.c:6116
#define NULL
Definition: lpi_spx1.cpp:155
SCIP_RETCODE SCIPmarkConsPropagate(SCIP *scip, SCIP_CONS *cons)
Definition: scip_cons.c:1951
#define SCIP_DECL_CONSDISABLE(x)
Definition: type_cons.h:725
void SCIPconshdlrSetExit(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXIT((*consexit)))
Definition: cons.c:4304
SCIP_RETCODE SCIPtransformCons(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **transcons)
Definition: scip_cons.c:1521
internal methods for global SCIP settings
SCIP_DECL_CONSDELVARS(ConshdlrSubtour::scip_delvars)
SCIP * scip
Definition: struct_cons.h:101
#define SCIP_CALL(x)
Definition: def.h:384
unsigned int SCIP_PRESOLTIMING
Definition: type_timing.h:52
SCIP main data structure.
BMS_BLKMEM * setmem
Definition: struct_mem.h:39
#define SCIP_DECL_CONSENABLE(x)
Definition: type_cons.h:710
SCIP_RETCODE SCIPconsDisable(SCIP_CONS *cons, SCIP_SET *set, SCIP_STAT *stat)
Definition: cons.c:6839
void SCIPconshdlrSetSepa(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa)
Definition: cons.c:4216
SCIP_RETCODE SCIPgetTransformedCons(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **transcons)
Definition: scip_cons.c:1611
SCIP_RETCODE SCIPcaptureCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip_cons.c:1075
void SCIPconshdlrSetActive(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSACTIVE((*consactive)))
Definition: cons.c:4432
SCIP_RETCODE SCIPsetConshdlrResprop(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop)))
Definition: scip_cons.c:632
struct SCIP_ConsData SCIP_CONSDATA
Definition: type_cons.h:56
SCIP_RETCODE SCIPdisableCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip_cons.c:1808
SCIP_RETCODE SCIPgetConsVars(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int varssize, SCIP_Bool *success)
Definition: scip_cons.c:2514
public methods for constraint handler plugins and constraints
#define SCIP_DECL_CONSGETVARS(x)
Definition: type_cons.h:856
SCIP_RETCODE SCIPpropCons(SCIP *scip, SCIP_CONS *cons, SCIP_PROPTIMING proptiming, SCIP_RESULT *result)
Definition: scip_cons.c:2277
#define SCIP_DECL_CONSEXIT(x)
Definition: type_cons.h:126
public data structures and miscellaneous methods
SCIP_RETCODE SCIPconsGetNVars(SCIP_CONS *cons, SCIP_SET *set, int *nvars, SCIP_Bool *success)
Definition: cons.c:6318
#define SCIP_Bool
Definition: def.h:84
SCIP_RETCODE SCIPsetConsLocal(SCIP *scip, SCIP_CONS *cons, SCIP_Bool local)
Definition: scip_cons.c:1335
SCIP_DECL_CONSPROP(ConshdlrSubtour::scip_prop)
SCIP_RETCODE SCIPconsAddAge(SCIP_CONS *cons, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_Real deltaage, SCIP_REOPT *reopt)
Definition: cons.c:7068
SCIP_RETCODE SCIPconsEnfops(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool solinfeasible, SCIP_Bool objinfeasible, SCIP_RESULT *result)
Definition: cons.c:7333
static const char * paramname[]
Definition: lpi_msk.c:5021
void SCIPconsSetModifiable(SCIP_CONS *cons, SCIP_Bool modifiable)
Definition: cons.c:6660
SCIP_RETCODE SCIPconsRelease(SCIP_CONS **cons, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: cons.c:6203
void SCIPconshdlrSetDelete(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
Definition: cons.c:4388
void SCIPconshdlrSetInit(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINIT((*consinit)))
Definition: cons.c:4293
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
Definition: scip_cons.c:2473
#define SCIP_DECL_CONSEXITPRE(x)
Definition: type_cons.h:170
methods for debugging
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
Definition: cons.c:8214
SCIP_RETCODE SCIPsetConshdlrDisable(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDISABLE((*consdisable)))
Definition: scip_cons.c:724
datastructures for block memory pools and memory buffers
void SCIPconsSetRemovable(SCIP_CONS *cons, SCIP_Bool removable)
Definition: cons.c:6682
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
Definition: cons.c:8284
SCIP_RETCODE SCIPprobRemoveConsName(SCIP_PROB *prob, SCIP_CONS *cons)
Definition: prob.c:1255
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
Definition: cons.c:8254
SCIP_RETCODE SCIPconshdlrSetPresol(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
Definition: cons.c:4359
#define SCIP_PRESOLTIMING_ALWAYS
Definition: type_timing.h:49
SCIP_RETCODE SCIPsetSetDefaultBoolParam(SCIP_SET *set, const char *name, SCIP_Bool defaultvalue)
Definition: set.c:3288
SCIP_RETCODE SCIPsepasolCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_RESULT *result)
Definition: scip_cons.c:2247
SCIP_RETCODE SCIPenfolpCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool solinfeasible, SCIP_RESULT *result)
Definition: scip_cons.c:2131
#define SCIP_PROPTIMING_BEFORELP
Definition: type_timing.h:56
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint)))
Definition: scip_cons.c:770
SCIP_RETCODE SCIPsetConshdlrEnable(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENABLE((*consenable)))
Definition: scip_cons.c:701
void SCIPconshdlrSetGetNVars(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
Definition: cons.c:4520
void SCIPconshdlrSetParse(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
Definition: cons.c:4498
SCIP_RETCODE SCIPsetConshdlrExitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITPRE((*consexitpre)))
Definition: scip_cons.c:501
SCIP_RETCODE SCIPsetConsStickingAtNode(SCIP *scip, SCIP_CONS *cons, SCIP_Bool stickingatnode)
Definition: scip_cons.c:1436
general public methods
BMS_BLKMEM * probmem
Definition: struct_mem.h:40
void SCIPconsCapture(SCIP_CONS *cons)
Definition: cons.c:6191
unsigned int SCIP_PROPTIMING
Definition: type_timing.h:66
SCIP_RETCODE SCIPenfopsCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool solinfeasible, SCIP_Bool objinfeasible, SCIP_RESULT *result)
Definition: scip_cons.c:2100
SCIP_RETCODE SCIPsepalpCons(SCIP *scip, SCIP_CONS *cons, SCIP_RESULT *result)
Definition: scip_cons.c:2220
SCIP_RETCODE SCIPsetConshdlrInit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINIT((*consinit)))
Definition: scip_cons.c:381
SCIP_RETCODE SCIPsetConsEnforced(SCIP *scip, SCIP_CONS *cons, SCIP_Bool enforce)
Definition: scip_cons.c:1258
SCIP_RETCODE SCIPsetConshdlrExit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXIT((*consexit)))
Definition: scip_cons.c:405
#define SCIP_DECL_CONSFREE(x)
Definition: type_cons.h:106
void SCIPconshdlrSetDisable(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDISABLE((*consdisable)))
Definition: cons.c:4465
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
Definition: scip_cons.c:1110
SCIP_SET * set
Definition: struct_scip.h:63
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
Definition: scip_cons.c:525
public methods for message output
#define SCIP_DECL_CONSINIT(x)
Definition: type_cons.h:116
SCIP_DECL_CONSLOCK(ConshdlrSubtour::scip_lock)
SCIP_MESSAGEHDLR * messagehdlr
Definition: struct_scip.h:66
#define SCIP_DECL_CONSENFORELAX(x)
Definition: type_cons.h:378
SCIP_RETCODE SCIPconsSetInitial(SCIP_CONS *cons, SCIP_SET *set, SCIP_STAT *stat, SCIP_Bool initial)
Definition: cons.c:6460
void SCIPconshdlrSetResprop(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop)))
Definition: cons.c:4421
#define SCIP_Real
Definition: def.h:177
SCIP_RETCODE SCIPaddConsLocksType(SCIP *scip, SCIP_CONS *cons, SCIP_LOCKTYPE locktype, int nlockspos, int nlocksneg)
Definition: scip_cons.c:2009
SCIP_DECL_CONSPRINT(ConshdlrSubtour::scip_print)
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
Definition: scip_cons.c:839
SCIP_RETCODE SCIPconsPresol(SCIP_CONS *cons, SCIP_SET *set, int nrounds, SCIP_PRESOLTIMING timing, int nnewfixedvars, int nnewaggrvars, int nnewchgvartypes, int nnewchgbds, int nnewholes, int nnewdelconss, int nnewaddconss, int nnewupgdconss, int nnewchgcoefs, int nnewchgsides, int *nfixedvars, int *naggrvars, int *nchgvartypes, int *nchgbds, int *naddholes, int *ndelconss, int *naddconss, int *nupgdconss, int *nchgcoefs, int *nchgsides, SCIP_RESULT *result)
Definition: cons.c:7655
void SCIPconshdlrSetDelvars(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELVARS((*consdelvars)))
Definition: cons.c:4476
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
Definition: cons.c:8274
SCIP_RETCODE SCIPconsPrint(SCIP_CONS *cons, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: cons.c:6243
internal methods for constraints and constraint handlers
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
Definition: cons.c:8264
#define SCIP_DECL_CONSACTIVE(x)
Definition: type_cons.h:680
SCIP_RETCODE SCIPsetConsModifiable(SCIP *scip, SCIP_CONS *cons, SCIP_Bool modifiable)
Definition: scip_cons.c:1361
SCIP_RETCODE SCIPaddConsLocks(SCIP *scip, SCIP_CONS *cons, int nlockspos, int nlocksneg)
Definition: scip_cons.c:2042
void SCIPconshdlrSetGetVars(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars)))
Definition: cons.c:4509
SCIP_RETCODE SCIPsetSetDefaultIntParam(SCIP_SET *set, const char *name, int defaultvalue)
Definition: set.c:3341
void SCIPconshdlrSetTrans(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
Definition: cons.c:4399
SCIP_RETCODE SCIPconsMarkPropagate(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:7001
SCIP_RETCODE SCIPconsEnforelax(SCIP_CONS *cons, SCIP_SET *set, SCIP_SOL *sol, SCIP_Bool solinfeasible, SCIP_RESULT *result)
Definition: cons.c:7419
SCIP_RETCODE SCIPconsEnable(SCIP_CONS *cons, SCIP_SET *set, SCIP_STAT *stat)
Definition: cons.c:6806
#define SCIP_DECL_CONSHDLRCOPY(x)
Definition: type_cons.h:98
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
Definition: type_cons.h:55
SCIP_DECL_CONSCOPY(ConshdlrSubtour::scip_copy)
void SCIPconshdlrSetExitpre(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITPRE((*consexitpre)))
Definition: cons.c:4348
SCIP_RETCODE SCIPconsEnfolp(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool solinfeasible, SCIP_RESULT *result)
Definition: cons.c:7377
SCIP_Bool SCIPconsIsMarkedPropagate(SCIP_CONS *cons)
Definition: cons.c:8294
int nconshdlrs
Definition: struct_set.h:111
SCIP_RETCODE SCIPconsDisablePropagation(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:6961
void SCIPconsSetLocal(SCIP_CONS *cons, SCIP_Bool local)
Definition: cons.c:6647
SCIP_RETCODE SCIPincludeConshdlr(SCIP *scip, const char *name, const char *desc, int sepapriority, int enfopriority, int chckpriority, int sepafreq, int propfreq, int eagerfreq, int maxprerounds, SCIP_Bool delaysepa, SCIP_Bool delayprop, SCIP_Bool needscons, SCIP_PROPTIMING proptiming, SCIP_PRESOLTIMING presoltiming, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSFREE((*consfree)), SCIP_DECL_CONSINIT((*consinit)), SCIP_DECL_CONSEXIT((*consexit)), SCIP_DECL_CONSINITPRE((*consinitpre)), SCIP_DECL_CONSEXITPRE((*consexitpre)), SCIP_DECL_CONSINITSOL((*consinitsol)), SCIP_DECL_CONSEXITSOL((*consexitsol)), SCIP_DECL_CONSDELETE((*consdelete)), SCIP_DECL_CONSTRANS((*constrans)), SCIP_DECL_CONSINITLP((*consinitlp)), SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), SCIP_DECL_CONSENFOLP((*consenfolp)), SCIP_DECL_CONSENFORELAX((*consenforelax)), SCIP_DECL_CONSENFOPS((*consenfops)), SCIP_DECL_CONSCHECK((*conscheck)), SCIP_DECL_CONSPROP((*consprop)), SCIP_DECL_CONSPRESOL((*conspresol)), SCIP_DECL_CONSRESPROP((*consresprop)), SCIP_DECL_CONSLOCK((*conslock)), SCIP_DECL_CONSACTIVE((*consactive)), SCIP_DECL_CONSDEACTIVE((*consdeactive)), SCIP_DECL_CONSENABLE((*consenable)), SCIP_DECL_CONSDISABLE((*consdisable)), SCIP_DECL_CONSDELVARS((*consdelvars)), SCIP_DECL_CONSPRINT((*consprint)), SCIP_DECL_CONSCOPY((*conscopy)), SCIP_DECL_CONSPARSE((*consparse)), SCIP_DECL_CONSGETVARS((*consgetvars)), SCIP_DECL_CONSGETNVARS((*consgetnvars)), SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)), SCIP_CONSHDLRDATA *conshdlrdata)
Definition: scip_cons.c:73
SCIP_RETCODE SCIPgetTransformedConss(SCIP *scip, int nconss, SCIP_CONS **conss, SCIP_CONS **transconss)
Definition: scip_cons.c:1651
SCIP_RETCODE SCIPsetConshdlrActive(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSACTIVE((*consactive)))
Definition: scip_cons.c:655
SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol)))
Definition: scip_cons.c:453
#define SCIPABORT()
Definition: def.h:356
SCIP_RETCODE SCIPdeactiveCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip_cons.c:2434
datastructures for global SCIP settings
void SCIPconshdlrSetInitlp(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp)))
Definition: cons.c:4410
SCIP_RETCODE SCIPconsInitlp(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool *infeasible)
Definition: cons.c:7463
SCIP_RETCODE SCIPconsCreate(SCIP_CONS **cons, BMS_BLKMEM *blkmem, SCIP_SET *set, const char *name, SCIP_CONSHDLR *conshdlr, SCIP_CONSDATA *consdata, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode, SCIP_Bool original, SCIP_Bool deleteconsdata)
Definition: cons.c:5811
SCIP_RETCODE SCIPconsCheck(SCIP_CONS *cons, SCIP_SET *set, SCIP_SOL *sol, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_RESULT *result)
Definition: cons.c:7295
SCIP_RETCODE SCIPconsSepalp(SCIP_CONS *cons, SCIP_SET *set, SCIP_RESULT *result)
Definition: cons.c:7489
SCIP_RETCODE SCIPinitlpCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *infeasible)
Definition: scip_cons.c:2193
void SCIPconshdlrSetGetDiveBdChgs(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)))
Definition: cons.c:4531
SCIP_RETCODE SCIPconsSetEnforced(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool enforce)
Definition: cons.c:6529
SCIP_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming)
Definition: scip_cons.c:266
SCIP_RETCODE SCIPsetConsInitial(SCIP *scip, SCIP_CONS *cons, SCIP_Bool initial)
Definition: scip_cons.c:1208