# Couenne::exprOp Class Reference

general n-ary operator-type expression: requires argument list. More...

`#include <CouenneExprOp.hpp>`

Inheritance diagram for Couenne::exprOp:

List of all members.

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

## Detailed Description

general n-ary operator-type expression: requires argument list.

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 31 of file CouenneExprOp.hpp.

## Constructor & Destructor Documentation

Couenne::exprOp::exprOp | ( | expression ** | arglist,
|  | int | nargs |
| ) |  |  | `[inline]`

Constructor.

Definition at line 45 of file CouenneExprOp.hpp.

Couenne::exprOp::exprOp | ( | expression * | arg0,
|  | expression * | arg1 |
| ) |  |  | `[inline]`

Constructor with two arguments (for convenience).

Definition at line 51 of file CouenneExprOp.hpp.

References arglist_.

virtual Couenne::exprOp::~exprOp | ( |  | ) | `[virtual]`

Destructor.

Couenne::exprOp::exprOp | ( | const exprOp & | e,
|  | Domain * | d = `NULL` |
| ) |  |  | `[inline]`

Copy constructor: only allocate space for argument list, which will be copied with clonearglist().

Definition at line 61 of file CouenneExprOp.hpp.

## Member Function Documentation

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

Node type.

Reimplemented from Couenne::expression.

Definition at line 41 of file CouenneExprOp.hpp.

References Couenne::N_ARY.

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

expression** Couenne::exprOp::ArgList | ( |  | ) | const`[inline, virtual]`

return argument list

Reimplemented from Couenne::expression.

Definition at line 66 of file CouenneExprOp.hpp.

References arglist_.

virtual void Couenne::exprOp::ArgList | ( | expression ** | al | ) | `[inline, virtual]`

set arglist (used in deleting nodes without deleting children)

Definition at line 70 of file CouenneExprOp.hpp.

References arglist_.

int Couenne::exprOp::nArgs | ( |  | ) | const`[inline, virtual]`

return number of arguments

Reimplemented from Couenne::expression.

Definition at line 74 of file CouenneExprOp.hpp.

References nargs_.

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

I/O.

Reimplemented from Couenne::expression.

Reimplemented in Couenne::exprGroup, and Couenne::exprQuad.

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

print position (PRE, INSIDE, POST)

Reimplemented in Couenne::exprLBCos, Couenne::exprUBCos, Couenne::exprLBDiv, Couenne::exprUBDiv, Couenne::exprLBMul, Couenne::exprUBMul, Couenne::exprLBSin, Couenne::exprUBSin, Couenne::exprMax, and Couenne::exprMin.

Definition at line 82 of file CouenneExprOp.hpp.

References Couenne::INSIDE.

virtual std::string Couenne::exprOp::printOp | ( |  | ) | const`[inline, virtual]`

print operator

Reimplemented in Couenne::exprLBCos, Couenne::exprUBCos, Couenne::exprLBDiv, Couenne::exprUBDiv, Couenne::exprLBMul, Couenne::exprUBMul, Couenne::exprLBSin, Couenne::exprUBSin, Couenne::exprDiv, Couenne::exprMax, Couenne::exprMin, Couenne::exprOddPow, Couenne::exprPow, Couenne::exprSub, and Couenne::exprSum.

Definition at line 86 of file CouenneExprOp.hpp.

virtual int Couenne::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 Couenne::expression.

Reimplemented in Couenne::exprGroup, and Couenne::exprQuad.

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

simplification

Reimplemented from Couenne::expression.

Reimplemented in Couenne::exprDiv, Couenne::exprGroup, Couenne::exprMax, Couenne::exprMin, Couenne::exprPow, Couenne::exprQuad, Couenne::exprSub, and Couenne::exprSum.

expression** Couenne::exprOp::clonearglist | ( | Domain * | d = `NULL` | ) | const`[inline]`

clone argument list (for use with clone method)

Definition at line 97 of file CouenneExprOp.hpp.

References arglist_, Couenne::expression::clone(), and nargs_.

Referenced by Couenne::exprSum::clone(), Couenne::exprSub::clone(), Couenne::exprPow::clone(), Couenne::exprOddPow::clone(), Couenne::exprMin::clone(), Couenne::exprMax::clone(), Couenne::exprDiv::clone(), Couenne::exprUBMul::clone(), Couenne::exprLBMul::clone(), Couenne::exprUBDiv::clone(), and Couenne::exprLBDiv::clone().

int Couenne::exprOp::shrink_arglist | ( | CouNumber | ,
|  | CouNumber |  |
| ) |  |  |

compress argument list

virtual int Couenne::exprOp::Linearity | ( |  | ) | `[inline, virtual]`

get a measure of "how linear" the expression is (see CouenneTypes.h)

Reimplemented from Couenne::expression.

Reimplemented in Couenne::exprDiv, Couenne::exprGroup, Couenne::exprMax, Couenne::exprMin, Couenne::exprPow, Couenne::exprQuad, Couenne::exprSub, and Couenne::exprSum.

Definition at line 110 of file CouenneExprOp.hpp.

References Couenne::NONLINEAR.

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

generate auxiliary variable

Reimplemented from Couenne::expression.

Reimplemented in Couenne::exprDiv, Couenne::exprMax, Couenne::exprMin, Couenne::exprOddPow, Couenne::exprPow, Couenne::exprSub, and Couenne::exprSum.

virtual enum expr_type Couenne::exprOp::code | ( |  | ) | `[inline, virtual]`

return code to classify type of expression

Reimplemented from Couenne::expression.

Reimplemented in Couenne::exprDiv, Couenne::exprGroup, Couenne::exprMax, Couenne::exprMin, Couenne::exprOddPow, Couenne::exprPow, Couenne::exprQuad, Couenne::exprSub, and Couenne::exprSum.

Definition at line 117 of file CouenneExprOp.hpp.

References Couenne::COU_EXPROP.

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

is this expression integer?

Reimplemented from Couenne::expression.

Reimplemented in Couenne::exprDiv, Couenne::exprGroup, Couenne::exprPow, and Couenne::exprQuad.

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

compare with other generic exprOp

Reimplemented from Couenne::expression.

Reimplemented in Couenne::exprGroup, and Couenne::exprQuad.

virtual int Couenne::exprOp::rank | ( |  | ) | `[virtual]`

used in rank-based branching variable choice

Reimplemented from Couenne::expression.

Reimplemented in Couenne::exprGroup, and Couenne::exprQuad.

virtual void Couenne::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 Couenne::expression.

Reimplemented in Couenne::exprGroup, and Couenne::exprQuad.

Definition at line 131 of file CouenneExprOp.hpp.

References arglist_, and nargs_.

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

replace variable with other

Reimplemented from Couenne::expression.

Reimplemented in Couenne::exprGroup, and Couenne::exprQuad.

virtual void Couenne::exprOp::realign | ( | const CouenneProblem * | p | ) | `[virtual]`

empty function to redirect variables to proper variable vector

Reimplemented from Couenne::expression.

Reimplemented in Couenne::exprGroup, and Couenne::exprQuad.

## Member Data Documentation

expression** Couenne::exprOp::arglist_`[protected]`

argument list is an array of pointers to other expressions

Definition at line 35 of file CouenneExprOp.hpp.

Referenced by ArgList(), Couenne::exprUBSin::clone(), Couenne::exprLBSin::clone(), Couenne::exprUBCos::clone(), Couenne::exprLBCos::clone(), clonearglist(), Couenne::exprLBCos::exprLBCos(), Couenne::exprLBSin::exprLBSin(), Couenne::exprMax::exprMax(), Couenne::exprMin::exprMin(), exprOp(), Couenne::exprUBCos::exprUBCos(), Couenne::exprUBSin::exprUBSin(), fillDepSet(), Couenne::exprPow::getFixVar(), Couenne::exprOddPow::getFixVar(), Couenne::exprSub::Linearity(), Couenne::exprDiv::Linearity(), Couenne::exprSum::operator()(), Couenne::exprSub::operator()(), Couenne::exprPow::operator()(), Couenne::exprOddPow::operator()(), Couenne::exprMin::operator()(), Couenne::exprMax::operator()(), Couenne::exprDiv::operator()(), Couenne::exprUBSin::operator()(), Couenne::exprLBSin::operator()(), Couenne::exprUBMul::operator()(), Couenne::exprLBMul::operator()(), Couenne::exprUBDiv::operator()(), Couenne::exprLBDiv::operator()(), Couenne::exprUBCos::operator()(), and Couenne::exprLBCos::operator()().

int Couenne::exprOp::nargs_`[protected]`

number of arguments (cardinality of arglist)

Definition at line 36 of file CouenneExprOp.hpp.

Referenced by Couenne::exprSum::clone(), Couenne::exprSub::clone(), Couenne::exprPow::clone(), Couenne::exprOddPow::clone(), Couenne::exprMin::clone(), Couenne::exprMax::clone(), Couenne::exprDiv::clone(), Couenne::exprUBMul::clone(), Couenne::exprLBMul::clone(), Couenne::exprUBDiv::clone(), Couenne::exprLBDiv::clone(), clonearglist(), fillDepSet(), nArgs(), Couenne::exprSum::operator()(), Couenne::exprMin::operator()(), and Couenne::exprMax::operator()().

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

- CouenneExprOp.hpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines