30#include "BcpsBranchObject.h"
73 BcpsBranchObject(model, varInd, direction, value)
78 down_[1] = floor(value_);
79 up_[0] = ceil(value_);
83 if (
up_[0]==floor(
up_[1])) {
106 BcpsBranchObject(model, varInd, intScore, dblScore, direction, value)
110 down_[0] = model->
solver()->getColLower()[iColumn];
111 down_[1] = floor(value_);
112 up_[0] = ceil(value_);
116 if (
up_[0]==floor(
up_[1])) {
136 BcpsBranchObject(model, varInd, direction, lowerValue)
139 numBranchesLeft_ = 1;
140 down_[0] = lowerValue;
141 down_[1] = upperValue;
153 virtual BcpsBranchObject *
clone()
const {
163 virtual double branch(
bool normalBranch =
false);
166 virtual void print(
bool normalBranch);
179 AlpsReturnStatus status = AlpsReturnStatusOk;
182 for (j = 0; j < 2; ++j) {
183 encoded->writeRep(
down_[j]);
185 for (j = 0; j < 2; ++j) {
186 encoded->writeRep(
up_[j]);
194 AlpsReturnStatus status = AlpsReturnStatusOk;
197 for (j = 0; j < 2; ++j) {
198 encoded.readRep(
down_[j]);
200 for (j = 0; j < 2; ++j) {
201 encoded.readRep(
up_[j]);
210 virtual AlpsReturnStatus
encode(AlpsEncoded *encoded)
const {
211 AlpsReturnStatus status = AlpsReturnStatusOk;
213 status = encodeBcps(encoded);
220 virtual AlpsReturnStatus
decode(AlpsEncoded &encoded) {
222 AlpsReturnStatus status = AlpsReturnStatusOk;
224 status = decodeBcps(encoded);
@ BlisBranchingObjectTypeInt
virtual void print(bool normalBranch)
Print something about branch - only if log level high.
virtual AlpsReturnStatus encode(AlpsEncoded *encoded) const
Pack to an encoded object.
BlisBranchObjectInt(BlisModel *model, int varInd, int direction, double lowerValue, double upperValue)
Create a degenerate branching object.
AlpsReturnStatus decodeBlis(AlpsEncoded &encoded)
Unpack Blis portion from an encoded object.
const double * getDown() const
Get down arm bounds.
BlisBranchObjectInt(BlisModel *model, int varInd, int direction, double value)
Construct a branching object, which branching on variable varInd.
BlisBranchObjectInt(BlisModel *model, int varInd, int intScore, double dblScore, int direction, double value)
Construct a branching object, which branching on variable varInd.
AlpsReturnStatus encodeBlis(AlpsEncoded *encoded) const
Pack Blis portion to an encoded object.
BlisBranchObjectInt()
Default constructor.
double up_[2]
Up_[0]: the lower bound of upper arm; Up_[1]: the upper bound of upper arm;.
virtual double branch(bool normalBranch=false)
Set the bounds for the variable according to the current arm of the branch and advances the object st...
virtual ~BlisBranchObjectInt()
Destructor.
double down_[2]
Down_[0]: the lower bound of down arm; Down_[1]: the upper bound of down arm;.
const double * getUp() const
Get upper arm bounds.
virtual AlpsReturnStatus decode(AlpsEncoded &encoded)
Unpack a branching object from an encoded object.
BlisBranchObjectInt(const BlisBranchObjectInt &)
Copy constructor.
virtual BcpsBranchObject * clone() const
Clone.
virtual OsiSolverInterface * solver()
Get lp solver.
const double * getColUpper()
Get column upper bound.
int * getIntColIndices() const
Get integers' column indices.