Scippy

SCIP

Solving Constraint Integer Programs

cons_abspower.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_abspower.h
17  * @ingroup CONSHDLRS
18  * @brief Constraint handler for absolute power constraints \f$\textrm{lhs} \leq \textrm{sign}(x+a) |x+a|^n + c z \leq \textrm{rhs}\f$
19  * @author Stefan Vigerske
20  *
21  */
22 
23 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
24 
25 #ifndef __SCIP_CONS_ABSPOWER_H__
26 #define __SCIP_CONS_ABSPOWER_H__
27 
28 #include "scip/scip.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 /** creates the handler for absolute power constraints and includes it in SCIP
35  *
36  * @ingroup ConshdlrIncludes
37  * */
38 extern
40  SCIP* scip /**< SCIP data structure */
41  );
42 
43 /**@addtogroup CONSHDLRS
44  *
45  * @{
46  *
47  * @name Absolute Power Constraints
48  *
49  * @{
50  *
51  * This constraint handler handles constraints of the form
52  * \f[
53  * \textrm{lhs} \leq \textrm{sign}(x+a) |x+a|^n + c z \leq \textrm{rhs}
54  * \f]
55  * for \f$n > 1.0\f$ a rational number, \f$a\f$ and \f$c\f$ arbitrary, and \f$x\f$ and \f$z\f$ variables.
56  * Note that \f$x\f$ can have \f$-a\f$ in the interior of its domain.
57  *
58  * Constraints are enforced by separation, domain propagation, and spatial branching.
59  *
60  * Cuts that separate on the convex hull of the graph of \f$\textrm{sign}(x+a) |x+a|^n\f$ are generated as long as they separate the relaxation solution.
61  * Otherwise, spatial branching on \f$x\f$ is applied.
62  *
63  * Further, domain propagation is implemented to propagate bound changes on \f$x\f$ onto \f$z\f$, and vice versa, and
64  * repropagation is implemented to allow for conflict analysis.
65  * During presolve, a pairwise comparison of absolute power constraints may allow to fix or aggregate some variables.
66  * See also
67  *
68  * @par
69  * Stefan Vigerske@n
70  * Decomposition of Multistage Stochastic Programs and a Constraint Integer Programming Approach to Mixed-Integer Nonlinear Programming@n
71  * PhD Thesis, Humboldt-University Berlin, 2012, submitted.
72  *
73  */
74 
75 /** creates and captures a absolute power constraint
76  *
77  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
78  */
79 extern
81  SCIP* scip, /**< SCIP data structure */
82  SCIP_CONS** cons, /**< pointer to hold the created constraint */
83  const char* name, /**< name of constraint */
84  SCIP_VAR* x, /**< nonlinear variable x in constraint */
85  SCIP_VAR* z, /**< linear variable z in constraint */
86  SCIP_Real exponent, /**< exponent n of |x+offset|^n term in constraint */
87  SCIP_Real xoffset, /**< offset in |x+offset|^n term in constraint */
88  SCIP_Real zcoef, /**< coefficient of z in constraint */
89  SCIP_Real lhs, /**< left hand side of constraint */
90  SCIP_Real rhs, /**< right hand side of constraint */
91  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
92  * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
93  SCIP_Bool separate, /**< should the constraint be separated during LP processing?
94  * Usually set to TRUE. */
95  SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
96  * TRUE for model constraints, FALSE for additional, redundant constraints. */
97  SCIP_Bool check, /**< should the constraint be checked for feasibility?
98  * TRUE for model constraints, FALSE for additional, redundant constraints. */
99  SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
100  * Usually set to TRUE. */
101  SCIP_Bool local, /**< is constraint only valid locally?
102  * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
103  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
104  * Usually set to FALSE. In column generation applications, set to TRUE if pricing
105  * adds coefficients to this constraint. */
106  SCIP_Bool dynamic, /**< is constraint subject to aging?
107  * Usually set to FALSE. Set to TRUE for own cuts which
108  * are seperated as constraints. */
109  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
110  * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
111  SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
112  * if it may be moved to a more global node?
113  * Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
114  );
115 
116 /** creates and captures an absolute power constraint
117  * in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
118  * method SCIPcreateConsAbspower(); all flags can be set via SCIPconsSetFLAGNAME-methods in scip.h
119  *
120  * @see SCIPcreateConsAbspower() for information about the basic constraint flag configuration
121  *
122  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
123  */
124 extern
126  SCIP* scip, /**< SCIP data structure */
127  SCIP_CONS** cons, /**< pointer to hold the created constraint */
128  const char* name, /**< name of constraint */
129  SCIP_VAR* x, /**< nonlinear variable x in constraint */
130  SCIP_VAR* z, /**< linear variable z in constraint */
131  SCIP_Real exponent, /**< exponent n of |x+offset|^n term in constraint */
132  SCIP_Real xoffset, /**< offset in |x+offset|^n term in constraint */
133  SCIP_Real zcoef, /**< coefficient of z in constraint */
134  SCIP_Real lhs, /**< left hand side of constraint */
135  SCIP_Real rhs /**< right hand side of constraint */
136  );
137 
138 /** gets the absolute power constraint as a nonlinear row representation */
139 extern
141  SCIP* scip, /**< SCIP data structure */
142  SCIP_CONS* cons, /**< constraint */
143  SCIP_NLROW** nlrow /**< a buffer where to store pointer to nonlinear row */
144  );
145 
146 /** gets nonlinear variable x in absolute power constraint */
147 extern
149  SCIP* scip, /**< SCIP data structure */
150  SCIP_CONS* cons /**< absolute power constraint */
151  );
152 
153 /** gets linear variable z in absolute power constraint */
154 extern
156  SCIP* scip, /**< SCIP data structure */
157  SCIP_CONS* cons /**< absolute power constraint */
158  );
159 
160 /** gets exponent in power term in absolute power constraint */
161 extern
163  SCIP* scip, /**< SCIP data structure */
164  SCIP_CONS* cons /**< absolute power constraint */
165  );
166 
167 /** gets offset in power term in absolute power constraint */
168 extern
170  SCIP* scip, /**< SCIP data structure */
171  SCIP_CONS* cons /**< absolute power constraint */
172  );
173 
174 /** gets coefficient of linear variable in absolute power constraint */
175 extern
177  SCIP* scip, /**< SCIP data structure */
178  SCIP_CONS* cons /**< absolute power constraint */
179  );
180 
181 /** gets left hand side in absolute power constraint */
182 extern
184  SCIP* scip, /**< SCIP data structure */
185  SCIP_CONS* cons /**< absolute power constraint */
186  );
187 
188 /** gets right hand side in absolute power constraint */
189 extern
191  SCIP* scip, /**< SCIP data structure */
192  SCIP_CONS* cons /**< absolute power constraint */
193  );
194 
195 /** gets the absolute violation of a absolute power constraint by a solution */
196 extern
198  SCIP* scip, /**< SCIP data structure */
199  SCIP_CONS* cons, /**< absolute power constraint */
200  SCIP_SOL* sol /**< LP solution */
201  );
202 
203 /* @} */
204 
205 /* @} */
206 
207 #ifdef __cplusplus
208 }
209 #endif
210 
211 #endif
SCIP_Real SCIPgetCoefLinearAbspower(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetNonlinearVarAbspower(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetOffsetAbspower(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetLinearVarAbspower(SCIP *scip, SCIP_CONS *cons)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_RETCODE SCIPcreateConsBasicAbspower(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *x, SCIP_VAR *z, SCIP_Real exponent, SCIP_Real xoffset, SCIP_Real zcoef, SCIP_Real lhs, SCIP_Real rhs)
SCIP_Real SCIPgetViolationAbspower(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol)
#define SCIP_Bool
Definition: def.h:61
SCIP_RETCODE SCIPgetNlRowAbspower(SCIP *scip, SCIP_CONS *cons, SCIP_NLROW **nlrow)
SCIP_RETCODE SCIPcreateConsAbspower(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *x, SCIP_VAR *z, SCIP_Real exponent, SCIP_Real xoffset, 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_RETCODE SCIPincludeConshdlrAbspower(SCIP *scip)
SCIP_Real SCIPgetRhsAbspower(SCIP *scip, SCIP_CONS *cons)
#define SCIP_Real
Definition: def.h:145
SCIP_Real SCIPgetExponentAbspower(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLhsAbspower(SCIP *scip, SCIP_CONS *cons)
SCIP callable library.