Scippy

SCIP

Solving Constraint Integer Programs

cons_varbound.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-2018 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 visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file cons_varbound.h
17  * @ingroup CONSHDLRS
18  * @brief Constraint handler for variable bound constraints \f$lhs \leq x + c y \leq rhs\f$.
19  * @author Tobias Achterberg
20  * @author Timo Berthold
21  * @author Michael Winkler
22  * @author Gerald Gamrath
23  * @author Stefan Heinz
24  *
25  */
26 
27 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
28 
29 #ifndef __SCIP_CONS_VARBOUND_H__
30 #define __SCIP_CONS_VARBOUND_H__
31 
32 
33 #include "scip/def.h"
34 #include "scip/type_cons.h"
35 #include "scip/type_lp.h"
36 #include "scip/type_retcode.h"
37 #include "scip/type_scip.h"
38 #include "scip/type_var.h"
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 /** creates the handler for variable bound constraints and includes it in SCIP
45  *
46  * @ingroup ConshdlrIncludes
47  * */
48 extern
50  SCIP* scip /**< SCIP data structure */
51  );
52 
53 /**@addtogroup CONSHDLRS
54  *
55  * @{
56  *
57  * @name Variable Bound Constraints
58  *
59  * @{
60  *
61  * This constraint handler handles a special type of linear constraints, namely variable bound constraints.
62  * A variable bound constraint has the form
63  * \f[
64  * lhs \leq x + c y \leq rhs
65  * \f]
66  * with coefficient \f$c \in Q\f$, \f$lhs\in Q \cup \{-\infty\}\f$, \f$rhs\in Q \cup \{\infty\}\f$,
67  * and decision variables \f$x\f$ (non-binary) and \f$y\f$ (binary or integer).
68  */
69 
70 /** creates and captures a variable bound constraint: lhs <= x + c*y <= rhs
71  *
72  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
73  */
74 extern
76  SCIP* scip, /**< SCIP data structure */
77  SCIP_CONS** cons, /**< pointer to hold the created constraint */
78  const char* name, /**< name of constraint */
79  SCIP_VAR* var, /**< variable x that has variable bound */
80  SCIP_VAR* vbdvar, /**< binary, integer or implicit integer bounding variable y */
81  SCIP_Real vbdcoef, /**< coefficient c of bounding variable y */
82  SCIP_Real lhs, /**< left hand side of variable bound inequality */
83  SCIP_Real rhs, /**< right hand side of variable bound inequality */
84  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
85  * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
86  SCIP_Bool separate, /**< should the constraint be separated during LP processing?
87  * Usually set to TRUE. */
88  SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
89  * TRUE for model constraints, FALSE for additional, redundant constraints. */
90  SCIP_Bool check, /**< should the constraint be checked for feasibility?
91  * TRUE for model constraints, FALSE for additional, redundant constraints. */
92  SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
93  * Usually set to TRUE. */
94  SCIP_Bool local, /**< is constraint only valid locally?
95  * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
96  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
97  * Usually set to FALSE. In column generation applications, set to TRUE if pricing
98  * adds coefficients to this constraint. */
99  SCIP_Bool dynamic, /**< is constraint subject to aging?
100  * Usually set to FALSE. Set to TRUE for own cuts which
101  * are separated as constraints. */
102  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
103  * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
104  SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
105  * if it may be moved to a more global node?
106  * Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
107  );
108 
109 /** creates and captures a varbound constraint
110  * in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
111  * method SCIPcreateConsVarbound(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h
112  *
113  * @see SCIPcreateConsVarbound() for information about the basic constraint flag configuration
114  *
115  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
116  */
117 extern
119  SCIP* scip, /**< SCIP data structure */
120  SCIP_CONS** cons, /**< pointer to hold the created constraint */
121  const char* name, /**< name of constraint */
122  SCIP_VAR* var, /**< variable x that has variable bound */
123  SCIP_VAR* vbdvar, /**< binary, integer or implicit integer bounding variable y */
124  SCIP_Real vbdcoef, /**< coefficient c of bounding variable y */
125  SCIP_Real lhs, /**< left hand side of variable bound inequality */
126  SCIP_Real rhs /**< right hand side of variable bound inequality */
127  );
128 
129 /** gets left hand side of variable bound constraint lhs <= x + c*y <= rhs */
130 extern
132  SCIP* scip, /**< SCIP data structure */
133  SCIP_CONS* cons /**< constraint data */
134  );
135 
136 /** gets right hand side of variable bound constraint lhs <= x + c*y <= rhs */
137 extern
139  SCIP* scip, /**< SCIP data structure */
140  SCIP_CONS* cons /**< constraint data */
141  );
142 
143 /** gets bounded variable x of variable bound constraint lhs <= x + c*y <= rhs */
144 extern
146  SCIP* scip, /**< SCIP data structure */
147  SCIP_CONS* cons /**< constraint data */
148  );
149 
150 /** gets bounding variable y of variable bound constraint lhs <= x + c*y <= rhs */
151 extern
153  SCIP* scip, /**< SCIP data structure */
154  SCIP_CONS* cons /**< constraint data */
155  );
156 
157 /** gets bound coefficient c of variable bound constraint lhs <= x + c*y <= rhs */
158 extern
160  SCIP* scip, /**< SCIP data structure */
161  SCIP_CONS* cons /**< constraint data */
162  );
163 
164 /** gets the dual solution of the variable bound constraint in the current LP */
165 extern
167  SCIP* scip, /**< SCIP data structure */
168  SCIP_CONS* cons /**< constraint data */
169  );
170 
171 /** gets the dual Farkas value of the variable bound constraint in the current infeasible LP */
172 extern
174  SCIP* scip, /**< SCIP data structure */
175  SCIP_CONS* cons /**< constraint data */
176  );
177 
178 /** returns the linear relaxation of the given variable bound constraint; may return NULL if no LP row was yet created;
179  * the user must not modify the row!
180  */
181 extern
183  SCIP* scip, /**< SCIP data structure */
184  SCIP_CONS* cons /**< constraint data */
185  );
186 
187 /* @} */
188 
189 /* @} */
190 
191 #ifdef __cplusplus
192 }
193 #endif
194 
195 #endif
SCIP_Real SCIPgetLhsVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetDualsolVarbound(SCIP *scip, SCIP_CONS *cons)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
type definitions for return codes for SCIP methods
SCIP_ROW * SCIPgetRowVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetVarVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsBasicVarbound(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *var, SCIP_VAR *vbdvar, SCIP_Real vbdcoef, SCIP_Real lhs, SCIP_Real rhs)
SCIP_RETCODE SCIPcreateConsVarbound(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *var, SCIP_VAR *vbdvar, SCIP_Real vbdcoef, SCIP_Real lhs, SCIP_Real rhs, 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)
type definitions for LP management
SCIP_Real SCIPgetRhsVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetDualfarkasVarbound(SCIP *scip, SCIP_CONS *cons)
type definitions for SCIP&#39;s main datastructure
type definitions for problem variables
SCIP_VAR * SCIPgetVbdvarVarbound(SCIP *scip, SCIP_CONS *cons)
#define SCIP_Bool
Definition: def.h:62
SCIP_Real SCIPgetVbdcoefVarbound(SCIP *scip, SCIP_CONS *cons)
#define SCIP_Real
Definition: def.h:150
common defines and data types used in all packages of SCIP
type definitions for constraints and constraint handlers
SCIP_RETCODE SCIPincludeConshdlrVarbound(SCIP *scip)