Scippy

SCIP

Solving Constraint Integer Programs

cons_bivariate.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-2017 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 cons_bivariate.h
17  * @ingroup CONSHDLRS
18  * @brief constraint handler for bivariate nonlinear constraints \f$\textrm{lhs} \leq f(x,y) + c z \leq \textrm{rhs}\f$
19  * @author Martin Ballerstein
20  * @author Dennis Michaels
21  * @author Stefan Vigerske
22  *
23  */
24 
25 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
26 
27 #ifndef __SCIP_CONS_BIVARIATE_H__
28 #define __SCIP_CONS_BIVARIATE_H__
29 
30 #include "scip/scip.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /** creates the handler for bivariate constraints and includes it in SCIP
37  *
38  * @ingroup ConshdlrIncludes
39  * */
40 extern
42  SCIP* scip /**< SCIP data structure */
43  );
44 
45 /**@addtogroup CONSHDLRS
46  *
47  * @{
48  *
49  * @name Bivariate Constraints
50  *
51  * This constraint handler handles constraints of the form
52  * \f[
53  * \textrm{lhs} \leq f(x,y) + c z \leq \textrm{rhs}
54  * \f]
55  * for a bivariate nonlinear function \f$f(x,y)\f$ (given as expression tree) that has
56  * a fixed convexity behaviour, that is, \f$f(x,y)\f$ has to be either jointly convex in \f$(x,y)\f$,
57  * or convex in \f$x\f$ and concave in \f$y\f$,
58  * or convex in \f$x\f$ and convex in \f$y\f$, but indefinite w.r.t. \f$(x,y)\f$.
59  * See also
60  *
61  * @par
62  * Martin Ballerstein, Dennis Michaels, and Stefan Vigerske@n
63  * Linear Underestimators for bivariate functions with a fixed convexity behavior@n
64  * ZIB Report 13-02, 2013. http://opus4.kobv.de/opus4-zib/frontdoor/index/index/docId/1764
65  *
66  * @{
67  */
68 
69 typedef enum
70 {
71  SCIP_BIVAR_ALLCONVEX = 0, /* f(x,y) is convex */
72  SCIP_BIVAR_1CONVEX_INDEFINITE = 1, /* f(x,y) is 1-convex and indefinite */
73  SCIP_BIVAR_CONVEX_CONCAVE = 2, /* f(x,y) is convex in x and concave in y */
74  SCIP_BIVAR_UNKNOWN = 3 /* unknown */
76 
77 /** creates and captures a bivariate constraint
78  *
79  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
80  */
81 extern
83  SCIP* scip, /**< SCIP data structure */
84  SCIP_CONS** cons, /**< pointer to hold the created constraint */
85  const char* name, /**< name of constraint */
86  SCIP_EXPRTREE* f, /**< expression tree specifying bivariate function f(x,y) */
87  SCIP_BIVAR_CONVEXITY convextype, /**< kind of convexity of f(x,y) */
88  SCIP_VAR* z, /**< linear variable in constraint */
89  SCIP_Real zcoef, /**< coefficient of linear variable */
90  SCIP_Real lhs, /**< left hand side of constraint */
91  SCIP_Real rhs, /**< right hand side of constraint */
92  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
93  * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
94  SCIP_Bool separate, /**< should the constraint be separated during LP processing?
95  * Usually set to TRUE. */
96  SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
97  * TRUE for model constraints, FALSE for additional, redundant constraints. */
98  SCIP_Bool check, /**< should the constraint be checked for feasibility?
99  * TRUE for model constraints, FALSE for additional, redundant constraints. */
100  SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
101  * Usually set to TRUE. */
102  SCIP_Bool local, /**< is constraint only valid locally?
103  * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
104  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
105  * Usually set to FALSE. In column generation applications, set to TRUE if pricing
106  * adds coefficients to this constraint. */
107  SCIP_Bool dynamic, /**< is constraint subject to aging?
108  * Usually set to FALSE. Set to TRUE for own cuts which
109  * are seperated as constraints. */
110  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
111  * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
112  SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
113  * if it may be moved to a more global node?
114  * Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
115  );
116 
117 /** creates and captures an absolute power constraint
118  * in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
119  * method SCIPcreateConsBivariate(); all flags can be set via SCIPconsSetFLAGNAME-methods in cons.h
120  *
121  * @see SCIPcreateConsBivariate() for information about the basic constraint flag configuration
122  *
123  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
124  */
125 extern
127  SCIP* scip, /**< SCIP data structure */
128  SCIP_CONS** cons, /**< pointer to hold the created constraint */
129  const char* name, /**< name of constraint */
130  SCIP_EXPRTREE* f, /**< expression tree specifying bivariate function f(x,y) */
131  SCIP_BIVAR_CONVEXITY convextype, /**< kind of convexity of f(x,y) */
132  SCIP_VAR* z, /**< linear variable in constraint */
133  SCIP_Real zcoef, /**< coefficient of linear variable */
134  SCIP_Real lhs, /**< left hand side of constraint */
135  SCIP_Real rhs /**< right hand side of constraint */
136  );
137 
138 /** gets the linear variable of a bivariate constraint, or NULL if no such variable */
139 extern
141  SCIP* scip, /**< SCIP data structure */
142  SCIP_CONS* cons /**< constraint */
143  );
144 
145 /** gets the coefficients of the linear variable of a bivariate constraint */
146 extern
148  SCIP* scip, /**< SCIP data structure */
149  SCIP_CONS* cons /**< constraint */
150  );
151 
152 /** gets the expression tree of a bivariate constraint */
153 extern
155  SCIP* scip, /**< SCIP data structure */
156  SCIP_CONS* cons /**< constraint */
157  );
158 
159 /** gets the left hand side of a bivariate constraint */
160 extern
162  SCIP* scip, /**< SCIP data structure */
163  SCIP_CONS* cons /**< constraint */
164  );
165 
166 /** gets the right hand side of a bivariate constraint */
167 extern
169  SCIP* scip, /**< SCIP data structure */
170  SCIP_CONS* cons /**< constraint */
171  );
172 
173 /* @} */
174 
175 /* @} */
176 
177 #ifdef __cplusplus
178 }
179 #endif
180 
181 #endif
SCIP_Real SCIPgetLinearCoefBivariate(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsBivariate(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_EXPRTREE *f, SCIP_BIVAR_CONVEXITY convextype, SCIP_VAR *z, SCIP_Real zcoef, 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)
SCIP_Real SCIPgetRhsBivariate(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsBasicBivariate(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_EXPRTREE *f, SCIP_BIVAR_CONVEXITY convextype, SCIP_VAR *z, SCIP_Real zcoef, SCIP_Real lhs, SCIP_Real rhs)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_RETCODE SCIPincludeConshdlrBivariate(SCIP *scip)
SCIP_EXPRTREE * SCIPgetExprtreeBivariate(SCIP *scip, SCIP_CONS *cons)
#define SCIP_Bool
Definition: def.h:61
SCIP_Real SCIPgetLhsBivariate(SCIP *scip, SCIP_CONS *cons)
SCIP_BIVAR_CONVEXITY
SCIP_VAR * SCIPgetLinearVarBivariate(SCIP *scip, SCIP_CONS *cons)
#define SCIP_Real
Definition: def.h:149
SCIP callable library.