22 #include "CoinHelperFunctions.hpp"
23 #include "CoinFinite.hpp"
25 using namespace Couenne;
64 bool found_one =
false;
69 for (
int i=0; i <
nargs_ - 1; i++) {
103 for (
register int i=0; i<
nargs_; i++) {
115 if (fabs (c) == 0.) {
152 for (
int i = 0; i <
nargs_; i++)
164 als [nonconst++] =
new exprMul (alm, nargs_);
168 return new exprSum (als, nonconst);
191 for (
register int i=1; i<
nargs_; i++) {
198 case LINEAR: lin0++;
break;
220 assert (varoth ->
Index () >= 0);
228 if (y <
c*x) {assert (y/
c >= right); right = y/
c;}
229 else {assert (y/
c <= left); left = y/
c;}
231 if (y <
c*x) {assert (y/
c <= left); left = y/
c;}
232 else {assert (y/
c >= right); right = y/
c;}
233 else left = - (right = COIN_DBL_MAX);
249 if (ind1 < 0)
return 0.;
250 else return fabs (x0);
252 if (ind1 < 0)
return fabs (x1);
253 else return sqrt (x0*x0 + x1*x1);
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...
expression * differentiate(int index)
differentiation
virtual void closestFeasible(expression *varind, expression *vardep, CouNumber &left, CouNumber &right) const
compute and for Violation Transfer algorithm
int compareExpr(const void *e0, const void *e1)
independent comparison
int shrink_arglist(CouNumber, CouNumber)
compress argument list
Power of an expression (binary operator), with constant.
virtual CouNumber gradientNorm(const double *x)
return l-2 norm of gradient at given point
virtual expression * clone(Domain *d=NULL) const
Cloning method.
virtual int Linearity()
get a measure of "how linear" the expression is:
exprMul(expression **, int)
Constructor.
virtual enum nodeType Type() const
Node type.
virtual int Index() const
Return index of variable (only valid for exprVar and exprAux)
expression * simplify()
simplification
virtual expression * simplify()
simplification
expression ** arglist_
argument list is an array of pointers to other expressions
double CouNumber
main number type in Couenne
int nargs_
number of arguments (cardinality of arglist)
general n-ary operator-type expression: requires argument list.
virtual CouNumber Value() const
value (empty)
void fint fint fint real fint real * x