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