Scippy

SCIP

Solving Constraint Integer Programs

expr.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 expr.h
26  * @brief private functions to work with algebraic expressions
27  * @ingroup INTERNALAPI
28  * @author Ksenia Bestuzheva
29  * @author Benjamin Mueller
30  * @author Felipe Serrano
31  * @author Stefan Vigerske
32  */
33 
34 #ifndef SCIP_EXPR_H_
35 #define SCIP_EXPR_H_
36 
37 #include "scip/pub_expr.h"
38 #include "scip/type_set.h"
39 #include "scip/type_stat.h"
40 #include "scip/type_clock.h"
41 #include "scip/type_message.h"
42 #include "blockmemshell/memory.h"
43 
44 #ifdef NDEBUG
45 #include "scip/struct_expr.h"
46 #include "scip/struct_set.h"
47 #endif
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
53 /**@name Expression Handler Methods */
54 /**@{ */
55 
56 /** create expression handler */
58  BMS_BLKMEM* blkmem, /**< block memory */
59  SCIP_EXPRHDLR** exprhdlr, /**< buffer where to store created expression handler */
60  const char* name, /**< name of expression handler (must not be NULL) */
61  const char* desc, /**< description of expression handler (can be NULL) */
62  unsigned int precedence, /**< precedence of expression operation (used for printing) */
63  SCIP_DECL_EXPREVAL((*eval)), /**< point evaluation callback (must not be NULL) */
64  SCIP_EXPRHDLRDATA* data /**< data of expression handler (can be NULL) */
65  );
66 
67 /** frees expression handler */
69  SCIP_EXPRHDLR** exprhdlr, /**< pointer to expression handler to be freed */
70  SCIP_SET* set, /**< global SCIP settings */
71  BMS_BLKMEM* blkmem /**< block memory */
72  );
73 
74 /** copies the given expression handler to a new scip */
76  SCIP_EXPRHDLR* exprhdlr, /**< expression handler */
77  SCIP_SET* targetset /**< SCIP_SET of SCIP to copy to */
78  );
79 
80 /** initialization of expression handler (resets statistics) */
81 void SCIPexprhdlrInit(
82  SCIP_EXPRHDLR* exprhdlr, /**< expression handler */
83  SCIP_SET* set /**< global SCIP settings */
84  );
85 
86 /** calls the print callback of an expression handler
87  *
88  * The method prints an expression.
89  * It is called while iterating over the expression graph at different stages.
90  *
91  * @see SCIP_DECL_EXPRPRINT
92  */
94  SCIP_EXPRHDLR* exprhdlr, /**< expression handler */
95  SCIP_SET* set, /**< global SCIP settings */
96  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
97  SCIP_EXPR* expr, /**< expression */
98  SCIP_EXPRITER_STAGE stage, /**< stage of expression iteration */
99  int currentchild, /**< index of current child if in stage visitingchild or visitedchild */
100  unsigned int parentprecedence, /**< precedence of parent */
101  FILE* file /**< the file to print to */
102  );
103 
104 /** calls the parse callback of an expression handler
105  *
106  * The method parses an expression.
107  * It should be called when parsing an expression and an operator with the expr handler name is found.
108  *
109  * @see SCIP_DECL_EXPRPARSE
110  */
112  SCIP_EXPRHDLR* exprhdlr, /**< expression handler */
113  SCIP_SET* set, /**< global SCIP settings */
114  const char* string, /**< string containing expression to be parse */
115  const char** endstring, /**< buffer to store the position of string after parsing */
116  SCIP_EXPR** expr, /**< buffer to store the parsed expression */
117  SCIP_Bool* success, /**< buffer to store whether the parsing was successful or not */
118  SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), /**< function to call on expression copy to create ownerdata */
119  void* ownercreatedata /**< data to pass to ownercreate */
120  );
121 
122 /** calls the curvature check callback of an expression handler
123  *
124  * @see SCIP_DECL_EXPRCURVATURE
125  */
126 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPcallExprCurvature() macro */
128  SCIP_EXPRHDLR* exprhdlr, /**< expression handler */
129  SCIP_SET* set, /**< global SCIP settings */
130  SCIP_EXPR* expr, /**< expression to check the curvature for */
131  SCIP_EXPRCURV exprcurvature, /**< desired curvature of this expression */
132  SCIP_Bool* success, /**< buffer to store whether the desired curvature be obtained */
133  SCIP_EXPRCURV* childcurv /**< array to store required curvature for each child */
134  );
135 
136 /** calls the monotonicity check callback of an expression handler
137  *
138  * @see SCIP_DECL_EXPRMONOTONICITY
139  */
140 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPcallExprMonotonicity() macro */
142  SCIP_EXPRHDLR* exprhdlr, /**< expression handler */
143  SCIP_SET* set, /**< global SCIP settings */
144  SCIP_EXPR* expr, /**< expression to check the monotonicity for */
145  int childidx, /**< index of the considered child expression */
146  SCIP_MONOTONE* result /**< buffer to store the monotonicity */
147  );
148 
149 /** calls the integrality check callback of an expression handler
150  *
151  * @see SCIP_DECL_EXPRINTEGRALITY
152  */
154  SCIP_EXPRHDLR* exprhdlr, /**< expression handler */
155  SCIP_SET* set, /**< global SCIP settings */
156  SCIP_EXPR* expr, /**< expression to check integrality for */
157  SCIP_Bool* isintegral /**< buffer to store whether expression is integral */
158  );
159 
160 /** calls the hash callback of an expression handler
161  *
162  * The method hashes an expression by taking the hashes of its children into account.
163  *
164  * @see SCIP_DECL_EXPRHASH
165  */
167  SCIP_EXPRHDLR* exprhdlr, /**< expression handler */
168  SCIP_SET* set, /**< global SCIP settings */
169  SCIP_EXPR* expr, /**< expression to be hashed */
170  unsigned int* hashkey, /**< buffer to store the hash value */
171  unsigned int* childrenhashes /**< array with hash values of children */
172  );
173 
174 /** calls the compare callback of an expression handler
175  *
176  * The method receives two expressions, expr1 and expr2, and returns
177  * - -1 if expr1 < expr2,
178  * - 0 if expr1 = expr2,
179  * - 1 if expr1 > expr2.
180  *
181  * @see SCIP_DECL_EXPRCOMPARE
182  */
184  SCIP_SET* set, /**< global SCIP settings */
185  SCIP_EXPR* expr1, /**< first expression in comparison */
186  SCIP_EXPR* expr2 /**< second expression in comparison */
187  );
188 
189 /** calls the evaluation callback of an expression handler
190  *
191  * The method evaluates an expression by taking the values of its children into account.
192  *
193  * Further, allows to evaluate w.r.t. given expression and children values instead of those stored in children expressions.
194  *
195  * @see SCIP_DECL_EXPREVAL
196  */
197 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPcallExprEval() macro */
199  SCIP_EXPRHDLR* exprhdlr, /**< expression handler */
200  SCIP_SET* set, /**< global SCIP settings */
201  BMS_BUFMEM* bufmem, /**< buffer memory, can be NULL if childrenvals is NULL */
202  SCIP_EXPR* expr, /**< expression to be evaluated */
203  SCIP_Real* val, /**< buffer to store value of expression */
204  SCIP_Real* childrenvals, /**< values for children, or NULL if values stored in children should be used */
205  SCIP_SOL* sol /**< solution that is evaluated (can be NULL) */
206  );
207 
208 /** calls the backward derivative evaluation callback of an expression handler
209  *
210  * The method should compute the partial derivative of expr w.r.t its child at childidx.
211  * That is, it returns
212  * \f[
213  * \frac{\partial \text{expr}}{\partial \text{child}_{\text{childidx}}}
214  * \f]
215  *
216  * Further, allows to differentiate w.r.t. given expression and children values instead of those stored in children expressions.
217  *
218  * @see SCIP_DECL_EXPRBWDIFF
219  */
221  SCIP_EXPRHDLR* exprhdlr, /**< expression handler */
222  SCIP_SET* set, /**< global SCIP settings */
223  BMS_BUFMEM* bufmem, /**< buffer memory, can be NULL if childrenvals is NULL */
224  SCIP_EXPR* expr, /**< expression to be differentiated */
225  int childidx, /**< index of the child */
226  SCIP_Real* derivative, /**< buffer to store the partial derivative w.r.t. the i-th children */
227  SCIP_Real* childrenvals, /**< values for children, or NULL if values stored in children should be used */
228  SCIP_Real exprval /**< value for expression, used only if childrenvals is not NULL */
229  );
230 
231 /** calls the forward differentiation callback of an expression handler
232  *
233  * @see SCIP_DECL_EXPRFWDIFF
234  */
236  SCIP_EXPRHDLR* exprhdlr, /**< expression handler */
237  SCIP_SET* set, /**< global SCIP settings */
238  SCIP_EXPR* expr, /**< expression to be differentiated */
239  SCIP_Real* dot, /**< buffer to store derivative value */
240  SCIP_SOL* direction /**< direction of the derivative (useful only for var expressions) */
241  );
242 
243 /** calls the evaluation and forward-differentiation callback of an expression handler
244  *
245  * The method evaluates an expression by taking the values of its children into account.
246  * The method differentiates an expression by taking the values and directional derivatives of its children into account.
247  *
248  * Further, allows to evaluate and differentiate w.r.t. given values for children instead of those stored in children expressions.
249  *
250  * It probably doesn't make sense to call this function for a variable-expression if sol and/or direction are not given.
251  *
252  * @see SCIP_DECL_EXPREVAL
253  * @see SCIP_DECL_EXPRFWDIFF
254  */
255 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPcallExprEvalFwdiff() macro */
257  SCIP_EXPRHDLR* exprhdlr, /**< expression handler */
258  SCIP_SET* set, /**< global SCIP settings */
259  BMS_BUFMEM* bufmem, /**< buffer memory, can be NULL if childrenvals is NULL */
260  SCIP_EXPR* expr, /**< expression to be evaluated */
261  SCIP_Real* val, /**< buffer to store value of expression */
262  SCIP_Real* dot, /**< buffer to store derivative value */
263  SCIP_Real* childrenvals, /**< values for children, or NULL if values stored in children should be used */
264  SCIP_SOL* sol, /**< solution that is evaluated (can be NULL) */
265  SCIP_Real* childrendirs, /**< directional derivatives for children, or NULL if dot-values stored in children should be used */
266  SCIP_SOL* direction /**< direction of the derivative (useful only for var expressions, can be NULL if childrendirs is given) */
267  );
268 
269 /** calls the evaluation callback for Hessian directions (backward over forward) of an expression handler
270  *
271  * @see SCIP_DECL_EXPRBWFWDIFF
272  */
274  SCIP_EXPRHDLR* exprhdlr, /**< expression handler */
275  SCIP_SET* set, /**< global SCIP settings */
276  SCIP_EXPR* expr, /**< expression to be differentiated */
277  int childidx, /**< index of the child */
278  SCIP_Real* bardot, /**< buffer to store derivative value */
279  SCIP_SOL* direction /**< direction of the derivative (useful only for var expressions) */
280  );
281 
282 /** calls the interval evaluation callback of an expression handler
283  *
284  * @see SCIP_DECL_EXPRINTEVAL
285  */
286 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPcallExprInteval() macro */
288  SCIP_EXPRHDLR* exprhdlr, /**< expression handler */
289  SCIP_SET* set, /**< global SCIP settings */
290  SCIP_EXPR* expr, /**< expression to be evaluated */
291  SCIP_INTERVAL* interval, /**< buffer where to store interval */
292  SCIP_DECL_EXPR_INTEVALVAR((*intevalvar)), /**< callback to be called when interval-evaluating a variable */
293  void* intevalvardata /**< data to be passed to intevalvar callback */
294  );
295 
296 /** calls the estimator callback of an expression handler
297  *
298  * @see SCIP_DECL_EXPRESTIMATE
299  */
300 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPcallExprEstimate() macro */
302  SCIP_EXPRHDLR* exprhdlr, /**< expression handler */
303  SCIP_SET* set, /**< global SCIP settings */
304  SCIP_EXPR* expr, /**< expression to be estimated */
305  SCIP_INTERVAL* localbounds, /**< current bounds for children */
306  SCIP_INTERVAL* globalbounds, /**< global bounds for children */
307  SCIP_Real* refpoint, /**< children values for the reference point where to estimate */
308  SCIP_Bool overestimate, /**< whether the expression needs to be over- or underestimated */
309  SCIP_Real targetvalue, /**< a value that the estimator shall exceed, can be +/-infinity */
310  SCIP_Real* coefs, /**< array to store coefficients of estimator */
311  SCIP_Real* constant, /**< buffer to store constant part of estimator */
312  SCIP_Bool* islocal, /**< buffer to store whether estimator is valid locally only */
313  SCIP_Bool* success, /**< buffer to indicate whether an estimator could be computed */
314  SCIP_Bool* branchcand /**< array to indicate which children (not) to consider for branching */
315  );
316 
317 /** calls the intitial estimators callback of an expression handler
318  *
319  * @see SCIP_DECL_EXPRINITESTIMATES
320  */
321 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPcallExprInitestimates() macro */
323  SCIP_EXPRHDLR* exprhdlr, /**< expression handler */
324  SCIP_SET* set, /**< global SCIP settings */
325  SCIP_EXPR* expr, /**< expression to be estimated */
326  SCIP_INTERVAL* bounds, /**< bounds for children */
327  SCIP_Bool overestimate, /**< whether the expression shall be overestimated or underestimated */
328  SCIP_Real* coefs[SCIP_EXPR_MAXINITESTIMATES], /**< buffer to store coefficients of computed estimators */
329  SCIP_Real constant[SCIP_EXPR_MAXINITESTIMATES], /**< buffer to store constant of computed estimators */
330  int* nreturned /**< buffer to store number of estimators that have been computed */
331  );
332 
333 /** calls the simplification callback of an expression handler
334  *
335  * @see SCIP_DECL_EXPRSIMPLIFY
336  */
337 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPsimplifyExpr() and SCIPexprSimplify() macros */
339  SCIP_EXPRHDLR* exprhdlr, /**< expression handler */
340  SCIP_SET* set, /**< global SCIP settings */
341  SCIP_EXPR* expr, /**< expression to simplify */
342  SCIP_EXPR** simplifiedexpr, /**< buffer to store the simplified expression */
343  SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), /**< function to call on expression copy to create ownerdata */
344  void* ownercreatedata /**< data to pass to ownercreate */
345  );
346 
347 /** calls the reverse propagation callback of an expression handler
348  *
349  * The method propagates given bounds over the children of an expression.
350  *
351  * @see SCIP_DECL_EXPRREVERSEPROP
352  */
353 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPcallExprReverseprop() macro */
355  SCIP_EXPRHDLR* exprhdlr, /**< expression handler */
356  SCIP_SET* set, /**< global SCIP settings */
357  SCIP_EXPR* expr, /**< expression to propagate */
358  SCIP_INTERVAL bounds, /**< the bounds on the expression that should be propagated */
359  SCIP_INTERVAL* childrenbounds, /**< array to store computed bounds for children, initialized with current activity */
360  SCIP_Bool* infeasible /**< buffer to store whether a children bounds were propagated to an empty interval */
361  );
362 
363 /**@} */
364 
365 
366 /**@name Expression Methods */
367 /**@{ */
368 
369 /** creates and captures an expression with given expression data and children */
371  SCIP_SET* set, /**< global SCIP settings */
372  BMS_BLKMEM* blkmem, /**< block memory */
373  SCIP_EXPR** expr, /**< pointer where to store expression */
374  SCIP_EXPRHDLR* exprhdlr, /**< expression handler */
375  SCIP_EXPRDATA* exprdata, /**< expression data (expression assumes ownership) */
376  int nchildren, /**< number of children */
377  SCIP_EXPR** children, /**< children (can be NULL if nchildren is 0) */
378  SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), /**< function to call to create ownerdata */
379  void* ownercreatedata /**< data to pass to ownercreate */
380  );
381 
382 /** appends child to the children list of expr */
383 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPappendExprChild() macro */
385  SCIP_SET* set, /**< global SCIP settings */
386  BMS_BLKMEM* blkmem, /**< block memory */
387  SCIP_EXPR* expr, /**< expression */
388  SCIP_EXPR* child /**< expression to be appended */
389  );
390 
391 /** overwrites/replaces a child of an expressions
392  *
393  * @note the old child is released and the newchild is captured, unless they are the same (=same pointer)
394  */
395 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPreplaceExprChild() macro */
397  SCIP_SET* set, /**< global SCIP settings */
398  SCIP_STAT* stat, /**< dynamic problem statistics */
399  BMS_BLKMEM* blkmem, /**< block memory */
400  SCIP_EXPR* expr, /**< expression where a child is going to be replaced */
401  int childidx, /**< index of child being replaced */
402  SCIP_EXPR* newchild /**< the new child */
403  );
404 
405 /** remove all children of expr */
406 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPremoveExprChildren() macro */
408  SCIP_SET* set, /**< global SCIP settings */
409  SCIP_STAT* stat, /**< dynamic problem statistics */
410  BMS_BLKMEM* blkmem, /**< block memory */
411  SCIP_EXPR* expr /**< expression */
412  );
413 
414 /** copies an expression including subexpressions
415  *
416  * @note If copying fails due to an expression handler not being available in the targetscip, then *targetexpr will be set to NULL.
417  *
418  * For all or some expressions, a mapping to an existing expression can be specified via the mapexpr callback.
419  * The mapped expression (including its children) will not be copied in this case and its ownerdata will not be touched.
420  * If, however, the mapexpr callback returns NULL for the targetexpr, then the expr will be copied in the usual way.
421  */
422 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPduplicateExpr() macro */
424  SCIP_SET* set, /**< global SCIP settings */
425  SCIP_STAT* stat, /**< dynamic problem statistics */
426  BMS_BLKMEM* blkmem, /**< block memory */
427  SCIP_SET* targetset, /**< global SCIP settings data structure where target expression will live */
428  SCIP_STAT* targetstat, /**< dynamic problem statistics in target SCIP */
429  BMS_BLKMEM* targetblkmem, /**< block memory in target SCIP */
430  SCIP_EXPR* sourceexpr, /**< expression to be copied */
431  SCIP_EXPR** targetexpr, /**< buffer to store pointer to copy of source expression */
432  SCIP_DECL_EXPR_MAPEXPR((*mapexpr)), /**< expression mapping function, or NULL for creating new expressions */
433  void* mapexprdata, /**< data of expression mapping function */
434  SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), /**< function to call on expression copy to create ownerdata */
435  void* ownercreatedata /**< data to pass to ownercreate */
436  );
437 
438 /** duplicates the given expression without its children */
439 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPduplicateExprShallow() macro */
441  SCIP_SET* set, /**< global SCIP settings */
442  BMS_BLKMEM* blkmem, /**< block memory */
443  SCIP_EXPR* expr, /**< original expression */
444  SCIP_EXPR** copyexpr, /**< buffer to store (shallow) duplicate of expr */
445  SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), /**< function to call on expression copy to create ownerdata */
446  void* ownercreatedata /**< data to pass to ownercreate */
447  );
448 
449 /** captures an expression (increments usage count) */
450 void SCIPexprCapture(
451  SCIP_EXPR* expr /**< expression */
452  );
453 
454 /** releases an expression (decrements usage count and possibly frees expression) */
455 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPreleaseExpr() macro */
457  SCIP_SET* set, /**< global SCIP settings */
458  SCIP_STAT* stat, /**< dynamic problem statistics */
459  BMS_BLKMEM* blkmem, /**< block memory */
460  SCIP_EXPR** expr /**< pointer to expression */
461  );
462 
463 /** returns whether an expression is a variable expression */
465  SCIP_SET* set, /**< global SCIP settings */
466  SCIP_EXPR* expr /**< expression */
467  );
468 
469 /** returns whether an expression is a value expression */
471  SCIP_SET* set, /**< global SCIP settings */
472  SCIP_EXPR* expr /**< expression */
473  );
474 
475 /** returns whether an expression is a sum expression */
477  SCIP_SET* set, /**< global SCIP settings */
478  SCIP_EXPR* expr /**< expression */
479  );
480 
481 /** returns whether an expression is a product expression */
483  SCIP_SET* set, /**< global SCIP settings */
484  SCIP_EXPR* expr /**< expression */
485  );
486 
487 /** returns whether an expression is a power expression */
489  SCIP_SET* set, /**< global SCIP settings */
490  SCIP_EXPR* expr /**< expression */
491  );
492 
493 /** print an expression as info-message */
494 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPprintExpr() macro */
496  SCIP_SET* set, /**< global SCIP settings */
497  SCIP_STAT* stat, /**< dynamic problem statistics */
498  BMS_BLKMEM* blkmem, /**< block memory */
499  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
500  FILE* file, /**< file to print to, or NULL for stdout */
501  SCIP_EXPR* expr /**< expression to be printed */
502  );
503 
504 /** initializes printing of expressions in dot format to a give FILE* pointer */
506  SCIP_SET* set, /**< global SCIP settings */
507  SCIP_STAT* stat, /**< dynamic problem statistics */
508  BMS_BLKMEM* blkmem, /**< block memory */
509  SCIP_EXPRPRINTDATA** printdata, /**< buffer to store dot printing data */
510  FILE* file, /**< file to print to, or NULL for stdout */
511  SCIP_EXPRPRINT_WHAT whattoprint /**< info on what to print for each expression */
512  );
513 
514 /** initializes printing of expressions in dot format to a file with given filename */
516  SCIP_SET* set, /**< global SCIP settings */
517  SCIP_STAT* stat, /**< dynamic problem statistics */
518  BMS_BLKMEM* blkmem, /**< block memory */
519  SCIP_EXPRPRINTDATA** printdata, /**< buffer to store dot printing data */
520  const char* filename, /**< name of file to print to */
521  SCIP_EXPRPRINT_WHAT whattoprint /**< info on what to print for each expression */
522  );
523 
524 /** main part of printing an expression in dot format */
526  SCIP_SET* set, /**< global SCIP settings */
527  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
528  SCIP_EXPRPRINTDATA* printdata, /**< data as initialized by \ref SCIPprintExprDotInit() */
529  SCIP_EXPR* expr /**< expression to be printed */
530  );
531 
532 /** finishes printing of expressions in dot format */
534  SCIP_SET* set, /**< global SCIP settings */
535  SCIP_STAT* stat, /**< dynamic problem statistics */
536  BMS_BLKMEM* blkmem, /**< block memory */
537  SCIP_EXPRPRINTDATA** printdata /**< buffer where dot printing data has been stored */
538  );
539 
540 /** prints structure of an expression a la Maple's dismantle */
542  SCIP_SET* set, /**< global SCIP settings */
543  SCIP_STAT* stat, /**< dynamic problem statistics */
544  BMS_BLKMEM* blkmem, /**< block memory */
545  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
546  FILE* file, /**< file to print to, or NULL for stdout */
547  SCIP_EXPR* expr /**< expression to dismantle */
548  );
549 
550 /** evaluate an expression in a point
551  *
552  * Iterates over expressions to also evaluate children, if necessary.
553  * Value can be received via SCIPexprGetEvalValue().
554  * If an evaluation error (division by zero, ...) occurs, this value will
555  * be set to SCIP_INVALID.
556  *
557  * If a nonzero \p soltag is passed, then only (sub)expressions are
558  * reevaluated that have a different solution tag. If a soltag of 0
559  * is passed, then subexpressions are always reevaluated.
560  * The tag is stored together with the value and can be received via
561  * SCIPexprGetEvalTag().
562  */
563 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPevalExpr() macro */
565  SCIP_SET* set, /**< global SCIP settings */
566  SCIP_STAT* stat, /**< dynamic problem statistics */
567  BMS_BLKMEM* blkmem, /**< block memory */
568  SCIP_EXPR* expr, /**< expression to be evaluated */
569  SCIP_SOL* sol, /**< solution to be evaluated */
570  SCIP_Longint soltag /**< tag that uniquely identifies the solution (with its values), or 0. */
571  );
572 
573 /** evaluates gradient of an expression for a given point
574  *
575  * Initiates an expression walk to also evaluate children, if necessary.
576  * Value can be received via SCIPgetExprPartialDiffNonlinear().
577  * If an error (division by zero, ...) occurs, this value will
578  * be set to SCIP_INVALID.
579  */
580 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPevalExprGradient() macro */
582  SCIP_SET* set, /**< global SCIP settings */
583  SCIP_STAT* stat, /**< dynamic problem statistics */
584  BMS_BLKMEM* blkmem, /**< block memory */
585  SCIP_EXPR* rootexpr, /**< expression to be evaluated */
586  SCIP_SOL* sol, /**< solution to be evaluated (NULL for the current LP solution) */
587  SCIP_Longint soltag /**< tag that uniquely identifies the solution (with its values), or 0. */
588  );
589 
590 /** evaluates Hessian-vector product of an expression for a given point and direction
591  *
592  * Evaluates children, if necessary.
593  * Value can be received via SCIPgetExprPartialDiffGradientDirNonlinear()
594  * If an error (division by zero, ...) occurs, this value will
595  * be set to SCIP_INVALID.
596  */
597 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPevalExprHessianDir() macro */
599  SCIP_SET* set, /**< global SCIP settings */
600  SCIP_STAT* stat, /**< dynamic problem statistics */
601  BMS_BLKMEM* blkmem, /**< block memory */
602  SCIP_EXPR* rootexpr, /**< expression to be evaluated */
603  SCIP_SOL* sol, /**< solution to be evaluated (NULL for the current LP solution) */
604  SCIP_Longint soltag, /**< tag that uniquely identifies the solution (with its values), or 0. */
605  SCIP_SOL* direction /**< direction */
606  );
607 
608 /** possibly reevaluates and then returns the activity of the expression
609  *
610  * Reevaluate activity if currently stored is no longer uptodate.
611  * If the expr owner provided a evalactivity-callback, then call this.
612  * Otherwise, loop over descendants and compare activitytag with stat's domchgcount, i.e.,
613  * whether some bound was changed since last evaluation, to check whether exprhdlrs INTEVAL should be called.
614  *
615  * @note If expression is set to be integral, then activities are tightened to integral values.
616  * Thus, ensure that the integrality information is valid (if set to TRUE; the default (FALSE) is always ok).
617  */
618 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPevalExprActivity() macro */
620  SCIP_SET* set, /**< global SCIP settings */
621  SCIP_STAT* stat, /**< dynamic problem statistics */
622  BMS_BLKMEM* blkmem, /**< block memory */
623  SCIP_EXPR* rootexpr /**< expression */
624  );
625 
626 /** compare expressions
627  *
628  * @return -1, 0 or 1 if expr1 <, =, > expr2, respectively
629  * @note The given expressions are assumed to be simplified.
630  */
631 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPcompareExpr() macro */
632 int SCIPexprCompare(
633  SCIP_SET* set, /**< global SCIP settings */
634  SCIP_EXPR* expr1, /**< first expression */
635  SCIP_EXPR* expr2 /**< second expression */
636  );
637 
638 /** simplifies an expression
639  *
640  * @see SCIPsimplifyExpr
641  */
642 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPsimplifyExpr() macro */
644  SCIP_SET* set, /**< global SCIP settings */
645  SCIP_STAT* stat, /**< dynamic problem statistics */
646  BMS_BLKMEM* blkmem, /**< block memory */
647  SCIP_EXPR* rootexpr, /**< expression to be simplified */
648  SCIP_EXPR** simplified, /**< buffer to store simplified expression */
649  SCIP_Bool* changed, /**< buffer to store if rootexpr actually changed */
650  SCIP_Bool* infeasible, /**< buffer to store whether infeasibility has been detected */
651  SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), /**< function to call to create ownerdata */
652  void* ownercreatedata /**< data to pass to ownercreate */
653  );
654 
655 
656 /** retrieves symmetry information from an expression
657  *
658  * @see SCIPgetSymDataExpr
659  */
660 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPgetSymdataExpr() macro */
662  SCIP_SET* set, /**< global SCIP settings */
663  SCIP_EXPR* expr, /**< expression from which information is retrieved */
664  SYM_EXPRDATA** symdata /**< buffer to store symmetry information */
665  );
666 
667 #ifdef NDEBUG
668 #define SCIPexprCapture(expr) ++(expr)->nuses
669 #define SCIPexprIsVar(set, expr) ((expr)->exprhdlr == (set)->exprhdlrvar)
670 #define SCIPexprIsValue(set, expr) ((expr)->exprhdlr == (set)->exprhdlrval)
671 #define SCIPexprIsSum(set, expr) ((expr)->exprhdlr == (set)->exprhdlrsum)
672 #define SCIPexprIsProduct(set, expr) ((expr)->exprhdlr == (set)->exprhdlrproduct)
673 #define SCIPexprIsPower(set, expr) ((expr)->exprhdlr == (set)->exprhdlrpow)
674 #endif
675 
676 /**@} */
677 
678 /**@name Expression Iterator Methods */
679 /**@{ */
680 
681 /** creates an expression iterator */
682 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPcreateExpriter() macro */
684  SCIP_STAT* stat, /**< dynamic problem statistics */
685  BMS_BLKMEM* blkmem, /**< block memory */
686  SCIP_EXPRITER** iterator /**< buffer to store expression iterator */
687  );
688 
689 /** frees an expression iterator */
690 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPfreeExpriter() macro */
691 void SCIPexpriterFree(
692  SCIP_EXPRITER** iterator /**< pointer to the expression iterator */
693  );
694 
695 /**@} */
696 
697 
698 /**@name Quadratic expression functions */
699 /**@{ */
700 
701 /** checks whether an expression is quadratic
702  *
703  * An expression is quadratic if it is either a power expression with exponent 2.0, a product of two expressions,
704  * or a sum of terms where at least one is a square or a product of two.
705  *
706  * Use \ref SCIPexprGetQuadraticData to get data about the representation as quadratic.
707  */
708 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPcheckExprQuadratic() macro */
710  SCIP_SET* set, /**< global SCIP settings */
711  BMS_BLKMEM* blkmem, /**< block memory */
712  SCIP_EXPR* expr, /**< expression */
713  SCIP_Bool* isquadratic /**< buffer to store result */
714  );
715 
716 /** frees information on quadratic representation of an expression
717  *
718  * Reverts SCIPexprCheckQuadratic().
719  * Before doing changes to an expression, it can be useful to call this function.
720  */
721 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPfreeExprQuadratic() macro */
723  BMS_BLKMEM* blkmem, /**< block memory */
724  SCIP_EXPR* expr /**< expression */
725  );
726 
727 /** Checks the curvature of the quadratic function stored in quaddata
728  *
729  * For this, it builds the matrix Q of quadratic coefficients and computes its eigenvalues using LAPACK.
730  * If Q is
731  * - semidefinite positive -> curv is set to convex,
732  * - semidefinite negative -> curv is set to concave,
733  * - otherwise -> curv is set to unknown.
734  *
735  * If `assumevarfixed` is given and some expressions in quadratic terms correspond to variables present in
736  * this hashmap, then the corresponding rows and columns are ignored in the matrix Q.
737  */
738 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPcomputeExprQuadraticCurvature() macro */
740  SCIP_SET* set, /**< global SCIP settings */
741  BMS_BLKMEM* blkmem, /**< block memory */
742  BMS_BUFMEM* bufmem, /**< buffer memory */
743  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
744  SCIP_EXPR* expr, /**< quadratic expression */
745  SCIP_EXPRCURV* curv, /**< pointer to store the curvature of quadratics */
746  SCIP_HASHMAP* assumevarfixed, /**< hashmap containing variables that should be assumed to be fixed, or NULL */
747  SCIP_Bool storeeigeninfo /**< whether the eigenvalues and eigenvectors should be stored */
748  );
749 
750 /**@} */
751 
752 /**@name Monomial expression functions */
753 /**@{ */
754 
755 /** returns a monomial representation of a product expression
756  *
757  * The array to store all factor expressions needs to be of size the number of
758  * children in the expression which is given by SCIPexprGetNChildren().
759  *
760  * Given a non-trivial monomial expression, the function finds its representation as \f$cx^\alpha\f$, where
761  * \f$c\f$ is a real coefficient, \f$x\f$ is a vector of auxiliary or original variables (where some entries can
762  * be NULL is the auxiliary variable has not been created yet), and \f$\alpha\f$ is a real vector of exponents.
763  *
764  * A non-trivial monomial is a product of a least two expressions.
765  */
766 SCIP_EXPORT /* need SCIP_EXPORT here, because func is exposed in API via SCIPgetExprMonomialData() macro */
768  SCIP_SET* set, /**< global SCIP settings */
769  BMS_BLKMEM* blkmem, /**< block memory */
770  SCIP_EXPR* expr, /**< expression */
771  SCIP_Real* coef, /**< coefficient \f$c\f$ */
772  SCIP_Real* exponents, /**< exponents \f$\alpha\f$ */
773  SCIP_EXPR** exprs /**< expressions \f$x\f$ */
774  );
775 
776 /**@} */
777 
778 #ifdef __cplusplus
779 }
780 #endif
781 
782 #endif /* SCIP_EXPR_H_ */
SCIP_Bool SCIPexprIsPower(SCIP_SET *set, SCIP_EXPR *expr)
Definition: expr.c:2254
SCIP_RETCODE SCIPexprhdlrBwFwDiffExpr(SCIP_EXPRHDLR *exprhdlr, SCIP_SET *set, SCIP_EXPR *expr, int childidx, SCIP_Real *bardot, SCIP_SOL *direction)
Definition: expr.c:1489
static SCIP_RETCODE eval(SCIP *scip, SCIP_EXPR *expr, SCIP_EXPRINTDATA *exprintdata, const vector< Type > &x, Type &val)
SCIP_RETCODE SCIPexprEvalGradient(SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_EXPR *rootexpr, SCIP_SOL *sol, SCIP_Longint soltag)
Definition: expr.c:2745
SCIP_RETCODE SCIPexprGetMonomialData(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_EXPR *expr, SCIP_Real *coef, SCIP_Real *exponents, SCIP_EXPR **exprs)
Definition: expr.c:4255
#define SCIP_DECL_EXPREVAL(x)
Definition: type_expr.h:426
SCIP_MONOTONE
Definition: type_expr.h:69
#define SCIP_DECL_EXPR_INTEVALVAR(x)
Definition: type_expr.h:163
SCIP_RETCODE SCIPexprCopy(SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_SET *targetset, SCIP_STAT *targetstat, BMS_BLKMEM *targetblkmem, SCIP_EXPR *sourceexpr, SCIP_EXPR **targetexpr, SCIP_DECL_EXPR_MAPEXPR((*mapexpr)), void *mapexprdata, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
Definition: expr.c:1878
SCIP_RETCODE SCIPexprAppendChild(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_EXPR *expr, SCIP_EXPR *child)
Definition: expr.c:1785
SCIP_RETCODE SCIPexprDismantle(SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_MESSAGEHDLR *messagehdlr, FILE *file, SCIP_EXPR *expr)
Definition: expr.c:2546
int SCIPexprhdlrCompareExpr(SCIP_SET *set, SCIP_EXPR *expr1, SCIP_EXPR *expr2)
Definition: expr.c:1162
SCIP_RETCODE SCIPexprPrintDotInit2(SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_EXPRPRINTDATA **printdata, const char *filename, SCIP_EXPRPRINT_WHAT whattoprint)
Definition: expr.c:2347
SCIP_RETCODE SCIPexprhdlrHashExpr(SCIP_EXPRHDLR *exprhdlr, SCIP_SET *set, SCIP_EXPR *expr, unsigned int *hashkey, unsigned int *childrenhashes)
Definition: expr.c:1113
SCIP_RETCODE SCIPexprhdlrCopyInclude(SCIP_EXPRHDLR *exprhdlr, SCIP_SET *targetset)
Definition: expr.c:859
SCIP_RETCODE SCIPexprhdlrEstimateExpr(SCIP_EXPRHDLR *exprhdlr, SCIP_SET *set, SCIP_EXPR *expr, SCIP_INTERVAL *localbounds, SCIP_INTERVAL *globalbounds, SCIP_Real *refpoint, SCIP_Bool overestimate, SCIP_Real targetvalue, SCIP_Real *coefs, SCIP_Real *constant, SCIP_Bool *islocal, SCIP_Bool *success, SCIP_Bool *branchcand)
Definition: expr.c:1556
SCIP_RETCODE SCIPexprSimplify(SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_EXPR *rootexpr, SCIP_EXPR **simplified, SCIP_Bool *changed, SCIP_Bool *infeasible, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
Definition: expr.c:3189
structure definitions related to algebraic expressions
SCIP_RETCODE SCIPexprhdlrIntEvalExpr(SCIP_EXPRHDLR *exprhdlr, SCIP_SET *set, SCIP_EXPR *expr, SCIP_INTERVAL *interval, SCIP_DECL_EXPR_INTEVALVAR((*intevalvar)), void *intevalvardata)
Definition: expr.c:1525
SCIP_RETCODE SCIPexprGetSymData(SCIP_SET *set, SCIP_EXPR *expr, SYM_EXPRDATA **symdata)
Definition: expr.c:3283
struct SCIP_ExprData SCIP_EXPRDATA
Definition: type_expr.h:54
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_RETCODE SCIPexprPrintDot(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_EXPRPRINTDATA *printdata, SCIP_EXPR *expr)
Definition: expr.c:2379
SCIP_RETCODE SCIPexprRemoveChildren(SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_EXPR *expr)
Definition: expr.c:1846
type definitions for global SCIP settings
struct SCIP_ExprPrintData SCIP_EXPRPRINTDATA
Definition: type_expr.h:741
SCIP_RETCODE SCIPexprEvalHessianDir(SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_EXPR *rootexpr, SCIP_SOL *sol, SCIP_Longint soltag, SCIP_SOL *direction)
Definition: expr.c:2844
SCIP_RETCODE SCIPexprPrintDotInit(SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_EXPRPRINTDATA **printdata, FILE *file, SCIP_EXPRPRINT_WHAT whattoprint)
Definition: expr.c:2315
SCIP_RETCODE SCIPexprhdlrReversePropExpr(SCIP_EXPRHDLR *exprhdlr, SCIP_SET *set, SCIP_EXPR *expr, SCIP_INTERVAL bounds, SCIP_INTERVAL *childrenbounds, SCIP_Bool *infeasible)
Definition: expr.c:1680
void SCIPexprhdlrInit(SCIP_EXPRHDLR *exprhdlr, SCIP_SET *set)
Definition: expr.c:884
SCIP_RETCODE SCIPexprComputeQuadraticCurvature(SCIP_SET *set, BMS_BLKMEM *blkmem, BMS_BUFMEM *bufmem, SCIP_MESSAGEHDLR *messagehdlr, SCIP_EXPR *expr, SCIP_EXPRCURV *curv, SCIP_HASHMAP *assumevarfixed, SCIP_Bool storeeigeninfo)
Definition: expr.c:3629
SCIP_RETCODE SCIPexprhdlrInitEstimatesExpr(SCIP_EXPRHDLR *exprhdlr, SCIP_SET *set, SCIP_EXPR *expr, SCIP_INTERVAL *bounds, SCIP_Bool overestimate, SCIP_Real *coefs[SCIP_EXPR_MAXINITESTIMATES], SCIP_Real constant[SCIP_EXPR_MAXINITESTIMATES], int *nreturned)
Definition: expr.c:1600
SCIP_RETCODE SCIPexprPrintDotFinal(SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_EXPRPRINTDATA **printdata)
Definition: expr.c:2493
SCIP_RETCODE SCIPexprhdlrBwDiffExpr(SCIP_EXPRHDLR *exprhdlr, SCIP_SET *set, BMS_BUFMEM *bufmem, SCIP_EXPR *expr, int childidx, SCIP_Real *derivative, SCIP_Real *childrenvals, SCIP_Real exprval)
Definition: expr.c:1272
type definitions for problem statistics
void SCIPexpriterFree(SCIP_EXPRITER **iterator)
Definition: expriter.c:446
public functions to work with algebraic expressions
SCIP_RETCODE SCIPexprReplaceChild(SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_EXPR *expr, int childidx, SCIP_EXPR *newchild)
Definition: expr.c:1816
SCIP_RETCODE SCIPexprhdlrIntegralityExpr(SCIP_EXPRHDLR *exprhdlr, SCIP_SET *set, SCIP_EXPR *expr, SCIP_Bool *isintegral)
Definition: expr.c:1083
SCIP_Bool SCIPexprIsVar(SCIP_SET *set, SCIP_EXPR *expr)
Definition: expr.c:2206
SCIP_RETCODE SCIPexprhdlrFwDiffExpr(SCIP_EXPRHDLR *exprhdlr, SCIP_SET *set, SCIP_EXPR *expr, SCIP_Real *dot, SCIP_SOL *direction)
Definition: expr.c:1345
SCIP_RETCODE SCIPexprhdlrCreate(BMS_BLKMEM *blkmem, SCIP_EXPRHDLR **exprhdlr, const char *name, const char *desc, unsigned int precedence, SCIP_DECL_EXPREVAL((*eval)), SCIP_EXPRHDLRDATA *data)
Definition: expr.c:305
SCIP_RETCODE SCIPexprPrint(SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_MESSAGEHDLR *messagehdlr, FILE *file, SCIP_EXPR *expr)
Definition: expr.c:2266
SCIP_RETCODE SCIPexpriterCreate(SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_EXPRITER **iterator)
Definition: expriter.c:427
SCIP_RETCODE SCIPexprRelease(SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_EXPR **expr)
Definition: expr.c:2074
void SCIPexprCapture(SCIP_EXPR *expr)
Definition: expr.c:2064
SCIP_RETCODE SCIPexprEval(SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_EXPR *expr, SCIP_SOL *sol, SCIP_Longint soltag)
Definition: expr.c:2654
SCIP_RETCODE SCIPexprCreate(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_EXPR **expr, SCIP_EXPRHDLR *exprhdlr, SCIP_EXPRDATA *exprdata, int nchildren, SCIP_EXPR **children, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
Definition: expr.c:1728
unsigned int SCIP_EXPRPRINT_WHAT
Definition: type_expr.h:740
SCIP_RETCODE SCIPexprhdlrSimplifyExpr(SCIP_EXPRHDLR *exprhdlr, SCIP_SET *set, SCIP_EXPR *expr, SCIP_EXPR **simplifiedexpr, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
Definition: expr.c:1635
SCIP_RETCODE SCIPexprCheckQuadratic(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_EXPR *expr, SCIP_Bool *isquadratic)
Definition: expr.c:3315
#define SCIP_Bool
Definition: def.h:91
#define SCIP_DECL_EXPR_OWNERCREATE(x)
Definition: type_expr.h:143
SCIP_EXPRCURV
Definition: type_expr.h:60
SCIP_RETCODE SCIPexprhdlrPrintExpr(SCIP_EXPRHDLR *exprhdlr, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_EXPR *expr, SCIP_EXPRITER_STAGE stage, int currentchild, unsigned int parentprecedence, FILE *file)
Definition: expr.c:917
SCIP_RETCODE SCIPexprhdlrParseExpr(SCIP_EXPRHDLR *exprhdlr, SCIP_SET *set, const char *string, const char **endstring, SCIP_EXPR **expr, SCIP_Bool *success, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
Definition: expr.c:986
struct SCIP_ExprhdlrData SCIP_EXPRHDLRDATA
Definition: type_expr.h:195
int SCIPexprCompare(SCIP_SET *set, SCIP_EXPR *expr1, SCIP_EXPR *expr2)
Definition: expr.c:3082
SCIP_RETCODE SCIPexprDuplicateShallow(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_EXPR *expr, SCIP_EXPR **copyexpr, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
Definition: expr.c:2033
type definitions for clocks and timing issues
void SCIPexprFreeQuadratic(BMS_BLKMEM *blkmem, SCIP_EXPR *expr)
Definition: expr.c:3583
SCIP_Bool SCIPexprIsValue(SCIP_SET *set, SCIP_EXPR *expr)
Definition: expr.c:2218
SCIP_Bool SCIPexprIsSum(SCIP_SET *set, SCIP_EXPR *expr)
Definition: expr.c:2230
#define SCIP_DECL_EXPR_MAPEXPR(x)
Definition: type_expr.h:182
#define SCIP_Real
Definition: def.h:173
#define SCIP_EXPR_MAXINITESTIMATES
Definition: type_expr.h:198
#define SCIP_Longint
Definition: def.h:158
SCIP_RETCODE SCIPexprEvalActivity(SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_EXPR *rootexpr)
Definition: expr.c:2950
type definitions for message output methods
SCIP_RETCODE SCIPexprhdlrEvalFwDiffExpr(SCIP_EXPRHDLR *exprhdlr, SCIP_SET *set, BMS_BUFMEM *bufmem, SCIP_EXPR *expr, SCIP_Real *val, SCIP_Real *dot, SCIP_Real *childrenvals, SCIP_SOL *sol, SCIP_Real *childrendirs, SCIP_SOL *direction)
Definition: expr.c:1386
unsigned int SCIP_EXPRITER_STAGE
Definition: type_expr.h:699
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:437
datastructures for global SCIP settings
SCIP_RETCODE SCIPexprhdlrCurvatureExpr(SCIP_EXPRHDLR *exprhdlr, SCIP_SET *set, SCIP_EXPR *expr, SCIP_EXPRCURV exprcurvature, SCIP_Bool *success, SCIP_EXPRCURV *childcurv)
Definition: expr.c:1025
SCIP_RETCODE SCIPexprhdlrFree(SCIP_EXPRHDLR **exprhdlr, SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition: expr.c:340
SCIP_RETCODE SCIPexprhdlrMonotonicityExpr(SCIP_EXPRHDLR *exprhdlr, SCIP_SET *set, SCIP_EXPR *expr, int childidx, SCIP_MONOTONE *result)
Definition: expr.c:1054
SCIP_RETCODE SCIPexprhdlrEvalExpr(SCIP_EXPRHDLR *exprhdlr, SCIP_SET *set, BMS_BUFMEM *bufmem, SCIP_EXPR *expr, SCIP_Real *val, SCIP_Real *childrenvals, SCIP_SOL *sol)
Definition: expr.c:1205
SCIP_Bool SCIPexprIsProduct(SCIP_SET *set, SCIP_EXPR *expr)
Definition: expr.c:2242
memory allocation routines