expression class for unary functions (sin, log, etc. More...
#include <CouenneExprUnary.hpp>
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 |
expression class for unary functions (sin, log, etc.
)
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 33 of file CouenneExprUnary.hpp.
Couenne::exprUnary::exprUnary | ( | expression * | argument | ) | [inline] |
Constructor.
Definition at line 47 of file CouenneExprUnary.hpp.
Couenne::exprUnary::~exprUnary | ( | ) | [inline] |
Destructor.
Definition at line 56 of file CouenneExprUnary.hpp.
virtual enum nodeType Couenne::exprUnary::Type | ( | ) | const [inline, virtual] |
node type
Reimplemented from Couenne::expression.
Definition at line 43 of file CouenneExprUnary.hpp.
virtual unary_function Couenne::exprUnary::F | ( | ) | [inline, virtual] |
the operator itself (e.g. sin, log...)
Reimplemented in Couenne::exprAbs, Couenne::exprCeil, Couenne::exprCos, Couenne::exprExp, Couenne::exprFloor, Couenne::exprInv, Couenne::exprLog, Couenne::exprOpp, and Couenne::exprSin.
Definition at line 52 of file CouenneExprUnary.hpp.
int Couenne::exprUnary::nArgs | ( | ) | const [inline, virtual] |
return number of arguments
Reimplemented from Couenne::expression.
Definition at line 60 of file CouenneExprUnary.hpp.
virtual expression* Couenne::exprUnary::Argument | ( | ) | const [inline, virtual] |
return argument (when applicable, i.e., with univariate functions)
Reimplemented from Couenne::expression.
Definition at line 64 of file CouenneExprUnary.hpp.
virtual expression** Couenne::exprUnary::ArgPtr | ( | ) | [inline, virtual] |
return pointer to argument (when applicable, i.e., with univariate functions)
Reimplemented from Couenne::expression.
Definition at line 68 of file CouenneExprUnary.hpp.
void exprUnary::print | ( | std::ostream & | out = std::cout , |
|
bool | descend = false | |||
) | const [virtual] |
print this expression to iostream
Reimplemented from Couenne::expression.
Reimplemented in Couenne::exprInv, and Couenne::exprOpp.
Definition at line 21 of file exprUnary.cpp.
virtual enum pos Couenne::exprUnary::printPos | ( | ) | const [inline, virtual] |
print position (PRE, INSIDE, POST)
Definition at line 75 of file CouenneExprUnary.hpp.
virtual std::string Couenne::exprUnary::printOp | ( | ) | const [inline, virtual] |
print operator
Reimplemented in Couenne::exprAbs, Couenne::exprCeil, Couenne::exprCos, Couenne::exprExp, Couenne::exprFloor, Couenne::exprLog, and Couenne::exprSin.
Definition at line 79 of file CouenneExprUnary.hpp.
virtual CouNumber Couenne::exprUnary::operator() | ( | ) | [inline, virtual] |
compute value of unary operator
Implements Couenne::expression.
Definition at line 83 of file CouenneExprUnary.hpp.
virtual int Couenne::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 Couenne::expression.
Definition at line 88 of file CouenneExprUnary.hpp.
expression * exprUnary::simplify | ( | ) | [virtual] |
simplification
Reimplemented from Couenne::expression.
Reimplemented in Couenne::exprOpp.
Definition at line 40 of file simplify.cpp.
virtual int Couenne::exprUnary::Linearity | ( | ) | [inline, virtual] |
get a measure of "how linear" the expression is (see CouenneTypes.h) for general univariate functions, return nonlinear.
Reimplemented from Couenne::expression.
Reimplemented in Couenne::exprInv, and Couenne::exprOpp.
Definition at line 96 of file CouenneExprUnary.hpp.
exprAux * exprUnary::standardize | ( | CouenneProblem * | p, | |
bool | addAux = true | |||
) | [virtual] |
reduce expression in standard form, creating additional aux variables (and constraints)
Reimplemented from Couenne::expression.
Reimplemented in Couenne::exprOpp.
Definition at line 50 of file exprUnary.cpp.
virtual enum expr_type Couenne::exprUnary::code | ( | ) | [inline, virtual] |
type of operator
Reimplemented from Couenne::expression.
Reimplemented in Couenne::exprAbs, Couenne::exprCeil, Couenne::exprCos, Couenne::exprExp, Couenne::exprFloor, Couenne::exprInv, Couenne::exprLog, Couenne::exprOpp, and Couenne::exprSin.
Definition at line 104 of file CouenneExprUnary.hpp.
bool exprUnary::isInteger | ( | ) | [virtual] |
is this expression integer?
Reimplemented from Couenne::expression.
Reimplemented in Couenne::exprAbs, and Couenne::exprOpp.
Definition at line 78 of file exprUnary.cpp.
int exprUnary::compare | ( | exprUnary & | e1 | ) | [virtual] |
compare two unary functions
comparison when looking for duplicates
Reimplemented from Couenne::expression.
Definition at line 33 of file exprUnary.cpp.
virtual int Couenne::exprUnary::rank | ( | ) | [inline, virtual] |
used in rank-based branching variable choice
Reimplemented from Couenne::expression.
Definition at line 114 of file CouenneExprUnary.hpp.
virtual void Couenne::exprUnary::fillDepSet | ( | std::set< DepNode *, compNode > * | dep, | |
DepGraph * | g | |||
) | [inline, virtual] |
fill in dependence structure
Reimplemented from Couenne::expression.
Definition at line 118 of file CouenneExprUnary.hpp.
replace variable with other
Reimplemented from Couenne::expression.
Definition at line 66 of file exprUnary.cpp.
virtual void Couenne::exprUnary::realign | ( | const CouenneProblem * | p | ) | [inline, virtual] |
empty function to redirect variables to proper variable vector
Reimplemented from Couenne::expression.
Definition at line 125 of file CouenneExprUnary.hpp.
expression* Couenne::exprUnary::argument_ [protected] |
single argument taken by this expression
Definition at line 38 of file CouenneExprUnary.hpp.