Couenne
0.2
|
Auxiliary variable. More...
#include <CouenneExprAux.hpp>
Public Types | |
enum | intType { Unset =-1, Continuous, Integer } |
integrality type of an auxiliary variable: unset, continuous, integer More... | |
![]() | |
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 exprVar * | clone (Domain *d=NULL) const |
Cloning method. More... | |
expression * | Lb () |
get lower bound expression More... | |
expression * | Ub () |
get upper bound expression More... | |
virtual void | print (std::ostream &=std::cout, bool=false) const |
Print expression. More... | |
expression * | Image () 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... | |
expression * | simplify () |
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... | |
CouenneObject * | properObject (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... | |
![]() | |
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 CouNumber & | lb () |
Get/set lower bound value. More... | |
virtual CouNumber & | ub () |
Get/set upper bound value. More... | |
virtual CouNumber | gradientNorm (const double *x) |
return l-2 norm of gradient at given point More... | |
virtual expression * | differentiate (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 Domain * | domain () |
return pointer to variable domain More... | |
virtual enum convexity | convexity () const |
either CONVEX, CONCAVE, AFFINE, or NONCONVEX More... | |
![]() | |
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 expression * | Argument () 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 expression * | Original () 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 exprAux * | standardize (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 expression * | Copy () const |
return copy of this expression (only makes sense in exprCopy) More... | |
Protected Attributes | |
expression * | image_ |
The expression associated with this auxiliary variable. More... | |
expression * | lb_ |
lower bound, a function of the associated expression and the bounds on the variables in the expression More... | |
expression * | ub_ |
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... | |
![]() | |
int | varIndex_ |
The index of the variable. More... | |
Domain * | domain_ |
Pointer to a descriptor of the current point/bounds. More... | |
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.
integrality type of an auxiliary variable: unset, continuous, integer
Enumerator | |
---|---|
Unset | |
Continuous | |
Integer |
Definition at line 37 of file CouenneExprAux.hpp.
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 |
Destructor.
|
inlinevirtual |
Node type.
Reimplemented from Couenne::exprVar.
Definition at line 75 of file CouenneExprAux.hpp.
References Couenne::AUX.
Cloning method.
Reimplemented from Couenne::exprVar.
Definition at line 91 of file CouenneExprAux.hpp.
References exprAux().
|
inlinevirtual |
get lower bound expression
Reimplemented from Couenne::exprVar.
Definition at line 94 of file CouenneExprAux.hpp.
References lb_.
|
inlinevirtual |
get upper bound expression
Reimplemented from Couenne::exprVar.
Definition at line 95 of file CouenneExprAux.hpp.
References ub_.
|
virtual |
Print expression.
Reimplemented from Couenne::exprVar.
|
inlinevirtual |
The expression associated with this auxiliary variable.
Reimplemented from Couenne::expression.
Definition at line 102 of file CouenneExprAux.hpp.
References image_.
|
inlinevirtual |
Sets expression associated with this auxiliary variable.
Reimplemented from Couenne::expression.
Definition at line 106 of file CouenneExprAux.hpp.
References image_.
|
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_.
fill in the set with all indices of variables appearing in the expression
Reimplemented from Couenne::exprVar.
|
virtual |
simplify
Reimplemented from Couenne::exprVar.
|
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.
|
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.
|
virtual |
generate cuts for expression associated with this auxiliary
Reimplemented from Couenne::exprVar.
|
inlinevirtual |
used in rank-based branching variable choice
Reimplemented from Couenne::exprVar.
Definition at line 141 of file CouenneExprAux.hpp.
References rank_.
|
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().
|
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().
|
inlinevirtual |
Set this variable as integer.
Reimplemented from Couenne::exprVar.
Definition at line 166 of file CouenneExprAux.hpp.
References Continuous, Integer, and integer_.
|
inline |
Tell this variable appears once more.
Definition at line 170 of file CouenneExprAux.hpp.
References multiplicity_.
|
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_.
|
inlinevirtual |
Disable this auxiliary variable.
Reimplemented from Couenne::exprVar.
Definition at line 177 of file CouenneExprAux.hpp.
References multiplicity_.
|
inlinevirtual |
How many times this variable appears.
Reimplemented from Couenne::expression.
Definition at line 180 of file CouenneExprAux.hpp.
References multiplicity_.
|
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_.
|
inline |
|
virtual |
return proper object to handle expression associated with this variable (NULL if this is not an auxiliary)
Reimplemented from Couenne::exprVar.
|
inlinevirtual |
return its sign in the definition constraint
Reimplemented from Couenne::exprVar.
Definition at line 201 of file CouenneExprAux.hpp.
References sign_.
|
protected |
The expression associated with this auxiliary variable.
Definition at line 42 of file CouenneExprAux.hpp.
Referenced by Image(), and isDefinedInteger().
|
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().
|
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().
|
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().
|
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().
|
protected |
is this variable integer?
Definition at line 63 of file CouenneExprAux.hpp.
Referenced by isDefinedInteger(), and setInteger().
|
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().
|
protected |
"sign" of the defining constraint
Definition at line 70 of file CouenneExprAux.hpp.
Referenced by sign().