#include <exprUnary.hpp>
Inheritance diagram for exprUnary:
Public Member Functions | |
virtual enum nodeType | Type () const |
node type | |
exprUnary (expression *argument) | |
Constructor. | |
virtual unary_function | F () |
the operator itself (e.g. sin, log...) | |
~exprUnary () | |
Destructor. | |
int | nArgs () const |
return number of arguments | |
virtual expression * | Argument () const |
return argument (when applicable, i.e., with univariate functions) | |
virtual expression ** | ArgPtr () |
return pointer to argument (when applicable, i.e., with univariate functions) | |
virtual void | print (std::ostream &out=std::cout, bool=false) const |
print this expression to iostream | |
virtual enum pos | printPos () const |
print position (PRE, INSIDE, POST) | |
virtual std::string | printOp () const |
print operator | |
virtual CouNumber | operator() () |
compute value of unary 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 | |
expression * | simplify () |
simplification | |
virtual int | Linearity () |
get a measure of "how linear" the expression is (see CouenneTypes.h) for general univariate functions, return nonlinear. | |
virtual exprAux * | standardize (CouenneProblem *, bool addAux=true) |
reduce expression in standard form, creating additional aux variables (and constraints) | |
virtual enum expr_type | code () |
type of operator | |
virtual bool | isInteger () |
is this expression integer? | |
virtual int | compare (exprUnary &) |
compare two unary functions | |
virtual int | rank () |
used in rank-based branching variable choice | |
virtual void | fillDepSet (std::set< DepNode *, compNode > *dep, DepGraph *g) |
fill in dependence structure | |
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 * | argument_ |
single argument taken by this expression |
)
univariate operator-type expression: requires single argument. All unary functions are derived from this base class, which has a lot of common methods that need not be re-implemented by any univariate class.
Definition at line 32 of file exprUnary.hpp.
exprUnary::exprUnary | ( | expression * | argument | ) | [inline] |
exprUnary::~exprUnary | ( | ) | [inline] |
virtual enum nodeType exprUnary::Type | ( | ) | const [inline, virtual] |
node type
Reimplemented from expression.
Definition at line 42 of file exprUnary.hpp.
References UNARY.
Referenced by exprInv::Linearity(), replace(), simplify(), and exprOpp::simplify().
virtual unary_function exprUnary::F | ( | ) | [inline, virtual] |
the operator itself (e.g. sin, log...)
Reimplemented in exprAbs, exprCos, exprExp, exprInv, exprLog, exprOpp, and exprSin.
Definition at line 51 of file exprUnary.hpp.
References zero_fun().
Referenced by isInteger(), and operator()().
int exprUnary::nArgs | ( | ) | const [inline, virtual] |
return number of arguments
Reimplemented from expression.
Definition at line 59 of file exprUnary.hpp.
virtual expression* exprUnary::Argument | ( | ) | const [inline, virtual] |
return argument (when applicable, i.e., with univariate functions)
Reimplemented from expression.
Definition at line 63 of file exprUnary.hpp.
References argument_.
Referenced by exprCos::generateCuts(), exprSin::generateCuts(), and exprOpp::simplify().
virtual expression** exprUnary::ArgPtr | ( | ) | [inline, virtual] |
return pointer to argument (when applicable, i.e., with univariate functions)
Reimplemented from expression.
Definition at line 67 of file exprUnary.hpp.
References argument_.
void exprUnary::print | ( | std::ostream & | out = std::cout , |
|
bool | = false | |||
) | const [virtual] |
print this expression to iostream
Reimplemented from expression.
Reimplemented in exprInv, and exprOpp.
Definition at line 18 of file exprUnary.cpp.
References argument_, POST, PRE, printOp(), and printPos().
virtual enum pos exprUnary::printPos | ( | ) | const [inline, virtual] |
print position (PRE, INSIDE, POST)
Definition at line 74 of file exprUnary.hpp.
References PRE.
Referenced by print().
virtual std::string exprUnary::printOp | ( | ) | const [inline, virtual] |
virtual CouNumber exprUnary::operator() | ( | ) | [inline, virtual] |
compute value of unary operator
Implements expression.
Definition at line 82 of file exprUnary.hpp.
References F().
virtual int exprUnary::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 expression.
Definition at line 87 of file exprUnary.hpp.
References argument_.
expression * exprUnary::simplify | ( | ) | [virtual] |
simplification
Reimplemented from expression.
Reimplemented in exprOpp.
Definition at line 39 of file simplify.cpp.
References argument_, CONST, and Type().
Referenced by exprOpp::simplify().
virtual int exprUnary::Linearity | ( | ) | [inline, virtual] |
get a measure of "how linear" the expression is (see CouenneTypes.h) for general univariate functions, return nonlinear.
Reimplemented from expression.
Reimplemented in exprInv, and exprOpp.
Definition at line 95 of file exprUnary.hpp.
References NONLINEAR.
exprAux * exprUnary::standardize | ( | CouenneProblem * | , | |
bool | addAux = true | |||
) | [virtual] |
reduce expression in standard form, creating additional aux variables (and constraints)
Reimplemented from expression.
Reimplemented in exprOpp.
Definition at line 47 of file exprUnary.cpp.
References argument_.
virtual enum expr_type exprUnary::code | ( | ) | [inline, virtual] |
type of operator
Reimplemented from expression.
Reimplemented in exprAbs, exprCos, exprExp, exprInv, exprLog, exprOpp, and exprSin.
Definition at line 103 of file exprUnary.hpp.
References COU_EXPRUNARY.
Referenced by compare().
bool exprUnary::isInteger | ( | ) | [virtual] |
is this expression integer?
Reimplemented from expression.
Reimplemented in exprAbs, and exprOpp.
Definition at line 75 of file exprUnary.cpp.
References argument_, COUENNE_EPS, COUENNE_INFINITY, COUENNE_round, F(), and expression::getBounds().
Referenced by exprSin::impliedBound(), exprLog::impliedBound(), exprInv::impliedBound(), and exprCos::impliedBound().
int exprUnary::compare | ( | exprUnary & | ) | [virtual] |
virtual int exprUnary::rank | ( | ) | [inline, virtual] |
used in rank-based branching variable choice
Reimplemented from expression.
Definition at line 113 of file exprUnary.hpp.
References argument_.
virtual void exprUnary::fillDepSet | ( | std::set< DepNode *, compNode > * | dep, | |
DepGraph * | g | |||
) | [inline, virtual] |
fill in dependence structure
Reimplemented from expression.
Definition at line 117 of file exprUnary.hpp.
replace variable with other
Reimplemented from expression.
Definition at line 63 of file exprUnary.cpp.
References argument_, expression::Index(), Type(), VAR, w, and x.
virtual void exprUnary::realign | ( | const CouenneProblem * | p | ) | [inline, virtual] |
empty function to redirect variables to proper variable vector
Reimplemented from expression.
Definition at line 124 of file exprUnary.hpp.
References argument_.
expression* exprUnary::argument_ [protected] |
single argument taken by this expression
Definition at line 37 of file exprUnary.hpp.
Referenced by ArgPtr(), Argument(), exprSin::clone(), exprOpp::clone(), exprLog::clone(), exprInv::clone(), exprExp::clone(), exprCos::clone(), exprAbs::clone(), compare(), DepList(), exprSin::differentiate(), exprOpp::differentiate(), exprLog::differentiate(), exprInv::differentiate(), exprExp::differentiate(), exprCos::differentiate(), exprAbs::differentiate(), fillDepSet(), exprOpp::generateCuts(), exprLog::generateCuts(), exprInv::generateCuts(), exprExp::generateCuts(), exprAbs::generateCuts(), exprSin::getBounds(), exprOpp::getBounds(), exprLog::getBounds(), exprExp::getBounds(), exprCos::getBounds(), exprAbs::getBounds(), exprInv::getBounds(), exprSin::gradientNorm(), exprOpp::gradientNorm(), exprLog::gradientNorm(), exprInv::gradientNorm(), exprExp::gradientNorm(), exprCos::gradientNorm(), exprAbs::gradientNorm(), exprSin::impliedBound(), exprOpp::impliedBound(), exprLog::impliedBound(), exprInv::impliedBound(), exprExp::impliedBound(), exprCos::impliedBound(), exprAbs::impliedBound(), exprLog::isCuttable(), exprInv::isCuttable(), exprExp::isCuttable(), exprAbs::isCuttable(), exprOpp::isInteger(), exprAbs::isInteger(), isInteger(), exprOpp::Linearity(), exprInv::Linearity(), exprOpp::print(), exprInv::print(), print(), rank(), realign(), replace(), exprLog::selectBranch(), exprInv::selectBranch(), exprExp::selectBranch(), exprAbs::selectBranch(), simplify(), exprOpp::simplify(), exprOpp::standardize(), standardize(), and ~exprUnary().