# Couenne::exprCopy Class Reference

`#include <CouenneExprCopy.hpp>`

Inheritance diagram for Couenne::exprCopy:

List of all members.

## Public Member Functions
enum nodeType | Type () const
| node type
| exprCopy (expression *copy)
| Empty constructor - used in cloning method of exprClone.
| exprCopy (const exprCopy &e, Domain *d=NULL)
| Copy constructor.
virtual | ~exprCopy ()
| Destructor -- CAUTION: this is the only destructive destructor, exprClone and exprStore do not destroy anything.
virtual expression * | clone (Domain *d=NULL) const
| Cloning method.
const expression * | Original () const
| If this is an exprClone of a exprClone of an expr???, point to the original expr??? instead of an exprClone -- improves computing efficiency.
bool | isaCopy () const
| return true if this is a copy of something, i.e.
expression * | Copy () const
| return copy of this expression (only makes sense in exprCopy)
expression * | Image () const
| return pointer to corresponding expression (for auxiliary variables only)
int | Index () const
| Get variable index in problem.
int | nArgs () const
| Return number of arguments (when applicable, that is, with N-ary functions).
expression ** | ArgList () const
| return arglist (when applicable, that is, with N-ary functions)
void | ArgList (expression **al)
| set arglist (used in deleting nodes without deleting children)
expression * | Argument () const
| return argument (when applicable, i.e., with univariate functions)
expression ** | ArgPtr ()
| return pointer to argument (when applicable, i.e., with univariate functions)
virtual void | print (std::ostream &out=std::cout, bool descend=false) const
| I/O.
virtual CouNumber | Value () const
| value
virtual CouNumber | operator() ()
| null function for evaluating the expression
CouNumber | gradientNorm (const double *x)
| return l-2 norm of gradient at given point
expression * | differentiate (int index)
| differentiation
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 ()
| simplify expression (useful for derivatives)
int | Linearity ()
| get a measure of "how linear" the expression is (see CouenneTypes.h)
bool | isInteger ()
| is this expression integer?
virtual bool | isDefinedInteger ()
| is this expression DEFINED as integer?
void | getBounds (expression *&lower, expression *&upper)
| Get lower and upper bound of an expression (if any).
void | getBounds (CouNumber &lower, CouNumber &upper)
| Get value of lower and upper bound of an expression (if any).
exprAux * | standardize (CouenneProblem *p, bool addAux=true)
| Create standard formulation of this expression.
void | generateCuts (expression *w, OsiCuts &cs, const CouenneCutGenerator *cg, t_chg_bounds *chg=NULL, int wind=-1, CouNumber lb=-COUENNE_INFINITY, CouNumber ub=COUENNE_INFINITY)
| generate convexification cut for constraint w = this
enum expr_type | code ()
| code for comparisons
enum convexity | convexity () const
| either CONVEX, CONCAVE, AFFINE, or NONCONVEX
int | compare (expression &e)
| compare this with other expression
int | rank ()
| used in rank-based branching variable choice
bool | impliedBound (int wind, CouNumber *l, CouNumber *u, t_chg_bounds *chg)
| implied bound processing
int | Multiplicity ()
| multiplicity of a variable: how many times this variable occurs in expressions throughout the problem
CouNumber | selectBranch (const CouenneObject *obj, const OsiBranchingInformation *info, expression *&var, double *&brpts, double *&brDist, int &way)
| Set up branching object by evaluating many branching points for each expression's arguments.
void | replace (exprVar *, exprVar *)
| replace occurrence of a variable with another variable
void | fillDepSet (std::set< DepNode *, compNode > *dep, DepGraph *g)
| fill in dependence structure
void | realign (const CouenneProblem *p)
| redirect variables to proper variable vector
bool | isBijective () const
| indicating if function is monotonically increasing
CouNumber | inverse (expression *vardep) const
| compute the inverse function
void | closestFeasible (expression *varind, expression *vardep, CouNumber &left, CouNumber &right) const
| closest feasible points in function in both directions
bool | isCuttable (CouenneProblem *problem, int index) const
| can this expression be further linearized or are we on its concave ("bad") side
## Protected Attributes
expression * | copy_
| the expression this object is a (reference) copy of
CouNumber | value_
| saved value to be used by exprStore expressions

## Detailed Description

Definition at line 25 of file CouenneExprCopy.hpp.

## Constructor & Destructor Documentation

Couenne::exprCopy::exprCopy | ( | expression * | copy | ) | `[inline]`

Empty constructor - used in cloning method of exprClone.

Constructor

Definition at line 45 of file CouenneExprCopy.hpp.

Referenced by clone().

Couenne::exprCopy::exprCopy | ( | const exprCopy & | e,
|  | Domain * | d = `NULL` |
| ) |  |  |

Copy constructor.

virtual Couenne::exprCopy::~exprCopy | ( |  | ) | `[inline, virtual]`

Destructor -- CAUTION: this is the only destructive destructor, exprClone and exprStore do not destroy anything.

Definition at line 55 of file CouenneExprCopy.hpp.

References copy_.

## Member Function Documentation

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

node type

Reimplemented from Couenne::expression.

Definition at line 38 of file CouenneExprCopy.hpp.

References copy_, and Type().

Referenced by Type().

virtual expression* Couenne::exprCopy::clone | ( | Domain * | d = `NULL` | ) | const`[inline, virtual]`

Cloning method.

Reimplemented from Couenne::expression.

Reimplemented in Couenne::exprClone, and Couenne::exprStore.

Definition at line 61 of file CouenneExprCopy.hpp.

References exprCopy().

const expression* Couenne::exprCopy::Original | ( |  | ) | const`[inline, virtual]`

If this is an exprClone of a exprClone of an expr???, point to the original expr??? instead of an exprClone -- improves computing efficiency.

Reimplemented from Couenne::expression.

Definition at line 67 of file CouenneExprCopy.hpp.

References copy_, and Original().

Referenced by Original().

bool Couenne::exprCopy::isaCopy | ( |  | ) | const`[inline, virtual]`

return true if this is a copy of something, i.e.

if it is an exprCopy or derivates

Reimplemented from Couenne::expression.

Definition at line 72 of file CouenneExprCopy.hpp.

Referenced by Copy().

expression* Couenne::exprCopy::Copy | ( |  | ) | const`[inline, virtual]`

return copy of this expression (only makes sense in exprCopy)

Reimplemented from Couenne::expression.

Definition at line 76 of file CouenneExprCopy.hpp.

References Copy(), copy_, and isaCopy().

Referenced by Copy().

expression* Couenne::exprCopy::Image | ( |  | ) | const`[inline, virtual]`

return pointer to corresponding expression (for auxiliary variables only)

Reimplemented from Couenne::expression.

Definition at line 80 of file CouenneExprCopy.hpp.

References copy_, and Image().

Referenced by Image().

int Couenne::exprCopy::Index | ( |  | ) | const`[inline, virtual]`

Get variable index in problem.

Reimplemented from Couenne::expression.

Definition at line 84 of file CouenneExprCopy.hpp.

References copy_, and Index().

Referenced by Index().

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

Return number of arguments (when applicable, that is, with N-ary functions).

Reimplemented from Couenne::expression.

Definition at line 88 of file CouenneExprCopy.hpp.

References copy_, and nArgs().

Referenced by nArgs().

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

return arglist (when applicable, that is, with N-ary functions)

Reimplemented from Couenne::expression.

Definition at line 92 of file CouenneExprCopy.hpp.

References ArgList(), and copy_.

Referenced by ArgList().

void Couenne::exprCopy::ArgList | ( | expression ** | al | ) | `[inline]`

set arglist (used in deleting nodes without deleting children)

Definition at line 96 of file CouenneExprCopy.hpp.

References ArgList(), and copy_.

Referenced by ArgList().

expression* Couenne::exprCopy::Argument | ( |  | ) | const`[inline, virtual]`

return argument (when applicable, i.e., with univariate functions)

Reimplemented from Couenne::expression.

Definition at line 100 of file CouenneExprCopy.hpp.

References Argument(), and copy_.

Referenced by Argument().

expression** Couenne::exprCopy::ArgPtr | ( |  | ) | `[inline, virtual]`

return pointer to argument (when applicable, i.e., with univariate functions)

Reimplemented from Couenne::expression.

Definition at line 104 of file CouenneExprCopy.hpp.

References ArgPtr(), and copy_.

Referenced by ArgPtr().

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

I/O.

Reimplemented from Couenne::expression.

Reimplemented in Couenne::exprClone, and Couenne::exprStore.

virtual CouNumber Couenne::exprCopy::Value | ( |  | ) | const`[inline, virtual]`

value

Reimplemented from Couenne::expression.

Reimplemented in Couenne::exprClone.

Definition at line 112 of file CouenneExprCopy.hpp.

References value_.

Referenced by Couenne::exprStore::operator()().

virtual CouNumber Couenne::exprCopy::operator() | ( |  | ) | `[inline, virtual]`

null function for evaluating the expression

Implements Couenne::expression.

Reimplemented in Couenne::exprClone, and Couenne::exprStore.

Definition at line 116 of file CouenneExprCopy.hpp.

References copy_, and value_.

CouNumber Couenne::exprCopy::gradientNorm | ( | const double * | x | ) | `[inline, virtual]`

return l-2 norm of gradient at given point

Reimplemented from Couenne::expression.

Definition at line 122 of file CouenneExprCopy.hpp.

References copy_, and gradientNorm().

Referenced by gradientNorm().

expression* Couenne::exprCopy::differentiate | ( | int | index | ) | `[inline, virtual]`

differentiation

Reimplemented from Couenne::expression.

Definition at line 126 of file CouenneExprCopy.hpp.

References copy_, and differentiate().

Referenced by differentiate().

int Couenne::exprCopy::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 131 of file CouenneExprCopy.hpp.

References copy_, and DepList().

Referenced by DepList().

expression* Couenne::exprCopy::simplify | ( |  | ) | `[inline, virtual]`

simplify expression (useful for derivatives)

Reimplemented from Couenne::expression.

Definition at line 136 of file CouenneExprCopy.hpp.

References copy_, and simplify().

Referenced by simplify().

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

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

Reimplemented from Couenne::expression.

Definition at line 140 of file CouenneExprCopy.hpp.

References copy_, and Linearity().

Referenced by Linearity().

bool Couenne::exprCopy::isInteger | ( |  | ) | `[inline, virtual]`

is this expression integer?

Reimplemented from Couenne::expression.

Definition at line 143 of file CouenneExprCopy.hpp.

References copy_, and isInteger().

Referenced by isInteger().

virtual bool Couenne::exprCopy::isDefinedInteger | ( |  | ) | `[inline, virtual]`

is this expression DEFINED as integer?

Reimplemented from Couenne::expression.

Definition at line 147 of file CouenneExprCopy.hpp.

References copy_, and isDefinedInteger().

Referenced by isDefinedInteger().

void Couenne::exprCopy::getBounds | ( | expression *& | lower,
|  | expression *& | upper |
| ) |  |  | `[inline]`

Get lower and upper bound of an expression (if any).

Definition at line 151 of file CouenneExprCopy.hpp.

References copy_, and getBounds().

Referenced by getBounds().

void Couenne::exprCopy::getBounds | ( | CouNumber & | lower,
|  | CouNumber & | upper |
| ) |  |  | `[inline, virtual]`

Get value of lower and upper bound of an expression (if any).

Reimplemented from Couenne::expression.

Definition at line 155 of file CouenneExprCopy.hpp.

References copy_, and getBounds().

Referenced by getBounds().

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

Create standard formulation of this expression.

Reimplemented from Couenne::expression.

Definition at line 160 of file CouenneExprCopy.hpp.

References copy_, and standardize().

Referenced by standardize().

void Couenne::exprCopy::generateCuts | ( | expression * | w,
|  | OsiCuts & | cs,
|  | const CouenneCutGenerator * | cg,
|  | t_chg_bounds * | chg = `NULL`,
|  | int | wind = `-1`,
|  | CouNumber | lb = `-COUENNE_INFINITY`,
|  | CouNumber | ub = `COUENNE_INFINITY` |
| ) |  |  | `[inline]`

generate convexification cut for constraint w = this

Definition at line 164 of file CouenneExprCopy.hpp.

References copy_, and generateCuts().

Referenced by generateCuts().

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

code for comparisons

Reimplemented from Couenne::expression.

Definition at line 173 of file CouenneExprCopy.hpp.

References code(), and copy_.

Referenced by code().

enum convexity Couenne::exprCopy::convexity | ( |  | ) | const`[inline, virtual]`

either CONVEX, CONCAVE, AFFINE, or NONCONVEX

Reimplemented from Couenne::expression.

Definition at line 177 of file CouenneExprCopy.hpp.

References convexity(), and copy_.

Referenced by convexity().

int Couenne::exprCopy::compare | ( | expression & | e | ) | `[inline]`

compare this with other expression

Definition at line 181 of file CouenneExprCopy.hpp.

References compare(), and copy_.

Referenced by compare().

int Couenne::exprCopy::rank | ( |  | ) | `[inline, virtual]`

used in rank-based branching variable choice

Reimplemented from Couenne::expression.

Definition at line 185 of file CouenneExprCopy.hpp.

References copy_, and rank().

Referenced by rank().

bool Couenne::exprCopy::impliedBound | ( | int | wind,
|  | CouNumber * | l,
|  | CouNumber * | u,
|  | t_chg_bounds * | chg |
| ) |  |  | `[inline]`

implied bound processing

Definition at line 189 of file CouenneExprCopy.hpp.

References copy_, and impliedBound().

Referenced by impliedBound().

int Couenne::exprCopy::Multiplicity | ( |  | ) | `[inline, virtual]`

multiplicity of a variable: how many times this variable occurs in expressions throughout the problem

Reimplemented from Couenne::expression.

Definition at line 194 of file CouenneExprCopy.hpp.

References copy_, and Multiplicity().

Referenced by Multiplicity().

CouNumber Couenne::exprCopy::selectBranch | ( | const CouenneObject * | obj,
|  | const OsiBranchingInformation * | info,
|  | expression *& | var,
|  | double *& | brpts,
|  | double *& | brDist,
|  | int & | way |
| ) |  |  | `[inline]`

Set up branching object by evaluating many branching points for each expression's arguments.

Return estimated improvement in objective function

Definition at line 199 of file CouenneExprCopy.hpp.

References copy_, and selectBranch().

Referenced by selectBranch().

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

replace occurrence of a variable with another variable

Reimplemented from Couenne::expression.

void Couenne::exprCopy::fillDepSet | ( | std::set< DepNode *, compNode > * | dep,
|  | DepGraph * | g |
| ) |  |  | `[inline, virtual]`

fill in dependence structure

Reimplemented from Couenne::expression.

Definition at line 213 of file CouenneExprCopy.hpp.

References copy_, and fillDepSet().

Referenced by fillDepSet().

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

redirect variables to proper variable vector

Reimplemented from Couenne::expression.

bool Couenne::exprCopy::isBijective | ( |  | ) | const`[inline, virtual]`

indicating if function is monotonically increasing

Reimplemented from Couenne::expression.

Definition at line 221 of file CouenneExprCopy.hpp.

References copy_, and isBijective().

Referenced by isBijective().

CouNumber Couenne::exprCopy::inverse | ( | expression * | vardep | ) | const`[inline]`

compute the inverse function

Definition at line 225 of file CouenneExprCopy.hpp.

References copy_, and inverse().

Referenced by inverse().

void Couenne::exprCopy::closestFeasible | ( | expression * | varind,
|  | expression * | vardep,
|  | CouNumber & | left,
|  | CouNumber & | right |
| ) |  |  | const`[inline]`

closest feasible points in function in both directions

Definition at line 229 of file CouenneExprCopy.hpp.

References closestFeasible(), and copy_.

Referenced by closestFeasible().

bool Couenne::exprCopy::isCuttable | ( | CouenneProblem * | problem,
|  | int | index |
| ) |  |  | const`[inline, virtual]`

can this expression be further linearized or are we on its concave ("bad") side

Reimplemented from Couenne::expression.

Definition at line 235 of file CouenneExprCopy.hpp.

References copy_, and isCuttable().

Referenced by isCuttable().

## Member Data Documentation

expression* Couenne::exprCopy::copy_`[protected]`

the expression this object is a (reference) copy of

Definition at line 30 of file CouenneExprCopy.hpp.

Referenced by ArgList(), ArgPtr(), Argument(), closestFeasible(), code(), compare(), convexity(), Copy(), DepList(), differentiate(), fillDepSet(), generateCuts(), getBounds(), gradientNorm(), Image(), impliedBound(), Index(), inverse(), isBijective(), isCuttable(), isDefinedInteger(), isInteger(), Linearity(), Multiplicity(), nArgs(), Couenne::exprStore::operator()(), operator()(), Couenne::exprClone::operator()(), Original(), rank(), selectBranch(), simplify(), standardize(), Type(), Couenne::exprClone::Value(), Couenne::exprClone::~exprClone(), ~exprCopy(), and Couenne::exprStore::~exprStore().

CouNumber Couenne::exprCopy::value_`[protected]`

saved value to be used by exprStore expressions

Reimplemented in Couenne::exprStore.

Definition at line 33 of file CouenneExprCopy.hpp.

Referenced by operator()(), and Value().

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

- CouenneExprCopy.hpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines