#include <exprOp.hpp>
Inheritance diagram for exprOp:
Public Member Functions | |
virtual enum nodeType | Type () const |
Node type. | |
exprOp (expression **arglist, int nargs) | |
Constructor. | |
exprOp (expression *arg0, expression *arg1) | |
Constructor with two arguments (for convenience). | |
virtual | ~exprOp () |
Destructor. | |
exprOp (const exprOp &e, Domain *d=NULL) | |
Copy constructor: only allocate space for argument list, which will be copied with clonearglist(). | |
expression ** | ArgList () const |
return argument list | |
virtual void | ArgList (expression **al) |
set arglist (used in deleting nodes without deleting children) | |
int | nArgs () const |
return number of arguments | |
virtual void | print (std::ostream &out=std::cout, bool=false) const |
I/O. | |
virtual enum pos | printPos () const |
print position (PRE, INSIDE, POST) | |
virtual std::string | printOp () const |
print operator | |
virtual 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 | |
virtual expression * | simplify () |
simplification | |
expression ** | clonearglist (Domain *d=NULL) const |
clone argument list (for use with clone method) | |
int | shrink_arglist (CouNumber, CouNumber) |
compress argument list | |
virtual int | Linearity () |
get a measure of "how linear" the expression is (see CouenneTypes.h) | |
virtual exprAux * | standardize (CouenneProblem *, bool addAux=true) |
generate auxiliary variable | |
virtual enum expr_type | code () |
return code to classify type of expression | |
virtual bool | isInteger () |
is this expression integer? | |
virtual int | compare (exprOp &) |
compare with other generic exprOp | |
virtual int | rank () |
used in rank-based branching variable choice | |
virtual void | fillDepSet (std::set< DepNode *, compNode > *dep, DepGraph *g) |
fill in dependence structure update dependence set with index of this variable | |
virtual void | replace (exprVar *, exprVar *) |
replace variable with other | |
virtual void | realign (const CouenneProblem *p) |
empty function to redirect variables to proper variable vector | |
Protected Attributes | |
expression ** | arglist_ |
argument list is an array of pointers to other expressions | |
int | nargs_ |
number of arguments (cardinality of arglist) |
All non-unary and non-leaf operators, i.e., sum, subtraction, multiplication, power, division, max, min, etc. are derived from this class.
Definition at line 29 of file exprOp.hpp.
exprOp::exprOp | ( | expression ** | arglist, | |
int | nargs | |||
) | [inline] |
exprOp::exprOp | ( | expression * | arg0, | |
expression * | arg1 | |||
) | [inline] |
Constructor with two arguments (for convenience).
Definition at line 49 of file exprOp.hpp.
References arglist_.
exprOp::~exprOp | ( | ) | [virtual] |
Copy constructor: only allocate space for argument list, which will be copied with clonearglist().
Definition at line 59 of file exprOp.hpp.
virtual enum nodeType exprOp::Type | ( | ) | const [inline, virtual] |
Node type.
Reimplemented from expression.
Definition at line 39 of file exprOp.hpp.
References N_ARY.
Referenced by exprSum::generateCuts(), exprMul::generateCuts(), exprGroup::generateCuts(), exprPow::getBounds(), exprMul::getBounds(), exprPow::impliedBound(), exprMul::impliedBound(), exprDiv::impliedBound(), exprPow::Linearity(), exprDiv::Linearity(), exprGroup::print(), exprQuad::realign(), exprGroup::realign(), replace(), exprPow::selectBranch(), exprSum::simplify(), exprSub::simplify(), exprPow::simplify(), exprMul::simplify(), exprDiv::simplify(), standardize(), and exprPow::standardize().
expression** exprOp::ArgList | ( | ) | const [inline, virtual] |
return argument list
Reimplemented from expression.
Definition at line 64 of file exprOp.hpp.
References arglist_.
Referenced by compare().
virtual void exprOp::ArgList | ( | expression ** | al | ) | [inline, virtual] |
set arglist (used in deleting nodes without deleting children)
Reimplemented from expression.
Definition at line 68 of file exprOp.hpp.
References arglist_.
int exprOp::nArgs | ( | ) | const [inline, virtual] |
return number of arguments
Reimplemented from expression.
Definition at line 72 of file exprOp.hpp.
References nargs_.
void exprOp::print | ( | std::ostream & | out = std::cout , |
|
bool | = false | |||
) | const [virtual] |
I/O.
Reimplemented from expression.
Reimplemented in exprGroup, and exprQuad.
Definition at line 37 of file exprOp.cpp.
References arglist_, INSIDE, MAX_ARG_LINE, nargs_, PRE, printOp(), and printPos().
Referenced by exprGroup::print().
virtual enum pos exprOp::printPos | ( | ) | const [inline, virtual] |
virtual std::string exprOp::printOp | ( | ) | const [inline, virtual] |
int exprOp::DepList | ( | std::set< int > & | deplist, | |
enum dig_type | type = ORIG_ONLY | |||
) | [virtual] |
fill in the set with all indices of variables appearing in the expression
Reimplemented from expression.
Reimplemented in exprGroup, and exprQuad.
Definition at line 204 of file exprOp.cpp.
References arglist_, and nargs_.
Referenced by exprGroup::DepList().
expression * exprOp::simplify | ( | ) | [virtual] |
simplification
Reimplemented from expression.
Reimplemented in exprDiv, exprGroup, exprMax, exprMin, exprMul, exprPow, exprQuad, exprSub, and exprSum.
Definition at line 19 of file simplify.cpp.
References arglist_, and nargs_.
Referenced by exprSum::simplify(), exprSub::simplify(), exprQuad::simplify(), exprPow::simplify(), exprMul::simplify(), exprGroup::simplify(), and exprDiv::simplify().
expression** exprOp::clonearglist | ( | Domain * | d = NULL |
) | const [inline] |
clone argument list (for use with clone method)
Definition at line 95 of file exprOp.hpp.
References arglist_, expression::clone(), and nargs_.
Referenced by exprSum::clone(), exprSub::clone(), exprPow::clone(), exprMul::clone(), exprMin::clone(), exprMax::clone(), exprDiv::clone(), exprUBMul::clone(), exprLBMul::clone(), exprUBDiv::clone(), and exprLBDiv::clone().
compress argument list
Definition at line 55 of file simplifiers.cpp.
References arglist_, COUENNE_EPS, k, and nargs_.
Referenced by exprSum::simplify(), and exprMul::simplify().
virtual int exprOp::Linearity | ( | ) | [inline, virtual] |
exprAux * exprOp::standardize | ( | CouenneProblem * | , | |
bool | addAux = true | |||
) | [virtual] |
generate auxiliary variable
Reimplemented from expression.
Reimplemented in exprDiv, exprMax, exprMin, exprMul, exprPow, exprSub, and exprSum.
Definition at line 137 of file exprOp.cpp.
References arglist_, AUX, nargs_, Type(), and VAR.
Referenced by exprPow::standardize(), exprMul::standardize(), and exprDiv::standardize().
virtual enum expr_type exprOp::code | ( | ) | [inline, virtual] |
return code to classify type of expression
Reimplemented from expression.
Reimplemented in exprDiv, exprGroup, exprMax, exprMin, exprMul, exprPow, exprQuad, exprSub, and exprSum.
Definition at line 115 of file exprOp.hpp.
References COU_EXPROP.
Referenced by compare().
bool exprOp::isInteger | ( | ) | [virtual] |
is this expression integer?
Reimplemented from expression.
Reimplemented in exprDiv, exprGroup, exprPow, and exprQuad.
Definition at line 182 of file exprOp.cpp.
References arglist_, COUENNE_EPS, expression::getBounds(), Domain::lb(), nargs_, and Domain::ub().
Referenced by exprSub::impliedBound(), exprSum::impliedBound(), exprMul::impliedBound(), exprGroup::isInteger(), and exprMul::standardize().
int exprOp::compare | ( | exprOp & | ) | [virtual] |
compare with other generic exprOp
Definition at line 66 of file exprOp.cpp.
References ArgList(), arglist_, code(), COU_EXPRGROUP, COU_EXPRQUAD, and nargs_.
Referenced by exprSum::exprSum(), and exprSub::simplify().
int exprOp::rank | ( | ) | [virtual] |
used in rank-based branching variable choice
Reimplemented from expression.
Reimplemented in exprGroup, and exprQuad.
Definition at line 113 of file exprOp.cpp.
References arglist_, nargs_, and r.
Referenced by exprGroup::rank().
virtual void exprOp::fillDepSet | ( | std::set< DepNode *, compNode > * | dep, | |
DepGraph * | g | |||
) | [inline, virtual] |
fill in dependence structure update dependence set with index of this variable
Reimplemented from expression.
Reimplemented in exprGroup, and exprQuad.
Definition at line 129 of file exprOp.hpp.
References arglist_, g, and nargs_.
Referenced by exprGroup::fillDepSet().
replace variable with other
Reimplemented from expression.
Reimplemented in exprGroup, and exprQuad.
Definition at line 153 of file exprOp.cpp.
References arglist_, AUX, expression::Index(), N_ARY, nargs_, Type(), UNARY, VAR, w, and x.
Referenced by exprGroup::replace().
void exprOp::realign | ( | const CouenneProblem * | p | ) | [virtual] |
empty function to redirect variables to proper variable vector
Reimplemented from expression.
Reimplemented in exprGroup, and exprQuad.
Definition at line 228 of file exprOp.cpp.
expression** exprOp::arglist_ [protected] |
argument list is an array of pointers to other expressions
Definition at line 33 of file exprOp.hpp.
Referenced by ArgList(), exprMul::balancedMul(), exprUBSin::clone(), exprLBSin::clone(), exprUBCos::clone(), exprLBCos::clone(), clonearglist(), exprPow::closestFeasible(), exprMul::closestFeasible(), exprDiv::closestFeasible(), compare(), DepList(), exprSum::differentiate(), exprSub::differentiate(), exprQuad::differentiate(), exprPow::differentiate(), exprMul::differentiate(), exprGroup::differentiate(), exprDiv::differentiate(), exprLBCos::exprLBCos(), exprLBSin::exprLBSin(), exprMax::exprMax(), exprMin::exprMin(), exprMul::exprMul(), exprOp(), exprSum::exprSum(), exprUBCos::exprUBCos(), exprUBSin::exprUBSin(), fillDepSet(), exprSum::generateCuts(), exprSub::generateCuts(), exprPow::generateCuts(), exprMul::generateCuts(), exprGroup::generateCuts(), exprDiv::generateCuts(), exprSum::getBounds(), exprSub::getBounds(), exprDiv::getBounds(), exprPow::getBounds(), exprMul::getBounds(), exprPow::getFixVar(), exprPow::gradientNorm(), exprMul::gradientNorm(), exprDiv::gradientNorm(), exprSub::impliedBound(), exprSum::impliedBound(), exprPow::impliedBound(), exprMul::impliedBound(), exprDiv::impliedBound(), exprPow::isCuttable(), exprPow::isInteger(), exprDiv::isInteger(), isInteger(), exprSum::Linearity(), exprSub::Linearity(), exprPow::Linearity(), exprMul::Linearity(), exprDiv::Linearity(), exprSum::operator()(), exprSub::operator()(), exprPow::operator()(), exprMul::operator()(), exprMin::operator()(), exprMax::operator()(), exprDiv::operator()(), exprUBSin::operator()(), exprLBSin::operator()(), exprUBMul::operator()(), exprLBMul::operator()(), exprUBDiv::operator()(), exprLBDiv::operator()(), exprUBCos::operator()(), exprLBCos::operator()(), print(), rank(), realign(), replace(), exprPow::selectBranch(), exprMul::selectBranch(), exprDiv::selectBranch(), shrink_arglist(), simplify(), exprSum::simplify(), exprSub::simplify(), exprPow::simplify(), exprMul::simplify(), exprDiv::simplify(), exprSub::standardize(), exprSum::standardize(), standardize(), exprPow::standardize(), exprMul::standardize(), and ~exprOp().
int exprOp::nargs_ [protected] |
number of arguments (cardinality of arglist)
Definition at line 34 of file exprOp.hpp.
Referenced by exprSum::clone(), exprSub::clone(), exprPow::clone(), exprMul::clone(), exprMin::clone(), exprMax::clone(), exprDiv::clone(), exprUBMul::clone(), exprLBMul::clone(), exprUBDiv::clone(), exprLBDiv::clone(), clonearglist(), compare(), DepList(), exprSum::differentiate(), exprSub::differentiate(), exprQuad::differentiate(), exprMul::differentiate(), exprGroup::differentiate(), exprMul::exprMul(), exprSum::exprSum(), fillDepSet(), exprSum::generateCuts(), exprGroup::generateCuts(), exprSum::getBounds(), exprSum::impliedBound(), isInteger(), exprSum::Linearity(), exprMul::Linearity(), nArgs(), exprSum::operator()(), exprMul::operator()(), exprMin::operator()(), exprMax::operator()(), exprGroup::print(), print(), rank(), realign(), replace(), shrink_arglist(), simplify(), exprSum::simplify(), exprMul::simplify(), exprSum::standardize(), standardize(), exprMul::standardize(), and ~exprOp().