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