# Couenne::exprUnary Class Reference

expression class for unary functions (sin, log, etc. More...

`#include <CouenneExprUnary.hpp>`

Inheritance diagram for Couenne::exprUnary:

List of all members.

## 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

## Detailed Description

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.

## Constructor & Destructor Documentation

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.

References argument_.

## Member Function Documentation

virtual enum nodeType Couenne::exprUnary::Type | ( |  | ) | const`[inline, virtual]`

node type

Reimplemented from Couenne::expression.

Definition at line 43 of file CouenneExprUnary.hpp.

References Couenne::UNARY.

Referenced by Couenne::exprInv::Linearity().

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.

References Couenne::zero_fun().

Referenced by operator()().

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.

References argument_.

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.

References argument_.

virtual void Couenne::exprUnary::print | ( | std::ostream & | out = `std::cout`,
|  | bool | = `false` |
| ) |  |  | const`[virtual]`

print this expression to iostream

Reimplemented from Couenne::expression.

Reimplemented in Couenne::exprInv, and Couenne::exprOpp.

virtual enum pos Couenne::exprUnary::printPos | ( |  | ) | const`[inline, virtual]`

print position (PRE, INSIDE, POST)

Definition at line 75 of file CouenneExprUnary.hpp.

References Couenne::PRE.

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.

References F().

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.

References argument_, and DepList().

Referenced by DepList().

expression* Couenne::exprUnary::simplify | ( |  | ) | `[virtual]`

simplification

Reimplemented from Couenne::expression.

Reimplemented in Couenne::exprOpp.

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.

References Couenne::NONLINEAR.

virtual exprAux* Couenne::exprUnary::standardize | ( | CouenneProblem * | ,
|  | bool | addAux = `true` |
| ) |  |  | `[virtual]`

reduce expression in standard form, creating additional aux variables (and constraints)

Reimplemented from Couenne::expression.

Reimplemented in Couenne::exprOpp.

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.

References Couenne::COU_EXPRUNARY.

virtual bool Couenne::exprUnary::isInteger | ( |  | ) | `[virtual]`

is this expression integer?

Reimplemented from Couenne::expression.

Reimplemented in Couenne::exprAbs, and Couenne::exprOpp.

Referenced by Couenne::exprSin::impliedBound(), and Couenne::exprCos::impliedBound().

virtual int Couenne::exprUnary::compare | ( | exprUnary & |  | ) | `[virtual]`

compare two unary functions

Reimplemented from Couenne::expression.

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.

References argument_.

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.

References argument_, and fillDepSet().

Referenced by fillDepSet().

virtual void Couenne::exprUnary::replace | ( | exprVar * | ,
|  | exprVar * |  |
| ) |  |  | `[virtual]`

replace variable with other

Reimplemented from Couenne::expression.

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.

References argument_, and realign().

Referenced by realign().

## Member Data Documentation

expression* Couenne::exprUnary::argument_`[protected]`

single argument taken by this expression

Definition at line 38 of file CouenneExprUnary.hpp.

Referenced by ArgPtr(), Argument(), Couenne::exprSin::clone(), Couenne::exprOpp::clone(), Couenne::exprLog::clone(), Couenne::exprInv::clone(), Couenne::exprFloor::clone(), Couenne::exprExp::clone(), Couenne::exprCos::clone(), Couenne::exprCeil::clone(), Couenne::exprAbs::clone(), DepList(), fillDepSet(), Couenne::exprSin::gradientNorm(), Couenne::exprOpp::gradientNorm(), Couenne::exprFloor::gradientNorm(), Couenne::exprExp::gradientNorm(), Couenne::exprCos::gradientNorm(), Couenne::exprCeil::gradientNorm(), Couenne::exprAbs::gradientNorm(), Couenne::exprSin::impliedBound(), Couenne::exprCos::impliedBound(), Couenne::exprOpp::isInteger(), Couenne::exprAbs::isInteger(), Couenne::exprOpp::Linearity(), Couenne::exprInv::Linearity(), rank(), realign(), and ~exprUnary().

The documentation for this class was generated from the following file:

- CouenneExprUnary.hpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines