BcpsBranchObject contains the member data required when choosing branching entities and excuting actual branching. More...
#include <BcpsBranchObject.h>
Public Member Functions | |
BcpsBranchObject () | |
Default Constructor. More... | |
BcpsBranchObject (BcpsModel *model) | |
Useful constructor. More... | |
BcpsBranchObject (BcpsModel *model, int objectIndex, int direction, double value) | |
Useful constructor. More... | |
BcpsBranchObject (BcpsModel *model, int objectIndex, int upScore, double downScore, int direction, double value) | |
Useful constructor. More... | |
BcpsBranchObject (const BcpsBranchObject &) | |
Copy constructor. More... | |
virtual | ~BcpsBranchObject () |
Destructor. More... | |
BcpsBranchObject & | operator= (const BcpsBranchObject &rhs) |
Assignment operator. More... | |
virtual BcpsBranchObject * | clone () const =0 |
Clone a object. More... | |
int | getType () |
Get type. More... | |
void | setType (int t) |
Set type. More... | |
virtual int | numBranches () const |
The number of branch arms created for this branch object. More... | |
virtual int | numBranchesLeft () const |
The number of branch arms left to be evaluated. More... | |
virtual double | branch (bool normalBranch=false)=0 |
Perform branching as specified by the branching object. More... | |
virtual void | print (bool normalBranch) |
Print information about this branching object. More... | |
virtual bool | boundBranch () const |
Return true if branching should fix object bounds. More... | |
int | getObjectIndex () const |
Object objectIndex. More... | |
void | setObjectIndex (int ind) |
Set object objectIndex. More... | |
double | getUpScore () const |
Get integer score. More... | |
void | setUpScore (double score) |
Set integer score. More... | |
double | getDownScore () const |
Get double score. More... | |
void | setDownScore (double score) |
Get double score. More... | |
int | getDirection () const |
Returns a code indicating the active arm of the branching object. More... | |
void | setDirection (int direction) |
Set the direction of the branching object. More... | |
double | getValue () const |
Return object branching value. More... | |
BcpsModel * | model () const |
Return model. More... | |
virtual AlpsReturnStatus | encode (AlpsEncoded *encoded) const |
Pack to an encoded object. More... | |
virtual AlpsReturnStatus | decode (AlpsEncoded &encoded) |
Unpack a branching object from an encoded object. More... | |
Protected Member Functions | |
AlpsReturnStatus | encodeBcps (AlpsEncoded *encoded) const |
Pack Bcps portion to an encoded object. More... | |
AlpsReturnStatus | decodeBcps (AlpsEncoded &encoded) |
Unpack Bcps portion from an encoded object. More... | |
Protected Attributes | |
int | type_ |
Type of branching. More... | |
BcpsModel * | model_ |
The model that owns this branch object. More... | |
int | objectIndex_ |
Branch object index. More... | |
double | upScore_ |
Quality/Goodness of this object. More... | |
double | downScore_ |
The score of branching down. More... | |
int | direction_ |
Information required to do branching. More... | |
double | value_ |
Current branching value. More... | |
int | numBranchesLeft_ |
Number of arms remaining to be evaluated. More... | |
BcpsBranchObject contains the member data required when choosing branching entities and excuting actual branching.
It also has the member funtions to do branching by adjusting bounds, etc. in solver. Branching objects can be simple integer variables or more complicated objects like SOS.
Definition at line 47 of file BcpsBranchObject.h.
|
inline |
Default Constructor.
Definition at line 91 of file BcpsBranchObject.h.
|
inline |
Useful constructor.
Definition at line 104 of file BcpsBranchObject.h.
|
inline |
Useful constructor.
Definition at line 117 of file BcpsBranchObject.h.
|
inline |
Useful constructor.
Definition at line 133 of file BcpsBranchObject.h.
BcpsBranchObject::BcpsBranchObject | ( | const BcpsBranchObject & | ) |
Copy constructor.
|
inlinevirtual |
Destructor.
Definition at line 154 of file BcpsBranchObject.h.
BcpsBranchObject& BcpsBranchObject::operator= | ( | const BcpsBranchObject & | rhs | ) |
Assignment operator.
|
pure virtual |
Clone a object.
Implemented in BlisBranchObjectInt, BlisBranchObjectInt, and BlisBranchObjectBilevel.
|
inline |
Get type.
Definition at line 163 of file BcpsBranchObject.h.
|
inline |
Set type.
Definition at line 166 of file BcpsBranchObject.h.
|
inlinevirtual |
The number of branch arms created for this branch object.
Definition at line 169 of file BcpsBranchObject.h.
|
inlinevirtual |
The number of branch arms left to be evaluated.
Definition at line 172 of file BcpsBranchObject.h.
|
pure virtual |
Perform branching as specified by the branching object.
Also, update the status of this branching object.
Implemented in BlisBranchObjectInt, BlisBranchObjectInt, and BlisBranchObjectBilevel.
|
inlinevirtual |
Print information about this branching object.
Reimplemented in BlisBranchObjectInt, BlisBranchObjectInt, and BlisBranchObjectBilevel.
Definition at line 180 of file BcpsBranchObject.h.
|
inlinevirtual |
Return true if branching should fix object bounds.
Definition at line 183 of file BcpsBranchObject.h.
|
inline |
Object objectIndex.
Definition at line 186 of file BcpsBranchObject.h.
|
inline |
Set object objectIndex.
Definition at line 189 of file BcpsBranchObject.h.
|
inline |
Get integer score.
Definition at line 192 of file BcpsBranchObject.h.
|
inline |
Set integer score.
Definition at line 195 of file BcpsBranchObject.h.
|
inline |
Get double score.
Definition at line 198 of file BcpsBranchObject.h.
|
inline |
Get double score.
Definition at line 201 of file BcpsBranchObject.h.
|
inline |
Returns a code indicating the active arm of the branching object.
Definition at line 204 of file BcpsBranchObject.h.
|
inline |
Set the direction of the branching object.
Definition at line 207 of file BcpsBranchObject.h.
|
inline |
Return object branching value.
Definition at line 210 of file BcpsBranchObject.h.
|
inline |
Return model.
Definition at line 213 of file BcpsBranchObject.h.
|
inlineprotected |
Pack Bcps portion to an encoded object.
Definition at line 218 of file BcpsBranchObject.h.
|
inlineprotected |
Unpack Bcps portion from an encoded object.
Definition at line 232 of file BcpsBranchObject.h.
|
inlinevirtual |
Pack to an encoded object.
Reimplemented in BlisBranchObjectInt, BlisBranchObjectInt, and BlisBranchObjectBilevel.
Definition at line 248 of file BcpsBranchObject.h.
|
inlinevirtual |
Unpack a branching object from an encoded object.
Reimplemented in BlisBranchObjectInt, BlisBranchObjectInt, and BlisBranchObjectBilevel.
Definition at line 256 of file BcpsBranchObject.h.
|
protected |
Type of branching.
Definition at line 52 of file BcpsBranchObject.h.
|
protected |
The model that owns this branch object.
Definition at line 55 of file BcpsBranchObject.h.
|
protected |
Branch object index.
The index is not the same as variable index. For integer branching, the index refers to the position in the integer object array/vector.
Definition at line 60 of file BcpsBranchObject.h.
|
protected |
Quality/Goodness of this object.
They are set when creating candiate branching entities, and used when comparing two branching enities. Derived class can add more metrics.The score of branching up. Used for binary branching only.
Definition at line 69 of file BcpsBranchObject.h.
|
protected |
The score of branching down.
Used for binary branching only.
Definition at line 72 of file BcpsBranchObject.h.
|
protected |
Information required to do branching.
Used for binary branching only. The direction of the active branch. Down is -1, up is 1.
Definition at line 78 of file BcpsBranchObject.h.
|
protected |
Current branching value.
For integer, it can be fractional solution value.
Definition at line 82 of file BcpsBranchObject.h.
|
protected |
Number of arms remaining to be evaluated.
Definition at line 85 of file BcpsBranchObject.h.