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 */
59  SCIP_EXPRTREE* tree /**< expression tree */
60  );
61 
62 /** stores array of variables in expression tree */
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 */
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 */
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  */
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 */
105  SCIP_NLROW* nlrow /**< NLP row */
106  );
107 
108 /** gets number of variables of linear part */
111  SCIP_NLROW* nlrow /**< NLP row */
112  );
113 
114 /** gets array with variables of linear part */
117  SCIP_NLROW* nlrow /**< NLP row */
118  );
119 
120 /** gets array with coefficients in linear part */
123  SCIP_NLROW* nlrow /**< NLP row */
124  );
125 
126 /** gets number of quadratic variables in quadratic part */
129  SCIP_NLROW* nlrow /**< NLP row */
130  );
131 
132 /** gets quadratic variables in quadratic part */
135  SCIP_NLROW* nlrow /**< NLP row */
136  );
137 
138 /** gives position of variable in quadvars array of row, or -1 if not found */
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 */
148  SCIP_NLROW* nlrow /**< NLP row */
149  );
150 
151 /** gets quadratic elements in quadratic part */
154  SCIP_NLROW* nlrow /**< NLP row */
155  );
156 
157 /** gets array with coefficients in linear part */
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 */
170  SCIP_NLROW* nlrow /**< NLP row */
171  );
172 
173 /** returns the left hand side of a nonlinear row */
176  SCIP_NLROW* nlrow /**< NLP row */
177  );
178 
179 /** returns the right hand side of a nonlinear row */
182  SCIP_NLROW* nlrow /**< NLP row */
183  );
184 
185 /** returns the curvature of a nonlinear row */
188  SCIP_NLROW* nlrow /**< NLP row */
189  );
190 
191 /** sets the curvature of a nonlinear row */
194  SCIP_NLROW* nlrow, /**< NLP row */
195  SCIP_EXPRCURV curvature /**< curvature of NLP row */
196  );
197 
198 /** returns the name of a nonlinear row */
200 const char* SCIPnlrowGetName(
201  SCIP_NLROW* nlrow /**< NLP row */
202  );
203 
204 /** gets position of a nonlinear row in current NLP, or -1 if not in NLP */
207  SCIP_NLROW* nlrow /**< NLP row */
208  );
209 
210 /** returns TRUE iff row is member of current NLP */
213  SCIP_NLROW* nlrow /**< NLP row */
214  );
215 
216 /** gets the dual NLP solution of a nlrow
217  * 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
218  */
221  SCIP_NLROW* nlrow /**< NLP row */
222  );
223 
224 /**@} */
225 
226 /**@} */ /* PublicNLPMethods */
227 
228 #ifdef __cplusplus
229 }
230 #endif
231 
232 #endif /* __SCIP_PUB_NLP_H__ */
SCIP_EXPORT SCIP_EXPRTREE * SCIPnlrowGetExprtree(SCIP_NLROW *nlrow)
Definition: nlp.c:3364
type definitions for NLP management
#define SCIP_EXPORT
Definition: def.h:98
SCIP_EXPORT SCIP_Real SCIPnlrowGetDualsol(SCIP_NLROW *nlrow)
Definition: nlp.c:3445
SCIP_EXPORT int SCIPnlrowGetNLPPos(SCIP_NLROW *nlrow)
Definition: nlp.c:3423
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
type definitions for global SCIP settings
type definitions for problem statistics
SCIP_EXPORT int SCIPnlrowGetNQuadVars(SCIP_NLROW *nlrow)
Definition: nlp.c:3276
SCIP_EXPORT SCIP_RETCODE SCIPexprtreePrintWithNames(SCIP_EXPRTREE *tree, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: nlp.c:173
SCIP_EXPORT SCIP_Bool SCIPnlrowIsInNLP(SCIP_NLROW *nlrow)
Definition: nlp.c:3433
SCIP_EXPORT int SCIPnlrowGetNQuadElems(SCIP_NLROW *nlrow)
Definition: nlp.c:3323
SCIP_EXPORT int SCIPnlrowGetNLinearVars(SCIP_NLROW *nlrow)
Definition: nlp.c:3246
type definitions for problem variables
SCIP_EXPORT SCIP_QUADELEM * SCIPnlrowGetQuadElems(SCIP_NLROW *nlrow)
Definition: nlp.c:3333
SCIP_EXPORT SCIP_EXPRCURV SCIPnlrowGetCurvature(SCIP_NLROW *nlrow)
Definition: nlp.c:3394
SCIP_EXPORT SCIP_Real SCIPnlrowGetRhs(SCIP_NLROW *nlrow)
Definition: nlp.c:3384
#define SCIP_Bool
Definition: def.h:70
SCIP_EXPORT SCIP_RETCODE SCIPexprtreeSetVars(SCIP_EXPRTREE *tree, int nvars, SCIP_VAR **vars)
Definition: nlp.c:112
SCIP_EXPORT int SCIPnlrowSearchQuadVar(SCIP_NLROW *nlrow, SCIP_VAR *var)
Definition: nlp.c:3296
SCIP_EXPORT SCIP_VAR ** SCIPexprtreeGetVars(SCIP_EXPRTREE *tree)
Definition: nlp.c:102
SCIP_EXPORT SCIP_Real SCIPnlrowGetLhs(SCIP_NLROW *nlrow)
Definition: nlp.c:3374
SCIP_EXPORT SCIP_Real * SCIPnlrowGetLinearCoefs(SCIP_NLROW *nlrow)
Definition: nlp.c:3266
SCIP_EXPORT SCIP_RETCODE SCIPexprtreeAddVars(SCIP_EXPRTREE *tree, int nvars, SCIP_VAR **vars)
Definition: nlp.c:144
type definitions for storing primal CIP solutions
enum SCIP_ExprCurv SCIP_EXPRCURV
Definition: type_expr.h:95
SCIP_EXPORT void SCIPnlrowGetQuadData(SCIP_NLROW *nlrow, int *nquadvars, SCIP_VAR ***quadvars, int *nquadelems, SCIP_QUADELEM **quadelems)
Definition: nlp.c:3343
type definitions for expressions and expression trees
SCIP_EXPORT const char * SCIPnlrowGetName(SCIP_NLROW *nlrow)
Definition: nlp.c:3413
#define SCIP_Real
Definition: def.h:164
SCIP_EXPORT SCIP_VAR ** SCIPnlrowGetQuadVars(SCIP_NLROW *nlrow)
Definition: nlp.c:3286
type definitions for message output methods
SCIP_EXPORT SCIP_Real SCIPnlrowGetConstant(SCIP_NLROW *nlrow)
Definition: nlp.c:3236
SCIP_EXPORT SCIP_VAR ** SCIPnlrowGetLinearVars(SCIP_NLROW *nlrow)
Definition: nlp.c:3256
common defines and data types used in all packages of SCIP
SCIP_EXPORT void SCIPnlrowSetCurvature(SCIP_NLROW *nlrow, SCIP_EXPRCURV curvature)
Definition: nlp.c:3403
type definitions for specific NLP solver interfaces
SCIP_EXPORT int SCIPexprtreeFindVar(SCIP_EXPRTREE *tree, SCIP_VAR *var)
Definition: nlp.c:206
memory allocation routines