SCIP Doxygen Documentation
Loading...
Searching...
No Matches
cons_fixedvar.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-2026 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 cons_fixedvar.c
26 * @ingroup DEFPLUGINS_CONS
27 * @brief constraint handler that checks bounds on fixed variables
28 * @author Stefan Vigerske
29 *
30 * For each original variable that has a counterpart in the transformed problem
31 * which is not active (i.e., fixed, negated, aggregated, or multiaggregated),
32 * check the original bounds. In enforcement, add a cut that enforces the bounds
33 * or tighten LP feasibility tolerance.
34 */
35
36/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
37
38#include "scip/cons_fixedvar.h"
39
40
41/* fundamental constraint handler properties */
42#define CONSHDLR_NAME "fixedvar"
43#define CONSHDLR_DESC "check bounds of original variables that are not active in transformed problem"
44#define CONSHDLR_ENFOPRIORITY -7000000 /**< priority of the constraint handler for constraint enforcing */
45#define CONSHDLR_CHECKPRIORITY -7000000 /**< priority of the constraint handler for checking feasibility */
46#define CONSHDLR_EAGERFREQ -1 /**< frequency for using all instead of only the useful constraints in separation,
47 * propagation and enforcement, -1 for no eager evaluations, 0 for first only */
48#define CONSHDLR_NEEDSCONS FALSE /**< should the constraint handler be skipped, if no constraints are available? */
49
50/* parameter default values */
51#define DEFAULT_ENABLED TRUE /**< enable constraint handler */
52#define DEFAULT_SUBSCIPS TRUE /**< also run in subSCIPs */
53#define DEFAULT_PREFERCUT TRUE /**< whether to prefer separation over tightening LP feastol in enforcement */
54
55/*
56 * Data structures
57 */
58
59/** constraint handler data */
60struct SCIP_ConshdlrData
61{
62 SCIP_VAR** vars; /**< variables to check */
63 int nvars; /**< number of variables to check */
64 int varssize; /**< size of vars array */
65
66 SCIP_Bool enabled; /**< whether to do anything */
67 SCIP_Bool subscips; /**< whether to be active in subSCIPs */
68 SCIP_Bool prefercut; /**< whether to prefer separation over tightening LP feastol in enforcement */
69};
70
71
72/*
73 * Local methods
74 */
75
76/** an assert for checking that the violation is not so large
77 *
78 * The idea of this constraint handler is the handling of tiny bound violations that are scaled up
79 * above the feasibility tolerance by aggregation factors. Usually, the violation should still be
80 * rather "small". For this test, we quantify "small" as 0.5.
81 */
82#define assertSmallViolation(lb, val, ub) (assert((val) >= (lb) - 0.5 && (val) <= (ub) + 0.5))
83
84/** add cut to enforce global bounds on variable aggregation
85 *
86 * Given an original fixed variable x, add cut lb <= x <= ub.
87 * SCIP will replace x by the corresponding aggregation of x in the transformed problem.
88 * Though we only need to enforce original bounds on x, we use here the global bounds on x for lb/ub,
89 * as these should be as tight as or tighter than the original bounds.
90 */
91static
93 SCIP* scip, /**< SCIP data structure */
94 SCIP_CONSHDLR* conshdlr, /**< fixedvar conshdlr */
95 SCIP_SOL* sol, /**< solution that is enforced */
96 SCIP_VAR* var, /**< fixed original variable which bound is violated */
97 SCIP_Bool* success, /**< buffer to store whether cut was added */
98 SCIP_Bool* cutoff /**< buffer to store whether a cutoff was detected */
99 )
100{
101 SCIP_ROW* row;
102 char name[SCIP_MAXSTRLEN];
103
104 assert(scip != NULL);
105 assert(var != NULL);
106 assert(success != NULL);
107 assert(cutoff != NULL);
108
109 *cutoff = FALSE;
110
111 SCIPdebugMsg(scip, "addCut for variable <%s> [%.15g,%.15g] with value <%.15g>\n", SCIPvarGetName(var), SCIPvarGetLbGlobal(var), SCIPvarGetUbGlobal(var), SCIPgetSolVal(scip, sol, var));
112
113 (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_bounds", SCIPvarGetName(var));
114
117
119 SCIP_CALL( SCIPaddVarToRow(scip, row, var, 1.0) );
120
121#ifdef SCIP_DEBUG
123#endif
124
125 /* solution should be violated in the row */
127
129 SCIP_CALL( SCIPreleaseRow(scip, &row) );
130
131 *success = TRUE;
132
133 return SCIP_OKAY;
134}
135
136
137/*
138 * Callback methods of constraint handler
139 */
140
141/** copy method for constraint handler plugins (called when SCIP copies plugins) */
142static
143SCIP_DECL_CONSHDLRCOPY(conshdlrCopyFixedvar)
144{ /*lint --e{715}*/
145 assert(scip != NULL);
146 assert(conshdlr != NULL);
147
149
150 if( SCIPconshdlrGetData(conshdlr)->subscips )
151 {
153 }
154
155 *valid = TRUE;
156
157 return SCIP_OKAY;
158}
159
160/** destructor of constraint handler to free constraint handler data (called when SCIP is exiting) */
161static
162SCIP_DECL_CONSFREE(consFreeFixedvar)
163{ /*lint --e{715}*/
164 SCIP_CONSHDLRDATA* conshdlrdata;
165
166 conshdlrdata = SCIPconshdlrGetData(conshdlr);
167 assert(conshdlrdata != NULL);
168 assert(conshdlrdata->vars == NULL); /* should have been freed in Exitsol */
169
170 SCIPfreeBlockMemory(scip, &conshdlrdata);
171 SCIPconshdlrSetData(conshdlr, NULL);
172
173 return SCIP_OKAY;
174}
175
176/** solving process initialization method of constraint handler (called when branch and bound process is about to begin) */
177static
178SCIP_DECL_CONSINITSOL(consInitsolFixedvar)
179{ /*lint --e{715}*/
180 SCIP_CONSHDLRDATA* conshdlrdata;
181 SCIP_VAR** vars;
182 int nvars;
183 int i;
184
185 conshdlrdata = SCIPconshdlrGetData(conshdlr);
186 assert(conshdlrdata != NULL);
187 assert(conshdlrdata->vars == NULL);
188 assert(conshdlrdata->varssize == 0);
189 assert(conshdlrdata->nvars == 0);
190
191 if( !conshdlrdata->enabled )
192 return SCIP_OKAY;
193
194 if( SCIPgetNFixedVars(scip) == 0 )
195 return SCIP_OKAY;
196
199
200 /* for faster checks, collect original variables that are fixed in transformed problem
201 * during solve, this list does not change
202 */
203 conshdlrdata->varssize = SCIPgetNFixedVars(scip);
204 SCIP_CALL( SCIPallocBlockMemoryArray(scip, &conshdlrdata->vars, conshdlrdata->varssize) );
205
206 for( i = 0; i < nvars; ++i )
207 {
208 SCIP_VAR* var;
209
211
212 /* skip original variable without counterpart in transformed problem */
213 if( var == NULL )
214 continue;
215
216 /* skip original variable that is still active in transformed problem
217 * the normal feasibility checks in SCIP should ensure that bounds are satisfied
218 */
219 if( SCIPvarIsActive(var) )
220 continue;
221
222 /* skip free original variable */
224 continue;
225
226 assert(conshdlrdata->nvars < conshdlrdata->varssize);
227 conshdlrdata->vars[conshdlrdata->nvars++] = vars[i];
228 }
229
230 return SCIP_OKAY;
231}
232
233
234/** solving process deinitialization method of constraint handler (called before branch and bound process data is freed) */
235static
236SCIP_DECL_CONSEXITSOL(consExitsolFixedvar)
237{ /*lint --e{715}*/
238 SCIP_CONSHDLRDATA* conshdlrdata;
239
240 conshdlrdata = SCIPconshdlrGetData(conshdlr);
241 assert(conshdlrdata != NULL);
242
243 SCIPfreeBlockMemoryArrayNull(scip, &conshdlrdata->vars, conshdlrdata->varssize);
244 conshdlrdata->varssize = 0;
245 conshdlrdata->nvars = 0;
246
247 return SCIP_OKAY;
248}
249
250/** constraint enforcing method of constraint handler for LP solutions */
251static
252SCIP_DECL_CONSENFOLP(consEnfolpFixedvar)
253{ /*lint --e{715}*/
254 SCIP_CONSHDLRDATA* conshdlrdata;
255 SCIP_Bool addcut;
256 int i;
257
258 assert(scip != NULL);
259 assert(result != NULL);
260
262
263 conshdlrdata = SCIPconshdlrGetData(conshdlr);
264 assert(conshdlrdata != NULL);
265
266 /* we will try separation if this is preferred or the LP feastol is too small already */
267 addcut = conshdlrdata->prefercut || !SCIPisPositive(scip, SCIPgetLPFeastol(scip));
268
269 for( i = 0; i < conshdlrdata->nvars; ++i )
270 {
271 SCIP_VAR* var;
272 SCIP_Real lb;
273 SCIP_Real ub;
274 SCIP_Real val;
275
276 var = conshdlrdata->vars[i];
277 assert(var != NULL);
278
281 val = SCIPgetSolVal(scip, NULL, var);
282
283 if( (!SCIPisInfinity(scip, -lb) && SCIPisFeasLT(scip, val, lb)) || (!SCIPisInfinity(scip, ub) && SCIPisFeasGT(scip, val, ub)) )
284 {
285 if( !solinfeasible )
286 assertSmallViolation(lb, val, ub);
287
288 if( addcut )
289 {
290 SCIP_Bool success;
292
293 SCIP_CALL( addCut(scip, conshdlr, NULL, var, &success, &cutoff) );
294
295 if( cutoff )
296 {
298 break;
299 }
300
301 if( success )
302 {
304 break;
305 }
306
307 /* tighten LP feasibility tolerance, but check other variables first */
309 }
310 else
311 {
312 /* tighten LP feasibility tolerance */
314 break;
315 }
316 }
317 }
318
319 if( *result == SCIP_INFEASIBLE )
320 {
321 /* if we could not add a cut or find a cutoff, then try to tighten LP feasibility tolerance
322 * otherwise, we have no mean to enforce the bound, and declare the solution as feasible instead
323 */
325 {
326 SCIP_Real redfeastol = SCIPgetLPFeastol(scip) / 10.0;
327
328 SCIPsetLPFeastol(scip, MAX(redfeastol, SCIPepsilon(scip))); /*lint !e666*/
330 }
331 else
332 {
334 SCIPwarningMessage(scip, "Declaring solution with violated bound in original problem as feasible because attempts to enforce the bound have failed. We are very sorry.\n");
335 }
336 }
337
338 return SCIP_OKAY;
339}
340
341
342/** constraint enforcing method of constraint handler for relaxation solutions */
343static
344SCIP_DECL_CONSENFORELAX(consEnforelaxFixedvar)
345{ /*lint --e{715}*/
346 SCIP_CONSHDLRDATA* conshdlrdata;
347 int i;
348
349 assert(scip != NULL);
350 assert(result != NULL);
351
353
354 conshdlrdata = SCIPconshdlrGetData(conshdlr);
355 assert(conshdlrdata != NULL);
356
357 for( i = 0; i < conshdlrdata->nvars; ++i )
358 {
359 SCIP_VAR* var;
360 SCIP_Real lb;
361 SCIP_Real ub;
362 SCIP_Real val;
363
364 var = conshdlrdata->vars[i];
365 assert(var != NULL);
366
369 val = SCIPgetSolVal(scip, sol, var);
370
371 if( (!SCIPisInfinity(scip, -lb) && SCIPisFeasLT(scip, val, lb)) || (!SCIPisInfinity(scip, ub) && SCIPisFeasGT(scip, val, ub)) )
372 {
373 SCIP_Bool success;
375
376 if( !solinfeasible )
377 assertSmallViolation(lb, val, ub);
378
379 SCIP_CALL( addCut(scip, conshdlr, sol, var, &success, &cutoff) );
380
381 if( cutoff )
382 {
384 break;
385 }
386
387 if( success )
388 {
390 break;
391 }
392
393 /* switch to solving the LP relaxation, but check other variables first */
395 }
396 }
397
398 return SCIP_OKAY;
399}
400
401
402/** constraint enforcing method of constraint handler for pseudo solutions */
403static
404SCIP_DECL_CONSENFOPS(consEnfopsFixedvar)
405{ /*lint --e{715}*/
406 SCIP_CONSHDLRDATA* conshdlrdata;
407 int i;
408
409 assert(scip != NULL);
410 assert(result != NULL);
411
413
414 /* skip check for solutions that are already declared infeasible
415 * we could not do anything else than also signaling infeasibility
416 */
417 if( solinfeasible )
418 return SCIP_OKAY;
419
420 conshdlrdata = SCIPconshdlrGetData(conshdlr);
421 assert(conshdlrdata != NULL);
422
423 for( i = 0; i < conshdlrdata->nvars; ++i )
424 {
425 SCIP_VAR* var;
426 SCIP_Real lb;
427 SCIP_Real ub;
428 SCIP_Real val;
429
430 var = conshdlrdata->vars[i];
431 assert(var != NULL);
432
435 val = SCIPgetSolVal(scip, NULL, var);
436
437 if( (!SCIPisInfinity(scip, -lb) && SCIPisFeasLT(scip, val, lb)) || (!SCIPisInfinity(scip, ub) && SCIPisFeasGT(scip, val, ub)) )
438 {
440
441 assertSmallViolation(lb, val, ub);
442
443 break;
444 }
445 }
446
447 return SCIP_OKAY;
448}
449
450
451/** feasibility check method of constraint handler for integral solutions */
452static
453SCIP_DECL_CONSCHECK(consCheckFixedvar)
454{ /*lint --e{715}*/
455 SCIP_CONSHDLRDATA* conshdlrdata;
456 SCIP_VAR** vars;
457 int nvars;
458 int i;
459
460 assert(scip != NULL);
461 assert(result != NULL);
462
464
465 conshdlrdata = SCIPconshdlrGetData(conshdlr);
466 assert(conshdlrdata != NULL);
467
468 if( !conshdlrdata->enabled )
469 return SCIP_OKAY;
470
471 /* skip if no transformed problem yet */
473 return SCIP_OKAY;
474
475 /* during solving use cached list of relevant original variables, otherwise loop through all variables */
477 {
478 nvars = conshdlrdata->nvars;
479 vars = conshdlrdata->vars;
480 }
481 else
482 {
485 }
486 assert(vars != NULL || nvars == 0);
487
488 for( i = 0; i < nvars; ++i )
489 {
490 SCIP_VAR* var;
491 SCIP_Real lb;
492 SCIP_Real ub;
493 SCIP_Real val;
494
496
497 if( var == NULL )
498 continue;
499
500 if( SCIPvarIsActive(var) )
501 continue;
502
505 val = SCIPgetSolVal(scip, sol, var);
506
507 if( !SCIPisInfinity(scip, -lb) && SCIPisFeasLT(scip, val, lb) )
508 {
509 SCIPdebugMsg(scip, "lower bound of <%s> [%g,%g] violated, solution value <%g>\n",
510 SCIPvarGetName(var), lb, ub, val);
511
512 if( printreason )
513 {
514 SCIPinfoMessage(scip, NULL, "solution violates lower bound of non-active variable <%s> [%g,%g], solution value <%g>\n",
515 SCIPvarGetName(vars[i]), lb, ub, val);
516 }
517
519
520 if( !completely )
521 {
522 assertSmallViolation(lb, val, ub);
523 return SCIP_OKAY;
524 }
525 }
526
527 if( !SCIPisInfinity(scip, ub) && SCIPisFeasGT(scip, val, ub) )
528 {
529 SCIPdebugMsg(scip, "upper bound of <%s> [%g,%g] violated, solution value <%g>\n",
530 SCIPvarGetName(var), lb, ub, val);
531
532 if( printreason )
533 {
534 SCIPinfoMessage(scip, NULL, "solution violates upper bound of non-active variable <%s> [%g,%g], solution value <%g>\n",
535 SCIPvarGetName(vars[i]), lb, ub, val);
536 }
537
539
540 if( !completely )
541 {
542 assertSmallViolation(lb, val, ub);
543 return SCIP_OKAY;
544 }
545 }
546 }
547
548 return SCIP_OKAY;
549}
550
551
552/** variable rounding lock method of constraint handler */
553static
554SCIP_DECL_CONSLOCK(consLockFixedvar)
555{ /*lint --e{715}*/
556 return SCIP_OKAY;
557}
558
559
560/*
561 * constraint specific interface methods
562 */
563
564/** creates the fixedvar constraint handler and includes it in SCIP */
566 SCIP* scip /**< SCIP data structure */
567 )
568{
569 SCIP_CONSHDLRDATA* conshdlrdata;
570 SCIP_CONSHDLR* conshdlr = NULL;
571
572 /* create fixedvar constraint handler data */
573 SCIP_CALL( SCIPallocClearBlockMemory(scip, &conshdlrdata) );
574
575 /* include constraint handler */
578 consEnfolpFixedvar, consEnfopsFixedvar, consCheckFixedvar, consLockFixedvar,
579 conshdlrdata) );
580 assert(conshdlr != NULL);
581
582 /* set non-fundamental callbacks via specific setter functions */
583 SCIP_CALL( SCIPsetConshdlrCopy(scip, conshdlr, conshdlrCopyFixedvar, NULL) );
584 SCIP_CALL( SCIPsetConshdlrFree(scip, conshdlr, consFreeFixedvar) );
585 SCIP_CALL( SCIPsetConshdlrInitsol(scip, conshdlr, consInitsolFixedvar) );
586 SCIP_CALL( SCIPsetConshdlrExitsol(scip, conshdlr, consExitsolFixedvar) );
587 SCIP_CALL( SCIPsetConshdlrEnforelax(scip, conshdlr, consEnforelaxFixedvar) );
588
589 /* add fixedvar constraint handler parameters */
590 SCIP_CALL( SCIPaddBoolParam(scip, "constraints/" CONSHDLR_NAME "/enabled",
591 "whether to check and enforce bounds on fixed variables",
592 &conshdlrdata->enabled, FALSE, DEFAULT_ENABLED, NULL, NULL) );
593
594 SCIP_CALL( SCIPaddBoolParam(scip, "constraints/" CONSHDLR_NAME "/subscips",
595 "whether to act on subSCIPs",
596 &conshdlrdata->subscips, FALSE, DEFAULT_SUBSCIPS, NULL, NULL) );
597
598 SCIP_CALL( SCIPaddBoolParam(scip, "constraints/" CONSHDLR_NAME "/prefercut",
599 "whether to prefer separation over tightening LP feastol in enforcement",
600 &conshdlrdata->prefercut, FALSE, DEFAULT_PREFERCUT, NULL, NULL) );
601
602 return SCIP_OKAY;
603}
#define CONSHDLR_NEEDSCONS
Definition cons_and.c:96
#define CONSHDLR_CHECKPRIORITY
Definition cons_and.c:88
#define CONSHDLR_DESC
Definition cons_and.c:85
#define CONSHDLR_EAGERFREQ
Definition cons_and.c:91
#define CONSHDLR_ENFOPRIORITY
Definition cons_and.c:87
#define CONSHDLR_NAME
Definition cons_and.c:84
#define DEFAULT_SUBSCIPS
#define assertSmallViolation(lb, val, ub)
static SCIP_RETCODE addCut(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Bool *success, SCIP_Bool *cutoff)
#define DEFAULT_PREFERCUT
#define DEFAULT_ENABLED
constraint handler that checks bounds on fixed variables
#define NULL
Definition def.h:257
#define SCIP_MAXSTRLEN
Definition def.h:278
#define SCIP_Bool
Definition def.h:100
#define SCIP_STRINGEQ(name, reference, retcode)
Definition def.h:454
#define SCIP_Real
Definition def.h:165
#define TRUE
Definition def.h:102
#define FALSE
Definition def.h:103
#define MAX(x, y)
Definition def.h:229
#define SCIP_CALL(x)
Definition def.h:364
SCIP_RETCODE SCIPincludeConshdlrFixedvar(SCIP *scip)
SCIP_STAGE SCIPgetStage(SCIP *scip)
SCIP_VAR ** SCIPgetOrigVars(SCIP *scip)
Definition scip_prob.c:2811
int SCIPgetNOrigVars(SCIP *scip)
Definition scip_prob.c:2838
int SCIPgetNFixedVars(SCIP *scip)
Definition scip_prob.c:2705
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
#define SCIPdebugMsg
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition scip_param.c:57
void SCIPconshdlrSetData(SCIP_CONSHDLR *conshdlr, SCIP_CONSHDLRDATA *conshdlrdata)
Definition cons.c:4350
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:372
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:323
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
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
Definition cons.c:4320
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)),)
Definition scip_cons.c:347
SCIP_RETCODE SCIPsetConshdlrInitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:444
SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr)
Definition cons.c:4340
SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:468
SCIP_RETCODE SCIPaddRow(SCIP *scip, SCIP_ROW *row, SCIP_Bool forcecut, SCIP_Bool *infeasible)
Definition scip_cut.c:225
void SCIPsetLPFeastol(SCIP *scip, SCIP_Real newfeastol)
Definition scip_lp.c:444
SCIP_Real SCIPgetLPFeastol(SCIP *scip)
Definition scip_lp.c:434
#define SCIPallocClearBlockMemory(scip, ptr)
Definition scip_mem.h:91
#define SCIPallocBlockMemoryArray(scip, ptr, num)
Definition scip_mem.h:93
#define SCIPfreeBlockMemory(scip, ptr)
Definition scip_mem.h:108
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
Definition scip_mem.h:111
SCIP_RETCODE SCIPcreateEmptyRowConshdlr(SCIP *scip, SCIP_ROW **row, SCIP_CONSHDLR *conshdlr, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition scip_lp.c:1367
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
Definition scip_lp.c:1646
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
Definition scip_lp.c:2176
SCIP_Real SCIPgetRowSolFeasibility(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
Definition scip_lp.c:2131
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
Definition scip_lp.c:1508
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
Definition scip_sol.c:1763
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPepsilon(SCIP *scip)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
Definition var.c:23674
SCIP_Real SCIPvarGetLbOriginal(SCIP_VAR *var)
Definition var.c:24052
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
Definition var.c:24174
const char * SCIPvarGetName(SCIP_VAR *var)
Definition var.c:23299
SCIP_Real SCIPvarGetUbOriginal(SCIP_VAR *var)
Definition var.c:24095
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
Definition var.c:24152
SCIP_RETCODE SCIPgetTransformedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **transvar)
Definition scip_var.c:2078
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition misc.c:10827
return SCIP_OKAY
SCIP_Bool cutoff
static SCIP_SOL * sol
assert(minobj< SCIPgetCutoffbound(scip))
int nvars
SCIP_VAR * var
static SCIP_VAR ** vars
#define SCIP_DECL_CONSENFOLP(x)
Definition type_cons.h:363
#define SCIP_DECL_CONSINITSOL(x)
Definition type_cons.h:201
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
Definition type_cons.h:64
#define SCIP_DECL_CONSENFORELAX(x)
Definition type_cons.h:388
#define SCIP_DECL_CONSENFOPS(x)
Definition type_cons.h:431
#define SCIP_DECL_CONSLOCK(x)
Definition type_cons.h:676
struct SCIP_Conshdlr SCIP_CONSHDLR
Definition type_cons.h:62
#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
struct SCIP_Row SCIP_ROW
Definition type_lp.h:105
@ SCIP_CUTOFF
Definition type_result.h:48
@ SCIP_FEASIBLE
Definition type_result.h:45
@ SCIP_SEPARATED
Definition type_result.h:49
@ SCIP_SOLVELP
Definition type_result.h:55
@ SCIP_INFEASIBLE
Definition type_result.h:46
@ SCIP_INVALIDCALL
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP
Definition type_scip.h:39
@ SCIP_STAGE_TRANSFORMED
Definition type_set.h:47
@ SCIP_STAGE_FREETRANS
Definition type_set.h:56
@ SCIP_STAGE_SOLVING
Definition type_set.h:53
struct SCIP_Sol SCIP_SOL
Definition type_sol.h:57
struct SCIP_Var SCIP_VAR
Definition type_var.h:166