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