#include <exprVar.hpp>
Inheritance diagram for exprVar:
Public Member Functions | |
virtual enum nodeType | Type () const |
Node type. | |
exprVar (int varIndex, Domain *d=NULL) | |
Constructor. | |
virtual | ~exprVar () |
destructor | |
exprVar (const exprVar &e, Domain *d=NULL) | |
Copy constructor. | |
virtual exprVar * | clone (Domain *d=NULL) const |
Cloning method. | |
int | Index () const |
Get variable index in problem. | |
virtual expression * | Lb () |
Get lower bound expression. | |
virtual expression * | Ub () |
Get upper bound expression. | |
virtual CouNumber & | lb () |
Get/set lower bound value. | |
virtual CouNumber & | ub () |
Get/set upper bound value. | |
virtual void | print (std::ostream &out=std::cout, bool=false) const |
print | |
virtual CouNumber | operator() () |
return the value of the variable | |
virtual CouNumber | gradientNorm (const double *x) |
return l-2 norm of gradient at given point | |
virtual expression * | differentiate (int index) |
differentiation | |
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 void | crossBounds () |
set bounds depending on both branching rules and propagated bounds. | |
virtual expression * | simplify () |
simplify | |
virtual int | Linearity () |
get a measure of "how linear" the expression is (see CouenneTypes.h) | |
virtual bool | isDefinedInteger () |
is this expression defined as an integer? | |
virtual bool | isInteger () |
is this variable integer? | |
virtual void | getBounds (expression *&, expression *&) |
Get expressions of lower and upper bound of an expression (if any). | |
virtual void | getBounds (CouNumber &lb, CouNumber &ub) |
Get value of lower and upper bound of an expression (if any). | |
virtual void | generateCuts (const OsiSolverInterface &, OsiCuts &, const CouenneCutGenerator *, t_chg_bounds *=NULL, int=-1, CouNumber=-COUENNE_INFINITY, CouNumber=COUENNE_INFINITY) |
generate cuts for expression associated with this auxiliary | |
virtual void | generateCuts (expression *w, const OsiSolverInterface &si, OsiCuts &cs, const CouenneCutGenerator *cg, t_chg_bounds *=NULL, int=-1, CouNumber=-COUENNE_INFINITY, CouNumber=COUENNE_INFINITY) |
generate convexification cut for constraint w = this | |
virtual enum expr_type | code () |
code for comparison | |
virtual bool | impliedBound (int, CouNumber *, CouNumber *, t_chg_bounds *) |
implied bound processing | |
virtual int | rank () |
rank of an original variable is always one | |
virtual void | fillDepSet (std::set< DepNode *, compNode > *, DepGraph *) |
update dependence set with index of this variable | |
virtual bool | isFixed () |
is this variable fixed? | |
virtual void | linkDomain (Domain *d) |
link this variable to a domain | |
virtual Domain * | domain () |
return pointer to variable domain | |
virtual void | decreaseMult () |
virtual void | zeroMult () |
Disable variable (empty for compatibility with exprAux). | |
virtual void | setInteger (bool value) |
Set this variable as integer (empty for compatibility with exprAux). | |
virtual enum convexity | convexity () const |
either CONVEX, CONCAVE, AFFINE, or NONCONVEX | |
virtual CouenneObject | properObject (CouenneProblem *p, Bonmin::BabSetupBase *base, JnlstPtr jnlst_) |
return proper object to handle expression associated with this variable (NULL if this is not an auxiliary) | |
Protected Attributes | |
int | varIndex_ |
The index of the variable. | |
Domain * | domain_ |
Pointer to a descriptor of the current point/bounds. |
All variables of the expression must be objects of this class or of the derived exprAux class
Definition at line 33 of file exprVar.hpp.
exprVar::exprVar | ( | int | varIndex, | |
Domain * | d = NULL | |||
) | [inline] |
virtual exprVar::~exprVar | ( | ) | [inline, virtual] |
virtual enum nodeType exprVar::Type | ( | ) | const [inline, virtual] |
Node type.
Reimplemented from expression.
Reimplemented in exprAux, exprLowerBound, and exprUpperBound.
Definition at line 43 of file exprVar.hpp.
References VAR.
Cloning method.
Reimplemented from expression.
Reimplemented in exprAux, exprLowerBound, exprUpperBound, and exprIVar.
Definition at line 60 of file exprVar.hpp.
References exprVar().
int exprVar::Index | ( | ) | const [inline, virtual] |
Get variable index in problem.
Reimplemented from expression.
Definition at line 64 of file exprVar.hpp.
References varIndex_.
Referenced by generateCuts(), exprAux::generateCuts(), and exprAux::properObject().
expression * exprVar::Lb | ( | ) | [virtual] |
expression * exprVar::Ub | ( | ) | [virtual] |
virtual CouNumber& exprVar::lb | ( | ) | [inline, virtual] |
Get/set lower bound value.
Definition at line 72 of file exprVar.hpp.
References domain_, and varIndex_.
Referenced by exprAux::generateCuts(), getBounds(), isFixed(), isInteger(), exprAux::isInteger(), exprLowerBound::operator()(), and exprAux::properObject().
virtual CouNumber& exprVar::ub | ( | ) | [inline, virtual] |
Get/set upper bound value.
Definition at line 73 of file exprVar.hpp.
References domain_, and varIndex_.
Referenced by exprAux::generateCuts(), getBounds(), isFixed(), isInteger(), exprAux::isInteger(), exprUpperBound::operator()(), and exprAux::properObject().
virtual void exprVar::print | ( | std::ostream & | out = std::cout , |
|
bool | = false | |||
) | const [inline, virtual] |
Reimplemented from expression.
Reimplemented in exprAux, exprLowerBound, exprUpperBound, and exprIVar.
Definition at line 76 of file exprVar.hpp.
References varIndex_.
virtual CouNumber exprVar::operator() | ( | ) | [inline, virtual] |
return the value of the variable
Implements expression.
Reimplemented in exprAux, exprLowerBound, and exprUpperBound.
Definition at line 81 of file exprVar.hpp.
virtual CouNumber exprVar::gradientNorm | ( | const double * | x | ) | [inline, virtual] |
return l-2 norm of gradient at given point
Reimplemented from expression.
Definition at line 85 of file exprVar.hpp.
virtual expression* exprVar::differentiate | ( | int | index | ) | [inline, virtual] |
differentiation
Reimplemented from expression.
Reimplemented in exprAux, exprLowerBound, and exprUpperBound.
Definition at line 89 of file exprVar.hpp.
References varIndex_.
virtual int exprVar::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 expression.
Reimplemented in exprAux.
Definition at line 94 of file exprVar.hpp.
References varIndex_.
virtual void exprVar::crossBounds | ( | ) | [inline, virtual] |
set bounds depending on both branching rules and propagated bounds.
To be used after standardization
Reimplemented in exprAux.
Definition at line 106 of file exprVar.hpp.
virtual expression* exprVar::simplify | ( | ) | [inline, virtual] |
simplify
Reimplemented from expression.
Reimplemented in exprAux.
Definition at line 109 of file exprVar.hpp.
virtual int exprVar::Linearity | ( | ) | [inline, virtual] |
get a measure of "how linear" the expression is (see CouenneTypes.h)
Reimplemented from expression.
Reimplemented in exprAux, exprLowerBound, and exprUpperBound.
Definition at line 113 of file exprVar.hpp.
References LINEAR.
virtual bool exprVar::isDefinedInteger | ( | ) | [inline, virtual] |
is this expression defined as an integer?
Reimplemented from expression.
Reimplemented in exprAux, and exprIVar.
Definition at line 117 of file exprVar.hpp.
virtual bool exprVar::isInteger | ( | ) | [inline, virtual] |
is this variable integer?
Reimplemented from expression.
Reimplemented in exprAux, and exprIVar.
Definition at line 121 of file exprVar.hpp.
References COUENNE_EPS, domain_, lb(), ub(), and varIndex_.
void exprVar::getBounds | ( | expression *& | , | |
expression *& | ||||
) | [virtual] |
Get expressions of lower and upper bound of an expression (if any).
Reimplemented from expression.
Definition at line 20 of file exprVar.cpp.
References domain_, lb(), ub(), and varIndex_.
Referenced by exprAux::crossBounds().
Get value of lower and upper bound of an expression (if any).
Reimplemented from expression.
Definition at line 28 of file exprVar.cpp.
virtual void exprVar::generateCuts | ( | const OsiSolverInterface & | , | |
OsiCuts & | , | |||
const CouenneCutGenerator * | , | |||
t_chg_bounds * | = NULL , |
|||
int | = -1 , |
|||
CouNumber | = -COUENNE_INFINITY , |
|||
CouNumber | = COUENNE_INFINITY | |||
) | [inline, virtual] |
generate cuts for expression associated with this auxiliary
Reimplemented in exprAux.
Definition at line 139 of file exprVar.hpp.
void exprVar::generateCuts | ( | expression * | w, | |
const OsiSolverInterface & | si, | |||
OsiCuts & | cs, | |||
const CouenneCutGenerator * | cg, | |||
t_chg_bounds * | = NULL , |
|||
int | = -1 , |
|||
CouNumber | = -COUENNE_INFINITY , |
|||
CouNumber | = COUENNE_INFINITY | |||
) | [virtual] |
generate convexification cut for constraint w = this
Reimplemented from expression.
Definition at line 36 of file exprVar.cpp.
virtual enum expr_type exprVar::code | ( | ) | [inline, virtual] |
code for comparison
Reimplemented from expression.
Reimplemented in exprLowerBound, and exprUpperBound.
Definition at line 154 of file exprVar.hpp.
References COU_EXPRVAR.
Referenced by exprAux::properObject().
bool exprVar::impliedBound | ( | int | wind, | |
CouNumber * | l, | |||
CouNumber * | u, | |||
t_chg_bounds * | chg | |||
) | [virtual] |
implied bound processing
Expression w = x, upon change in lower or upper bound of w, whose index is wind
Reimplemented from expression.
Definition at line 47 of file exprVar.cpp.
References t_chg_bounds::CHANGED, t_chg_bounds::setLower(), t_chg_bounds::setUpper(), updateBound(), and varIndex_.
virtual int exprVar::rank | ( | ) | [inline, virtual] |
rank of an original variable is always one
Reimplemented from expression.
Reimplemented in exprAux.
Definition at line 161 of file exprVar.hpp.
update dependence set with index of this variable
Reimplemented from expression.
Definition at line 61 of file exprVar.cpp.
virtual bool exprVar::isFixed | ( | ) | [inline, virtual] |
is this variable fixed?
Definition at line 168 of file exprVar.hpp.
References COUENNE_EPS, lb(), and ub().
virtual void exprVar::linkDomain | ( | Domain * | d | ) | [inline, virtual] |
link this variable to a domain
Reimplemented from expression.
Reimplemented in exprAux.
Definition at line 172 of file exprVar.hpp.
References domain_.
virtual Domain* exprVar::domain | ( | ) | [inline, virtual] |
virtual void exprVar::decreaseMult | ( | ) | [inline, virtual] |
virtual void exprVar::zeroMult | ( | ) | [inline, virtual] |
Disable variable (empty for compatibility with exprAux).
Reimplemented in exprAux.
Definition at line 183 of file exprVar.hpp.
virtual void exprVar::setInteger | ( | bool | value | ) | [inline, virtual] |
Set this variable as integer (empty for compatibility with exprAux).
Reimplemented in exprAux.
Definition at line 186 of file exprVar.hpp.
virtual enum convexity exprVar::convexity | ( | ) | const [inline, virtual] |
either CONVEX, CONCAVE, AFFINE, or NONCONVEX
Reimplemented from expression.
Definition at line 189 of file exprVar.hpp.
References AFFINE.
CouenneObject exprVar::properObject | ( | 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 in exprAux.
Definition at line 71 of file exprVar.cpp.
int exprVar::varIndex_ [protected] |
The index of the variable.
Definition at line 37 of file exprVar.hpp.
Referenced by DepList(), exprAux::DepList(), differentiate(), exprAux::exprAux(), fillDepSet(), generateCuts(), exprAux::generateCuts(), getBounds(), impliedBound(), Index(), isInteger(), lb(), Lb(), operator()(), exprUpperBound::operator()(), exprLowerBound::operator()(), exprAux::operator()(), print(), exprIVar::print(), exprUpperBound::print(), exprLowerBound::print(), exprAux::print(), ub(), and Ub().
Domain* exprVar::domain_ [protected] |
Pointer to a descriptor of the current point/bounds.
Definition at line 38 of file exprVar.hpp.
Referenced by domain(), exprAux::exprAux(), exprAux::generateCuts(), getBounds(), isInteger(), lb(), Lb(), linkDomain(), exprAux::linkDomain(), operator()(), exprUpperBound::operator()(), exprLowerBound::operator()(), exprAux::operator()(), ub(), and Ub().