24 #include "CoinHelperFunctions.hpp"
25 #include "CoinFinite.hpp"
27 using namespace Couenne;
160 alm [0] =
new exprPow (alp, 2);
165 als [0] =
new exprMul (alm1, 2);
170 alm2 [0] =
new exprDiv (ald, 2);
173 als [1] =
new exprMul (alm2, 2);
175 alm [1] =
new exprSum (als, 2);
313 if (isInt || isInvInt)
318 ((y < xk) ? left : right) = yk;
323 if (y < xk) right = yk;
327 if (y > xk) left = yk;
333 left = - (right = COIN_DBL_MAX);
341 if (x > yk) left = yk;
346 if (x > yk) left = yk;
347 else if (x < -yk) right = -yk;
348 else left = - (right = yk);
352 left = - (right = yk);
354 if (x > 0) left = yk;
359 if (
k > 0) ((y < xk) ? left : right) = yk;
360 else ((y > xk) ? left : right) = yk;
381 isInvInt = (exponent != 0.) &&
::isInteger (1. / exponent);
387 if (isInt || isInvInt) {
394 y = problem -> X (index);
404 y = problem -> X (index);
406 return (((exponent <= 1.) && (y >=
safe_pow (x, exponent))) ||
407 ((exponent >= 1.) && (y <=
safe_pow (x, exponent))));
414 y = problem -> X (index),
415 lb = problem -> Lb (index),
416 ub = problem -> Ub (index);
418 if (isInt || isInvInt)
virtual bool isInteger()
is this expression integer?
virtual CouNumber gradientNorm(const double *x)
return l-2 norm of gradient at given point
virtual int dependsOn(int *ind, int n, enum dig_type type=STOP_AT_AUX)
dependence on variable set: return cardinality of subset of the set of indices in first argument whic...
CouExpr & log(CouExpr &e)
Power of an expression (binary operator), with constant.
expression * clone(Domain *d=NULL) const
cloning method
virtual int Linearity()
get a measure of "how linear" the expression is
exprPow(expression **al, int n=2, bool signpower=false)
Constructor.
virtual bool isCuttable(CouenneProblem *problem, int index) const
can this expression be further linearized or are we on its concave ("bad") side
#define COUENNE_EPS_SIMPL
virtual enum nodeType Type() const
Node type.
virtual int Index() const
Return index of variable (only valid for exprVar and exprAux)
virtual void getBounds(expression *&, expression *&)
Get lower and upper bound of an expression (if any)
Class for MINLP problems with symbolic information.
expression clone (points to another expression)
void fint fint fint real fint real real real real real real real real real fint real * alp
bool issignpower_
do we mean a signed power function: sign(arg0) * |arg0|^arg1 (assumes that arg1 is constant) ...
virtual expression * simplify()
simplification
expression ** arglist_
argument list is an array of pointers to other expressions
double CouNumber
main number type in Couenne
virtual void closestFeasible(expression *varind, expression *vardep, CouNumber &left, CouNumber &right) const
compute $y^{lv}$ and $y^{uv}$ for Violation Transfer algorithm
virtual expression * simplify()
simplification
CouNumber safe_pow(CouNumber base, CouNumber exponent, bool signpower=false)
compute power and check for integer-and-odd inverse exponent
virtual expression * differentiate(int index)
differentiation
virtual CouNumber Value() const
value (empty)
void fint fint fint real fint real * x
class for multiplications,