Couenne  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
Couenne::exprAux Class Reference

Auxiliary variable. More...

#include <CouenneExprAux.hpp>

Inheritance diagram for Couenne::exprAux:
Couenne::exprVar Couenne::expression

Public Types

enum  intType { Unset =-1, Continuous, Integer }
 integrality type of an auxiliary variable: unset, continuous, integer More...
 
- Public Types inherited from Couenne::expression
enum  auxSign { AUX_UNDEF =-2, AUX_LEQ =-1, AUX_EQ, AUX_GEQ }
 "sign" of the constraint defining an auxiliary. More...
 

Public Member Functions

enum nodeType Type () const
 Node type. More...
 
 exprAux (expression *, int, int, intType=Unset, Domain *=NULL, enum auxSign=expression::AUX_EQ)
 Constructor. More...
 
 exprAux (expression *, Domain *=NULL, enum auxSign=expression::AUX_EQ)
 Constructor to be used with standardize ([...], false) More...
 
virtual ~exprAux ()
 Destructor. More...
 
 exprAux (const exprAux &, Domain *d=NULL)
 Copy constructor. More...
 
virtual exprVarclone (Domain *d=NULL) const
 Cloning method. More...
 
expressionLb ()
 get lower bound expression More...
 
expressionUb ()
 get upper bound expression More...
 
virtual void print (std::ostream &=std::cout, bool=false) const
 Print expression. More...
 
expressionImage () const
 The expression associated with this auxiliary variable. More...
 
void Image (expression *image)
 Sets expression associated with this auxiliary variable. More...
 
CouNumber operator() ()
 Null function for evaluating the expression. More...
 
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 More...
 
expressionsimplify ()
 simplify More...
 
int Linearity ()
 Get a measure of "how linear" the expression is (see CouenneTypes.h) More...
 
void crossBounds ()
 Get lower and upper bound of an expression (if any) More...
 
void generateCuts (OsiCuts &, const CouenneCutGenerator *, t_chg_bounds *=NULL, int=-1, CouNumber=-COUENNE_INFINITY, CouNumber=COUENNE_INFINITY)
 generate cuts for expression associated with this auxiliary More...
 
virtual int rank ()
 used in rank-based branching variable choice More...
 
virtual bool isDefinedInteger ()
 is this expression defined as integer? More...
 
virtual bool isInteger ()
 is this expression integer? More...
 
virtual void setInteger (bool value)
 Set this variable as integer. More...
 
void increaseMult ()
 Tell this variable appears once more. More...
 
void decreaseMult ()
 Tell this variable appears once less (standardized within exprSum, for instance) More...
 
void zeroMult ()
 Disable this auxiliary variable. More...
 
int Multiplicity ()
 How many times this variable appears. More...
 
void linkDomain (Domain *d)
 link this variable to a domain More...
 
bool & top_level ()
 return top_level_ More...
 
CouenneObjectproperObject (CouenneCutGenerator *c, CouenneProblem *p, Bonmin::BabSetupBase *base, JnlstPtr jnlst)
 return proper object to handle expression associated with this variable (NULL if this is not an auxiliary) More...
 
virtual enum auxSign sign () const
 return its sign in the definition constraint More...
 
- Public Member Functions inherited from Couenne::exprVar
 exprVar (int varIndex, Domain *d=NULL)
 Constructor. More...
 
virtual ~exprVar ()
 destructor More...
 
 exprVar (const exprVar &e, Domain *d=NULL)
 Copy constructor. More...
 
int Index () const
 Get variable index in problem. More...
 
virtual CouNumberlb ()
 Get/set lower bound value. More...
 
virtual CouNumberub ()
 Get/set upper bound value. More...
 
virtual CouNumber gradientNorm (const double *x)
 return l-2 norm of gradient at given point More...
 
virtual expressiondifferentiate (int index)
 differentiation More...
 
virtual void getBounds (expression *&, expression *&)
 Get expressions of lower and upper bound of an expression (if any) More...
 
virtual void getBounds (CouNumber &lb, CouNumber &ub)
 Get value of lower and upper bound of an expression (if any) More...
 
virtual void generateCuts (expression *w, OsiCuts &cs, const CouenneCutGenerator *cg, t_chg_bounds *=NULL, int=-1, CouNumber=-COUENNE_INFINITY, CouNumber=COUENNE_INFINITY)
 generate convexification cut for constraint w = this More...
 
virtual enum expr_type code ()
 code for comparison More...
 
virtual bool impliedBound (int, CouNumber *, CouNumber *, t_chg_bounds *, enum auxSign=expression::AUX_EQ)
 implied bound processing More...
 
virtual void fillDepSet (std::set< DepNode *, compNode > *, DepGraph *)
 update dependence set with index of this variable More...
 
virtual bool isFixed ()
 is this variable fixed? More...
 
virtual Domaindomain ()
 return pointer to variable domain More...
 
virtual enum convexity convexity () const
 either CONVEX, CONCAVE, AFFINE, or NONCONVEX More...
 
- Public Member Functions inherited from Couenne::expression
 expression ()
 Constructor. More...
 
 expression (const expression &e, Domain *d=NULL)
 Copy constructor. More...
 
virtual ~expression ()
 Destructor. More...
 
virtual int nArgs () const
 return number of arguments (when applicable, that is, with N-ary functions) More...
 
virtual expression ** ArgList () const
 return arglist (when applicable, that is, with N-ary functions) More...
 
virtual void ArgList (expression **al)
 set arglist (used in deleting nodes without deleting children) More...
 
virtual expressionArgument () const
 return argument (when applicable, i.e., with univariate functions) More...
 
virtual expression ** ArgPtr ()
 return pointer to argument (when applicable, i.e., with univariate functions) More...
 
virtual CouNumber Value () const
 value (empty) More...
 
virtual const expressionOriginal () const
 If this is an exprClone of a exprClone of an expr???, point to the original expr??? instead of an exprClone – improve computing efficiency. More...
 
virtual int dependsOn (int *ind, int n, enum dig_type type=STOP_AT_AUX)
 dependence on variable set: return cardinality of subset of the set of indices in first argument which occur in expression. More...
 
int dependsOn (int singleton, enum dig_type type=STOP_AT_AUX)
 version with one index only More...
 
virtual exprAuxstandardize (CouenneProblem *p, bool addAux=true)
 Create standard form of this expression, by: More...
 
virtual int compare (expression &)
 compare expressions More...
 
virtual int compare (exprCopy &)
 compare copies of expressions More...
 
virtual 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. More...
 
virtual void replace (exprVar *, exprVar *)
 replace expression with another More...
 
virtual void realign (const CouenneProblem *p)
 empty function to redirect variables to proper variable vector More...
 
virtual bool isBijective () const
 indicating if function is monotonically increasing More...
 
virtual CouNumber inverse (expression *vardep) const
 compute the inverse function More...
 
virtual void closestFeasible (expression *varind, expression *vardep, CouNumber &left, CouNumber &right) const
 closest feasible points in function in both directions More...
 
virtual bool isCuttable (CouenneProblem *problem, int index) const
 can this expression be further linearized or are we on its concave ("bad") side More...
 
virtual bool isaCopy () const
 return true if this is a copy of something (i.e. an exprCopy) More...
 
virtual expressionCopy () const
 return copy of this expression (only makes sense in exprCopy) More...
 

Protected Attributes

expressionimage_
 The expression associated with this auxiliary variable. More...
 
expressionlb_
 lower bound, a function of the associated expression and the bounds on the variables in the expression More...
 
expressionub_
 upper bound, a function of the associated expression and the bounds on the variables in the expression More...
 
int rank_
 used in rank-based branching variable choice: original variables have rank 1; auxiliary w=f(x) has rank r(w) = r(x)+1; finally, auxiliary w=f(x1,x2...,xk) has rank r(w) = 1+max{r(xi):i=1..k}. More...
 
int multiplicity_
 number of appearances of this aux in the formulation. More...
 
enum intType integer_
 is this variable integer? More...
 
bool top_level_
 True if this variable replaces the lhs of a constraint, i.e., if it is a top level variable in the DAG of the problem. More...
 
enum auxSign sign_
 "sign" of the defining constraint More...
 
- Protected Attributes inherited from Couenne::exprVar
int varIndex_
 The index of the variable. More...
 
Domaindomain_
 Pointer to a descriptor of the current point/bounds. More...
 

Detailed Description

Auxiliary variable.

It is associated with an expression which depends, in general, on original and/or other auxiliary variables. It is used for AMPL's defined variables (aka common expressions) and to reformulate nonlinear constraints/objectives.

Definition at line 32 of file CouenneExprAux.hpp.

Member Enumeration Documentation

integrality type of an auxiliary variable: unset, continuous, integer

Enumerator
Unset 
Continuous 
Integer 

Definition at line 37 of file CouenneExprAux.hpp.

Constructor & Destructor Documentation

Couenne::exprAux::exprAux ( expression ,
int  ,
int  ,
intType  = Unset,
Domain = NULL,
enum  auxSign = expression::AUX_EQ 
)

Constructor.

Referenced by clone().

Couenne::exprAux::exprAux ( expression ,
Domain = NULL,
enum  auxSign = expression::AUX_EQ 
)

Constructor to be used with standardize ([...], false)

virtual Couenne::exprAux::~exprAux ( )
virtual

Destructor.

Couenne::exprAux::exprAux ( const exprAux ,
Domain d = NULL 
)

Copy constructor.

Member Function Documentation

enum nodeType Couenne::exprAux::Type ( ) const
inlinevirtual

Node type.

Reimplemented from Couenne::exprVar.

Definition at line 75 of file CouenneExprAux.hpp.

References Couenne::AUX.

virtual exprVar* Couenne::exprAux::clone ( Domain d = NULL) const
inlinevirtual

Cloning method.

Reimplemented from Couenne::exprVar.

Definition at line 91 of file CouenneExprAux.hpp.

References exprAux().

expression* Couenne::exprAux::Lb ( )
inlinevirtual

get lower bound expression

Reimplemented from Couenne::exprVar.

Definition at line 94 of file CouenneExprAux.hpp.

References lb_.

expression* Couenne::exprAux::Ub ( )
inlinevirtual

get upper bound expression

Reimplemented from Couenne::exprVar.

Definition at line 95 of file CouenneExprAux.hpp.

References ub_.

virtual void Couenne::exprAux::print ( std::ostream &  = std::cout,
bool  = false 
) const
virtual

Print expression.

Reimplemented from Couenne::exprVar.

expression* Couenne::exprAux::Image ( ) const
inlinevirtual

The expression associated with this auxiliary variable.

Reimplemented from Couenne::expression.

Definition at line 102 of file CouenneExprAux.hpp.

References image_.

void Couenne::exprAux::Image ( expression image)
inlinevirtual

Sets expression associated with this auxiliary variable.

Reimplemented from Couenne::expression.

Definition at line 106 of file CouenneExprAux.hpp.

References image_.

CouNumber Couenne::exprAux::operator() ( )
inlinevirtual

Null function for evaluating the expression.

Reimplemented from Couenne::exprVar.

Definition at line 110 of file CouenneExprAux.hpp.

References Couenne::exprVar::domain_, and Couenne::exprVar::varIndex_.

int Couenne::exprAux::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::exprVar.

expression* Couenne::exprAux::simplify ( )
virtual

simplify

Reimplemented from Couenne::exprVar.

int Couenne::exprAux::Linearity ( )
inlinevirtual

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

Reimplemented from Couenne::exprVar.

Definition at line 122 of file CouenneExprAux.hpp.

References Couenne::LINEAR.

void Couenne::exprAux::crossBounds ( )
virtual

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

set bounds depending on both branching rules and propagated bounds. To be used after standardization

Reimplemented from Couenne::exprVar.

void Couenne::exprAux::generateCuts ( OsiCuts &  ,
const CouenneCutGenerator ,
t_chg_bounds = NULL,
int  = -1,
CouNumber  = -COUENNE_INFINITY,
CouNumber  = COUENNE_INFINITY 
)
virtual

generate cuts for expression associated with this auxiliary

Reimplemented from Couenne::exprVar.

virtual int Couenne::exprAux::rank ( )
inlinevirtual

used in rank-based branching variable choice

Reimplemented from Couenne::exprVar.

Definition at line 141 of file CouenneExprAux.hpp.

References rank_.

virtual bool Couenne::exprAux::isDefinedInteger ( )
inlinevirtual

is this expression defined as integer?

Reimplemented from Couenne::exprVar.

Definition at line 145 of file CouenneExprAux.hpp.

References Continuous, image_, Integer, integer_, isInteger(), and Unset.

Referenced by isInteger().

virtual bool Couenne::exprAux::isInteger ( )
inlinevirtual

is this expression integer?

Reimplemented from Couenne::exprVar.

Definition at line 154 of file CouenneExprAux.hpp.

References COUENNE_round, isDefinedInteger(), Couenne::exprVar::lb(), and Couenne::exprVar::ub().

Referenced by isDefinedInteger().

virtual void Couenne::exprAux::setInteger ( bool  value)
inlinevirtual

Set this variable as integer.

Reimplemented from Couenne::exprVar.

Definition at line 166 of file CouenneExprAux.hpp.

References Continuous, Integer, and integer_.

void Couenne::exprAux::increaseMult ( )
inline

Tell this variable appears once more.

Definition at line 170 of file CouenneExprAux.hpp.

References multiplicity_.

void Couenne::exprAux::decreaseMult ( )
inlinevirtual

Tell this variable appears once less (standardized within exprSum, for instance)

Reimplemented from Couenne::exprVar.

Definition at line 174 of file CouenneExprAux.hpp.

References multiplicity_.

void Couenne::exprAux::zeroMult ( )
inlinevirtual

Disable this auxiliary variable.

Reimplemented from Couenne::exprVar.

Definition at line 177 of file CouenneExprAux.hpp.

References multiplicity_.

int Couenne::exprAux::Multiplicity ( )
inlinevirtual

How many times this variable appears.

Reimplemented from Couenne::expression.

Definition at line 180 of file CouenneExprAux.hpp.

References multiplicity_.

void Couenne::exprAux::linkDomain ( Domain d)
inlinevirtual

link this variable to a domain

Reimplemented from Couenne::exprVar.

Definition at line 183 of file CouenneExprAux.hpp.

References Couenne::exprVar::domain_, lb_, and ub_.

bool& Couenne::exprAux::top_level ( )
inline

return top_level_

Definition at line 190 of file CouenneExprAux.hpp.

References top_level_.

CouenneObject* Couenne::exprAux::properObject ( CouenneCutGenerator c,
CouenneProblem p,
Bonmin::BabSetupBase *  base,
JnlstPtr  jnlst 
)
virtual

return proper object to handle expression associated with this variable (NULL if this is not an auxiliary)

Reimplemented from Couenne::exprVar.

virtual enum auxSign Couenne::exprAux::sign ( ) const
inlinevirtual

return its sign in the definition constraint

Reimplemented from Couenne::exprVar.

Definition at line 201 of file CouenneExprAux.hpp.

References sign_.

Member Data Documentation

expression* Couenne::exprAux::image_
protected

The expression associated with this auxiliary variable.

Definition at line 42 of file CouenneExprAux.hpp.

Referenced by Image(), and isDefinedInteger().

expression* Couenne::exprAux::lb_
protected

lower bound, a function of the associated expression and the bounds on the variables in the expression

Definition at line 46 of file CouenneExprAux.hpp.

Referenced by Lb(), and linkDomain().

expression* Couenne::exprAux::ub_
protected

upper bound, a function of the associated expression and the bounds on the variables in the expression

Definition at line 50 of file CouenneExprAux.hpp.

Referenced by linkDomain(), and Ub().

int Couenne::exprAux::rank_
protected

used in rank-based branching variable choice: original variables have rank 1; auxiliary w=f(x) has rank r(w) = r(x)+1; finally, auxiliary w=f(x1,x2...,xk) has rank r(w) = 1+max{r(xi):i=1..k}.

Definition at line 55 of file CouenneExprAux.hpp.

Referenced by rank().

int Couenne::exprAux::multiplicity_
protected

number of appearances of this aux in the formulation.

The more times it occurs in the formulation, the more implication its branching has on other variables

Definition at line 60 of file CouenneExprAux.hpp.

Referenced by decreaseMult(), increaseMult(), Multiplicity(), and zeroMult().

enum intType Couenne::exprAux::integer_
protected

is this variable integer?

Definition at line 63 of file CouenneExprAux.hpp.

Referenced by isDefinedInteger(), and setInteger().

bool Couenne::exprAux::top_level_
protected

True if this variable replaces the lhs of a constraint, i.e., if it is a top level variable in the DAG of the problem.

Definition at line 67 of file CouenneExprAux.hpp.

Referenced by top_level().

enum auxSign Couenne::exprAux::sign_
protected

"sign" of the defining constraint

Definition at line 70 of file CouenneExprAux.hpp.

Referenced by sign().


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