11 #include "CoinHelperFunctions.hpp"
16 using namespace Ipopt;
17 using namespace Couenne;
21 CouenneThreeWayBranchObj::CouenneThreeWayBranchObj (
JnlstPtr jnlst,
61 switch (branchIndex_) {
67 "Warning, branchIndex_ has a strange value (%d)\n", branchIndex_);
72 int index =
brVar_ -> Index ();
76 l = solver -> getColLower () [index],
77 u = solver -> getColUpper () [index];
84 case -1: solver -> setColUpper (index, integer ? floor (
lcrop_) :
lcrop_);
break;
85 case 0: solver -> setColLower (index, integer ? ceil (lcrop_) : lcrop_);
86 solver -> setColUpper (index, integer ? floor (
rcrop_) :
rcrop_);
break;
87 case 1: solver -> setColLower (index, integer ? ceil (rcrop_) : rcrop_);
break;
88 default:
jnlst_->Printf(J_WARNING,
J_BRANCHING,
"Couenne: branching on nonsense way %d\n", way);
96 "#3# Branch: x%d <= %g\n", index,
lcrop_);
break;
98 "#3# Branch: %g <= x%d <= %g\n",
lcrop_, index,
rcrop_);
break;
100 "#3# Branch: x%d >= %g\n", index,
rcrop_);
break;
101 default:
jnlst_->Printf(J_DETAILED,
J_BRANCHING,
"Couenne: branching on nonsense way %d\n", way);
CouNumber lcrop_
left divider
virtual double branch(OsiSolverInterface *solver=NULL)
Execute the actions required to branch, as specified by the current state of the branching object...
int firstBranch_
First branch to be performed: 0 is left, 1 is central, 2 is right.
JnlstPtr jnlst_
True if the associated variable is integer.
const Ipopt::EJournalCategory J_BRANCHING(Ipopt::J_USER1)
double CouNumber
main number type in Couenne
CouNumber rcrop_
right divider
expression * brVar_
The variable this branching object refers to.
bool isInteger(CouNumber x)
is this number integer?