Scippy

SCIP

Solving Constraint Integer Programs

expr_exp.c
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_exp.c
17  * @ingroup DEFPLUGINS_EXPR
18  * @brief exponential expression handler
19  * @author Stefan Vigerske
20  * @author Benjamin Mueller
21  * @author Ksenia Bestuzheva
22  */
23 
24 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
25 
26 #define _USE_MATH_DEFINES /* to get M_E on Windows */ /*lint !750 */
27 
28 #include <string.h>
29 #include <math.h>
30 
31 #include "scip/expr_exp.h"
32 #include "scip/expr_value.h"
33 
34 #define EXPRHDLR_NAME "exp"
35 #define EXPRHDLR_DESC "exponential expression"
36 #define EXPRHDLR_PRECEDENCE 85000
37 #define EXPRHDLR_HASHKEY SCIPcalcFibHash(10181.0)
38 
39 /*
40  * Data structures
41  */
42 
43 /*
44  * Local methods
45  */
46 
47 /** computes coefficients of secant of an exponential term */
48 static
50  SCIP* scip, /**< SCIP data structure */
51  SCIP_Real lb, /**< lower bound on variable */
52  SCIP_Real ub, /**< upper bound on variable */
53  SCIP_Real* lincoef, /**< buffer to add coefficient of secant */
54  SCIP_Real* linconstant, /**< buffer to add constant of secant */
55  SCIP_Bool* success /**< buffer to set to FALSE if secant has failed due to large numbers or unboundedness */
56  )
57 {
58  SCIP_Real coef;
59  SCIP_Real constant;
60 
61  assert(scip != NULL);
62  assert(!SCIPisInfinity(scip, lb));
63  assert(!SCIPisInfinity(scip, -ub));
64  assert(SCIPisLE(scip, lb, ub));
65  assert(lincoef != NULL);
66  assert(linconstant != NULL);
67  assert(success != NULL);
68 
69  if( SCIPisInfinity(scip, -lb) || SCIPisInfinity(scip, ub) )
70  {
71  /* unboundedness */
72  *success = FALSE;
73  return;
74  }
75 
76  /* if lb and ub are too close use a safe secant */
77  if( SCIPisEQ(scip, lb, ub) )
78  {
79  coef = 0.0;
80  constant = exp(ub);
81  }
82  else
83  {
84  coef = (exp(ub) - exp(lb)) / (ub - lb);
85  constant = exp(ub) - coef * ub;
86  }
87 
88  if( SCIPisInfinity(scip, REALABS(coef)) || SCIPisInfinity(scip, REALABS(constant)) )
89  {
90  *success = FALSE;
91  return;
92  }
93 
94  *lincoef += coef;
95  *linconstant += constant;
96 }
97 
98 /** computes coefficients of linearization of an exponential term in a reference point */
99 static
101  SCIP* scip, /**< SCIP data structure */
102  SCIP_Real refpoint, /**< point for which to compute value of linearization */
103  SCIP_Bool isint, /**< whether corresponding variable is a discrete variable, and thus linearization could be moved */
104  SCIP_Real* lincoef, /**< buffer to add coefficient of secant */
105  SCIP_Real* linconstant, /**< buffer to add constant of secant */
106  SCIP_Bool* success /**< buffer to set to FALSE if secant has failed due to large numbers or unboundedness */
107  )
108 {
109  SCIP_Real constant;
110  SCIP_Real coef;
111 
112  assert(scip != NULL);
113  assert(lincoef != NULL);
114  assert(linconstant != NULL);
115  assert(success != NULL);
116 
117  if( SCIPisInfinity(scip, REALABS(refpoint)) )
118  {
119  *success = FALSE;
120  return;
121  }
122 
123  if( !isint || SCIPisIntegral(scip, refpoint) )
124  {
125  coef = exp(refpoint);
126  constant = exp(refpoint) * (1.0 - refpoint);
127  }
128  else
129  {
130  /* exp(x) -> secant between f=floor(refpoint) and f+1 = ((e-1)*e^f) * x + e^f - f * ((e-1)*e^f) */
131  SCIP_Real f;
132 
133  f = SCIPfloor(scip, refpoint);
134 
135  coef = (M_E - 1.0) * exp(f);
136  constant = exp(f) - f * coef;
137  }
138 
139  if( SCIPisInfinity(scip, REALABS(coef)) || SCIPisInfinity(scip, REALABS(constant)) )
140  {
141  *success = FALSE;
142  return;
143  }
144 
145  *lincoef += coef;
146  *linconstant += constant;
147 }
148 
149 /*
150  * Callback methods of expression handler
151  */
152 
153 /** simplifies an exp expression
154  *
155  * Evaluates the exponential function when its child is a value expression.
156  *
157  * TODO: exp(log(*)) = *
158  */
159 static
161 {
162  SCIP_EXPR* child;
163 
164  assert(scip != NULL);
165  assert(expr != NULL);
166  assert(simplifiedexpr != NULL);
167  assert(SCIPexprGetNChildren(expr) == 1);
168 
169  child = SCIPexprGetChildren(expr)[0];
170  assert(child != NULL);
171 
172  /**! [SnippetExprSimplifyExp] */
173  /* check for value expression */
174  if( SCIPisExprValue(scip, child) )
175  {
176  SCIP_CALL( SCIPcreateExprValue(scip, simplifiedexpr, exp(SCIPgetValueExprValue(child)), ownercreate, ownercreatedata) );
177  }
178  else
179  {
180  *simplifiedexpr = expr;
181 
182  /* we have to capture it, since it must simulate a "normal" simplified call in which a new expression is created */
183  SCIPcaptureExpr(*simplifiedexpr);
184  }
185  /**! [SnippetExprSimplifyExp] */
186 
187  return SCIP_OKAY;
188 }
189 
190 /** expression handler copy callback */
191 static
193 { /*lint --e{715}*/
195 
196  return SCIP_OKAY;
197 }
198 
199 /** expression data copy callback */
200 static
202 { /*lint --e{715}*/
203  assert(targetexprdata != NULL);
204  assert(sourceexpr != NULL);
205  assert(SCIPexprGetData(sourceexpr) == NULL);
206 
207  *targetexprdata = NULL;
208 
209  return SCIP_OKAY;
210 }
211 
212 /** expression data free callback */
213 static
215 { /*lint --e{715}*/
216  assert(expr != NULL);
217 
218  SCIPexprSetData(expr, NULL);
219 
220  return SCIP_OKAY;
221 }
222 
223 /** expression parse callback */
224 static
226 { /*lint --e{715}*/
227  SCIP_EXPR* childexpr;
228 
229  assert(expr != NULL);
230 
231  /**! [SnippetExprParseExp] */
232  /* parse child expression from remaining string */
233  SCIP_CALL( SCIPparseExpr(scip, &childexpr, string, endstring, ownercreate, ownercreatedata) );
234  assert(childexpr != NULL);
235 
236  /* create exponential expression */
237  SCIP_CALL( SCIPcreateExprExp(scip, expr, childexpr, ownercreate, ownercreatedata) );
238  assert(*expr != NULL);
239 
240  /* release child expression since it has been captured by the exponential expression */
241  SCIP_CALL( SCIPreleaseExpr(scip, &childexpr) );
242 
243  *success = TRUE;
244  /**! [SnippetExprParseExp] */
245 
246  return SCIP_OKAY;
247 }
248 
249 /** expression point evaluation callback */
250 static
252 { /*lint --e{715}*/
253  assert(expr != NULL);
254  assert(SCIPexprGetData(expr) == NULL);
255  assert(SCIPexprGetNChildren(expr) == 1);
256  assert(SCIPexprGetEvalValue(SCIPexprGetChildren(expr)[0]) != SCIP_INVALID); /*lint !e777*/
257 
258  *val = exp(SCIPexprGetEvalValue(SCIPexprGetChildren(expr)[0]));
259 
260  return SCIP_OKAY;
261 }
262 
263 /** expression derivative evaluation callback */
264 static
266 { /*lint --e{715}*/
267  assert(expr != NULL);
268  assert(childidx == 0);
269  assert(!SCIPisExprValue(scip, SCIPexprGetChildren(expr)[0]));
270  assert(SCIPexprGetEvalValue(expr) != SCIP_INVALID); /*lint !e777*/
271 
272  *val = SCIPexprGetEvalValue(expr);
273 
274  return SCIP_OKAY;
275 }
276 
277 /** expression interval evaluation callback */
278 static
280 { /*lint --e{715}*/
281  SCIP_INTERVAL childinterval;
282 
283  assert(expr != NULL);
284  assert(SCIPexprGetData(expr) == NULL);
285  assert(SCIPexprGetNChildren(expr) == 1);
286 
287  childinterval = SCIPexprGetActivity(SCIPexprGetChildren(expr)[0]);
288 
289  if( SCIPintervalIsEmpty(SCIP_INTERVAL_INFINITY, childinterval) )
290  SCIPintervalSetEmpty(interval);
291  else
292  SCIPintervalExp(SCIP_INTERVAL_INFINITY, interval, childinterval);
293 
294  return SCIP_OKAY;
295 }
296 
297 /** expression estimator callback */
298 static
300 { /*lint --e{715}*/
301  assert(scip != NULL);
302  assert(expr != NULL);
303  assert(SCIPexprGetNChildren(expr) == 1);
304  assert(strcmp(SCIPexprhdlrGetName(SCIPexprGetHdlr(expr)), EXPRHDLR_NAME) == 0);
305  assert(coefs != NULL);
306  assert(constant != NULL);
307  assert(islocal != NULL);
308  assert(branchcand != NULL);
309  assert(*branchcand == TRUE);
310  assert(success != NULL);
311 
312  *success = TRUE;
313  *coefs = 0.0;
314  *constant = 0.0;
315 
316  if( overestimate )
317  {
318  addExpSecant(scip, localbounds[0].inf, localbounds[0].sup, coefs, constant, success);
319  *islocal = TRUE; /* secants are only valid locally */
320  }
321  else
322  {
323  addExpLinearization(scip, refpoint[0], SCIPexprIsIntegral(SCIPexprGetChildren(expr)[0]), coefs, constant, success);
324  *islocal = FALSE; /* linearization are globally valid */
325  *branchcand = FALSE;
326  }
327 
328  return SCIP_OKAY;
329 }
330 
331 /** initital estimates callback for an exponential expression */
332 static
334 {
335  SCIP_Real refpointsunder[3] = {SCIP_INVALID, SCIP_INVALID, SCIP_INVALID};
336  SCIP_Bool overest[4] = {FALSE, FALSE, FALSE, TRUE};
337  SCIP_EXPR* child;
338  SCIP_Real lb;
339  SCIP_Real ub;
340  SCIP_Bool success;
341  int i;
342 
343  assert(scip != NULL);
344  assert(expr != NULL);
345  assert(SCIPexprGetNChildren(expr) == 1);
346  assert(strcmp(SCIPexprhdlrGetName(SCIPexprGetHdlr(expr)), EXPRHDLR_NAME) == 0);
347 
348  /* get expression data */
349  child = SCIPexprGetChildren(expr)[0];
350  assert(child != NULL);
351 
352  lb = bounds[0].inf;
353  ub = bounds[0].sup;
354 
355  if( !overestimate )
356  {
357  SCIP_Real lbfinite;
358  SCIP_Real ubfinite;
359 
360  /* make bounds finite */
361  lbfinite = SCIPisInfinity(scip, -lb) ? MIN(-5.0, ub - 0.1 * REALABS(ub)) : lb; /*lint !e666*/
362  ubfinite = SCIPisInfinity(scip, ub) ? MAX( 3.0, lb + 0.1 * REALABS(lb)) : ub; /*lint !e666*/
363 
364  refpointsunder[0] = (7.0 * lbfinite + ubfinite) / 8.0;
365  refpointsunder[1] = (lbfinite + ubfinite) / 2.0;
366  refpointsunder[2] = (lbfinite + 7.0 * ubfinite) / 8.0;
367  }
368 
369  *nreturned = 0;
370  for( i = 0; i < 4; ++i )
371  {
372  if( !overest[i] && overestimate )
373  continue;
374 
375  if( overest[i] && (!overestimate || SCIPisInfinity(scip, ub) || SCIPisInfinity(scip, -lb)) )
376  continue;
377 
378  assert(overest[i] || (SCIPisLE(scip, refpointsunder[i], ub) && SCIPisGE(scip, refpointsunder[i], lb))); /*lint !e661*/
379 
380  coefs[*nreturned][0] = 0.0;
381  constant[*nreturned] = 0.0;
382 
383  success = TRUE;
384 
385  if( !overest[i] )
386  {
387  assert(i < 3);
388  addExpLinearization(scip, refpointsunder[i], SCIPexprIsIntegral(child), coefs[*nreturned], &constant[*nreturned], &success); /*lint !e661*/
389  }
390  else
391  addExpSecant(scip, lb, ub, coefs[*nreturned], &constant[*nreturned], &success);
392 
393  if( success )
394  ++*nreturned;
395  }
396 
397  return SCIP_OKAY;
398 }
399 
400 /** expression reverse propagation callback */
401 static
403 { /*lint --e{715}*/
404  assert(scip != NULL);
405  assert(expr != NULL);
406  assert(SCIPexprGetNChildren(expr) == 1);
407  assert(SCIPintervalGetInf(bounds) >= 0.0);
408 
409  if( SCIPintervalGetSup(bounds) <= 0.0 )
410  {
411  *infeasible = TRUE;
412  return SCIP_OKAY;
413  }
414 
415  /* f = exp(c0) -> c0 = log(f) */
416  SCIPintervalLog(SCIP_INTERVAL_INFINITY, childrenbounds, bounds);
417 
418  return SCIP_OKAY;
419 }
420 
421 /** expression hash callback */
422 static
424 { /*lint --e{715}*/
425  assert(scip != NULL);
426  assert(expr != NULL);
427  assert(SCIPexprGetNChildren(expr) == 1);
428  assert(hashkey != NULL);
429  assert(childrenhashes != NULL);
430 
431  *hashkey = EXPRHDLR_HASHKEY;
432  *hashkey ^= childrenhashes[0];
433 
434  return SCIP_OKAY;
435 }
436 
437 /** expression curvature detection callback */
438 static
440 { /*lint --e{715}*/
441  assert(scip != NULL);
442  assert(expr != NULL);
443  assert(childcurv != NULL);
444  assert(success != NULL);
445  assert(SCIPexprGetNChildren(expr) == 1);
446 
447  /* expression is convex if child is convex; expression cannot be concave or linear */
448  if( exprcurvature == SCIP_EXPRCURV_CONVEX )
449  {
450  *success = TRUE;
451  *childcurv = SCIP_EXPRCURV_CONVEX;
452  }
453  else
454  *success = FALSE;
455 
456  return SCIP_OKAY;
457 }
458 
459 /** expression monotonicity detection callback */
460 static
462 { /*lint --e{715}*/
463  assert(scip != NULL);
464  assert(expr != NULL);
465  assert(result != NULL);
466  assert(childidx == 0);
467 
468  *result = SCIP_MONOTONE_INC;
469 
470  return SCIP_OKAY;
471 }
472 
473 /** creates the handler for exponential expressions and includes it into SCIP */
475  SCIP* scip /**< SCIP data structure */
476  )
477 {
478  SCIP_EXPRHDLR* exprhdlr;
479 
481  EXPRHDLR_PRECEDENCE, evalExp, NULL) );
482  assert(exprhdlr != NULL);
483 
484  SCIPexprhdlrSetCopyFreeHdlr(exprhdlr, copyhdlrExp, NULL);
485  SCIPexprhdlrSetCopyFreeData(exprhdlr, copydataExp, freedataExp);
486  SCIPexprhdlrSetSimplify(exprhdlr, simplifyExp);
487  SCIPexprhdlrSetParse(exprhdlr, parseExp);
488  SCIPexprhdlrSetIntEval(exprhdlr, intevalExp);
489  SCIPexprhdlrSetEstimate(exprhdlr, initestimatesExp, estimateExp);
490  SCIPexprhdlrSetReverseProp(exprhdlr, reversepropExp);
491  SCIPexprhdlrSetHash(exprhdlr, hashExp);
492  SCIPexprhdlrSetDiff(exprhdlr, bwdiffExp, NULL, NULL);
493  SCIPexprhdlrSetCurvature(exprhdlr, curvatureExp);
494  SCIPexprhdlrSetMonotonicity(exprhdlr, monotonicityExp);
495 
496  return SCIP_OKAY;
497 }
498 
499 /** creates an exponential expression */
501  SCIP* scip, /**< SCIP data structure */
502  SCIP_EXPR** expr, /**< pointer where to store expression */
503  SCIP_EXPR* child, /**< single child */
504  SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), /**< function to call to create ownerdata */
505  void* ownercreatedata /**< data to pass to ownercreate */
506  )
507 {
508  assert(expr != NULL);
509  assert(child != NULL);
510  assert(SCIPfindExprhdlr(scip, EXPRHDLR_NAME) != NULL);
511 
512  SCIP_CALL( SCIPcreateExpr(scip, expr, SCIPfindExprhdlr(scip, EXPRHDLR_NAME), NULL, 1, &child, ownercreate, ownercreatedata) );
513 
514  return SCIP_OKAY;
515 }
516 
517 /** indicates whether expression is of exp-type */ /*lint -e{715}*/
519  SCIP* scip, /**< SCIP data structure */
520  SCIP_EXPR* expr /**< expression */
521  )
522 { /*lint --e{715}*/
523  assert(expr != NULL);
524 
525  return strcmp(SCIPexprhdlrGetName(SCIPexprGetHdlr(expr)), EXPRHDLR_NAME) == 0;
526 }
static SCIP_DECL_EXPREVAL(evalExp)
Definition: expr_exp.c:251
static SCIP_DECL_EXPRCURVATURE(curvatureExp)
Definition: expr_exp.c:439
static SCIP_DECL_EXPRESTIMATE(estimateExp)
Definition: expr_exp.c:299
static SCIP_DECL_EXPRHASH(hashExp)
Definition: expr_exp.c:423
int SCIPexprGetNChildren(SCIP_EXPR *expr)
Definition: expr.c:3798
void SCIPexprhdlrSetDiff(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRBWDIFF((*bwdiff)), SCIP_DECL_EXPRFWDIFF((*fwdiff)), SCIP_DECL_EXPRBWFWDIFF((*bwfwdiff)))
Definition: expr.c:464
const char * SCIPexprhdlrGetName(SCIP_EXPRHDLR *exprhdlr)
Definition: expr.c:525
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
void SCIPexprhdlrSetParse(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRPARSE((*parse)))
Definition: expr.c:398
static SCIP_DECL_EXPRINTEVAL(intevalExp)
Definition: expr_exp.c:279
#define FALSE
Definition: def.h:87
#define TRUE
Definition: def.h:86
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
void SCIPexprhdlrSetHash(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRHASH((*hash)))
Definition: expr.c:442
#define EXPRHDLR_NAME
Definition: expr_exp.c:34
SCIP_INTERVAL SCIPexprGetActivity(SCIP_EXPR *expr)
Definition: expr.c:3954
static SCIP_DECL_EXPRPARSE(parseExp)
Definition: expr_exp.c:225
SCIP_RETCODE SCIPcreateExprExp(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
Definition: expr_exp.c:500
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
void SCIPcaptureExpr(SCIP_EXPR *expr)
Definition: scip_expr.c:1399
SCIP_EXPRHDLR * SCIPfindExprhdlr(SCIP *scip, const char *name)
Definition: scip_expr.c:859
static void addExpLinearization(SCIP *scip, SCIP_Real refpoint, SCIP_Bool isint, SCIP_Real *lincoef, SCIP_Real *linconstant, SCIP_Bool *success)
Definition: expr_exp.c:100
SCIP_EXPRDATA * SCIPexprGetData(SCIP_EXPR *expr)
Definition: expr.c:3831
SCIP_EXPR ** SCIPexprGetChildren(SCIP_EXPR *expr)
Definition: expr.c:3808
static SCIP_DECL_EXPRCOPYDATA(copydataExp)
Definition: expr_exp.c:201
static SCIP_DECL_EXPRREVERSEPROP(reversepropExp)
Definition: expr_exp.c:402
SCIP_Real SCIPexprGetEvalValue(SCIP_EXPR *expr)
Definition: expr.c:3872
SCIP_RETCODE SCIPcreateExpr(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPRHDLR *exprhdlr, SCIP_EXPRDATA *exprdata, int nchildren, SCIP_EXPR **children, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
Definition: scip_expr.c:964
SCIP_Bool SCIPintervalIsEmpty(SCIP_Real infinity, SCIP_INTERVAL operand)
void SCIPintervalSetEmpty(SCIP_INTERVAL *resultant)
SCIP_Bool SCIPisExprValue(SCIP *scip, SCIP_EXPR *expr)
Definition: scip_expr.c:1432
SCIP_Real SCIPintervalGetInf(SCIP_INTERVAL interval)
#define NULL
Definition: lpi_spx1.cpp:155
SCIP_Real SCIPintervalGetSup(SCIP_INTERVAL interval)
#define REALABS(x)
Definition: def.h:201
#define SCIP_CALL(x)
Definition: def.h:384
SCIP_RETCODE SCIPcreateExprValue(SCIP *scip, SCIP_EXPR **expr, SCIP_Real value, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
Definition: expr_value.c:261
static SCIP_DECL_EXPRBWDIFF(bwdiffExp)
Definition: expr_exp.c:265
void SCIPexprhdlrSetCopyFreeHdlr(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRCOPYHDLR((*copyhdlr)), SCIP_DECL_EXPRFREEHDLR((*freehdlr)))
Definition: expr.c:359
#define SCIP_INTERVAL_INFINITY
Definition: def.h:199
void SCIPintervalLog(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand)
static SCIP_DECL_EXPRFREEDATA(freedataExp)
Definition: expr_exp.c:214
#define SCIP_Bool
Definition: def.h:84
#define SCIP_DECL_EXPR_OWNERCREATE(x)
Definition: type_expr.h:131
void SCIPexprhdlrSetMonotonicity(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRMONOTONICITY((*monotonicity)))
Definition: expr.c:420
SCIP_RETCODE SCIPreleaseExpr(SCIP *scip, SCIP_EXPR **expr)
Definition: scip_expr.c:1407
#define EXPRHDLR_HASHKEY
Definition: expr_exp.c:37
#define MAX(x, y)
Definition: tclique_def.h:83
void SCIPexprhdlrSetReverseProp(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRREVERSEPROP((*reverseprop)))
Definition: expr.c:501
SCIP_RETCODE SCIPparseExpr(SCIP *scip, SCIP_EXPR **expr, const char *exprstr, const char **finalpos, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
Definition: scip_expr.c:1370
SCIP_Bool SCIPexprIsIntegral(SCIP_EXPR *expr)
Definition: expr.c:4017
SCIP_EXPRHDLR * SCIPexprGetHdlr(SCIP_EXPR *expr)
Definition: expr.c:3821
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
#define EXPRHDLR_DESC
Definition: expr_exp.c:35
SCIP_RETCODE SCIPincludeExprhdlrExp(SCIP *scip)
Definition: expr_exp.c:474
void SCIPexprhdlrSetCopyFreeData(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRCOPYDATA((*copydata)), SCIP_DECL_EXPRFREEDATA((*freedata)))
Definition: expr.c:372
constant value expression handler
static SCIP_DECL_EXPRSIMPLIFY(simplifyExp)
Definition: expr_exp.c:160
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
void SCIPexprhdlrSetCurvature(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRCURVATURE((*curvature)))
Definition: expr.c:409
void SCIPexprSetData(SCIP_EXPR *expr, SCIP_EXPRDATA *exprdata)
Definition: expr.c:3846
SCIP_Bool SCIPisExprExp(SCIP *scip, SCIP_EXPR *expr)
Definition: expr_exp.c:518
#define SCIP_Real
Definition: def.h:177
static SCIP_DECL_EXPRCOPYHDLR(copyhdlrExp)
Definition: expr_exp.c:192
#define SCIP_INVALID
Definition: def.h:197
SCIP_Real SCIPgetValueExprValue(SCIP_EXPR *expr)
Definition: expr_value.c:285
void SCIPexprhdlrSetEstimate(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRINITESTIMATES((*initestimates)), SCIP_DECL_EXPRESTIMATE((*estimate)))
Definition: expr.c:512
static SCIP_DECL_EXPRINITESTIMATES(initestimatesExp)
Definition: expr_exp.c:333
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define EXPRHDLR_PRECEDENCE
Definition: expr_exp.c:36
SCIP_RETCODE SCIPincludeExprhdlr(SCIP *scip, SCIP_EXPRHDLR **exprhdlr, const char *name, const char *desc, unsigned int precedence, SCIP_DECL_EXPREVAL((*eval)), SCIP_EXPRHDLRDATA *data)
Definition: scip_expr.c:814
static void addExpSecant(SCIP *scip, SCIP_Real lb, SCIP_Real ub, SCIP_Real *lincoef, SCIP_Real *linconstant, SCIP_Bool *success)
Definition: expr_exp.c:49
static SCIP_DECL_EXPRMONOTONICITY(monotonicityExp)
Definition: expr_exp.c:461
void SCIPexprhdlrSetSimplify(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRSIMPLIFY((*simplify)))
Definition: expr.c:490
void SCIPintervalExp(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand)
void SCIPexprhdlrSetIntEval(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRINTEVAL((*inteval)))
Definition: expr.c:479
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
exponential expression handler