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