#include <CouenneExprCopy.hpp>
Inheritance diagram for Couenne::exprCopy:
Public Member Functions | |
enum nodeType | Type () const |
node type | |
exprCopy (expression *copy) | |
Constructor. | |
exprCopy (const exprCopy &e, Domain *d=NULL) | |
Copy constructor. | |
virtual | ~exprCopy () |
Destructor -- CAUTION: this is the only destructive destructor, exprClone and exprStore do not destroy anything. | |
virtual expression * | clone (Domain *d=NULL) const |
Cloning method. | |
const expression * | Original () const |
If this is an exprClone of a exprClone of an expr???, point to the original expr??? instead of an exprClone -- improves computing efficiency. | |
bool | isaCopy () const |
return true if this is a copy of something, i.e. | |
expression * | Copy () const |
return copy of this expression (only makes sense in exprCopy) | |
expression * | Image () const |
return pointer to corresponding expression (for auxiliary variables only) | |
int | Index () const |
Get variable index in problem. | |
int | nArgs () const |
Return number of arguments (when applicable, that is, with N-ary functions). | |
expression ** | ArgList () const |
return arglist (when applicable, that is, with N-ary functions) | |
void | ArgList (expression **al) |
set arglist (used in deleting nodes without deleting children) | |
expression * | Argument () const |
return argument (when applicable, i.e., with univariate functions) | |
expression ** | ArgPtr () |
return pointer to argument (when applicable, i.e., with univariate functions) | |
virtual void | print (std::ostream &out=std::cout, bool descend=false) const |
I/O. | |
virtual CouNumber | Value () const |
value | |
virtual CouNumber | operator() () |
null function for evaluating the expression | |
CouNumber | gradientNorm (const double *x) |
return l-2 norm of gradient at given point | |
expression * | differentiate (int index) |
differentiation | |
int | DepList (std::set< int > &deplist, enum dig_type type=ORIG_ONLY) |
fill in the set with all indices of variables appearing in the expression | |
expression * | simplify () |
simplify expression (useful for derivatives) | |
int | Linearity () |
get a measure of "how linear" the expression is (see CouenneTypes.h) | |
bool | isInteger () |
is this expression integer? | |
virtual bool | isDefinedInteger () |
is this expression DEFINED as integer? | |
void | getBounds (expression *&lower, expression *&upper) |
Get lower and upper bound of an expression (if any). | |
void | getBounds (CouNumber &lower, CouNumber &upper) |
Get value of lower and upper bound of an expression (if any). | |
exprAux * | standardize (CouenneProblem *p, bool addAux=true) |
Create standard formulation of this expression. | |
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 | |
enum expr_type | code () |
code for comparisons | |
enum convexity | convexity () const |
either CONVEX, CONCAVE, AFFINE, or NONCONVEX | |
int | compare (expression &e) |
compare this with other expression | |
int | rank () |
used in rank-based branching variable choice | |
bool | impliedBound (int wind, CouNumber *l, CouNumber *u, t_chg_bounds *chg) |
implied bound processing | |
int | Multiplicity () |
multiplicity of a variable: how many times this variable occurs in expressions throughout the problem | |
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 | replace (exprVar *, exprVar *) |
replace occurrence of a variable with another variable | |
void | fillDepSet (std::set< DepNode *, compNode > *dep, DepGraph *g) |
fill in dependence structure | |
void | realign (const CouenneProblem *p) |
redirect variables to proper variable vector | |
bool | isBijective () const |
indicating if function is monotonically increasing | |
CouNumber | inverse (expression *vardep) const |
compute the inverse function | |
void | closestFeasible (expression *varind, expression *vardep, CouNumber &left, CouNumber &right) const |
closest feasible points in function in both directions | |
bool | isCuttable (CouenneProblem *problem, int index) const |
can this expression be further linearized or are we on its concave ("bad") side | |
Protected Attributes | |
expression * | copy_ |
the expression this object is a (reference) copy of | |
CouNumber | value_ |
saved value to be used by exprStore expressions |
Definition at line 25 of file CouenneExprCopy.hpp.
Couenne::exprCopy::exprCopy | ( | expression * | copy | ) | [inline] |
virtual Couenne::exprCopy::~exprCopy | ( | ) | [inline, virtual] |
Destructor -- CAUTION: this is the only destructive destructor, exprClone and exprStore do not destroy anything.
Definition at line 55 of file CouenneExprCopy.hpp.
References copy_.
enum nodeType Couenne::exprCopy::Type | ( | ) | const [inline, virtual] |
node type
Reimplemented from Couenne::expression.
Definition at line 38 of file CouenneExprCopy.hpp.
References copy_.
virtual expression* Couenne::exprCopy::clone | ( | Domain * | d = NULL |
) | const [inline, virtual] |
Cloning method.
Reimplemented from Couenne::expression.
Reimplemented in Couenne::exprClone, and Couenne::exprStore.
Definition at line 61 of file CouenneExprCopy.hpp.
References exprCopy().
const expression* Couenne::exprCopy::Original | ( | ) | const [inline, virtual] |
If this is an exprClone of a exprClone of an expr???, point to the original expr??? instead of an exprClone -- improves computing efficiency.
Reimplemented from Couenne::expression.
Definition at line 67 of file CouenneExprCopy.hpp.
References copy_.
bool Couenne::exprCopy::isaCopy | ( | ) | const [inline, virtual] |
return true if this is a copy of something, i.e.
if it is an exprCopy or derivates
Reimplemented from Couenne::expression.
Definition at line 72 of file CouenneExprCopy.hpp.
Referenced by Copy().
expression* Couenne::exprCopy::Copy | ( | ) | const [inline, virtual] |
return copy of this expression (only makes sense in exprCopy)
Reimplemented from Couenne::expression.
Definition at line 76 of file CouenneExprCopy.hpp.
expression* Couenne::exprCopy::Image | ( | ) | const [inline, virtual] |
return pointer to corresponding expression (for auxiliary variables only)
Reimplemented from Couenne::expression.
Definition at line 80 of file CouenneExprCopy.hpp.
References copy_.
int Couenne::exprCopy::Index | ( | ) | const [inline, virtual] |
Get variable index in problem.
Reimplemented from Couenne::expression.
Definition at line 84 of file CouenneExprCopy.hpp.
References copy_.
int Couenne::exprCopy::nArgs | ( | ) | const [inline, virtual] |
Return number of arguments (when applicable, that is, with N-ary functions).
Reimplemented from Couenne::expression.
Definition at line 88 of file CouenneExprCopy.hpp.
References copy_.
expression** Couenne::exprCopy::ArgList | ( | ) | const [inline, virtual] |
return arglist (when applicable, that is, with N-ary functions)
Reimplemented from Couenne::expression.
Definition at line 92 of file CouenneExprCopy.hpp.
References copy_.
Referenced by ArgList().
void Couenne::exprCopy::ArgList | ( | expression ** | al | ) | [inline, virtual] |
set arglist (used in deleting nodes without deleting children)
Reimplemented from Couenne::expression.
Definition at line 96 of file CouenneExprCopy.hpp.
expression* Couenne::exprCopy::Argument | ( | ) | const [inline, virtual] |
return argument (when applicable, i.e., with univariate functions)
Reimplemented from Couenne::expression.
Definition at line 100 of file CouenneExprCopy.hpp.
References copy_.
expression** Couenne::exprCopy::ArgPtr | ( | ) | [inline, virtual] |
return pointer to argument (when applicable, i.e., with univariate functions)
Reimplemented from Couenne::expression.
Definition at line 104 of file CouenneExprCopy.hpp.
References copy_.
virtual void Couenne::exprCopy::print | ( | std::ostream & | out = std::cout , |
|
bool | descend = false | |||
) | const [virtual] |
I/O.
Reimplemented from Couenne::expression.
Reimplemented in Couenne::exprClone, and Couenne::exprStore.
virtual CouNumber Couenne::exprCopy::Value | ( | ) | const [inline, virtual] |
value
Reimplemented from Couenne::expression.
Reimplemented in Couenne::exprClone.
Definition at line 112 of file CouenneExprCopy.hpp.
References value_.
Referenced by Couenne::exprStore::operator()().
virtual CouNumber Couenne::exprCopy::operator() | ( | ) | [inline, virtual] |
null function for evaluating the expression
Implements Couenne::expression.
Reimplemented in Couenne::exprClone, and Couenne::exprStore.
Definition at line 116 of file CouenneExprCopy.hpp.
CouNumber Couenne::exprCopy::gradientNorm | ( | const double * | x | ) | [inline, virtual] |
return l-2 norm of gradient at given point
Reimplemented from Couenne::expression.
Definition at line 122 of file CouenneExprCopy.hpp.
References copy_.
expression* Couenne::exprCopy::differentiate | ( | int | index | ) | [inline, virtual] |
differentiation
Reimplemented from Couenne::expression.
Definition at line 126 of file CouenneExprCopy.hpp.
References copy_.
int Couenne::exprCopy::DepList | ( | std::set< int > & | deplist, | |
enum dig_type | type = ORIG_ONLY | |||
) | [inline, virtual] |
fill in the set with all indices of variables appearing in the expression
Reimplemented from Couenne::expression.
Definition at line 131 of file CouenneExprCopy.hpp.
References copy_.
expression* Couenne::exprCopy::simplify | ( | ) | [inline, virtual] |
simplify expression (useful for derivatives)
Reimplemented from Couenne::expression.
Definition at line 136 of file CouenneExprCopy.hpp.
References copy_.
int Couenne::exprCopy::Linearity | ( | ) | [inline, virtual] |
get a measure of "how linear" the expression is (see CouenneTypes.h)
Reimplemented from Couenne::expression.
Definition at line 140 of file CouenneExprCopy.hpp.
References copy_.
bool Couenne::exprCopy::isInteger | ( | ) | [inline, virtual] |
is this expression integer?
Reimplemented from Couenne::expression.
Definition at line 143 of file CouenneExprCopy.hpp.
References copy_.
virtual bool Couenne::exprCopy::isDefinedInteger | ( | ) | [inline, virtual] |
is this expression DEFINED as integer?
Reimplemented from Couenne::expression.
Definition at line 147 of file CouenneExprCopy.hpp.
References copy_.
void Couenne::exprCopy::getBounds | ( | expression *& | lower, | |
expression *& | upper | |||
) | [inline, virtual] |
Get lower and upper bound of an expression (if any).
Reimplemented from Couenne::expression.
Definition at line 151 of file CouenneExprCopy.hpp.
References copy_.
Referenced by getBounds().
Get value of lower and upper bound of an expression (if any).
Reimplemented from Couenne::expression.
Definition at line 155 of file CouenneExprCopy.hpp.
References copy_, and getBounds().
exprAux* Couenne::exprCopy::standardize | ( | CouenneProblem * | p, | |
bool | addAux = true | |||
) | [inline, virtual] |
Create standard formulation of this expression.
Reimplemented from Couenne::expression.
Definition at line 160 of file CouenneExprCopy.hpp.
References copy_.
void Couenne::exprCopy::generateCuts | ( | expression * | w, | |
OsiCuts & | cs, | |||
const CouenneCutGenerator * | cg, | |||
t_chg_bounds * | chg = NULL , |
|||
int | wind = -1 , |
|||
CouNumber | lb = -COUENNE_INFINITY , |
|||
CouNumber | ub = COUENNE_INFINITY | |||
) | [inline, virtual] |
generate convexification cut for constraint w = this
Reimplemented from Couenne::expression.
Definition at line 164 of file CouenneExprCopy.hpp.
References copy_.
enum expr_type Couenne::exprCopy::code | ( | ) | [inline, virtual] |
code for comparisons
Reimplemented from Couenne::expression.
Definition at line 173 of file CouenneExprCopy.hpp.
References copy_.
enum convexity Couenne::exprCopy::convexity | ( | ) | const [inline, virtual] |
either CONVEX, CONCAVE, AFFINE, or NONCONVEX
Reimplemented from Couenne::expression.
Definition at line 177 of file CouenneExprCopy.hpp.
References copy_.
int Couenne::exprCopy::compare | ( | expression & | e | ) | [inline, virtual] |
compare this with other expression
Reimplemented from Couenne::expression.
Definition at line 181 of file CouenneExprCopy.hpp.
References copy_.
int Couenne::exprCopy::rank | ( | ) | [inline, virtual] |
used in rank-based branching variable choice
Reimplemented from Couenne::expression.
Definition at line 185 of file CouenneExprCopy.hpp.
References copy_.
bool Couenne::exprCopy::impliedBound | ( | int | wind, | |
CouNumber * | l, | |||
CouNumber * | u, | |||
t_chg_bounds * | chg | |||
) | [inline] |
int Couenne::exprCopy::Multiplicity | ( | ) | [inline, virtual] |
multiplicity of a variable: how many times this variable occurs in expressions throughout the problem
Reimplemented from Couenne::expression.
Definition at line 194 of file CouenneExprCopy.hpp.
References copy_.
CouNumber Couenne::exprCopy::selectBranch | ( | const CouenneObject * | obj, | |
const OsiBranchingInformation * | info, | |||
expression *& | var, | |||
double *& | brpts, | |||
double *& | brDist, | |||
int & | way | |||
) | [inline, virtual] |
Set up branching object by evaluating many branching points for each expression's arguments.
Return estimated improvement in objective function
Reimplemented from Couenne::expression.
Definition at line 199 of file CouenneExprCopy.hpp.
References copy_.
void Couenne::exprCopy::fillDepSet | ( | std::set< DepNode *, compNode > * | dep, | |
DepGraph * | g | |||
) | [inline, virtual] |
fill in dependence structure
Reimplemented from Couenne::expression.
Definition at line 213 of file CouenneExprCopy.hpp.
References copy_.
void Couenne::exprCopy::realign | ( | const CouenneProblem * | p | ) | [virtual] |
bool Couenne::exprCopy::isBijective | ( | ) | const [inline, virtual] |
indicating if function is monotonically increasing
Reimplemented from Couenne::expression.
Definition at line 221 of file CouenneExprCopy.hpp.
References copy_.
CouNumber Couenne::exprCopy::inverse | ( | expression * | vardep | ) | const [inline, virtual] |
compute the inverse function
Reimplemented from Couenne::expression.
Definition at line 225 of file CouenneExprCopy.hpp.
References copy_.
void Couenne::exprCopy::closestFeasible | ( | expression * | varind, | |
expression * | vardep, | |||
CouNumber & | left, | |||
CouNumber & | right | |||
) | const [inline, virtual] |
closest feasible points in function in both directions
Reimplemented from Couenne::expression.
Definition at line 229 of file CouenneExprCopy.hpp.
References copy_.
bool Couenne::exprCopy::isCuttable | ( | CouenneProblem * | problem, | |
int | index | |||
) | const [inline, virtual] |
can this expression be further linearized or are we on its concave ("bad") side
Reimplemented from Couenne::expression.
Definition at line 235 of file CouenneExprCopy.hpp.
References copy_.
expression* Couenne::exprCopy::copy_ [protected] |
the expression this object is a (reference) copy of
Definition at line 30 of file CouenneExprCopy.hpp.
Referenced by ArgList(), ArgPtr(), Argument(), closestFeasible(), code(), compare(), convexity(), Copy(), DepList(), differentiate(), fillDepSet(), generateCuts(), getBounds(), gradientNorm(), Image(), impliedBound(), Index(), inverse(), isBijective(), isCuttable(), isDefinedInteger(), isInteger(), Linearity(), Multiplicity(), nArgs(), Couenne::exprStore::operator()(), operator()(), Couenne::exprClone::operator()(), Original(), rank(), selectBranch(), simplify(), standardize(), Type(), Couenne::exprClone::Value(), Couenne::exprClone::~exprClone(), ~exprCopy(), and Couenne::exprStore::~exprStore().
CouNumber Couenne::exprCopy::value_ [protected] |
saved value to be used by exprStore expressions
Reimplemented in Couenne::exprStore.
Definition at line 33 of file CouenneExprCopy.hpp.
Referenced by operator()(), and Value().