11 #include "OsiRowCut.hpp"
18 #include "CoinHelperFunctions.hpp"
19 #include "CoinFinite.hpp"
21 using namespace Couenne;
37 double retval = OsiSOSBranchingObject::branch (solver);
44 objind =
problem_ -> Obj (0) -> Body () -> Index ();
48 problem_ -> domain () -> push (solver);
50 int nMembers = dynamic_cast <
const OsiSOS *> (originalObject ()) -> numberMembers ();
51 const int *Members = dynamic_cast <
const OsiSOS *> (originalObject ()) -> members ();
73 *lb = solver -> getColLower (),
74 *ub = solver -> getColUpper ();
77 estimate = CoinMax (0., objind >= 0 ?
problem_ -> Lb (objind) - lb [objind] : 0.);
82 for (
int i=0; i<nvars; i++) {
83 if (
problem_ -> Lb (i) > lb [i]) solver -> setColLower (i,
problem_ -> Lb (i));
84 if (
problem_ -> Ub (i) < ub [i]) solver -> setColUpper (i,
problem_ -> Ub (i));
111 return (infeasible ? COIN_DBL_MAX : CoinMax (retval, estimate));
118 const OsiBranchingInformation*
info,
int way)
const
123 const double * solution = info->solution_;
124 double tolerance = info->primalTolerance_;
125 const double * upper = info->upper_;
126 int firstNonFixed=-1;
129 int lastNonZero = -1;
132 for (j=0;j<numberMembers_;j++) {
133 int iColumn = members_[
j];
134 if (upper[iColumn]) {
135 double value = CoinMax(0.0,solution[iColumn]);
140 if (value>tolerance) {
141 weight += weights_[
j]*value;
148 assert (lastNonZero-firstNonZero>=sosType_) ;
153 double separator=0.0;
154 for (iWhere=firstNonZero;iWhere<lastNonZero;iWhere++)
155 if (weight<weights_[iWhere+1])
159 separator = 0.5 *(weights_[iWhere]+weights_[iWhere+1]);
162 if (iWhere==lastNonFixed-1)
163 iWhere = lastNonFixed-2;
164 separator = weights_[iWhere+1];
CouenneProblem * problem_
pointer to Couenne problem
exprVar * reference_
The (auxiliary) variable this branching object refers to.
void fint fint fint real fint real real real real real real real real real fint real fint fint fint real fint fint fint fint * info
status of lower/upper bound of a variable, to be checked/modified in bound tightening ...
void setLower(ChangeStatus lower)
CouenneProblem * problem_
pointer to Couenne problem
virtual double branch(OsiSolverInterface *solver)
Does next branch and updates state.
void sparse2dense(int ncols, t_chg_bounds *chg_bds, int *&changed, int &nchanged)
translate sparse to dense vector (should be replaced)
void setUpper(ChangeStatus upper)
static const int infeasible
OsiBranchingObject * createBranch(OsiSolverInterface *si, const OsiBranchingInformation *info, int way) const
create branching objects
double CouNumber
main number type in Couenne
JnlstPtr jnlst_
SmartPointer to the Journalist.
bool doFBBT_
shall we do Feasibility based Bound Tightening (FBBT) at branching?
bool doConvCuts_
shall we add convexification cuts at branching?
bool doFBBT_
shall we do Feasibility based Bound Tightening (FBBT) at branching?