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-2024 Zuse Institute Berlin (ZIB) */
7/* */
8/* Licensed under the Apache License, Version 2.0 (the "License"); */
9/* you may not use this file except in compliance with the License. */
10/* You may obtain a copy of the License at */
11/* */
12/* http://www.apache.org/licenses/LICENSE-2.0 */
13/* */
14/* Unless required by applicable law or agreed to in writing, software */
15/* distributed under the License is distributed on an "AS IS" BASIS, */
16/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17/* See the License for the specific language governing permissions and */
18/* limitations under the License. */
19/* */
20/* You should have received a copy of the Apache-2.0 license */
21/* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22/* */
23/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24
25/**@file cons_soc.h
26 * @ingroup CONSHDLRS
27 * @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$
28 * @author Stefan Vigerske
29 */
30
31/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32
33#ifndef __SCIP_CONS_SOC_H__
34#define __SCIP_CONS_SOC_H__
35
36#include "scip/def.h"
37#include "scip/type_cons.h"
38#include "scip/type_nlp.h"
39#include "scip/type_retcode.h"
40#include "scip/type_scip.h"
41#include "scip/type_var.h"
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47/**@addtogroup CONSHDLRS
48 *
49 * @{
50 *
51 * @name SOC Constraints (deprecated)
52 *
53 * @{
54 */
55
56/** creates and captures a second order cone nonlinear constraint
57 *
58 * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
59 *
60 * @deprecated Use SCIPcreateConsBasicSOCNonlinear() instead
61 */
62SCIP_EXPORT
64 SCIP* scip, /**< SCIP data structure */
65 SCIP_CONS** cons, /**< pointer to hold the created constraint */
66 const char* name, /**< name of constraint */
67 int nvars, /**< number of variables on left hand side of constraint (n) */
68 SCIP_VAR** vars, /**< array with variables on left hand side (x_i) */
69 SCIP_Real* coefs, /**< array with coefficients of left hand side variables (alpha_i), or NULL if all 1.0 */
70 SCIP_Real* offsets, /**< array with offsets of variables (beta_i), or NULL if all 0.0 */
71 SCIP_Real constant, /**< constant on left hand side (gamma) */
72 SCIP_VAR* rhsvar, /**< variable on right hand side of constraint (x_{n+1}) */
73 SCIP_Real rhscoeff, /**< coefficient of variable on right hand side (alpha_{n+1}) */
74 SCIP_Real rhsoffset, /**< offset of variable on right hand side (beta_{n+1}) */
75 SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
76 * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
77 SCIP_Bool separate, /**< should the constraint be separated during LP processing?
78 * Usually set to TRUE. */
79 SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
80 * TRUE for model constraints, FALSE for additional, redundant constraints. */
81 SCIP_Bool check, /**< should the constraint be checked for feasibility?
82 * TRUE for model constraints, FALSE for additional, redundant constraints. */
83 SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
84 * Usually set to TRUE. */
85 SCIP_Bool local, /**< is constraint only valid locally?
86 * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
87 SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
88 * Usually set to FALSE. In column generation applications, set to TRUE if pricing
89 * adds coefficients to this constraint. */
90 SCIP_Bool dynamic, /**< is constraint subject to aging?
91 * Usually set to FALSE. Set to TRUE for own cuts which
92 * are separated as constraints. */
93 SCIP_Bool removable /**< should the relaxation be removed from the LP due to aging or cleanup?
94 * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
95 );
96
97/** creates and captures a second order cone nonlinear constraint
98 * in its most basic variant, i. e., with all constraint flags set to their default values, which can be set
99 * afterwards using SCIPsetConsFLAGNAME()
100 *
101 * @see SCIPcreateConsSOC() for the default constraint flag configuration
102 *
103 * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
104 *
105 * @deprecated Use SCIPcreateConsBasicSOCNonlinear() instead
106 */
107SCIP_EXPORT
109 SCIP* scip, /**< SCIP data structure */
110 SCIP_CONS** cons, /**< pointer to hold the created constraint */
111 const char* name, /**< name of constraint */
112 int nvars, /**< number of variables on left hand side of constraint (n) */
113 SCIP_VAR** vars, /**< array with variables on left hand side (x_i) */
114 SCIP_Real* coefs, /**< array with coefficients of left hand side variables (alpha_i), or NULL if all 1.0 */
115 SCIP_Real* offsets, /**< array with offsets of variables (beta_i), or NULL if all 0.0 */
116 SCIP_Real constant, /**< constant on left hand side (gamma) */
117 SCIP_VAR* rhsvar, /**< variable on right hand side of constraint (x_{n+1}) */
118 SCIP_Real rhscoeff, /**< coefficient of variable on right hand side (alpha_{n+1}) */
119 SCIP_Real rhsoffset /**< offset of variable on right hand side (beta_{n+1}) */
120 );
121
122/** Gets the SOC constraint as a nonlinear row representation.
123 *
124 * @deprecated Use SCIPgetNlRowNonlinear() instead.
125 */
126SCIP_EXPORT
128 SCIP* scip, /**< SCIP data structure */
129 SCIP_CONS* cons, /**< constraint */
130 SCIP_NLROW** nlrow /**< pointer to store nonlinear row */
131 );
132
133/** @} */
134
135/** @} */
136
137#ifdef __cplusplus
138}
139#endif
140
141#endif
common defines and data types used in all packages of SCIP
#define SCIP_Bool
Definition: def.h:91
#define SCIP_Real
Definition: def.h:173
SCIP_RETCODE SCIPgetNlRowSOC(SCIP *scip, SCIP_CONS *cons, SCIP_NLROW **nlrow)
Definition: cons_soc.c:191
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:162
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:106
type definitions for constraints and constraint handlers
type definitions for NLP management
type definitions for return codes for SCIP methods
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for SCIP's main datastructure
type definitions for problem variables