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