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