Scippy

SCIP

Solving Constraint Integer Programs

pub_nlp.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 2002-2022 Zuse Institute Berlin */
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 pub_nlp.h
26  * @ingroup PUBLICCOREAPI
27  * @brief public methods for NLP management
28  * @author Thorsten Gellermann
29  * @author Stefan Vigerske
30  */
31 
32 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
33 
34 #ifndef __SCIP_PUB_NLP_H__
35 #define __SCIP_PUB_NLP_H__
36 
37 #include <stdio.h>
38 
39 #include "scip/def.h"
40 #include "scip/type_message.h"
41 #include "blockmemshell/memory.h"
42 #include "scip/type_set.h"
43 #include "scip/type_stat.h"
44 #include "scip/type_nlp.h"
45 #include "scip/type_var.h"
46 #include "scip/type_sol.h"
47 #include "scip/type_expr.h"
48 #include "scip/type_nlpi.h"
49 
50 #ifdef NDEBUG
51 #include "scip/struct_nlp.h"
52 #endif
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 /**@addtogroup PublicNLRowMethods
59  *
60  * @{
61  */
62 
63 /** gets constant */
64 SCIP_EXPORT
66  SCIP_NLROW* nlrow /**< NLP row */
67  );
68 
69 /** gets number of variables of linear part */
70 SCIP_EXPORT
72  SCIP_NLROW* nlrow /**< NLP row */
73  );
74 
75 /** gets array with variables of linear part */
76 SCIP_EXPORT
78  SCIP_NLROW* nlrow /**< NLP row */
79  );
80 
81 /** gets array with coefficients in linear part */
82 SCIP_EXPORT
84  SCIP_NLROW* nlrow /**< NLP row */
85  );
86 
87 /** gets expression */
88 SCIP_EXPORT
90  SCIP_NLROW* nlrow /**< NLP row */
91  );
92 
93 /** returns the left hand side of a nonlinear row */
94 SCIP_EXPORT
96  SCIP_NLROW* nlrow /**< NLP row */
97  );
98 
99 /** returns the right hand side of a nonlinear row */
100 SCIP_EXPORT
102  SCIP_NLROW* nlrow /**< NLP row */
103  );
104 
105 /** returns the curvature of a nonlinear row */
106 SCIP_EXPORT
108  SCIP_NLROW* nlrow /**< NLP row */
109  );
110 
111 /** sets the curvature of a nonlinear row */
112 SCIP_EXPORT
114  SCIP_NLROW* nlrow, /**< NLP row */
115  SCIP_EXPRCURV curvature /**< curvature of NLP row */
116  );
117 
118 /** returns the name of a nonlinear row */
119 SCIP_EXPORT
120 const char* SCIPnlrowGetName(
121  SCIP_NLROW* nlrow /**< NLP row */
122  );
123 
124 /** gets position of a nonlinear row in current NLP, or -1 if not in NLP */
125 SCIP_EXPORT
127  SCIP_NLROW* nlrow /**< NLP row */
128  );
129 
130 /** returns TRUE iff row is member of current NLP */
131 SCIP_EXPORT
133  SCIP_NLROW* nlrow /**< NLP row */
134  );
135 
136 /** gets the dual NLP solution of a nlrow
137  *
138  * for a ranged constraint, the dual value is positive if the right hand side is active and negative if the left hand side is active
139  */
140 SCIP_EXPORT
142  SCIP_NLROW* nlrow /**< NLP row */
143  );
144 
145 #ifdef NDEBUG
146 /* If NDEBUG is defined, the function calls are overwritten by defines to reduce the number of function calls and
147  * speed up the algorithms.
148  */
149 #define SCIPnlrowGetConstant(nlrow) (nlrow)->constant
150 #define SCIPnlrowGetNLinearVars(nlrow) (nlrow)->nlinvars
151 #define SCIPnlrowGetLinearVars(nlrow) (nlrow)->linvars
152 #define SCIPnlrowGetLinearCoefs(nlrow) (nlrow)->lincoefs
153 #define SCIPnlrowGetExpr(nlrow) (nlrow)->expr
154 #define SCIPnlrowGetLhs(nlrow) (nlrow)->lhs
155 #define SCIPnlrowGetRhs(nlrow) (nlrow)->rhs
156 #define SCIPnlrowGetCurvature(nlrow) (nlrow)->curvature
157 #define SCIPnlrowSetCurvature(nlrow, curvature_) (nlrow)->curvature = curvature_
158 #define SCIPnlrowGetName(nlrow) (nlrow)->name
159 #define SCIPnlrowGetNLPPos(nlrow) (nlrow)->nlpindex
160 #define SCIPnlrowIsInNLP(nlrow) ((nlrow)->nlpindex != -1)
161 #define SCIPnlrowGetDualsol(nlrow) ((nlrow)->nlpiindex >= 0 ? (nlrow)->dualsol : 0.0)
162 #endif
163 
164 /**@} */
165 
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 #endif /* __SCIP_PUB_NLP_H__ */
type definitions for NLP management
SCIP_VAR ** SCIPnlrowGetLinearVars(SCIP_NLROW *nlrow)
Definition: nlp.c:1783
const char * SCIPnlrowGetName(SCIP_NLROW *nlrow)
Definition: nlp.c:1852
type definitions for global SCIP settings
SCIP_Real SCIPnlrowGetRhs(SCIP_NLROW *nlrow)
Definition: nlp.c:1823
datastructures for NLP management
int SCIPnlrowGetNLinearVars(SCIP_NLROW *nlrow)
Definition: nlp.c:1773
SCIP_EXPRCURV SCIPnlrowGetCurvature(SCIP_NLROW *nlrow)
Definition: nlp.c:1833
int SCIPnlrowGetNLPPos(SCIP_NLROW *nlrow)
Definition: nlp.c:1862
type definitions for problem statistics
SCIP_Bool SCIPnlrowIsInNLP(SCIP_NLROW *nlrow)
Definition: nlp.c:1872
SCIP_Real SCIPnlrowGetDualsol(SCIP_NLROW *nlrow)
Definition: nlp.c:1885
type definitions for problem variables
#define SCIP_Bool
Definition: def.h:93
SCIP_EXPRCURV
Definition: type_expr.h:57
type definitions for storing primal CIP solutions
SCIP_Real * SCIPnlrowGetLinearCoefs(SCIP_NLROW *nlrow)
Definition: nlp.c:1793
type and macro definitions related to algebraic expressions
#define SCIP_Real
Definition: def.h:186
type definitions for message output methods
common defines and data types used in all packages of SCIP
SCIP_Real SCIPnlrowGetConstant(SCIP_NLROW *nlrow)
Definition: nlp.c:1763
SCIP_Real SCIPnlrowGetLhs(SCIP_NLROW *nlrow)
Definition: nlp.c:1813
void SCIPnlrowSetCurvature(SCIP_NLROW *nlrow, SCIP_EXPRCURV curvature)
Definition: nlp.c:1842
SCIP_EXPR * SCIPnlrowGetExpr(SCIP_NLROW *nlrow)
Definition: nlp.c:1803
type definitions for NLP solver interfaces
memory allocation routines