11 #ifndef COUENNE_EXPRESSION_HPP
12 #define COUENNE_EXPRESSION_HPP
28 class CouenneCutGenerator;
73 virtual inline int Index ()
const
77 virtual inline int nArgs ()
const
118 virtual void print (std::ostream &s = std::cout,
138 {
return dependsOn (&singleton, 1, type);}
143 virtual inline int DepList (std::set <int> &deplist,
235 {var = NULL;
return 0.;}
291 register double delta = (sign > 0) ? (*dst - src) : (src - *dst);
317 if (e -> isaCopy ())
return getOriginal (e -> Copy ());
325 expression *simpler = complicated -> simplify ();
330 }
else return complicated;
Cut Generator for linear convexifications.
OsiObject for auxiliary variables $w=f(x)$.
Class for MINLP problems with symbolic information.
Define a dynamic point+bounds, with a way to save and restore previous points+bounds through a LIFO s...
virtual void closestFeasible(expression *varind, expression *vardep, CouNumber &left, CouNumber &right) const
closest feasible points in function in both directions
virtual void fillDepSet(std::set< DepNode *, compNode > *, DepGraph *)
update dependence set with index of variables on which this expression depends
virtual void getBounds(expression *&, expression *&)
Get lower and upper bound of an expression (if any)
virtual enum expr_type code()
return integer for comparing expressions (used to recognize common expression)
virtual expression ** ArgPtr()
return pointer to argument (when applicable, i.e., with univariate functions)
virtual CouNumber inverse(expression *vardep) const
compute the inverse function
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...
virtual bool isInteger()
is this expression integer?
virtual enum nodeType Type() const
node type
expression(const expression &e, Domain *d=NULL)
Copy constructor.
virtual expression * clone(Domain *d=NULL) const
Cloning method.
virtual int Index() const
Return index of variable (only valid for exprVar and exprAux)
virtual void realign(const CouenneProblem *p)
empty function to redirect variables to proper variable vector
virtual expression * Copy() const
return copy of this expression (only makes sense in exprCopy)
virtual CouNumber Value() const
value (empty)
virtual bool isCuttable(CouenneProblem *problem, int index) const
can this expression be further linearized or are we on its concave ("bad") side
virtual CouNumber operator()()=0
null function for evaluating the expression
virtual bool isaCopy() const
return true if this is a copy of something (i.e. an exprCopy)
virtual CouNumber gradientNorm(const double *x)
return l-2 norm of gradient at given point
virtual int compare(exprCopy &)
compare copies of expressions
virtual int compare(expression &)
compare expressions
virtual int Linearity()
get a measure of "how linear" the expression is (see CouenneTypes.h)
virtual void generateCuts(expression *w, OsiCuts &cs, const CouenneCutGenerator *cg, t_chg_bounds *chg=NULL, int wind=-1, CouNumber lb=-COUENNE_INFINITY, CouNumber ub=COUENNE_INFINITY)
generate convexification cut for constraint w = this
virtual void print(std::ostream &s=std::cout, bool=false) const
print expression to iostream
virtual void ArgList(expression **al)
set arglist (used in deleting nodes without deleting children)
virtual bool isBijective() const
indicating if function is monotonically increasing
virtual expression ** ArgList() const
return arglist (when applicable, that is, with N-ary functions)
virtual expression * Argument() const
return argument (when applicable, i.e., with univariate functions)
virtual void Image(expression *image)
set expression associated with this auxiliary variable (for compatibility with exprAux)
virtual expression * simplify()
simplify expression (useful for derivatives)
virtual expression * Image() const
return pointer to corresponding expression (for auxiliary variables only)
virtual enum convexity convexity() const
either CONVEX, CONCAVE, AFFINE, or NONCONVEX
virtual int nArgs() const
return number of arguments (when applicable, that is, with N-ary functions)
virtual int DepList(std::set< int > &deplist, enum dig_type type=ORIG_ONLY)
fill std::set with indices of variables on which this expression depends.
virtual exprAux * standardize(CouenneProblem *p, bool addAux=true)
Create standard form of this expression, by:
virtual void replace(exprVar *, exprVar *)
replace expression with another
virtual void getBounds(CouNumber &, CouNumber &)
Get lower and upper bound of an expression (if any) – real values.
virtual int rank()
used in rank-based branching variable choice: original variables have rank 1; auxiliary w=f(x) has ra...
auxSign
"sign" of the constraint defining an auxiliary.
virtual bool isDefinedInteger()
is this expression defined as an integer?
int dependsOn(int singleton, enum dig_type type=STOP_AT_AUX)
version with one index only
virtual void linkDomain(Domain *d)
empty function to update domain pointer
virtual bool impliedBound(int, CouNumber *, CouNumber *, t_chg_bounds *, enum auxSign=expression::AUX_EQ)
does a backward implied bound processing on every expression, including exprSums although already don...
virtual ~expression()
Destructor.
virtual int Multiplicity()
multiplicity of a variable
virtual const expression * Original() const
If this is an exprClone of a exprClone of an expr???, point to the original expr??...
virtual expression * differentiate(int)
differentiation
virtual CouNumber selectBranch(const CouenneObject *obj, const OsiBranchingInformation *info, expression *&var, double *&brpts, double *&brDist, int &way)
set up branching object by evaluating many branching points for each expression's arguments.
status of lower/upper bound of a variable, to be checked/modified in bound tightening
general include file for different compilers
int compareExpr(const void *e0, const void *e1)
independent comparison
nodeType
type of a node in an expression tree
dig_type
type of digging when filling the dependence list
double CouNumber
main number type in Couenne
bool updateBound(register int sign, register CouNumber *dst, register CouNumber src)
updates maximum violation.
expression * Simplified(expression *complicated)
Macro to return already simplified expression without having to do the if part every time simplify ()...
expr_type
code returned by the method expression::code()
bool isInteger(CouNumber x)
is this number integer?
expression * getOriginal(expression *e)
get original expression (can't make it an expression method as I need a non-const,...