SCIP Doxygen Documentation
 
Loading...
Searching...
No Matches
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
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,
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,
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
247
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 )
254
255 name = SCIPconshdlrGetName(conshdlr);
256
257 (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/sepafreq", name);
259
260 (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/delaysepa", name);
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
291
292 SCIPconshdlrSetProp(conshdlr, consprop, propfreq, delayprop, proptiming);
293
294 name = SCIPconshdlrGetName(conshdlr);
295
296 (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/propfreq", name);
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);
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
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{
349
350 assert(conshdlr != NULL);
351
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{
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{
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{
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 {
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
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
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
1142 case SCIP_STAGE_SOLVING:
1143 case SCIP_STAGE_SOLVED:
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{
1177
1178 assert( cons->scip == scip );
1179
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
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
1479 {
1481 }
1483 {
1485 }
1487 {
1489 }
1491 {
1493 }
1495 {
1497 }
1498 if( !SCIPconsIsDynamic(cons1) )
1499 {
1501 }
1503 {
1505 }
1507 {
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;
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];
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
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
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{
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{
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{
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{
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
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
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
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
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
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
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{
2092
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
2123
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
2153
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
2185
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
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
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
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
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
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
2395
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
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
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}
void SCIPconshdlrSetExitpre(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4353
SCIP_RETCODE SCIPconsAddLocks(SCIP_CONS *cons, SCIP_SET *set, SCIP_LOCKTYPE locktype, int nlockspos, int nlocksneg)
Definition cons.c:7252
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:6014
SCIP_RETCODE SCIPconsEnableSeparation(SCIP_CONS *cons, SCIP_SET *set)
Definition cons.c:6876
SCIP_RETCODE SCIPconshdlrSetPresol(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
Definition cons.c:4364
void SCIPconshdlrSetDelvars(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4481
SCIP_RETCODE SCIPconsEnable(SCIP_CONS *cons, SCIP_SET *set, SCIP_STAT *stat)
Definition cons.c:6809
void SCIPconsCapture(SCIP_CONS *cons)
Definition cons.c:6194
SCIP_RETCODE SCIPconsProp(SCIP_CONS *cons, SCIP_SET *set, SCIP_PROPTIMING proptiming, SCIP_RESULT *result)
Definition cons.c:7576
SCIP_RETCODE SCIPconsPrint(SCIP_CONS *cons, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition cons.c:6246
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:5816
void SCIPconshdlrSetInit(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4298
void SCIPconsSetLocal(SCIP_CONS *cons, SCIP_Bool local)
Definition cons.c:6650
SCIP_RETCODE SCIPconsMarkPropagate(SCIP_CONS *cons, SCIP_SET *set)
Definition cons.c:7004
void SCIPconshdlrSetGetNVars(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4525
SCIP_RETCODE SCIPconsDisable(SCIP_CONS *cons, SCIP_SET *set, SCIP_STAT *stat)
Definition cons.c:6842
SCIP_RETCODE SCIPconsDeactive(SCIP_CONS *cons, SCIP_SET *set)
Definition cons.c:7756
SCIP_RETCODE SCIPconsGetNVars(SCIP_CONS *cons, SCIP_SET *set, int *nvars, SCIP_Bool *success)
Definition cons.c:6321
void SCIPconsSetStickingAtNode(SCIP_CONS *cons, SCIP_Bool stickingatnode)
Definition cons.c:6696
SCIP_RETCODE SCIPconsSetSeparated(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool separate)
Definition cons.c:6497
SCIP_RETCODE SCIPconsSepalp(SCIP_CONS *cons, SCIP_SET *set, SCIP_RESULT *result)
Definition cons.c:7492
SCIP_RETCODE SCIPconsEnfops(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool solinfeasible, SCIP_Bool objinfeasible, SCIP_RESULT *result)
Definition cons.c:7336
SCIP_RETCODE SCIPconsActive(SCIP_CONS *cons, SCIP_SET *set)
Definition cons.c:7732
SCIP_RETCODE SCIPconsResetAge(SCIP_CONS *cons, SCIP_SET *set)
Definition cons.c:7151
void SCIPconshdlrSetExit(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4309
void SCIPconshdlrSetResprop(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4426
void SCIPconshdlrSetTrans(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4404
void SCIPconshdlrSetDelete(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4393
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:7616
void SCIPconshdlrSetParse(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4503
void SCIPconsSetRemovable(SCIP_CONS *cons, SCIP_Bool removable)
Definition cons.c:6685
void SCIPconshdlrSetExitsol(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4331
void SCIPconshdlrSetDisable(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4470
void SCIPconshdlrSetActive(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4437
SCIP_RETCODE SCIPconsTransform(SCIP_CONS *origcons, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_CONS **transcons)
Definition cons.c:6413
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:7298
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:2274
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:7071
SCIP_RETCODE SCIPconsEnablePropagation(SCIP_CONS *cons, SCIP_SET *set)
Definition cons.c:6934
SCIP_RETCODE SCIPconsEnfolp(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool solinfeasible, SCIP_RESULT *result)
Definition cons.c:7380
SCIP_RETCODE SCIPconsSetInitial(SCIP_CONS *cons, SCIP_SET *set, SCIP_STAT *stat, SCIP_Bool initial)
Definition cons.c:6463
SCIP_RETCODE SCIPconsChgName(SCIP_CONS *cons, BMS_BLKMEM *blkmem, const char *name)
Definition cons.c:6119
SCIP_RETCODE SCIPconsIncAge(SCIP_CONS *cons, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_REOPT *reopt)
Definition cons.c:7130
void SCIPconshdlrSetEnable(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4459
void SCIPconsSetDynamic(SCIP_CONS *cons, SCIP_Bool dynamic)
Definition cons.c:6674
SCIP_RETCODE SCIPconsSepasol(SCIP_CONS *cons, SCIP_SET *set, SCIP_SOL *sol, SCIP_RESULT *result)
Definition cons.c:7533
void SCIPconshdlrSetDeactive(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4448
void SCIPconshdlrSetGetVars(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4514
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:7658
SCIP_RETCODE SCIPconsDisablePropagation(SCIP_CONS *cons, SCIP_SET *set)
Definition cons.c:6964
void SCIPconshdlrSetGetDiveBdChgs(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4536
SCIP_RETCODE SCIPconsRelease(SCIP_CONS **cons, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition cons.c:6206
SCIP_RETCODE SCIPconsSetPropagated(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool propagate)
Definition cons.c:6615
SCIP_RETCODE SCIPconsDisableSeparation(SCIP_CONS *cons, SCIP_SET *set)
Definition cons.c:6906
void SCIPconshdlrSetInitsol(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4320
SCIP_RETCODE SCIPconsSetChecked(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool check)
Definition cons.c:6567
SCIP_RETCODE SCIPconsInitlp(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool *infeasible)
Definition cons.c:7466
SCIP_RETCODE SCIPconsEnforelax(SCIP_CONS *cons, SCIP_SET *set, SCIP_SOL *sol, SCIP_Bool solinfeasible, SCIP_RESULT *result)
Definition cons.c:7422
SCIP_CONS * SCIPconsGetTransformed(SCIP_CONS *cons)
Definition cons.c:6722
void SCIPconshdlrSetInitlp(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4415
SCIP_RETCODE SCIPconsUnmarkPropagate(SCIP_CONS *cons, SCIP_SET *set)
Definition cons.c:7034
void SCIPconshdlrSetCopy(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)),)
Definition cons.c:4272
void SCIPconshdlrSetFree(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4287
SCIP_RETCODE SCIPconsGetVars(SCIP_CONS *cons, SCIP_SET *set, SCIP_VAR **vars, int varssize, SCIP_Bool *success)
Definition cons.c:6285
void SCIPconshdlrSetInitpre(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4342
SCIP_RETCODE SCIPconsSetEnforced(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool enforce)
Definition cons.c:6532
void SCIPconsSetModifiable(SCIP_CONS *cons, SCIP_Bool modifiable)
Definition cons.c:6663
void SCIPconshdlrSetPrint(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4492
internal methods for constraints and constraint handlers
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
methods for debugging
#define SCIP_MAXSTRLEN
Definition def.h:302
#define TRUE
Definition def.h:95
#define FALSE
Definition def.h:96
#define SCIPABORT()
Definition def.h:360
#define SCIP_CALL(x)
Definition def.h:388
SCIP_STAGE SCIPgetStage(SCIP *scip)
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:366
void SCIPconshdlrSetEnforelax(SCIP_CONSHDLR *conshdlr,)
Definition cons.c:4261
SCIP_RETCODE SCIPsetConshdlrActive(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:664
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
Definition scip_cons.c:534
SCIP_RETCODE SCIPsetConshdlrEnable(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:710
void SCIPconshdlrSetProp(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING timingmask)
Definition cons.c:4242
SCIP_RETCODE SCIPsetConshdlrInitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:486
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_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming)
Definition scip_cons.c:275
int SCIPgetNConshdlrs(SCIP *scip)
Definition scip_cons.c:910
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:317
int SCIPconshdlrGetSepaPriority(SCIP_CONSHDLR *conshdlr)
Definition cons.c:5059
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 SCIPsetConshdlrGetDiveBdChgs(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:871
SCIP_RETCODE SCIPsetConshdlrDisable(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:733
void SCIPconshdlrSetSepa(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa)
Definition cons.c:4221
SCIP_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:802
SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:825
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:779
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
Definition cons.c:4180
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)),)
Definition scip_cons.c:341
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
Definition scip_cons.c:886
SCIP_RETCODE SCIPsetConshdlrInit(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:390
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 SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:572
SCIP_RETCODE SCIPsetConshdlrInitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:438
SCIP_RETCODE SCIPsetConshdlrDeactive(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:687
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:595
SCIP_RETCODE SCIPsetConshdlrResprop(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:641
SCIP_RETCODE SCIPsetConshdlrExitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:510
SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:462
SCIP_RETCODE SCIPsetConshdlrDelvars(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:756
SCIP_RETCODE SCIPsetConshdlrExit(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:414
SCIP_CONSHDLR ** SCIPgetConshdlrs(SCIP *scip)
Definition scip_cons.c:899
SCIP_RETCODE SCIPsetConshdlrInitlp(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:618
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:848
SCIP_RETCODE SCIPgetConsNVars(SCIP *scip, SCIP_CONS *cons, int *nvars, SCIP_Bool *success)
Definition scip_cons.c:2567
SCIP_RETCODE SCIPenfopsCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool solinfeasible, SCIP_Bool objinfeasible, SCIP_RESULT *result)
Definition scip_cons.c:2109
SCIP_RETCODE SCIPdisableConsSeparation(SCIP *scip, SCIP_CONS *cons)
Definition scip_cons.c:1870
SCIP_RETCODE SCIPgetTransformedConss(SCIP *scip, int nconss, SCIP_CONS **conss, SCIP_CONS **transconss)
Definition scip_cons.c:1660
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_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
Definition cons.c:8347
SCIP_RETCODE SCIPenableCons(SCIP *scip, SCIP_CONS *cons)
Definition scip_cons.c:1783
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_Bool SCIPconsIsInitial(SCIP_CONS *cons)
Definition cons.c:8257
SCIP_RETCODE SCIPsetConsStickingAtNode(SCIP *scip, SCIP_CONS *cons, SCIP_Bool stickingatnode)
Definition scip_cons.c:1445
SCIP_RETCODE SCIPchgConsName(SCIP *scip, SCIP_CONS *cons, const char *name)
Definition scip_cons.c:1170
SCIP_RETCODE SCIPenfolpCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool solinfeasible, SCIP_RESULT *result)
Definition scip_cons.c:2140
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
Definition scip_cons.c:2482
SCIP_RETCODE SCIPpropCons(SCIP *scip, SCIP_CONS *cons, SCIP_PROPTIMING proptiming, SCIP_RESULT *result)
Definition scip_cons.c:2286
SCIP_RETCODE SCIPtransformConss(SCIP *scip, int nconss, SCIP_CONS **conss, SCIP_CONS **transconss)
Definition scip_cons.c:1571
SCIP_RETCODE SCIPenableConsPropagation(SCIP *scip, SCIP_CONS *cons)
Definition scip_cons.c:1897
SCIP_RETCODE SCIPdeactiveCons(SCIP *scip, SCIP_CONS *cons)
Definition scip_cons.c:2443
SCIP_RETCODE SCIPsetConsSeparated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool separate)
Definition scip_cons.c:1242
SCIP_Bool SCIPconsIsMarkedPropagate(SCIP_CONS *cons)
Definition cons.c:8297
SCIP_Bool SCIPconsIsOriginal(SCIP_CONS *cons)
Definition cons.c:8387
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
Definition cons.c:8287
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
Definition cons.c:8217
SCIP_RETCODE SCIPsepalpCons(SCIP *scip, SCIP_CONS *cons, SCIP_RESULT *result)
Definition scip_cons.c:2229
SCIP_RETCODE SCIPsetConsDynamic(SCIP *scip, SCIP_CONS *cons, SCIP_Bool dynamic)
Definition scip_cons.c:1395
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
Definition cons.c:8397
SCIP_RETCODE SCIPgetConsVars(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int varssize, SCIP_Bool *success)
Definition scip_cons.c:2523
SCIP_RETCODE SCIPsetConsInitial(SCIP *scip, SCIP_CONS *cons, SCIP_Bool initial)
Definition scip_cons.c:1217
SCIP_RETCODE SCIPsetConsEnforced(SCIP *scip, SCIP_CONS *cons, SCIP_Bool enforce)
Definition scip_cons.c:1267
SCIP_RETCODE SCIPactiveCons(SCIP *scip, SCIP_CONS *cons)
Definition scip_cons.c:2414
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
Definition cons.c:8277
SCIP_RETCODE SCIPunmarkConsPropagate(SCIP *scip, SCIP_CONS *cons)
Definition scip_cons.c:1988
SCIP_RETCODE SCIPenableConsSeparation(SCIP *scip, SCIP_CONS *cons)
Definition scip_cons.c:1842
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
SCIP_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
Definition cons.c:8307
SCIP_RETCODE SCIPaddConsLocksType(SCIP *scip, SCIP_CONS *cons, SCIP_LOCKTYPE locktype, int nlockspos, int nlocksneg)
Definition scip_cons.c:2018
SCIP_Bool SCIPconsIsEnabled(SCIP_CONS *cons)
Definition cons.c:8185
SCIP_RETCODE SCIPdisableCons(SCIP *scip, SCIP_CONS *cons)
Definition scip_cons.c:1817
SCIP_RETCODE SCIPresetConsAge(SCIP *scip, SCIP_CONS *cons)
Definition scip_cons.c:1758
SCIP_RETCODE SCIPsetConsModifiable(SCIP *scip, SCIP_CONS *cons, SCIP_Bool modifiable)
Definition scip_cons.c:1370
SCIP_RETCODE SCIPmarkConsPropagate(SCIP *scip, SCIP_CONS *cons)
Definition scip_cons.c:1960
SCIP_RETCODE SCIPinitlpCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *infeasible)
Definition scip_cons.c:2202
SCIP_RETCODE SCIPsetConsRemovable(SCIP *scip, SCIP_CONS *cons, SCIP_Bool removable)
Definition scip_cons.c:1420
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
SCIP_RETCODE SCIPsetConsLocal(SCIP *scip, SCIP_CONS *cons, SCIP_Bool local)
Definition scip_cons.c:1344
SCIP_RETCODE SCIPaddConsLocks(SCIP *scip, SCIP_CONS *cons, int nlockspos, int nlocksneg)
Definition scip_cons.c:2051
SCIP_RETCODE SCIPgetTransformedCons(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **transcons)
Definition scip_cons.c:1620
SCIP_Bool SCIPconsIsAdded(SCIP_CONS *cons)
Definition cons.c:8517
SCIP_RETCODE SCIPenforelaxCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool solinfeasible, SCIP_RESULT *result)
Definition scip_cons.c:2170
SCIP_RETCODE SCIPupdateConsFlags(SCIP *scip, SCIP_CONS *cons0, SCIP_CONS *cons1)
Definition scip_cons.c:1470
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
Definition cons.c:8367
SCIP_RETCODE SCIPdisableConsPropagation(SCIP *scip, SCIP_CONS *cons)
Definition scip_cons.c:1927
SCIP_RETCODE SCIPaddConsAge(SCIP *scip, SCIP_CONS *cons, SCIP_Real deltaage)
Definition scip_cons.c:1701
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
SCIP_RETCODE SCIPsepasolCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_RESULT *result)
Definition scip_cons.c:2256
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
Definition scip_cons.c:1119
SCIP_RETCODE SCIPsetConsPropagated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool propagate)
Definition scip_cons.c:1317
SCIP_RETCODE SCIPtransformCons(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **transcons)
Definition scip_cons.c:1530
SCIP_RETCODE SCIPsetConsChecked(SCIP *scip, SCIP_CONS *cons, SCIP_Bool check)
Definition scip_cons.c:1292
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
Definition cons.c:8267
SCIP_RETCODE SCIPcaptureCons(SCIP *scip, SCIP_CONS *cons)
Definition scip_cons.c:1084
SCIP_RETCODE SCIPincConsAge(SCIP *scip, SCIP_CONS *cons)
Definition scip_cons.c:1730
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
Definition cons.c:8357
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition misc.c:10788
return SCIP_OKAY
int c
static SCIP_SOL * sol
assert(minobj< SCIPgetCutoffbound(scip))
int nvars
static SCIP_Bool propagate
static SCIP_VAR ** vars
static const char * paramname[]
Definition lpi_msk.c:5096
#define NULL
Definition lpi_spx1.cpp:161
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition scip_mem.c:57
SCIP_RETCODE SCIPprobAddConsName(SCIP_PROB *prob, SCIP_CONS *cons)
Definition prob.c:1249
SCIP_RETCODE SCIPprobRemoveConsName(SCIP_PROB *prob, SCIP_CONS *cons)
Definition prob.c:1264
internal methods for storing and manipulating the main problem
public methods for managing constraints
public methods for message output
#define SCIPerrorMessage
Definition pub_message.h:64
public data structures and miscellaneous methods
public methods for constraint handler plugins and constraints
general public methods
public methods for memory management
SCIP_RETCODE SCIPsetSetDefaultIntParam(SCIP_SET *set, const char *name, int defaultvalue)
Definition set.c:3274
SCIP_RETCODE SCIPsetSetDefaultBoolParam(SCIP_SET *set, const char *name, SCIP_Bool defaultvalue)
Definition set.c:3221
SCIP_CONSHDLR * SCIPsetFindConshdlr(SCIP_SET *set, const char *name)
Definition set.c:3933
SCIP_RETCODE SCIPsetIncludeConshdlr(SCIP_SET *set, SCIP_CONSHDLR *conshdlr)
Definition set.c:3794
void SCIPsetReinsertConshdlrSepaPrio(SCIP_SET *set, SCIP_CONSHDLR *conshdlr, int oldpriority)
Definition set.c:3850
internal methods for global SCIP settings
SCIP * scip
datastructures for constraints and constraint handlers
datastructures for block memory pools and memory buffers
SCIP main data structure.
datastructures for global SCIP settings
#define SCIP_DECL_CONSENFOLP(x)
Definition type_cons.h:362
#define SCIP_DECL_CONSINITPRE(x)
Definition type_cons.h:155
#define SCIP_DECL_CONSDELETE(x)
Definition type_cons.h:228
#define SCIP_DECL_CONSEXIT(x)
Definition type_cons.h:135
#define SCIP_DECL_CONSGETVARS(x)
Definition type_cons.h:865
#define SCIP_DECL_CONSINITSOL(x)
Definition type_cons.h:200
#define SCIP_DECL_CONSPRINT(x)
Definition type_cons.h:767
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
Definition type_cons.h:64
#define SCIP_DECL_CONSSEPALP(x)
Definition type_cons.h:287
#define SCIP_DECL_CONSDISABLE(x)
Definition type_cons.h:734
#define SCIP_DECL_CONSENFORELAX(x)
Definition type_cons.h:387
#define SCIP_DECL_CONSGETDIVEBDCHGS(x)
Definition type_cons.h:918
#define SCIP_DECL_CONSPROP(x)
Definition type_cons.h:504
#define SCIP_DECL_CONSGETNVARS(x)
Definition type_cons.h:883
#define SCIP_DECL_CONSRESPROP(x)
Definition type_cons.h:610
#define SCIP_DECL_CONSACTIVE(x)
Definition type_cons.h:689
#define SCIP_DECL_CONSENFOPS(x)
Definition type_cons.h:430
#define SCIP_DECL_CONSPARSE(x)
Definition type_cons.h:843
#define SCIP_DECL_CONSTRANS(x)
Definition type_cons.h:238
#define SCIP_DECL_CONSDEACTIVE(x)
Definition type_cons.h:704
#define SCIP_DECL_CONSPRESOL(x)
Definition type_cons.h:559
#define SCIP_DECL_CONSENABLE(x)
Definition type_cons.h:719
#define SCIP_DECL_CONSINITLP(x)
Definition type_cons.h:258
#define SCIP_DECL_CONSEXITPRE(x)
Definition type_cons.h:179
#define SCIP_DECL_CONSLOCK(x)
Definition type_cons.h:674
#define SCIP_DECL_CONSCOPY(x)
Definition type_cons.h:808
#define SCIP_DECL_CONSINIT(x)
Definition type_cons.h:125
struct SCIP_ConsData SCIP_CONSDATA
Definition type_cons.h:65
#define SCIP_DECL_CONSCHECK(x)
Definition type_cons.h:473
#define SCIP_DECL_CONSHDLRCOPY(x)
Definition type_cons.h:107
#define SCIP_DECL_CONSEXITSOL(x)
Definition type_cons.h:215
#define SCIP_DECL_CONSFREE(x)
Definition type_cons.h:115
#define SCIP_DECL_CONSSEPASOL(x)
Definition type_cons.h:319
#define SCIP_DECL_CONSDELVARS(x)
Definition type_cons.h:751
enum SCIP_BoundType SCIP_BOUNDTYPE
Definition type_lp.h:59
enum SCIP_Result SCIP_RESULT
Definition type_result.h:61
@ SCIP_INVALIDDATA
@ SCIP_INVALIDCALL
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_STAGE_PROBLEM
Definition type_set.h:45
@ SCIP_STAGE_INITPRESOLVE
Definition type_set.h:48
@ SCIP_STAGE_SOLVED
Definition type_set.h:54
@ SCIP_STAGE_PRESOLVING
Definition type_set.h:49
@ SCIP_STAGE_TRANSFORMED
Definition type_set.h:47
@ SCIP_STAGE_INITSOLVE
Definition type_set.h:52
@ SCIP_STAGE_EXITPRESOLVE
Definition type_set.h:50
@ SCIP_STAGE_EXITSOLVE
Definition type_set.h:55
@ SCIP_STAGE_FREETRANS
Definition type_set.h:56
@ SCIP_STAGE_SOLVING
Definition type_set.h:53
@ SCIP_STAGE_TRANSFORMING
Definition type_set.h:46
@ SCIP_STAGE_PRESOLVED
Definition type_set.h:51
unsigned int SCIP_PROPTIMING
Definition type_timing.h:74
#define SCIP_PRESOLTIMING_ALWAYS
Definition type_timing.h:58
unsigned int SCIP_PRESOLTIMING
Definition type_timing.h:61
#define SCIP_PROPTIMING_BEFORELP
Definition type_timing.h:65
enum SCIP_LockType SCIP_LOCKTYPE
Definition type_var.h:100
@ SCIP_LOCKTYPE_MODEL
Definition type_var.h:97