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-2014 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 email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file pub_nlp.h
17  * @ingroup PUBLICMETHODS
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 /**@name Expressions and Expression tree methods */
46 /**@{ */
47 
48 /** returns variables of expression tree */
49 extern
51  SCIP_EXPRTREE* tree /**< expression tree */
52 );
53 
54 /** stores array of variables in expression tree */
55 extern
57  SCIP_EXPRTREE* tree, /**< expression tree */
58  int nvars, /**< number of variables */
59  SCIP_VAR** vars /**< variables */
60 );
61 
62 /** adds variables to the expression tree variables array */
63 extern
65  SCIP_EXPRTREE* tree, /**< expression tree */
66  int nvars, /**< number of variables */
67  SCIP_VAR** vars /**< variables */
68 );
69 
70 /** prints an expression tree using variable names from variables array */
71 extern
73  SCIP_EXPRTREE* tree, /**< expression tree */
74  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
75  FILE* file /**< file for printing, or NULL for stdout */
76 );
77 
78 /** searches the variables array of an expression tree for a variable and returns its position, or -1 if not found
79  * Note that this is an O(n) operation!
80  */
81 extern
83  SCIP_EXPRTREE* tree, /**< expression tree */
84  SCIP_VAR* var /**< variable to search for */
85 );
86 
87 /**@} */
88 
89 /**@name Nonlinear row methods */
90 /**@{ */
91 
92 /** gets constant */
93 extern
95  SCIP_NLROW* nlrow /**< NLP row */
96  );
97 
98 /** gets number of variables of linear part */
99 extern
101  SCIP_NLROW* nlrow /**< NLP row */
102  );
103 
104 /** gets array with variables of linear part */
105 extern
107  SCIP_NLROW* nlrow /**< NLP row */
108  );
109 
110 /** gets array with coefficients in linear part */
111 extern
113  SCIP_NLROW* nlrow /**< NLP row */
114  );
115 
116 /** gets number of quadratic variables in quadratic part */
117 extern
119  SCIP_NLROW* nlrow /**< NLP row */
120  );
121 
122 /** gets quadratic variables in quadratic part */
123 extern
125  SCIP_NLROW* nlrow /**< NLP row */
126  );
127 
128 /** gives position of variable in quadvars array of row, or -1 if not found */
129 extern
131  SCIP_NLROW* nlrow, /**< nonlinear row */
132  SCIP_VAR* var /**< variable to search for */
133  );
134 
135 /** gets number of quadratic elements in quadratic part */
136 extern
138  SCIP_NLROW* nlrow /**< NLP row */
139  );
140 
141 /** gets quadratic elements in quadratic part */
142 extern
144  SCIP_NLROW* nlrow /**< NLP row */
145  );
146 
147 /** gets array with coefficients in linear part */
148 extern
150  SCIP_NLROW* nlrow, /**< NLP row */
151  int* nquadvars, /**< buffer to store number of variables in quadratic term, or NULL if not of interest */
152  SCIP_VAR*** quadvars, /**< buffer to store pointer to array of variables in quadratic term, or NULL if not of interest */
153  int* nquadelems, /**< buffer to store number of entries in quadratic term, or NULL if not of interest */
154  SCIP_QUADELEM** quadelems /**< buffer to store pointer to array of entries in quadratic term, or NULL if not of interest */
155  );
156 
157 /** gets expression tree */
158 extern
160  SCIP_NLROW* nlrow /**< NLP row */
161  );
162 
163 /** returns the left hand side of a nonlinear row */
164 extern
166  SCIP_NLROW* nlrow /**< NLP row */
167  );
168 
169 /** returns the right hand side of a nonlinear row */
170 extern
172  SCIP_NLROW* nlrow /**< NLP row */
173  );
174 
175 /** returns the name of a nonlinear row */
176 extern
177 const char* SCIPnlrowGetName(
178  SCIP_NLROW* nlrow /**< NLP row */
179  );
180 
181 /** gets position of a nonlinear row in current NLP, or -1 if not in NLP */
182 extern
184  SCIP_NLROW* nlrow /**< NLP row */
185  );
186 
187 /** returns TRUE iff row is member of current NLP */
188 extern
190  SCIP_NLROW* nlrow /**< NLP row */
191  );
192 
193 /** gets the dual NLP solution of a nlrow
194  * 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
195  */
196 extern
198  SCIP_NLROW* nlrow /**< NLP row */
199  );
200 
201 /**@} */
202 
203 #ifdef __cplusplus
204 }
205 #endif
206 
207 #endif /* __SCIP_PUB_NLP_H__ */
208