Scippy

SCIP

Solving Constraint Integer Programs

var.h
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-2014 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file var.h
17  * @brief internal methods for problem variables
18  * @author Tobias Achterberg
19  */
20 
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 #ifndef __SCIP_VAR_H__
24 #define __SCIP_VAR_H__
25 
26 
27 #include "scip/def.h"
28 #include "blockmemshell/memory.h"
29 #include "scip/type_retcode.h"
30 #include "scip/type_set.h"
31 #include "scip/type_stat.h"
32 #include "scip/type_misc.h"
33 #include "scip/type_history.h"
34 #include "scip/type_event.h"
35 #include "scip/type_lp.h"
36 #include "scip/type_var.h"
37 #include "scip/type_prob.h"
38 #include "scip/type_primal.h"
39 #include "scip/type_tree.h"
40 #include "scip/type_branch.h"
41 #include "scip/type_cons.h"
42 #include "scip/pub_var.h"
43 #include "scip/pub_misc.h"
44 
45 #ifndef NDEBUG
46 #include "scip/struct_var.h"
47 #else
48 #include "scip/event.h"
49 #endif
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 /*
56  * domain change methods
57  */
58 
59 /** applies single bound change */
60 extern
62  SCIP_BOUNDCHG* boundchg, /**< bound change to apply */
63  BMS_BLKMEM* blkmem, /**< block memory */
64  SCIP_SET* set, /**< global SCIP settings */
65  SCIP_STAT* stat, /**< problem statistics */
66  SCIP_LP* lp, /**< current LP data */
67  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
68  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
69  int depth, /**< depth in the tree, where the bound change takes place */
70  int pos, /**< position of the bound change in its bound change array */
71  SCIP_Bool* cutoff /**< pointer to store whether an infeasible bound change was detected */
72  );
73 
74 /** undoes single bound change */
75 extern
77  SCIP_BOUNDCHG* boundchg, /**< bound change to remove */
78  BMS_BLKMEM* blkmem, /**< block memory */
79  SCIP_SET* set, /**< global SCIP settings */
80  SCIP_STAT* stat, /**< problem statistics */
81  SCIP_LP* lp, /**< current LP data */
82  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
83  SCIP_EVENTQUEUE* eventqueue /**< event queue */
84  );
85 
86 /** applies domain change to the global problem */
87 extern
89  SCIP_DOMCHG* domchg, /**< domain change to apply */
90  BMS_BLKMEM* blkmem, /**< block memory */
91  SCIP_SET* set, /**< global SCIP settings */
92  SCIP_STAT* stat, /**< problem statistics */
93  SCIP_LP* lp, /**< current LP data */
94  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
95  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
96  SCIP_Bool* cutoff /**< pointer to store whether an infeasible domain change was detected */
97  );
98 
99 /** frees domain change data */
100 extern
102  SCIP_DOMCHG** domchg, /**< pointer to domain change */
103  BMS_BLKMEM* blkmem, /**< block memory */
104  SCIP_SET* set, /**< global SCIP settings */
105  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
106  SCIP_LP* lp /**< current LP data */
107  );
108 
109 /** converts a dynamic domain change data into a static one, using less memory than for a dynamic one */
110 extern
112  SCIP_DOMCHG** domchg, /**< pointer to domain change data */
113  BMS_BLKMEM* blkmem, /**< block memory */
114  SCIP_SET* set, /**< global SCIP settings */
115  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
116  SCIP_LP* lp /**< current LP data */
117  );
118 
119 /** applies domain change */
120 extern
122  SCIP_DOMCHG* domchg, /**< domain change to apply */
123  BMS_BLKMEM* blkmem, /**< block memory */
124  SCIP_SET* set, /**< global SCIP settings */
125  SCIP_STAT* stat, /**< problem statistics */
126  SCIP_LP* lp, /**< current LP data */
127  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
128  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
129  int depth, /**< depth in the tree, where the domain change takes place */
130  SCIP_Bool* cutoff /**< pointer to store whether an infeasible domain change was detected */
131  );
132 
133 /** undoes domain change */
134 extern
136  SCIP_DOMCHG* domchg, /**< domain change to remove */
137  BMS_BLKMEM* blkmem, /**< block memory */
138  SCIP_SET* set, /**< global SCIP settings */
139  SCIP_STAT* stat, /**< problem statistics */
140  SCIP_LP* lp, /**< current LP data */
141  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
142  SCIP_EVENTQUEUE* eventqueue /**< event queue */
143  );
144 
145 /** adds bound change to domain changes */
146 extern
148  SCIP_DOMCHG** domchg, /**< pointer to domain change data structure */
149  BMS_BLKMEM* blkmem, /**< block memory */
150  SCIP_SET* set, /**< global SCIP settings */
151  SCIP_VAR* var, /**< variable to change the bounds for */
152  SCIP_Real newbound, /**< new value for bound */
153  SCIP_BOUNDTYPE boundtype, /**< type of bound for var: lower or upper bound */
154  SCIP_BOUNDCHGTYPE boundchgtype, /**< type of bound change: branching decision or inference */
155  SCIP_Real lpsolval, /**< solval of variable in last LP on path to node, or SCIP_INVALID if unknown */
156  SCIP_VAR* infervar, /**< variable that was changed (parent of var, or var itself) */
157  SCIP_CONS* infercons, /**< constraint that deduced the bound change, or NULL */
158  SCIP_PROP* inferprop, /**< propagator that deduced the bound change, or NULL */
159  int inferinfo, /**< user information for inference to help resolving the conflict */
160  SCIP_BOUNDTYPE inferboundtype /**< type of bound for inference var: lower or upper bound */
161  );
162 
163 /** adds hole change to domain changes */
164 extern
166  SCIP_DOMCHG** domchg, /**< pointer to domain change data structure */
167  BMS_BLKMEM* blkmem, /**< block memory */
168  SCIP_SET* set, /**< global SCIP settings */
169  SCIP_HOLELIST** ptr, /**< changed list pointer */
170  SCIP_HOLELIST* newlist, /**< new value of list pointer */
171  SCIP_HOLELIST* oldlist /**< old value of list pointer */
172  );
173 
174 /** creates an artificial bound change information object with depth = INT_MAX and pos = -1 */
175 extern
177  SCIP_BDCHGINFO** bdchginfo, /**< pointer to store bound change information */
178  BMS_BLKMEM* blkmem, /**< block memory */
179  SCIP_VAR* var, /**< active variable that changed the bounds */
180  SCIP_BOUNDTYPE boundtype, /**< type of bound for var: lower or upper bound */
181  SCIP_Real oldbound, /**< old value for bound */
182  SCIP_Real newbound /**< new value for bound */
183  );
184 
185 /** frees a bound change information object */
186 extern
187 void SCIPbdchginfoFree(
188  SCIP_BDCHGINFO** bdchginfo, /**< pointer to store bound change information */
189  BMS_BLKMEM* blkmem /**< block memory */
190  );
191 
192 /** returns the relaxed bound change type */
193 extern
195  SCIP_BDCHGINFO* bdchginfo /**< bound change to add to the conflict set */
196  );
197 
198 /*
199  * methods for variables
200  */
201 
202 /** creates and captures an original problem variable; an integer variable with bounds
203  * zero and one is automatically converted into a binary variable
204  */
205 extern
207  SCIP_VAR** var, /**< pointer to variable data */
208  BMS_BLKMEM* blkmem, /**< block memory */
209  SCIP_SET* set, /**< global SCIP settings */
210  SCIP_STAT* stat, /**< problem statistics */
211  const char* name, /**< name of variable */
212  SCIP_Real lb, /**< lower bound of variable */
213  SCIP_Real ub, /**< upper bound of variable */
214  SCIP_Real obj, /**< objective function value */
215  SCIP_VARTYPE vartype, /**< type of variable */
216  SCIP_Bool initial, /**< should var's column be present in the initial root LP? */
217  SCIP_Bool removable, /**< is var's column removable from the LP (due to aging or cleanup)? */
218  SCIP_DECL_VARDELORIG ((*vardelorig)), /**< frees user data of original variable, or NULL */
219  SCIP_DECL_VARTRANS ((*vartrans)), /**< creates transformed user data by transforming original user data, or NULL */
220  SCIP_DECL_VARDELTRANS ((*vardeltrans)), /**< frees user data of transformed variable, or NULL */
221  SCIP_DECL_VARCOPY ((*varcopy)), /**< copies variable data if wanted to subscip, or NULL */
222  SCIP_VARDATA* vardata /**< user data for this specific variable */
223  );
224 
225 /** creates and captures a loose variable belonging to the transformed problem; an integer variable with bounds
226  * zero and one is automatically converted into a binary variable
227  */
228 extern
230  SCIP_VAR** var, /**< pointer to variable data */
231  BMS_BLKMEM* blkmem, /**< block memory */
232  SCIP_SET* set, /**< global SCIP settings */
233  SCIP_STAT* stat, /**< problem statistics */
234  const char* name, /**< name of variable */
235  SCIP_Real lb, /**< lower bound of variable */
236  SCIP_Real ub, /**< upper bound of variable */
237  SCIP_Real obj, /**< objective function value */
238  SCIP_VARTYPE vartype, /**< type of variable */
239  SCIP_Bool initial, /**< should var's column be present in the initial root LP? */
240  SCIP_Bool removable, /**< is var's column removable from the LP (due to aging or cleanup)? */
241  SCIP_DECL_VARDELORIG ((*vardelorig)), /**< frees user data of original variable, or NULL */
242  SCIP_DECL_VARTRANS ((*vartrans)), /**< creates transformed user data by transforming original user data, or NULL */
243  SCIP_DECL_VARDELTRANS ((*vardeltrans)), /**< frees user data of transformed variable, or NULL */
244  SCIP_DECL_VARCOPY ((*varcopy)), /**< copies variable data if wanted to subscip, or NULL */
245  SCIP_VARDATA* vardata /**< user data for this specific variable */
246  );
247 
248 /** copies and captures a variable from source to target SCIP; an integer variable with bounds zero and one is
249  * automatically converted into a binary variable; in case the variable data cannot be copied the variable is not
250  * copied at all
251  */
252 extern
254  SCIP_VAR** var, /**< pointer to store the target variable */
255  BMS_BLKMEM* blkmem, /**< block memory */
256  SCIP_SET* set, /**< global SCIP settings */
257  SCIP_STAT* stat, /**< problem statistics */
258  SCIP* sourcescip, /**< source SCIP data structure */
259  SCIP_VAR* sourcevar, /**< source variable */
260  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
261  * target variables */
262  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
263  * target constraints */
264  SCIP_Bool global /**< should global or local bounds be used? */
265  );
266 
267 /** parses variable information (in cip format) out of a string; if the parsing process was successful an original
268  * variable is created and captured; if variable is of integral type, fractional bounds are automatically rounded; an
269  * integer variable with bounds zero and one is automatically converted into a binary variable
270  */
271 extern
273  SCIP_VAR** var, /**< pointer to variable data */
274  BMS_BLKMEM* blkmem, /**< block memory */
275  SCIP_SET* set, /**< global SCIP settings */
276  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
277  SCIP_STAT* stat, /**< problem statistics */
278  const char* str, /**< string to parse */
279  SCIP_Bool initial, /**< should var's column be present in the initial root LP? */
280  SCIP_Bool removable, /**< is var's column removable from the LP (due to aging or cleanup)? */
281  SCIP_DECL_VARCOPY ((*varcopy)), /**< copies variable data if wanted to subscip, or NULL */
282  SCIP_DECL_VARDELORIG ((*vardelorig)), /**< frees user data of original variable */
283  SCIP_DECL_VARTRANS ((*vartrans)), /**< creates transformed user data by transforming original user data */
284  SCIP_DECL_VARDELTRANS ((*vardeltrans)), /**< frees user data of transformed variable */
285  SCIP_VARDATA* vardata, /**< user data for this specific variable */
286  char** endptr, /**< pointer to store the final string position if successfully */
287  SCIP_Bool* success /**< pointer store if the paring process was successful */
288  );
289 
290 /** parses variable information (in cip format) out of a string; if the parsing process was successful a loose variable
291  * belonging to the transformed problem is created and captured; if variable is of integral type, fractional bounds are
292  * automatically rounded; an integer variable with bounds zero and one is automatically converted into a binary
293  * variable
294  */
295 extern
297  SCIP_VAR** var, /**< pointer to variable data */
298  BMS_BLKMEM* blkmem, /**< block memory */
299  SCIP_SET* set, /**< global SCIP settings */
300  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
301  SCIP_STAT* stat, /**< problem statistics */
302  const char* str, /**< string to parse */
303  SCIP_Bool initial, /**< should var's column be present in the initial root LP? */
304  SCIP_Bool removable, /**< is var's column removable from the LP (due to aging or cleanup)? */
305  SCIP_DECL_VARCOPY ((*varcopy)), /**< copies variable data if wanted to subscip, or NULL */
306  SCIP_DECL_VARDELORIG ((*vardelorig)), /**< frees user data of original variable */
307  SCIP_DECL_VARTRANS ((*vartrans)), /**< creates transformed user data by transforming original user data */
308  SCIP_DECL_VARDELTRANS ((*vardeltrans)), /**< frees user data of transformed variable */
309  SCIP_VARDATA* vardata, /**< user data for this specific variable */
310  char** endptr, /**< pointer to store the final string position if successfully */
311  SCIP_Bool* success /**< pointer store if the paring process was successful */
312  );
313 
314 /** increases usage counter of variable */
315 extern
316 void SCIPvarCapture(
317  SCIP_VAR* var /**< variable */
318  );
319 
320 /** decreases usage counter of variable, and frees memory if necessary */
321 extern
323  SCIP_VAR** var, /**< pointer to variable */
324  BMS_BLKMEM* blkmem, /**< block memory */
325  SCIP_SET* set, /**< global SCIP settings */
326  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
327  SCIP_LP* lp /**< current LP data (may be NULL, if it's not a column variable) */
328  );
329 
330 /** change variable name */
331 extern
332 /** change variable name */
334  SCIP_VAR* var, /**< problem variable */
335  BMS_BLKMEM* blkmem, /**< block memory */
336  const char* name /**< name of variable */
337  );
338 
339 /** initializes variable data structure for solving */
340 extern
341 void SCIPvarInitSolve(
342  SCIP_VAR* var /**< problem variable */
343  );
344 
345 /** gets and captures transformed variable of a given variable; if the variable is not yet transformed,
346  * a new transformed variable for this variable is created
347  */
348 extern
350  SCIP_VAR* origvar, /**< original problem variable */
351  BMS_BLKMEM* blkmem, /**< block memory of transformed problem */
352  SCIP_SET* set, /**< global SCIP settings */
353  SCIP_STAT* stat, /**< problem statistics */
354  SCIP_OBJSENSE objsense, /**< objective sense of original problem; transformed is always MINIMIZE */
355  SCIP_VAR** transvar /**< pointer to store the transformed variable */
356  );
357 
358 /** gets corresponding transformed variable of an original or negated original variable */
359 extern
361  SCIP_VAR* origvar, /**< original problem variable */
362  BMS_BLKMEM* blkmem, /**< block memory of transformed problem */
363  SCIP_SET* set, /**< global SCIP settings */
364  SCIP_STAT* stat, /**< problem statistics */
365  SCIP_VAR** transvar /**< pointer to store the transformed variable, or NULL if not existing yet */
366  );
367 
368 /** converts transformed variable into column variable and creates LP column */
369 extern
371  SCIP_VAR* var, /**< problem variable */
372  BMS_BLKMEM* blkmem, /**< block memory */
373  SCIP_SET* set, /**< global SCIP settings */
374  SCIP_STAT* stat, /**< problem statistics */
375  SCIP_PROB* prob, /**< problem data */
376  SCIP_LP* lp /**< current LP data */
377  );
378 
379 /** converts column transformed variable back into loose variable, frees LP column */
380 extern
382  SCIP_VAR* var, /**< problem variable */
383  BMS_BLKMEM* blkmem, /**< block memory */
384  SCIP_SET* set, /**< global SCIP settings */
385  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
386  SCIP_PROB* prob, /**< problem data */
387  SCIP_LP* lp /**< current LP data */
388  );
389 
390 /** converts variable into fixed variable */
391 extern
393  SCIP_VAR* var, /**< problem variable */
394  BMS_BLKMEM* blkmem, /**< block memory */
395  SCIP_SET* set, /**< global SCIP settings */
396  SCIP_STAT* stat, /**< problem statistics */
397  SCIP_PROB* transprob, /**< tranformed problem data */
398  SCIP_PROB* origprob, /**< original problem data */
399  SCIP_PRIMAL* primal, /**< primal data */
400  SCIP_TREE* tree, /**< branch and bound tree */
401  SCIP_LP* lp, /**< current LP data */
402  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
403  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
404  SCIP_Real fixedval, /**< value to fix variable at */
405  SCIP_Bool* infeasible, /**< pointer to store whether the fixing is infeasible */
406  SCIP_Bool* fixed /**< pointer to store whether the fixing was performed (variable was unfixed) */
407  );
408 
409 /** transforms given variables, scalars and constant to the corresponding active variables, scalars and constant
410  *
411  * If the number of needed active variables is greater than the available slots in the variable array, nothing happens except
412  * that the required size is stored in the corresponding variable; hence, if afterwards the required size is greater than the
413  * available slots (varssize), nothing happens; otherwise, the active variable representation is stored in the arrays.
414  *
415  * The reason for this approach is that we cannot reallocate memory, since we do not know how the
416  * memory has been allocated (e.g., by a C++ 'new' or SCIP functions).
417  */
418 extern
420  SCIP_SET* set, /**< global SCIP settings */
421  SCIP_VAR** vars, /**< variable array to get active variables */
422  SCIP_Real* scalars, /**< scalars a_1, ..., a_n in linear sum a_1*x_1 + ... + a_n*x_n + c */
423  int* nvars, /**< pointer to number of variables and values in vars and vals array */
424  int varssize, /**< available slots in vars and scalars array */
425  SCIP_Real* constant, /**< pointer to constant c in linear sum a_1*x_1 + ... + a_n*x_n + c */
426  int* requiredsize, /**< pointer to store the required array size for the active variables */
427  SCIP_Bool mergemultiples /**< should multiple occurrences of a var be replaced by a single coeff? */
428  );
429 
430 /** transforms given variable, scalar and constant to the corresponding active, fixed, or
431  * multi-aggregated variable, scalar and constant; if the variable resolves to a fixed variable,
432  * "scalar" will be 0.0 and the value of the sum will be stored in "constant"; a multi-aggregation
433  * with only one active variable (this can happen due to fixings after the multi-aggregation),
434  * is treated like an aggregation; if the multi-aggregation constant is infinite, "scalar" will be 0.0
435  */
436 extern
438  SCIP_VAR** var, /**< pointer to problem variable x in sum a*x + c */
439  SCIP_SET* set, /**< global SCIP settings */
440  SCIP_Real* scalar, /**< pointer to scalar a in sum a*x + c */
441  SCIP_Real* constant /**< pointer to constant c in sum a*x + c */
442  );
443 
444 
445 /** flattens aggregation graph of multi-aggregated variable in order to avoid exponential recursion later-on */
446 extern
448  SCIP_VAR* var, /**< problem variable */
449  BMS_BLKMEM* blkmem, /**< block memory */
450  SCIP_SET* set /**< global SCIP settings */
451  );
452 
453 /** return for given variables all their active counterparts; all active variables will be pairwise different */
454 extern
456  SCIP_SET* set, /**< global SCIP settings */
457  SCIP_VAR** vars, /**< variable array with given variables and as output all active
458  * variables, if enough slots exist
459  */
460  int* nvars, /**< number of given variables, and as output number of active variables,
461  * if enough slots exist
462  */
463  int varssize, /**< available slots in vars array */
464  int* requiredsize /**< pointer to store the required array size for the active variables */
465  );
466 
467 /** performs second step of SCIPaggregateVars():
468  * the variable to be aggregated is chosen among active problem variables x' and y', preferring a less strict variable
469  * type as aggregation variable (i.e. continuous variables are preferred over implicit integers, implicit integers
470  * or integers over binaries). If none of the variables is continuous, it is tried to find an integer
471  * aggregation (i.e. integral coefficients a'' and b'', such that a''*x' + b''*y' == c''). This can lead to
472  * the detection of infeasibility (e.g. if c'' is fractional), or to a rejection of the aggregation (denoted by
473  * aggregated == FALSE), if the resulting integer coefficients are too large and thus numerically instable.
474  */
475 extern
477  SCIP_SET* set, /**< global SCIP settings */
478  BMS_BLKMEM* blkmem, /**< block memory */
479  SCIP_STAT* stat, /**< problem statistics */
480  SCIP_PROB* transprob, /**< tranformed problem data */
481  SCIP_PROB* origprob, /**< original problem data */
482  SCIP_PRIMAL* primal, /**< primal data */
483  SCIP_TREE* tree, /**< branch and bound tree */
484  SCIP_LP* lp, /**< current LP data */
485  SCIP_CLIQUETABLE* cliquetable, /**< clique table data structure */
486  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
487  SCIP_EVENTFILTER* eventfilter, /**< event filter for global (not variable dependent) events */
488  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
489  SCIP_VAR* varx, /**< variable x in equality a*x + b*y == c */
490  SCIP_VAR* vary, /**< variable y in equality a*x + b*y == c */
491  SCIP_Real scalarx, /**< multiplier a in equality a*x + b*y == c */
492  SCIP_Real scalary, /**< multiplier b in equality a*x + b*y == c */
493  SCIP_Real rhs, /**< right hand side c in equality a*x + b*y == c */
494  SCIP_Bool* infeasible, /**< pointer to store whether the aggregation is infeasible */
495  SCIP_Bool* aggregated /**< pointer to store whether the aggregation was successful */
496  );
497 
498 /** converts loose variable into aggregated variable */
499 extern
501  SCIP_VAR* var, /**< loose problem variable */
502  BMS_BLKMEM* blkmem, /**< block memory */
503  SCIP_SET* set, /**< global SCIP settings */
504  SCIP_STAT* stat, /**< problem statistics */
505  SCIP_PROB* transprob, /**< tranformed problem data */
506  SCIP_PROB* origprob, /**< original problem data */
507  SCIP_PRIMAL* primal, /**< primal data */
508  SCIP_TREE* tree, /**< branch and bound tree */
509  SCIP_LP* lp, /**< current LP data */
510  SCIP_CLIQUETABLE* cliquetable, /**< clique table data structure */
511  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
512  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
513  SCIP_VAR* aggvar, /**< loose variable y in aggregation x = a*y + c */
514  SCIP_Real scalar, /**< multiplier a in aggregation x = a*y + c */
515  SCIP_Real constant, /**< constant shift c in aggregation x = a*y + c */
516  SCIP_Bool* infeasible, /**< pointer to store whether the aggregation is infeasible */
517  SCIP_Bool* aggregated /**< pointer to store whether the aggregation was successful */
518  );
519 
520 /** converts variable into multi-aggregated variable */
521 extern
523  SCIP_VAR* var, /**< problem variable */
524  BMS_BLKMEM* blkmem, /**< block memory */
525  SCIP_SET* set, /**< global SCIP settings */
526  SCIP_STAT* stat, /**< problem statistics */
527  SCIP_PROB* transprob, /**< tranformed problem data */
528  SCIP_PROB* origprob, /**< original problem data */
529  SCIP_PRIMAL* primal, /**< primal data */
530  SCIP_TREE* tree, /**< branch and bound tree */
531  SCIP_LP* lp, /**< current LP data */
532  SCIP_CLIQUETABLE* cliquetable, /**< clique table data structure */
533  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
534  SCIP_EVENTFILTER* eventfilter, /**< event filter for global (not variable dependent) events */
535  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
536  int naggvars, /**< number n of variables in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
537  SCIP_VAR** aggvars, /**< variables y_i in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
538  SCIP_Real* scalars, /**< multipliers a_i in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
539  SCIP_Real constant, /**< constant shift c in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
540  SCIP_Bool* infeasible, /**< pointer to store whether the aggregation is infeasible */
541  SCIP_Bool* aggregated /**< pointer to store whether the aggregation was successful */
542  );
543 
544 /** returns whether variable is not allowed to be multi-aggregated */
545 extern
547  SCIP_VAR* var /**< problem variable */
548  );
549 
550 /** gets negated variable x' = offset - x of problem variable x; the negated variable is created if not yet existing;
551  * the negation offset of binary variables is always 1, the offset of other variables is fixed to lb + ub when the
552  * negated variable is created
553  */
554 extern
556  SCIP_VAR* var, /**< problem variable to negate */
557  BMS_BLKMEM* blkmem, /**< block memory of transformed problem */
558  SCIP_SET* set, /**< global SCIP settings */
559  SCIP_STAT* stat, /**< problem statistics */
560  SCIP_VAR** negvar /**< pointer to store the negated variable */
561  );
562 
563 /** informs variable that its position in problem's vars array changed */
564 extern
566  SCIP_VAR* var, /**< problem variable */
567  int probindex /**< new problem index of variable */
568  );
569 
570 /** gives the variable a new name
571  *
572  * @note the old pointer is overwritten, which might result in a memory leakage
573  */
574 extern
576  SCIP_VAR* var, /**< problem variable */
577  const char* name /**< new name of variable */
578  );
579 
580 /** informs variable that it will be removed from the problem; adjusts probindex and removes variable from the
581  * implication graph;
582  * If 'final' is TRUE, the thorough implication graph removal is not performed. Instead, only the
583  * variable bounds and implication data structures of the variable are freed. Since in the final removal
584  * of all variables from the transformed problem, this deletes the implication graph completely and is faster
585  * than removing the variables one by one, each time updating all lists of the other variables.
586  */
587 extern
589  SCIP_VAR* var, /**< problem variable */
590  BMS_BLKMEM* blkmem, /**< block memory buffer */
591  SCIP_SET* set, /**< global SCIP settings */
592  SCIP_Bool final /**< is this the final removal of all problem variables? */
593  );
594 
595 /** marks the variable to be deleted from the problem */
596 extern
597 void SCIPvarMarkDeleted(
598  SCIP_VAR* var /**< problem variable */
599  );
600 
601 /** marks the variable to not to be multi-aggregated */
602 extern
604  SCIP_VAR* var /**< problem variable */
605  );
606 
607 /** modifies lock numbers for rounding */
608 extern
610  SCIP_VAR* var, /**< problem variable */
611  BMS_BLKMEM* blkmem, /**< block memory */
612  SCIP_SET* set, /**< global SCIP settings */
613  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
614  int addnlocksdown, /**< increase in number of rounding down locks */
615  int addnlocksup /**< increase in number of rounding up locks */
616  );
617 
618 /** changes type of variable; cannot be called, if var belongs to a problem */
619 extern
621  SCIP_VAR* var, /**< problem variable to change */
622  SCIP_VARTYPE vartype /**< new type of variable */
623  );
624 
625 /** changes objective value of variable */
626 extern
628  SCIP_VAR* var, /**< variable to change */
629  BMS_BLKMEM* blkmem, /**< block memory */
630  SCIP_SET* set, /**< global SCIP settings */
631  SCIP_PROB* prob, /**< problem data */
632  SCIP_PRIMAL* primal, /**< primal data */
633  SCIP_LP* lp, /**< current LP data */
634  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
635  SCIP_Real newobj /**< new objective value for variable */
636  );
637 
638 /** adds value to objective value of variable */
639 extern
641  SCIP_VAR* var, /**< variable to change */
642  BMS_BLKMEM* blkmem, /**< block memory */
643  SCIP_SET* set, /**< global SCIP settings */
644  SCIP_STAT* stat, /**< problem statistics */
645  SCIP_PROB* transprob, /**< tranformed problem data */
646  SCIP_PROB* origprob, /**< original problem data */
647  SCIP_PRIMAL* primal, /**< primal data */
648  SCIP_TREE* tree, /**< branch and bound tree */
649  SCIP_LP* lp, /**< current LP data */
650  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
651  SCIP_Real addobj /**< additional objective value for variable */
652  );
653 
654 /** changes objective value of variable in current dive */
655 extern
657  SCIP_VAR* var, /**< problem variable to change */
658  SCIP_SET* set, /**< global SCIP settings */
659  SCIP_LP* lp, /**< current LP data */
660  SCIP_Real newobj /**< new objective value for variable */
661  );
662 
663 /** adjust lower bound to integral value, if variable is integral */
664 extern
665 void SCIPvarAdjustLb(
666  SCIP_VAR* var, /**< problem variable */
667  SCIP_SET* set, /**< global SCIP settings */
668  SCIP_Real* lb /**< pointer to lower bound to adjust */
669  );
670 
671 /** adjust upper bound to integral value, if variable is integral */
672 extern
673 void SCIPvarAdjustUb(
674  SCIP_VAR* var, /**< problem variable */
675  SCIP_SET* set, /**< global SCIP settings */
676  SCIP_Real* ub /**< pointer to upper bound to adjust */
677  );
678 
679 /** adjust lower or upper bound to integral value, if variable is integral */
680 extern
681 void SCIPvarAdjustBd(
682  SCIP_VAR* var, /**< problem variable */
683  SCIP_SET* set, /**< global SCIP settings */
684  SCIP_BOUNDTYPE boundtype, /**< type of bound to adjust */
685  SCIP_Real* bd /**< pointer to bound to adjust */
686  );
687 
688 /** changes lower bound of original variable in original problem */
689 extern
691  SCIP_VAR* var, /**< problem variable to change */
692  SCIP_SET* set, /**< global SCIP settings */
693  SCIP_Real newbound /**< new bound for variable */
694  );
695 
696 /** changes upper bound of original variable in original problem */
697 extern
699  SCIP_VAR* var, /**< problem variable to change */
700  SCIP_SET* set, /**< global SCIP settings */
701  SCIP_Real newbound /**< new bound for variable */
702  );
703 
704 /** changes global lower bound of variable; if possible, adjusts bound to integral value;
705  * updates local lower bound if the global bound is tighter
706  */
707 extern
709  SCIP_VAR* var, /**< problem variable to change */
710  BMS_BLKMEM* blkmem, /**< block memory */
711  SCIP_SET* set, /**< global SCIP settings */
712  SCIP_STAT* stat, /**< problem statistics */
713  SCIP_LP* lp, /**< current LP data, may be NULL for original variables */
714  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage, may be NULL for original variables */
715  SCIP_EVENTQUEUE* eventqueue, /**< event queue, may be NULL for original variables */
716  SCIP_Real newbound /**< new bound for variable */
717  );
718 
719 /** changes global upper bound of variable; if possible, adjusts bound to integral value;
720  * updates local upper bound if the global bound is tighter
721  */
722 extern
724  SCIP_VAR* var, /**< problem variable to change */
725  BMS_BLKMEM* blkmem, /**< block memory */
726  SCIP_SET* set, /**< global SCIP settings */
727  SCIP_STAT* stat, /**< problem statistics */
728  SCIP_LP* lp, /**< current LP data, may be NULL for original variables */
729  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage, may be NULL for original variables */
730  SCIP_EVENTQUEUE* eventqueue, /**< event queue, may be NULL for original variables */
731  SCIP_Real newbound /**< new bound for variable */
732  );
733 
734 /** changes global bound of variable; if possible, adjusts bound to integral value;
735  * updates local bound if the global bound is tighter
736  */
737 extern
739  SCIP_VAR* var, /**< problem variable to change */
740  BMS_BLKMEM* blkmem, /**< block memory */
741  SCIP_SET* set, /**< global SCIP settings */
742  SCIP_STAT* stat, /**< problem statistics */
743  SCIP_LP* lp, /**< current LP data, may be NULL for original variables */
744  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage, may be NULL for original variables */
745  SCIP_EVENTQUEUE* eventqueue, /**< event queue, may be NULL for original variables */
746  SCIP_Real newbound, /**< new bound for variable */
747  SCIP_BOUNDTYPE boundtype /**< type of bound: lower or upper bound */
748  );
749 
750 /** changes current local lower bound of variable; if possible, adjusts bound to integral value; stores inference
751  * information in variable
752  */
753 extern
755  SCIP_VAR* var, /**< problem variable to change */
756  BMS_BLKMEM* blkmem, /**< block memory */
757  SCIP_SET* set, /**< global SCIP settings */
758  SCIP_STAT* stat, /**< problem statistics */
759  SCIP_LP* lp, /**< current LP data, may be NULL for original variables */
760  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage, may be NULL for original variables */
761  SCIP_EVENTQUEUE* eventqueue, /**< event queue, may be NULL for original variables */
762  SCIP_Real newbound /**< new bound for variable */
763  );
764 
765 /** changes current local upper bound of variable; if possible, adjusts bound to integral value; stores inference
766  * information in variable
767  */
768 extern
770  SCIP_VAR* var, /**< problem variable to change */
771  BMS_BLKMEM* blkmem, /**< block memory */
772  SCIP_SET* set, /**< global SCIP settings */
773  SCIP_STAT* stat, /**< problem statistics */
774  SCIP_LP* lp, /**< current LP data, may be NULL for original variables */
775  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage, may be NULL for original variables */
776  SCIP_EVENTQUEUE* eventqueue, /**< event queue, may be NULL for original variables */
777  SCIP_Real newbound /**< new bound for variable */
778  );
779 
780 /** changes current local bound of variable; if possible, adjusts bound to integral value; stores inference
781  * information in variable
782  */
783 extern
785  SCIP_VAR* var, /**< problem variable to change */
786  BMS_BLKMEM* blkmem, /**< block memory */
787  SCIP_SET* set, /**< global SCIP settings */
788  SCIP_STAT* stat, /**< problem statistics */
789  SCIP_LP* lp, /**< current LP data, may be NULL for original variables */
790  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage, may be NULL for original variables */
791  SCIP_EVENTQUEUE* eventqueue, /**< event queue, may be NULL for original variables */
792  SCIP_Real newbound, /**< new bound for variable */
793  SCIP_BOUNDTYPE boundtype /**< type of bound: lower or upper bound */
794  );
795 
796 /** changes lazy lower bound of the variable, this is only possible if the variable is not in the LP yet */
797 extern
799  SCIP_VAR* var, /**< problem variable */
800  SCIP_SET* set, /**< global SCIP settings */
801  SCIP_Real lazylb /**< the lazy lower bound to be set */
802  );
803 
804 /** changes lazy upper bound of the variable, this is only possible if the variable is not in the LP yet */
806  SCIP_VAR* var, /**< problem variable */
807  SCIP_SET* set, /**< global SCIP settings */
808  SCIP_Real lazylb /**< the lazy lower bound to be set */
809  );
810 
811 /** changes lower bound of variable in current dive; if possible, adjusts bound to integral value */
812 extern
814  SCIP_VAR* var, /**< problem variable to change */
815  SCIP_SET* set, /**< global SCIP settings */
816  SCIP_LP* lp, /**< current LP data */
817  SCIP_Real newbound /**< new bound for variable */
818  );
819 
820 /** changes upper bound of variable in current dive; if possible, adjusts bound to integral value */
821 extern
823  SCIP_VAR* var, /**< problem variable to change */
824  SCIP_SET* set, /**< global SCIP settings */
825  SCIP_LP* lp, /**< current LP data */
826  SCIP_Real newbound /**< new bound for variable */
827  );
828 
829 /** for a multi-aggregated variable, gives the local lower bound computed by adding the local bounds from all aggregation variables
830  * this lower bound may be tighter than the one given by SCIPvarGetLbLocal, since the latter is not updated if bounds of aggregation variables are changing
831  * calling this function for a non-multi-aggregated variable is not allowed
832  */
833 extern
835  SCIP_VAR* var, /**< problem variable */
836  SCIP_SET* set /**< global SCIP settings */
837  );
838 
839 /** for a multi-aggregated variable, gives the local upper bound computed by adding the local bounds from all aggregation variables
840  * this upper bound may be tighter than the one given by SCIPvarGetUbLocal, since the latter is not updated if bounds of aggregation variables are changing
841  * calling this function for a non-multi-aggregated variable is not allowed
842  */
843 extern
845  SCIP_VAR* var, /**< problem variable */
846  SCIP_SET* set /**< global SCIP settings */
847  );
848 
849 /** for a multi-aggregated variable, gives the global lower bound computed by adding the global bounds from all aggregation variables
850  * this global bound may be tighter than the one given by SCIPvarGetLbGlobal, since the latter is not updated if bounds of aggregation variables are changing
851  * calling this function for a non-multi-aggregated variable is not allowed
852  */
853 extern
855  SCIP_VAR* var, /**< problem variable */
856  SCIP_SET* set /**< global SCIP settings */
857  );
858 
859 /** for a multi-aggregated variable, gives the global upper bound computed by adding the global bounds from all aggregation variables
860  * this upper bound may be tighter than the one given by SCIPvarGetUbGlobal, since the latter is not updated if bounds of aggregation variables are changing
861  * calling this function for a non-multi-aggregated variable is not allowed
862  */
863 extern
865  SCIP_VAR* var, /**< problem variable */
866  SCIP_SET* set /**< global SCIP settings */
867  );
868 
869 /** adds a hole to the original domain of the variable*/
870 extern
872  SCIP_VAR* var, /**< problem variable */
873  BMS_BLKMEM* blkmem, /**< block memory */
874  SCIP_SET* set, /**< global SCIP settings */
875  SCIP_Real left, /**< left bound of open interval in new hole */
876  SCIP_Real right /**< right bound of open interval in new hole */
877  );
878 
879 /** adds a hole to the variable's global domain */
880 extern
882  SCIP_VAR* var, /**< problem variable */
883  BMS_BLKMEM* blkmem, /**< block memory */
884  SCIP_SET* set, /**< global SCIP settings */
885  SCIP_STAT* stat, /**< problem statistics */
886  SCIP_EVENTQUEUE* eventqueue, /**< event queue, may be NULL for original variables */
887  SCIP_Real left, /**< left bound of open interval in new hole */
888  SCIP_Real right, /**< right bound of open interval in new hole */
889  SCIP_Bool* added /**< pointer to store whether the hole was added, or NULL */
890  );
891 
892 /** adds a hole to the variable's current local domain */
893 extern
895  SCIP_VAR* var, /**< problem variable */
896  BMS_BLKMEM* blkmem, /**< block memory */
897  SCIP_SET* set, /**< global SCIP settings */
898  SCIP_STAT* stat, /**< problem statistics */
899  SCIP_EVENTQUEUE* eventqueue, /**< event queue, may be NULL for original variables */
900  SCIP_Real left, /**< left bound of open interval in new hole */
901  SCIP_Real right, /**< right bound of open interval in new hole */
902  SCIP_Bool* added /**< pointer to store whether the hole was added, or NULL */
903  );
904 
905 /** resets the global and local bounds of original variable to their original values */
906 extern
908  SCIP_VAR* var, /**< problem variable */
909  BMS_BLKMEM* blkmem, /**< block memory */
910  SCIP_SET* set, /**< global SCIP settings */
911  SCIP_STAT* stat /**< problem statistics */
912  );
913 
914 /** returns at which depth in the tree a bound change was applied to the variable that conflicts with the
915  * given bound; returns -1 if the bound does not conflict with the current local bounds of the variable
916  */
917 extern
919  SCIP_VAR* var, /**< problem variable */
920  SCIP_SET* set, /**< global SCIP settings */
921  SCIP_BOUNDTYPE boundtype, /**< bound type of the conflicting bound */
922  SCIP_Real bound /**< conflicting bound */
923  );
924 
925 /** informs variable x about a globally valid variable lower bound x >= b*z + d with integer variable z;
926  * if z is binary, the corresponding valid implication for z is also added;
927  * improves the global bounds of the variable and the vlb variable if possible
928  */
929 extern
931  SCIP_VAR* var, /**< problem variable */
932  BMS_BLKMEM* blkmem, /**< block memory */
933  SCIP_SET* set, /**< global SCIP settings */
934  SCIP_STAT* stat, /**< problem statistics */
935  SCIP_PROB* transprob, /**< transformed problem */
936  SCIP_PROB* origprob, /**< original problem */
937  SCIP_TREE* tree, /**< branch and bound tree if in solving stage */
938  SCIP_LP* lp, /**< current LP data */
939  SCIP_CLIQUETABLE* cliquetable, /**< clique table data structure */
940  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
941  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
942  SCIP_VAR* vlbvar, /**< variable z in x >= b*z + d */
943  SCIP_Real vlbcoef, /**< coefficient b in x >= b*z + d */
944  SCIP_Real vlbconstant, /**< constant d in x >= b*z + d */
945  SCIP_Bool transitive, /**< should transitive closure of implication also be added? */
946  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
947  int* nbdchgs /**< pointer to store the number of performed bound changes, or NULL */
948  );
949 
950 /** informs variable x about a globally valid variable upper bound x <= b*z + d with integer variable z;
951  * if z is binary, the corresponding valid implication for z is also added;
952  * updates the global bounds of the variable and the vub variable correspondingly
953  */
954 extern
956  SCIP_VAR* var, /**< problem variable */
957  BMS_BLKMEM* blkmem, /**< block memory */
958  SCIP_SET* set, /**< global SCIP settings */
959  SCIP_STAT* stat, /**< problem statistics */
960  SCIP_PROB* transprob, /**< transformed problem */
961  SCIP_PROB* origprob, /**< original problem */
962  SCIP_TREE* tree, /**< branch and bound tree if in solving stage */
963  SCIP_LP* lp, /**< current LP data */
964  SCIP_CLIQUETABLE* cliquetable, /**< clique table data structure */
965  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
966  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
967  SCIP_VAR* vubvar, /**< variable z in x <= b*z + d */
968  SCIP_Real vubcoef, /**< coefficient b in x <= b*z + d */
969  SCIP_Real vubconstant, /**< constant d in x <= b*z + d */
970  SCIP_Bool transitive, /**< should transitive closure of implication also be added? */
971  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
972  int* nbdchgs /**< pointer to store the number of performed bound changes, or NULL */
973  );
974 
975 /** informs binary variable x about a globally valid implication: x == 0 or x == 1 ==> y <= b or y >= b;
976  * also adds the corresponding implication or variable bound to the implied variable;
977  * if the implication is conflicting, the variable is fixed to the opposite value;
978  * if the variable is already fixed to the given value, the implication is performed immediately;
979  * if the implication is redundant with respect to the variables' global bounds, it is ignored
980  */
981 extern
983  SCIP_VAR* var, /**< problem variable */
984  BMS_BLKMEM* blkmem, /**< block memory */
985  SCIP_SET* set, /**< global SCIP settings */
986  SCIP_STAT* stat, /**< problem statistics */
987  SCIP_PROB* transprob, /**< transformed problem */
988  SCIP_PROB* origprob, /**< original problem */
989  SCIP_TREE* tree, /**< branch and bound tree if in solving stage */
990  SCIP_LP* lp, /**< current LP data */
991  SCIP_CLIQUETABLE* cliquetable, /**< clique table data structure */
992  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
993  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
994  SCIP_Bool varfixing, /**< FALSE if y should be added in implications for x == 0, TRUE for x == 1 */
995  SCIP_VAR* implvar, /**< variable y in implication y <= b or y >= b */
996  SCIP_BOUNDTYPE impltype, /**< type of implication y <= b (SCIP_BOUNDTYPE_UPPER) or y >= b (SCIP_BOUNDTYPE_LOWER) */
997  SCIP_Real implbound, /**< bound b in implication y <= b or y >= b */
998  SCIP_Bool transitive, /**< should transitive closure of implication also be added? */
999  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
1000  int* nbdchgs /**< pointer to store the number of performed bound changes, or NULL */
1001  );
1002 
1003 /** fixes the bounds of a binary variable to the given value, counting bound changes and detecting infeasibility */
1004 extern
1006  SCIP_VAR* var, /**< problem variable */
1007  BMS_BLKMEM* blkmem, /**< block memory */
1008  SCIP_SET* set, /**< global SCIP settings */
1009  SCIP_STAT* stat, /**< problem statistics */
1010  SCIP_PROB* transprob, /**< transformed problem */
1011  SCIP_PROB* origprob, /**< original problem */
1012  SCIP_TREE* tree, /**< branch and bound tree if in solving stage */
1013  SCIP_LP* lp, /**< current LP data */
1014  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
1015  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
1016  SCIP_Bool value, /**< value to fix variable to */
1017  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
1018  int* nbdchgs /**< pointer to count the number of performed bound changes, or NULL */
1019  );
1020 
1021 /** adds the variable to the given clique and updates the list of cliques the binary variable is member of;
1022  * if the variable now appears twice in the clique with the same value, it is fixed to the opposite value;
1023  * if the variable now appears twice in the clique with opposite values, all other variables are fixed to
1024  * the opposite of the value they take in the clique
1025  */
1026 extern
1028  SCIP_VAR* var, /**< problem variable */
1029  BMS_BLKMEM* blkmem, /**< block memory */
1030  SCIP_SET* set, /**< global SCIP settings */
1031  SCIP_STAT* stat, /**< problem statistics */
1032  SCIP_PROB* transprob, /**< transformed problem */
1033  SCIP_PROB* origprob, /**< original problem */
1034  SCIP_TREE* tree, /**< branch and bound tree if in solving stage */
1035  SCIP_LP* lp, /**< current LP data */
1036  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
1037  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
1038  SCIP_Bool value, /**< value of the variable in the clique */
1039  SCIP_CLIQUE* clique, /**< clique the variable should be added to */
1040  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
1041  int* nbdchgs /**< pointer to count the number of performed bound changes, or NULL */
1042  );
1043 
1044 /** adds a filled clique to the cliquelists of all corresponding variables */
1045 extern
1047  SCIP_VAR** vars, /**< problem variables */
1048  SCIP_Bool* values, /**< values of the variables in the clique */
1049  int nvars, /**< number of problem variables */
1050  BMS_BLKMEM* blkmem, /**< block memory */
1051  SCIP_SET* set, /**< global SCIP settings */
1052  SCIP_CLIQUE* clique /**< clique that contains all given variables and values */
1053  );
1054 
1055 /** deletes the variable from the given clique and updates the list of cliques the binary variable is member of */
1056 extern
1058  SCIP_VAR* var, /**< problem variable */
1059  BMS_BLKMEM* blkmem, /**< block memory */
1060  SCIP_Bool value, /**< value of the variable in the clique */
1061  SCIP_CLIQUE* clique /**< clique the variable should be removed from */
1062  );
1063 
1064 /** deletes a clique from the list of cliques the binary variable is member of, but does not change the clique
1065  * itself
1066  */
1067 extern
1069  SCIP_VAR* var, /**< problem variable */
1070  BMS_BLKMEM* blkmem, /**< block memory */
1071  SCIP_Bool value, /**< value of the variable in the clique */
1072  SCIP_CLIQUE* clique /**< clique that should be removed from the variable's clique list */
1073  );
1074 
1075 /** sets the branch factor of the variable; this value can be used in the branching methods to scale the score
1076  * values of the variables; higher factor leads to a higher probability that this variable is chosen for branching
1077  */
1078 extern
1080  SCIP_VAR* var, /**< problem variable */
1081  SCIP_SET* set, /**< global SCIP settings */
1082  SCIP_Real branchfactor /**< factor to weigh variable's branching score with */
1083  );
1084 
1085 /** sets the branch priority of the variable; variables with higher branch priority are always preferred to variables
1086  * with lower priority in selection of branching variable
1087  */
1088 extern
1090  SCIP_VAR* var, /**< problem variable */
1091  int branchpriority /**< branching priority of the variable */
1092  );
1093 
1094 /** sets the branch direction of the variable; variables with higher branch direction are always preferred to variables
1095  * with lower direction in selection of branching variable
1096  */
1097 extern
1099  SCIP_VAR* var, /**< problem variable */
1100  SCIP_BRANCHDIR branchdirection /**< preferred branch direction of the variable (downwards, upwards, auto) */
1101  );
1102 
1103 /** gets objective value of variable in current SCIP_LP; the value can be different from the bound stored in the variable's own
1104  * data due to diving, that operate only on the LP without updating the variables
1105  */
1106 extern
1108  SCIP_VAR* var /**< problem variable */
1109  );
1110 
1111 /** gets lower bound of variable in current SCIP_LP; the bound can be different from the bound stored in the variable's own
1112  * data due to diving or conflict analysis, that operate only on the LP without updating the variables
1113  */
1114 extern
1116  SCIP_VAR* var, /**< problem variable */
1117  SCIP_SET* set /**< global SCIP settings */
1118  );
1119 
1120 /** gets upper bound of variable in current SCIP_LP; the bound can be different from the bound stored in the variable's own
1121  * data due to diving or conflict analysis, that operate only on the LP without updating the variables
1122  */
1123 extern
1125  SCIP_VAR* var, /**< problem variable */
1126  SCIP_SET* set /**< global SCIP settings */
1127  );
1128 
1129 /** returns solution value and index of variable lower bound that is closest to the variable's value in the given primal solution
1130  * or current LP solution if no primal solution is given; returns an index of -1 if no variable lower bound is available
1131  */
1132 extern
1134  SCIP_VAR* var, /**< active problem variable */
1135  SCIP_SOL* sol, /**< primal solution, or NULL for LP solution */
1136  SCIP_SET* set, /**< global SCIP settings */
1137  SCIP_STAT* stat, /**< problem statistics */
1138  SCIP_Real* closestvlb, /**< pointer to store the value of the closest variable lower bound */
1139  int* closestvlbidx /**< pointer to store the index of the closest variable lower bound */
1140  );
1141 
1142 /** returns solution value and index of variable upper bound that is closest to the variable's value in the given primal solution;
1143  * or current LP solution if no primal solution is given; returns an index of -1 if no variable upper bound is available
1144  */
1145 extern
1147  SCIP_VAR* var, /**< active problem variable */
1148  SCIP_SOL* sol, /**< primal solution, or NULL for LP solution */
1149  SCIP_SET* set, /**< global SCIP settings */
1150  SCIP_STAT* stat, /**< problem statistics */
1151  SCIP_Real* closestvub, /**< pointer to store the value of the closest variable upper bound */
1152  int* closestvubidx /**< pointer to store the index of the closest variable upper bound */
1153  );
1154 
1155 /** remembers the current solution as root solution in the problem variables */
1156 extern
1157 void SCIPvarStoreRootSol(
1158  SCIP_VAR* var, /**< problem variable */
1159  SCIP_Bool roothaslp /**< is the root solution from LP? */
1160  );
1161 
1162 /** updates the current solution as best root solution in the problem variables if it is better */
1163 extern
1165  SCIP_VAR* var, /**< problem variable */
1166  SCIP_SET* set, /**< global SCIP settings */
1167  SCIP_Real rootsol, /**< root solution value */
1168  SCIP_Real rootredcost, /**< root reduced cost */
1169  SCIP_Real rootlpobjval /**< objective value of the root LP */
1170  );
1171 
1172 /** returns the solution value of the problem variables in the relaxation solution */
1173 extern
1175  SCIP_VAR* var, /**< problem variable */
1176  SCIP_SET* set /**< global SCIP settings */
1177  );
1178 
1179 /** returns the solution value of the transformed problem variable in the relaxation solution */
1180 extern
1182  SCIP_VAR* var /**< problem variable */
1183  );
1184 
1185 /** returns for given variable the reduced cost */
1186 extern
1188  SCIP_VAR* var, /**< problem variable */
1189  SCIP_SET* set, /**< global SCIP settings */
1190  SCIP_Bool varfixing, /**< FALSE if for x == 0, TRUE for x == 1 */
1191  SCIP_STAT* stat, /**< problem statistics */
1192  SCIP_LP* lp /**< current LP data */
1193  );
1194 
1195 /** returns for the given binary variable the reduced cost which are given by the variable itself and its implication if
1196  * the binary variable is fixed to the given value
1197  */
1198 extern
1200  SCIP_VAR* var, /**< problem variable */
1201  SCIP_SET* set, /**< global SCIP settings */
1202  SCIP_Bool varfixing, /**< FALSE if for x == 0, TRUE for x == 1 */
1203  SCIP_STAT* stat, /**< problem statistics */
1204  SCIP_LP* lp /**< current LP data */
1205  );
1206 
1207 
1208 /** stores the solution value as relaxation solution in the problem variable */
1209 extern
1211  SCIP_VAR* var, /**< problem variable */
1212  SCIP_SET* set, /**< global SCIP settings */
1213  SCIP_RELAXATION* relaxation, /**< global relaxation data */
1214  SCIP_Real solval, /**< solution value in the current relaxation solution */
1215  SCIP_Bool updateobj /**< should the objective value be updated? */
1216  );
1217 
1218 /** stores the solution value as NLP solution in the problem variable */
1219 extern
1221  SCIP_VAR* var, /**< problem variable */
1222  SCIP_SET* set, /**< global SCIP settings */
1223  SCIP_Real solval /**< solution value in the current NLP solution */
1224  );
1225 
1226 /** resolves variable to columns and adds them with the coefficient to the row */
1227 extern
1229  SCIP_VAR* var, /**< problem variable */
1230  BMS_BLKMEM* blkmem, /**< block memory */
1231  SCIP_SET* set, /**< global SCIP settings */
1232  SCIP_STAT* stat, /**< problem statistics */
1233  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
1234  SCIP_PROB* prob, /**< problem data */
1235  SCIP_LP* lp, /**< current LP data */
1236  SCIP_ROW* row, /**< LP row */
1237  SCIP_Real val /**< value of coefficient */
1238  );
1239 
1240 /** updates the pseudo costs of the given variable and the global pseudo costs after a change of
1241  * "solvaldelta" in the variable's solution value and resulting change of "objdelta" in the in the LP's objective value
1242  */
1243 extern
1245  SCIP_VAR* var, /**< problem variable */
1246  SCIP_SET* set, /**< global SCIP settings */
1247  SCIP_STAT* stat, /**< problem statistics */
1248  SCIP_Real solvaldelta, /**< difference of variable's new LP value - old LP value */
1249  SCIP_Real objdelta, /**< difference of new LP's objective value - old LP's objective value */
1250  SCIP_Real weight /**< weight in (0,1] of this update in pseudo cost sum */
1251  );
1252 
1253 /** gets the variable's pseudo cost value for the given step size "solvaldelta" in the variable's LP solution value */
1254 extern
1256  SCIP_VAR* var, /**< problem variable */
1257  SCIP_STAT* stat, /**< problem statistics */
1258  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
1259  );
1260 
1261 /** gets the variable's pseudo cost value for the given step size "solvaldelta" in the variable's LP solution value,
1262  * only using the pseudo cost information of the current run
1263  */
1264 extern
1266  SCIP_VAR* var, /**< problem variable */
1267  SCIP_STAT* stat, /**< problem statistics */
1268  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
1269  );
1270 
1271 /** gets the variable's (possible fractional) number of pseudo cost updates for the given direction */
1272 extern
1274  SCIP_VAR* var, /**< problem variable */
1275  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
1276  );
1277 
1278 /** gets the variable's (possible fractional) number of pseudo cost updates for the given direction,
1279  * only using the pseudo cost information of the current run
1280  */
1281 extern
1283  SCIP_VAR* var, /**< problem variable */
1284  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
1285  );
1286 
1287 /** increases the VSIDS of the variable by the given weight */
1288 extern
1290  SCIP_VAR* var, /**< problem variable */
1291  BMS_BLKMEM* blkmem, /**< block memory, or NULL if the domain value is SCIP_UNKNOWN */
1292  SCIP_SET* set, /**< global SCIP settings, or NULL if the domain value is SCIP_UNKNOWN */
1293  SCIP_STAT* stat, /**< problem statistics */
1294  SCIP_BRANCHDIR dir, /**< branching direction */
1295  SCIP_Real value, /**< domain value, or SCIP_UNKNOWN */
1296  SCIP_Real weight /**< weight of this update in conflict score */
1297  );
1298 
1299 /** scales the VSIDS of the variable by the given scalar */
1300 extern
1302  SCIP_VAR* var, /**< problem variable */
1303  SCIP_Real scalar /**< scalar to multiply the conflict scores with */
1304  );
1305 
1306 /** increases the number of active conflicts by one and the overall length of the variable by the given length */
1308  SCIP_VAR* var, /**< problem variable */
1309  BMS_BLKMEM* blkmem, /**< block memory, or NULL if the domain value is SCIP_UNKNOWN */
1310  SCIP_SET* set, /**< global SCIP settings, or NULL if the domain value is SCIP_UNKNOWN */
1311  SCIP_STAT* stat, /**< problem statistics */
1312  SCIP_BRANCHDIR dir, /**< branching direction */
1313  SCIP_Real value, /**< domain value, or SCIP_UNKNOWN */
1314  SCIP_Real length /**< length of the conflict */
1315  );
1316 
1317 /** gets the number of active conflicts containing this variable in given direction */
1319  SCIP_VAR* var, /**< problem variable */
1320  SCIP_STAT* stat, /**< problem statistics */
1321  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
1322  );
1323 
1324 /** gets the number of active conflicts containing this variable in given direction
1325  * in the current run
1326  */
1328  SCIP_VAR* var, /**< problem variable */
1329  SCIP_STAT* stat, /**< problem statistics */
1330  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
1331  );
1332 
1333 /** gets the average conflict length in given direction due to branching on the variable */
1335  SCIP_VAR* var, /**< problem variable */
1336  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
1337  );
1338 
1339 /** gets the average conflict length in given direction due to branching on the variable
1340  * in the current run
1341  */
1343  SCIP_VAR* var, /**< problem variable */
1344  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
1345  );
1346 
1347 /** increases the number of branchings counter of the variable */
1348 extern
1350  SCIP_VAR* var, /**< problem variable */
1351  BMS_BLKMEM* blkmem, /**< block memory, or NULL if the domain value is SCIP_UNKNOWN */
1352  SCIP_SET* set, /**< global SCIP settings, or NULL if the domain value is SCIP_UNKNOWN */
1353  SCIP_STAT* stat, /**< problem statistics */
1354  SCIP_BRANCHDIR dir, /**< branching direction (downwards, or upwards) */
1355  SCIP_Real value, /**< domain value, or SCIP_UNKNOWN */
1356  int depth /**< depth at which the bound change took place */
1357  );
1358 
1359 /** increases the inference score of the variable by the given weight */
1360 extern
1362  SCIP_VAR* var, /**< problem variable */
1363  BMS_BLKMEM* blkmem, /**< block memory, or NULL if the domain value is SCIP_UNKNOWN */
1364  SCIP_SET* set, /**< global SCIP settings, or NULL if the domain value is SCIP_UNKNOWN */
1365  SCIP_STAT* stat, /**< problem statistics */
1366  SCIP_BRANCHDIR dir, /**< branching direction (downwards, or upwards) */
1367  SCIP_Real value, /**< domain value, or SCIP_UNKNOWN */
1368  SCIP_Real weight /**< weight of this update in inference score */
1369  );
1370 
1371 /** increases the cutoff score of the variable by the given weight */
1372 extern
1374  SCIP_VAR* var, /**< problem variable */
1375  BMS_BLKMEM* blkmem, /**< block memory, or NULL if the domain value is SCIP_UNKNOWN */
1376  SCIP_SET* set, /**< global SCIP settings, or NULL if the domain value is SCIP_UNKNOWN */
1377  SCIP_STAT* stat, /**< problem statistics */
1378  SCIP_BRANCHDIR dir, /**< branching direction (downwards, or upwards) */
1379  SCIP_Real value, /**< domain value, or SCIP_UNKNOWN */
1380  SCIP_Real weight /**< weight of this update in cutoff score */
1381  );
1382 
1383 /** returns the variable's VSIDS score */
1384 extern
1386  SCIP_VAR* var, /**< problem variable */
1387  SCIP_STAT* stat, /**< problem statistics */
1388  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
1389  );
1390 
1391 /** returns the variable's VSIDS score only using conflicts of the current run */
1392 extern
1394  SCIP_VAR* var, /**< problem variable */
1395  SCIP_STAT* stat, /**< problem statistics */
1396  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
1397  );
1398 
1399 /** returns the average number of inferences found after branching on the variable in given direction */
1400 extern
1402  SCIP_VAR* var, /**< problem variable */
1403  SCIP_STAT* stat, /**< problem statistics */
1404  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
1405  );
1406 
1407 /** returns the average number of inferences found after branching on the variable in given direction
1408  * in the current run
1409  */
1410 extern
1412  SCIP_VAR* var, /**< problem variable */
1413  SCIP_STAT* stat, /**< problem statistics */
1414  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
1415  );
1416 
1417 /** returns the average number of cutoffs found after branching on the variable in given direction */
1418 extern
1420  SCIP_VAR* var, /**< problem variable */
1421  SCIP_STAT* stat, /**< problem statistics */
1422  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
1423  );
1424 
1425 /** returns the average number of cutoffs found after branching on the variable in given direction in the current run */
1426 extern
1428  SCIP_VAR* var, /**< problem variable */
1429  SCIP_STAT* stat, /**< problem statistics */
1430  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
1431  );
1432 
1433 /** outputs variable information into file stream */
1434 extern
1436  SCIP_VAR* var, /**< problem variable */
1437  SCIP_SET* set, /**< global SCIP settings */
1438  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1439  FILE* file /**< output file (or NULL for standard output) */
1440  );
1441 
1442 /** includes event handler with given data in variable's event filter */
1443 extern
1445  SCIP_VAR* var, /**< problem variable */
1446  BMS_BLKMEM* blkmem, /**< block memory */
1447  SCIP_SET* set, /**< global SCIP settings */
1448  SCIP_EVENTTYPE eventtype, /**< event type to catch */
1449  SCIP_EVENTHDLR* eventhdlr, /**< event handler to call for the event processing */
1450  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler for the event processing */
1451  int* filterpos /**< pointer to store position of event filter entry, or NULL */
1452  );
1453 
1454 /** deletes event handler with given data from variable's event filter */
1455 extern
1457  SCIP_VAR* var, /**< problem variable */
1458  BMS_BLKMEM* blkmem, /**< block memory */
1459  SCIP_SET* set, /**< global SCIP settings */
1460  SCIP_EVENTTYPE eventtype, /**< event type mask of dropped event */
1461  SCIP_EVENTHDLR* eventhdlr, /**< event handler to call for the event processing */
1462  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler for the event processing */
1463  int filterpos /**< position of event filter entry returned by SCIPvarCatchEvent(), or -1 */
1464  );
1465 
1466 /** returns the variable's VSIDS score */
1467 extern
1469  SCIP_VAR* var, /**< problem variable */
1470  SCIP_STAT* stat, /**< problem statistics */
1471  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
1472  );
1473 
1474 /** returns the position of the bound change index */
1475 extern
1476 int SCIPbdchgidxGetPos(
1477  SCIP_BDCHGIDX* bdchgidx /**< bound change index */
1478  );
1479 
1480 #ifdef NDEBUG
1481 
1482 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
1483  * speed up the algorithms.
1484  */
1485 
1486 #define SCIPvarCatchEvent(var, blkmem, set, eventtype, eventhdlr, eventdata, filterpos) \
1487  SCIPeventfilterAdd(var->eventfilter, blkmem, set, eventtype, eventhdlr, eventdata, filterpos)
1488 #define SCIPvarDropEvent(var, blkmem, set, eventtype, eventhdlr, eventdata, filterpos) \
1489  SCIPeventfilterDel(var->eventfilter, blkmem, set, eventtype, eventhdlr, eventdata, filterpos)
1490 #define SCIPvarGetVSIDS(var, stat, dir) ((var)->varstatus == SCIP_VARSTATUS_LOOSE || (var)->varstatus == SCIP_VARSTATUS_COLUMN ? \
1491  SCIPhistoryGetVSIDS(var->history, dir)/stat->vsidsweight : SCIPvarGetVSIDS_rec(var, stat, dir))
1492 #define SCIPbdchgidxGetPos(bdchgidx) ((bdchgidx)->pos)
1493 
1494 #endif
1495 
1496 /*
1497  * Hash functions
1498  */
1499 
1500 /** gets the key (i.e. the name) of the given variable */
1501 extern
1502 SCIP_DECL_HASHGETKEY(SCIPhashGetKeyVar);
1503 
1504 #ifdef __cplusplus
1505 }
1506 #endif
1507 
1508 #endif
1509