Scippy

SCIP

Solving Constraint Integer Programs

cons_soc.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-2022 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 scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file cons_soc.h
17  * @ingroup CONSHDLRS
18  * @brief some API functions of removed constraint handler for second order cone constraints \f$\sqrt{\gamma + \sum_{i=1}^{n} (\alpha_i\, (x_i + \beta_i))^2} \leq \alpha_{n+1}\, (x_{n+1}+\beta_{n+1})\f$
19  * @author Stefan Vigerske
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_CONS_SOC_H__
25 #define __SCIP_CONS_SOC_H__
26 
27 #include "scip/def.h"
28 #include "scip/type_cons.h"
29 #include "scip/type_nlp.h"
30 #include "scip/type_retcode.h"
31 #include "scip/type_scip.h"
32 #include "scip/type_var.h"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 /**@addtogroup CONSHDLRS
39  *
40  * @{
41  *
42  * @name SOC Constraints (deprecated)
43  *
44  * @{
45  */
46 
47 /** creates and captures a second order cone nonlinear constraint
48  *
49  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
50  *
51  * @deprecated Use SCIPcreateConsBasicSOCNonlinear() instead
52  */
53 SCIP_EXPORT
55  SCIP* scip, /**< SCIP data structure */
56  SCIP_CONS** cons, /**< pointer to hold the created constraint */
57  const char* name, /**< name of constraint */
58  int nvars, /**< number of variables on left hand side of constraint (n) */
59  SCIP_VAR** vars, /**< array with variables on left hand side (x_i) */
60  SCIP_Real* coefs, /**< array with coefficients of left hand side variables (alpha_i), or NULL if all 1.0 */
61  SCIP_Real* offsets, /**< array with offsets of variables (beta_i), or NULL if all 0.0 */
62  SCIP_Real constant, /**< constant on left hand side (gamma) */
63  SCIP_VAR* rhsvar, /**< variable on right hand side of constraint (x_{n+1}) */
64  SCIP_Real rhscoeff, /**< coefficient of variable on right hand side (alpha_{n+1}) */
65  SCIP_Real rhsoffset, /**< offset of variable on right hand side (beta_{n+1}) */
66  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
67  * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
68  SCIP_Bool separate, /**< should the constraint be separated during LP processing?
69  * Usually set to TRUE. */
70  SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
71  * TRUE for model constraints, FALSE for additional, redundant constraints. */
72  SCIP_Bool check, /**< should the constraint be checked for feasibility?
73  * TRUE for model constraints, FALSE for additional, redundant constraints. */
74  SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
75  * Usually set to TRUE. */
76  SCIP_Bool local, /**< is constraint only valid locally?
77  * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
78  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
79  * Usually set to FALSE. In column generation applications, set to TRUE if pricing
80  * adds coefficients to this constraint. */
81  SCIP_Bool dynamic, /**< is constraint subject to aging?
82  * Usually set to FALSE. Set to TRUE for own cuts which
83  * are separated as constraints. */
84  SCIP_Bool removable /**< should the relaxation be removed from the LP due to aging or cleanup?
85  * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
86  );
87 
88 /** creates and captures a second order cone nonlinear constraint
89  * in its most basic variant, i. e., with all constraint flags set to their default values, which can be set
90  * afterwards using SCIPsetConsFLAGNAME()
91  *
92  * @see SCIPcreateConsSOC() for the default constraint flag configuration
93  *
94  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
95  *
96  * @deprecated Use SCIPcreateConsBasicSOCNonlinear() instead
97  */
98 SCIP_EXPORT
100  SCIP* scip, /**< SCIP data structure */
101  SCIP_CONS** cons, /**< pointer to hold the created constraint */
102  const char* name, /**< name of constraint */
103  int nvars, /**< number of variables on left hand side of constraint (n) */
104  SCIP_VAR** vars, /**< array with variables on left hand side (x_i) */
105  SCIP_Real* coefs, /**< array with coefficients of left hand side variables (alpha_i), or NULL if all 1.0 */
106  SCIP_Real* offsets, /**< array with offsets of variables (beta_i), or NULL if all 0.0 */
107  SCIP_Real constant, /**< constant on left hand side (gamma) */
108  SCIP_VAR* rhsvar, /**< variable on right hand side of constraint (x_{n+1}) */
109  SCIP_Real rhscoeff, /**< coefficient of variable on right hand side (alpha_{n+1}) */
110  SCIP_Real rhsoffset /**< offset of variable on right hand side (beta_{n+1}) */
111  );
112 
113 /** Gets the SOC constraint as a nonlinear row representation.
114  *
115  * @deprecated Use SCIPgetNlRowNonlinear() instead.
116  */
117 SCIP_EXPORT
119  SCIP* scip, /**< SCIP data structure */
120  SCIP_CONS* cons, /**< constraint */
121  SCIP_NLROW** nlrow /**< pointer to store nonlinear row */
122  );
123 
124 /** @} */
125 
126 /** @} */
127 
128 #ifdef __cplusplus
129 }
130 #endif
131 
132 #endif
SCIP_RETCODE SCIPcreateConsBasicSOC(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *coefs, SCIP_Real *offsets, SCIP_Real constant, SCIP_VAR *rhsvar, SCIP_Real rhscoeff, SCIP_Real rhsoffset)
Definition: cons_soc.c:153
type definitions for NLP management
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
type definitions for return codes for SCIP methods
SCIP_RETCODE SCIPgetNlRowSOC(SCIP *scip, SCIP_CONS *cons, SCIP_NLROW **nlrow)
Definition: cons_soc.c:182
type definitions for SCIP&#39;s main datastructure
type definitions for problem variables
#define SCIP_Bool
Definition: def.h:84
#define SCIP_Real
Definition: def.h:177
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPcreateConsSOC(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *coefs, SCIP_Real *offsets, SCIP_Real constant, SCIP_VAR *rhsvar, SCIP_Real rhscoeff, SCIP_Real rhsoffset, 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)
Definition: cons_soc.c:97
type definitions for constraints and constraint handlers