#include <CouenneObject.hpp>
Inheritance diagram for Couenne::CouenneObject:
Public Types | |
INFEASIBILITY | |
INTERVAL_LP | |
INTERVAL_LP_REV | |
INTERVAL_BR | |
INTERVAL_BR_REV | |
PROJECTDIST | |
EXPR_OBJ | |
VAR_OBJ | |
VT_OBJ | |
NO_STRATEGY | |
NO_BRANCH | |
MID_INTERVAL | |
MIN_AREA | |
BALANCED | |
LP_CENTRAL | |
LP_CLAMPED | |
enum | pseudocostMult { INFEASIBILITY, INTERVAL_LP, INTERVAL_LP_REV, INTERVAL_BR, INTERVAL_BR_REV, PROJECTDIST } |
type of up/down estimate to return for pseudocosts More... | |
enum | branch_obj { EXPR_OBJ, VAR_OBJ, VT_OBJ } |
type of object (for branching variable selection) More... | |
enum | brSelStrat { NO_STRATEGY, NO_BRANCH, MID_INTERVAL, MIN_AREA, BALANCED, LP_CENTRAL, LP_CLAMPED } |
strategy names More... | |
Public Member Functions | |
CouenneObject () | |
empty constructor (for unused objects) | |
CouenneObject (CouenneCutGenerator *cutgen, CouenneProblem *p, exprVar *ref, Bonmin::BabSetupBase *base, JnlstPtr jnlst) | |
Constructor with information for branching point selection strategy. | |
CouenneObject (exprVar *ref, Bonmin::BabSetupBase *base, JnlstPtr jnlst) | |
Constructor with lesser information, used for infeasibility only. | |
~CouenneObject () | |
Destructor. | |
CouenneObject (const CouenneObject &src) | |
Copy constructor. | |
virtual CouenneObject * | clone () const |
Cloning method. | |
void | setParameters (Bonmin::BabSetupBase *base) |
set object parameters by reading from command line | |
virtual double | infeasibility (const OsiBranchingInformation *info, int &way) const |
compute infeasibility of this variable, |w - f(x)| (where w is the auxiliary variable defined as w = f(x) | |
virtual double | checkInfeasibility (const OsiBranchingInformation *info) const |
compute infeasibility of this variable, |w - f(x)|, where w is the auxiliary variable defined as w = f(x) | |
virtual double | feasibleRegion (OsiSolverInterface *, const OsiBranchingInformation *) const |
fix (one of the) arguments of reference auxiliary variable | |
virtual OsiBranchingObject * | createBranch (OsiSolverInterface *, const OsiBranchingInformation *, int) const |
create CouenneBranchingObject or CouenneThreeWayBranchObj based on this object | |
exprVar * | Reference () const |
return reference auxiliary variable | |
enum brSelStrat | Strategy () const |
return branching point selection strategy | |
CouNumber | getBrPoint (funtriplet *ft, CouNumber x0, CouNumber l, CouNumber u, const OsiBranchingInformation *info=NULL) const |
pick branching point based on current strategy | |
CouNumber | midInterval (CouNumber x, CouNumber l, CouNumber u, const OsiBranchingInformation *info=NULL) const |
returns a point "inside enough" a given interval, or x if it already is. | |
virtual double | downEstimate () const |
Return "down" estimate (for non-convex, distance old <--> new LP point). | |
virtual double | upEstimate () const |
Return "up" estimate (for non-convex, distance old <--> new LP point). | |
void | setEstimate (double est, int direction) |
set up/down estimate (0 for down, 1 for up). | |
void | setEstimates (const OsiBranchingInformation *info, CouNumber *infeasibility, CouNumber *brpt) const |
set up/down estimates based on branching information | |
virtual bool | isCuttable () const |
are we on the bad or good side of the expression? | |
virtual double | intInfeasibility (double value, double lb, double ub) const |
integer infeasibility: min {value - floor(value), ceil(value) - value} | |
CouNumber | lp_clamp () const |
Defines safe interval percentage for using LP point as a branching point. | |
Protected Attributes | |
CouenneCutGenerator * | cutGen_ |
pointer to cut generator (not necessary, can be NULL) | |
CouenneProblem * | problem_ |
pointer to Couenne problem | |
exprVar * | reference_ |
The (auxiliary) variable this branching object refers to. | |
enum brSelStrat | strategy_ |
Branching point selection strategy. | |
JnlstPtr | jnlst_ |
SmartPointer to the Journalist. | |
CouNumber | alpha_ |
Combination parameter for the mid-point branching point selection strategy. | |
CouNumber | lp_clamp_ |
Defines safe interval percentage for using LP point as a branching point. | |
CouNumber | feas_tolerance_ |
feasibility tolerance (equal to that of CouenneProblem) | |
bool | doFBBT_ |
shall we do Feasibility based Bound Tightening (FBBT) at branching? | |
bool | doConvCuts_ |
shall we add convexification cuts at branching? | |
double | downEstimate_ |
down estimate (to be used in pseudocost) | |
double | upEstimate_ |
up estimate (to be used in pseudocost) | |
enum pseudocostMult | pseudoMultType_ |
multiplier type for pseudocost |
Associated with a multi-variate function $f(x)$ and a related infeasibility $|w-f(x)|$, creates branches to help restoring feasibility
Definition at line 57 of file CouenneObject.hpp.
CouenneObject::CouenneObject | ( | ) |
empty constructor (for unused objects)
Definition at line 23 of file CouenneObject.cpp.
Referenced by clone().
CouenneObject::CouenneObject | ( | CouenneCutGenerator * | cutgen, | |
CouenneProblem * | p, | |||
exprVar * | ref, | |||
Bonmin::BabSetupBase * | base, | |||
JnlstPtr | jnlst | |||
) |
Constructor with information for branching point selection strategy.
Definition at line 42 of file CouenneObject.cpp.
References alpha_, Couenne::AUX, BALANCED, Couenne::J_BRANCHING(), jnlst_, LP_CENTRAL, lp_clamp_, LP_CLAMPED, MID_INTERVAL, MIN_AREA, NO_BRANCH, print(), reference_, setParameters(), and strategy_.
CouenneObject::CouenneObject | ( | exprVar * | ref, | |
Bonmin::BabSetupBase * | base, | |||
JnlstPtr | jnlst | |||
) |
Constructor with lesser information, used for infeasibility only.
Definition at line 91 of file CouenneObject.cpp.
References setParameters().
Couenne::CouenneObject::~CouenneObject | ( | ) | [inline] |
CouenneObject::CouenneObject | ( | const CouenneObject & | src | ) |
virtual CouenneObject* Couenne::CouenneObject::clone | ( | ) | const [inline, virtual] |
Cloning method.
Reimplemented in Couenne::CouenneComplObject, Couenne::CouenneVarObject, and Couenne::CouenneVTObject.
Definition at line 91 of file CouenneObject.hpp.
References CouenneObject().
void CouenneObject::setParameters | ( | Bonmin::BabSetupBase * | base | ) |
set object parameters by reading from command line
Definition at line 470 of file CouenneObject.cpp.
References alpha_, Couenne::AUX, BALANCED, Couenne::COU_EXPRCOS, Couenne::COU_EXPRDIV, Couenne::COU_EXPREXP, Couenne::COU_EXPRINV, Couenne::COU_EXPRLOG, Couenne::COU_EXPRMUL, Couenne::COU_EXPRPOW, Couenne::COU_EXPRSIN, COUENNE_EPS, Couenne::default_alpha, Couenne::default_clamp, doConvCuts_, doFBBT_, feas_tolerance_, INFEASIBILITY, INTERVAL_BR, INTERVAL_BR_REV, INTERVAL_LP, INTERVAL_LP_REV, LP_CENTRAL, lp_clamp_, LP_CLAMPED, MID_INTERVAL, MIN_AREA, NO_BRANCH, PROJECTDIST, pseudoMultType_, reference_, s, and strategy_.
Referenced by CouenneObject().
double CouenneObject::infeasibility | ( | const OsiBranchingInformation * | info, | |
int & | way | |||
) | const [virtual] |
compute infeasibility of this variable, |w - f(x)| (where w is the auxiliary variable defined as w = f(x)
Reimplemented in Couenne::CouenneComplObject, Couenne::CouenneVarObject, and Couenne::CouenneVTObject.
Definition at line 361 of file CouenneObject.cpp.
References checkInfeasibility(), downEstimate_, INFEASIBILITY, intInfeasibility(), Couenne::isInteger(), NO_BRANCH, problem_, pseudoMultType_, reference_, setEstimates(), strategy_, and upEstimate_.
double CouenneObject::checkInfeasibility | ( | const OsiBranchingInformation * | info | ) | const [virtual] |
compute infeasibility of this variable, |w - f(x)|, where w is the auxiliary variable defined as w = f(x)
Reimplemented in Couenne::CouenneComplObject, and Couenne::CouenneVarObject.
Definition at line 406 of file CouenneObject.cpp.
References Couenne::expression::AUX_GEQ, Couenne::expression::AUX_LEQ, COUENNE_EPS, COUENNE_INFINITY, feas_tolerance_, intInfeasibility(), Couenne::isInteger(), Couenne::J_BRANCHING(), jnlst_, print(), ratio(), reference_, and Couenne::VAR.
Referenced by infeasibility().
double CouenneObject::feasibleRegion | ( | OsiSolverInterface * | , | |
const OsiBranchingInformation * | ||||
) | const [virtual] |
fix (one of the) arguments of reference auxiliary variable
Reimplemented in Couenne::CouenneVarObject.
Definition at line 28 of file feasibleRegion.cpp.
References Couenne::COU_EXPRGROUP, Couenne::COU_EXPRQUAD, e, Couenne::N_ARY, reference_, TOL, and Couenne::UNARY.
OsiBranchingObject * CouenneObject::createBranch | ( | OsiSolverInterface * | , | |
const OsiBranchingInformation * | , | |||
int | ||||
) | const [virtual] |
create CouenneBranchingObject or CouenneThreeWayBranchObj based on this object
Debug output
Reimplemented in Couenne::CouenneComplObject, and Couenne::CouenneVarObject.
Definition at line 148 of file CouenneObject.cpp.
References COUENNE_EPS, cutGen_, doConvCuts_, doFBBT_, downEstimate_, Couenne::J_BRANCHING(), jnlst_, print(), problem_, PROJECTDIST, pseudoMultType_, reference_, setEstimates(), Couenne::TWO_LEFT, Couenne::TWO_RAND, Couenne::TWO_RIGHT, and upEstimate_.
exprVar* Couenne::CouenneObject::Reference | ( | ) | const [inline] |
return reference auxiliary variable
Definition at line 114 of file CouenneObject.hpp.
References reference_.
Referenced by Couenne::CouenneVarObject::checkInfeasibility(), Couenne::CouenneChooseStrong::chooseVariable(), Couenne::CouenneVarObject::computeBranchingPoint(), Couenne::CouenneChooseStrong::doStrongBranching(), Couenne::CouenneChooseStrong::goodCandidate(), Couenne::CouenneVTObject::infeasibility(), and Couenne::exprDiv::selectBranch().
enum brSelStrat Couenne::CouenneObject::Strategy | ( | ) | const [inline] |
return branching point selection strategy
Definition at line 118 of file CouenneObject.hpp.
References strategy_.
CouNumber CouenneObject::getBrPoint | ( | funtriplet * | ft, | |
CouNumber | x0, | |||
CouNumber | l, | |||
CouNumber | u, | |||
const OsiBranchingInformation * | info = NULL | |||
) | const |
pick branching point based on current strategy
Definition at line 334 of file CouenneObject.cpp.
References BALANCED, COUENNE_EPS, LP_CENTRAL, lp_clamp_, LP_CLAMPED, Couenne::maxHeight(), MID_INTERVAL, midInterval(), MIN_AREA, Couenne::minMaxDelta(), strategy_, and THRES_ZERO_SYMM.
CouNumber CouenneObject::midInterval | ( | CouNumber | x, | |
CouNumber | l, | |||
CouNumber | u, | |||
const OsiBranchingInformation * | info = NULL | |||
) | const |
returns a point "inside enough" a given interval, or x if it already is.
Modify alpha_ using gap provided by info
Definition at line 266 of file CouenneObject.cpp.
References AGGR_MUL, alpha_, Couenne::closeToBounds, COUENNE_EPS, COUENNE_INFINITY, Couenne::Couenne_large_bound, e, Couenne::large_bound, and problem_.
Referenced by Couenne::CouenneVarObject::computeBranchingPoint(), Couenne::CouenneVarObject::createBranch(), getBrPoint(), and setEstimates().
virtual double Couenne::CouenneObject::downEstimate | ( | ) | const [inline, virtual] |
Return "down" estimate (for non-convex, distance old <--> new LP point).
Definition at line 129 of file CouenneObject.hpp.
References downEstimate_.
virtual double Couenne::CouenneObject::upEstimate | ( | ) | const [inline, virtual] |
Return "up" estimate (for non-convex, distance old <--> new LP point).
Definition at line 138 of file CouenneObject.hpp.
References upEstimate_.
void Couenne::CouenneObject::setEstimate | ( | double | est, | |
int | direction | |||
) | [inline] |
set up/down estimate (0 for down, 1 for up).
This happens in CouenneChooseStrong, where a new LP point is available and we can measure distance from old LP point. This is the denominator we use in pseudocost
Definition at line 150 of file CouenneObject.hpp.
References downEstimate_, and upEstimate_.
void CouenneObject::setEstimates | ( | const OsiBranchingInformation * | info, | |
CouNumber * | infeasibility, | |||
CouNumber * | brpt | |||
) | const |
set up/down estimates based on branching information
Definition at line 571 of file CouenneObject.cpp.
References Couenne::closeToBounds, COUENNE_INFINITY, downEstimate_, e, INFEASIBILITY, INTERVAL_BR, INTERVAL_BR_REV, INTERVAL_LP, INTERVAL_LP_REV, Couenne::max_pseudocost, midInterval(), PROJECTDIST, pseudoMultType_, reference_, and upEstimate_.
Referenced by createBranch(), Couenne::CouenneVarObject::infeasibility(), and infeasibility().
virtual bool Couenne::CouenneObject::isCuttable | ( | ) | const [inline, virtual] |
are we on the bad or good side of the expression?
Reimplemented in Couenne::CouenneVarObject.
Definition at line 159 of file CouenneObject.hpp.
References Couenne::isInteger(), problem_, and reference_.
double CouenneObject::intInfeasibility | ( | double | value, | |
double | lb, | |||
double | ub | |||
) | const [virtual] |
integer infeasibility: min {value - floor(value), ceil(value) - value}
Handle special cases so that Cbc and Couenne agree. Also, check out-of-bounds values.
Definition at line 137 of file CouenneObject.cpp.
References COUENNE_EPS.
Referenced by checkInfeasibility(), Couenne::CouenneVTObject::infeasibility(), Couenne::CouenneVarObject::infeasibility(), and infeasibility().
CouNumber Couenne::CouenneObject::lp_clamp | ( | ) | const [inline] |
Defines safe interval percentage for using LP point as a branching point.
Definition at line 170 of file CouenneObject.hpp.
References lp_clamp_.
CouenneCutGenerator* Couenne::CouenneObject::cutGen_ [protected] |
pointer to cut generator (not necessary, can be NULL)
Definition at line 176 of file CouenneObject.hpp.
Referenced by Couenne::CouenneVarObject::createBranch(), createBranch(), and Couenne::CouenneComplObject::createBranch().
CouenneProblem* Couenne::CouenneObject::problem_ [protected] |
pointer to Couenne problem
Definition at line 179 of file CouenneObject.hpp.
Referenced by Couenne::CouenneVarObject::checkInfeasibility(), Couenne::CouenneVarObject::computeBranchingPoint(), Couenne::CouenneVarObject::createBranch(), createBranch(), Couenne::CouenneComplObject::createBranch(), Couenne::CouenneVTObject::infeasibility(), Couenne::CouenneVarObject::infeasibility(), infeasibility(), Couenne::CouenneVarObject::isCuttable(), isCuttable(), and midInterval().
exprVar* Couenne::CouenneObject::reference_ [protected] |
The (auxiliary) variable this branching object refers to.
If the expression is w=f(x,y), this is w, as opposed to CouenneBranchingObject, where it would be either x or y.
Definition at line 184 of file CouenneObject.hpp.
Referenced by Couenne::CouenneVarObject::checkInfeasibility(), checkInfeasibility(), Couenne::CouenneComplObject::checkInfeasibility(), Couenne::CouenneVarObject::computeBranchingPoint(), CouenneObject(), Couenne::CouenneVarObject::CouenneVarObject(), Couenne::CouenneVarObject::createBranch(), createBranch(), Couenne::CouenneComplObject::createBranch(), feasibleRegion(), Couenne::CouenneVarObject::feasibleRegion(), Couenne::CouenneVTObject::infeasibility(), Couenne::CouenneVarObject::infeasibility(), infeasibility(), Couenne::CouenneComplObject::infeasibility(), Couenne::CouenneVarObject::isCuttable(), isCuttable(), Reference(), setEstimates(), and setParameters().
enum brSelStrat Couenne::CouenneObject::strategy_ [protected] |
Branching point selection strategy.
Definition at line 187 of file CouenneObject.hpp.
Referenced by Couenne::CouenneVarObject::computeBranchingPoint(), CouenneObject(), Couenne::CouenneVarObject::CouenneVarObject(), Couenne::CouenneVarObject::createBranch(), getBrPoint(), infeasibility(), setParameters(), and Strategy().
JnlstPtr Couenne::CouenneObject::jnlst_ [protected] |
SmartPointer to the Journalist.
Definition at line 190 of file CouenneObject.hpp.
Referenced by checkInfeasibility(), Couenne::CouenneVarObject::computeBranchingPoint(), CouenneObject(), Couenne::CouenneVarObject::CouenneVarObject(), Couenne::CouenneVarObject::createBranch(), createBranch(), Couenne::CouenneComplObject::createBranch(), Couenne::CouenneVTObject::infeasibility(), and Couenne::CouenneVarObject::infeasibility().
CouNumber Couenne::CouenneObject::alpha_ [protected] |
Combination parameter for the mid-point branching point selection strategy.
Definition at line 194 of file CouenneObject.hpp.
Referenced by CouenneObject(), Couenne::CouenneVarObject::CouenneVarObject(), midInterval(), and setParameters().
CouNumber Couenne::CouenneObject::lp_clamp_ [protected] |
Defines safe interval percentage for using LP point as a branching point.
Definition at line 197 of file CouenneObject.hpp.
Referenced by Couenne::CouenneVarObject::computeBranchingPoint(), CouenneObject(), Couenne::CouenneVarObject::CouenneVarObject(), Couenne::CouenneVarObject::createBranch(), getBrPoint(), lp_clamp(), and setParameters().
CouNumber Couenne::CouenneObject::feas_tolerance_ [protected] |
feasibility tolerance (equal to that of CouenneProblem)
Definition at line 200 of file CouenneObject.hpp.
Referenced by checkInfeasibility(), Couenne::CouenneVTObject::infeasibility(), Couenne::CouenneVarObject::infeasibility(), and setParameters().
bool Couenne::CouenneObject::doFBBT_ [protected] |
shall we do Feasibility based Bound Tightening (FBBT) at branching?
Definition at line 203 of file CouenneObject.hpp.
Referenced by Couenne::CouenneVarObject::createBranch(), createBranch(), Couenne::CouenneComplObject::createBranch(), and setParameters().
bool Couenne::CouenneObject::doConvCuts_ [protected] |
shall we add convexification cuts at branching?
Definition at line 206 of file CouenneObject.hpp.
Referenced by Couenne::CouenneVarObject::createBranch(), createBranch(), Couenne::CouenneComplObject::createBranch(), and setParameters().
double Couenne::CouenneObject::downEstimate_ [mutable, protected] |
down estimate (to be used in pseudocost)
Definition at line 209 of file CouenneObject.hpp.
Referenced by Couenne::CouenneVarObject::computeBranchingPoint(), createBranch(), downEstimate(), Couenne::CouenneVTObject::infeasibility(), Couenne::CouenneVarObject::infeasibility(), infeasibility(), setEstimate(), and setEstimates().
double Couenne::CouenneObject::upEstimate_ [mutable, protected] |
up estimate (to be used in pseudocost)
Definition at line 212 of file CouenneObject.hpp.
Referenced by Couenne::CouenneVarObject::computeBranchingPoint(), createBranch(), Couenne::CouenneVTObject::infeasibility(), Couenne::CouenneVarObject::infeasibility(), infeasibility(), setEstimate(), setEstimates(), and upEstimate().
enum pseudocostMult Couenne::CouenneObject::pseudoMultType_ [protected] |
multiplier type for pseudocost
Definition at line 215 of file CouenneObject.hpp.
Referenced by Couenne::CouenneVarObject::computeBranchingPoint(), createBranch(), Couenne::CouenneVarObject::infeasibility(), infeasibility(), setEstimates(), and setParameters().