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 (C) 2002-2019 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 scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file pub_nlp.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for NLP management
19  * @author Thorsten Gellermann
20  * @author Stefan Vigerske
21  */
22 
23 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
24 
25 #ifndef __SCIP_PUB_NLP_H__
26 #define __SCIP_PUB_NLP_H__
27 
28 #include <stdio.h>
29 
30 #include "scip/def.h"
31 #include "scip/type_message.h"
32 #include "blockmemshell/memory.h"
33 #include "scip/type_set.h"
34 #include "scip/type_stat.h"
35 #include "scip/type_nlp.h"
36 #include "scip/type_var.h"
37 #include "scip/type_sol.h"
38 #include "nlpi/type_expr.h"
39 #include "nlpi/type_nlpi.h"
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 /**@addtogroup PublicNLPMethods
46  *
47  * @{
48  */
49 
50 
51 /**@addtogroup PublicExpressionTreeMethods
52  *
53  * @{
54  */
55 
56 /** returns variables of expression tree */
57 extern
59  SCIP_EXPRTREE* tree /**< expression tree */
60  );
61 
62 /** stores array of variables in expression tree */
63 extern
65  SCIP_EXPRTREE* tree, /**< expression tree */
66  int nvars, /**< number of variables */
67  SCIP_VAR** vars /**< variables */
68  );
69 
70 /** adds variables to the expression tree variables array */
71 extern
73  SCIP_EXPRTREE* tree, /**< expression tree */
74  int nvars, /**< number of variables */
75  SCIP_VAR** vars /**< variables */
76  );
77 
78 /** prints an expression tree using variable names from variables array */
79 extern
81  SCIP_EXPRTREE* tree, /**< expression tree */
82  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
83  FILE* file /**< file for printing, or NULL for stdout */
84  );
85 
86 /** searches the variables array of an expression tree for a variable and returns its position, or -1 if not found
87  * Note that this is an O(n) operation!
88  */
89 extern
91  SCIP_EXPRTREE* tree, /**< expression tree */
92  SCIP_VAR* var /**< variable to search for */
93  );
94 
95 /**@} */
96 
97 /**@addtogroup PublicNLRowMethods
98  *
99  * @{
100  */
101 
102 /** gets constant */
103 extern
105  SCIP_NLROW* nlrow /**< NLP row */
106  );
107 
108 /** gets number of variables of linear part */
109 extern
111  SCIP_NLROW* nlrow /**< NLP row */
112  );
113 
114 /** gets array with variables of linear part */
115 extern
117  SCIP_NLROW* nlrow /**< NLP row */
118  );
119 
120 /** gets array with coefficients in linear part */
121 extern
123  SCIP_NLROW* nlrow /**< NLP row */
124  );
125 
126 /** gets number of quadratic variables in quadratic part */
127 extern
129  SCIP_NLROW* nlrow /**< NLP row */
130  );
131 
132 /** gets quadratic variables in quadratic part */
133 extern
135  SCIP_NLROW* nlrow /**< NLP row */
136  );
137 
138 /** gives position of variable in quadvars array of row, or -1 if not found */
139 extern
141  SCIP_NLROW* nlrow, /**< nonlinear row */
142  SCIP_VAR* var /**< variable to search for */
143  );
144 
145 /** gets number of quadratic elements in quadratic part */
146 extern
148  SCIP_NLROW* nlrow /**< NLP row */
149  );
150 
151 /** gets quadratic elements in quadratic part */
152 extern
154  SCIP_NLROW* nlrow /**< NLP row */
155  );
156 
157 /** gets array with coefficients in linear part */
158 extern
160  SCIP_NLROW* nlrow, /**< NLP row */
161  int* nquadvars, /**< buffer to store number of variables in quadratic term, or NULL if not of interest */
162  SCIP_VAR*** quadvars, /**< buffer to store pointer to array of variables in quadratic term, or NULL if not of interest */
163  int* nquadelems, /**< buffer to store number of entries in quadratic term, or NULL if not of interest */
164  SCIP_QUADELEM** quadelems /**< buffer to store pointer to array of entries in quadratic term, or NULL if not of interest */
165  );
166 
167 /** gets expression tree */
168 extern
170  SCIP_NLROW* nlrow /**< NLP row */
171  );
172 
173 /** returns the left hand side of a nonlinear row */
174 extern
176  SCIP_NLROW* nlrow /**< NLP row */
177  );
178 
179 /** returns the right hand side of a nonlinear row */
180 extern
182  SCIP_NLROW* nlrow /**< NLP row */
183  );
184 
185 /** returns the curvature of a nonlinear row */
187  SCIP_NLROW* nlrow /**< NLP row */
188  );
189 
190 /** sets the curvature of a nonlinear row */
192  SCIP_NLROW* nlrow, /**< NLP row */
193  SCIP_EXPRCURV curvature /**< curvature of NLP row */
194  );
195 
196 /** returns the name of a nonlinear row */
197 extern
198 const char* SCIPnlrowGetName(
199  SCIP_NLROW* nlrow /**< NLP row */
200  );
201 
202 /** gets position of a nonlinear row in current NLP, or -1 if not in NLP */
203 extern
205  SCIP_NLROW* nlrow /**< NLP row */
206  );
207 
208 /** returns TRUE iff row is member of current NLP */
209 extern
211  SCIP_NLROW* nlrow /**< NLP row */
212  );
213 
214 /** gets the dual NLP solution of a nlrow
215  * 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
216  */
217 extern
219  SCIP_NLROW* nlrow /**< NLP row */
220  );
221 
222 /**@} */
223 
224 /**@} */ /* PublicNLPMethods */
225 
226 #ifdef __cplusplus
227 }
228 #endif
229 
230 #endif /* __SCIP_PUB_NLP_H__ */
int SCIPnlrowSearchQuadVar(SCIP_NLROW *nlrow, SCIP_VAR *var)
Definition: nlp.c:3296
type definitions for NLP management
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
type definitions for global SCIP settings
int SCIPnlrowGetNQuadVars(SCIP_NLROW *nlrow)
Definition: nlp.c:3276
SCIP_Real SCIPnlrowGetRhs(SCIP_NLROW *nlrow)
Definition: nlp.c:3384
int SCIPnlrowGetNLinearVars(SCIP_NLROW *nlrow)
Definition: nlp.c:3246
SCIP_RETCODE SCIPexprtreeSetVars(SCIP_EXPRTREE *tree, int nvars, SCIP_VAR **vars)
Definition: nlp.c:112
SCIP_EXPRCURV SCIPnlrowGetCurvature(SCIP_NLROW *nlrow)
Definition: nlp.c:3394
void SCIPnlrowGetQuadData(SCIP_NLROW *nlrow, int *nquadvars, SCIP_VAR ***quadvars, int *nquadelems, SCIP_QUADELEM **quadelems)
Definition: nlp.c:3343
int SCIPnlrowGetNLPPos(SCIP_NLROW *nlrow)
Definition: nlp.c:3423
SCIP_VAR ** SCIPexprtreeGetVars(SCIP_EXPRTREE *tree)
Definition: nlp.c:102
type definitions for problem statistics
int SCIPnlrowGetNQuadElems(SCIP_NLROW *nlrow)
Definition: nlp.c:3323
SCIP_RETCODE SCIPexprtreePrintWithNames(SCIP_EXPRTREE *tree, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: nlp.c:173
SCIP_Bool SCIPnlrowIsInNLP(SCIP_NLROW *nlrow)
Definition: nlp.c:3433
SCIP_VAR ** SCIPnlrowGetQuadVars(SCIP_NLROW *nlrow)
Definition: nlp.c:3286
SCIP_Real SCIPnlrowGetDualsol(SCIP_NLROW *nlrow)
Definition: nlp.c:3445
SCIP_QUADELEM * SCIPnlrowGetQuadElems(SCIP_NLROW *nlrow)
Definition: nlp.c:3333
type definitions for problem variables
#define SCIP_Bool
Definition: def.h:69
SCIP_RETCODE SCIPexprtreeAddVars(SCIP_EXPRTREE *tree, int nvars, SCIP_VAR **vars)
Definition: nlp.c:144
type definitions for storing primal CIP solutions
SCIP_EXPRTREE * SCIPnlrowGetExprtree(SCIP_NLROW *nlrow)
Definition: nlp.c:3364
enum SCIP_ExprCurv SCIP_EXPRCURV
Definition: type_expr.h:95
type definitions for expressions and expression trees
#define SCIP_Real
Definition: def.h:157
type definitions for message output methods
SCIP_Real * SCIPnlrowGetLinearCoefs(SCIP_NLROW *nlrow)
Definition: nlp.c:3266
const char * SCIPnlrowGetName(SCIP_NLROW *nlrow)
Definition: nlp.c:3413
int SCIPexprtreeFindVar(SCIP_EXPRTREE *tree, SCIP_VAR *var)
Definition: nlp.c:206
SCIP_VAR ** SCIPnlrowGetLinearVars(SCIP_NLROW *nlrow)
Definition: nlp.c:3256
common defines and data types used in all packages of SCIP
SCIP_Real SCIPnlrowGetConstant(SCIP_NLROW *nlrow)
Definition: nlp.c:3236
SCIP_Real SCIPnlrowGetLhs(SCIP_NLROW *nlrow)
Definition: nlp.c:3374
void SCIPnlrowSetCurvature(SCIP_NLROW *nlrow, SCIP_EXPRCURV curvature)
Definition: nlp.c:3403
type definitions for specific NLP solver interfaces
memory allocation routines