5 #ifndef OsiBranchingObject_H 6 #define OsiBranchingObject_H 12 #include "CoinError.hpp" 13 #include "CoinTypes.hpp" 121 int )
const {
throw CoinError(
"Need code",
"createBranch",
"OsiBranchingObject");
return NULL; }
159 {
whichWay_ =
static_cast<short int>(way) ; }
224 {preferredWay_=value;}
228 {
return preferredWay_;}
278 {
return numberBranches_;}
282 {
return numberBranches_-branchIndex_;}
286 { numberBranches_ ++;}
292 { numberBranches_=1;}
318 {
return branchIndex_;}
323 { branchIndex_ =
static_cast<short int>(branchIndex) ; }
331 {
return originalObject_;}
334 {originalObject_=object;}
481 int way ,
double value) ;
503 {
return !branchIndex_ ? firstBranch_ : -firstBranch_;}
557 {columnNumber_=value;}
567 {
return originalLower_;}
569 { originalLower_=value;}
571 {
return originalUpper_;}
573 { originalUpper_=value;}
581 virtual void resetSequenceEtc(
int numberColumns,
const int * originalColumns);
622 int way ,
double value) ;
631 int way ,
double value,
double downUpperBound,
double upLowerBound) ;
686 const int * which,
const double * weights,
int type=1);
723 virtual void resetSequenceEtc(
int numberColumns,
const int * originalColumns);
727 {
return numberMembers_;}
748 {
return (sosType_==1&&integerValued_);}
751 { integerValued_=yesNo;}
757 {numberMembers_=value;}
838 int numberPoints,
const double * points,
bool range=
false);
875 {columnNumber_=value;}
892 bool findRange(
double value,
double integerTolerance)
const;
896 virtual void floorCeiling(
double & floorLotsize,
double & ceilingLotsize,
double value,
897 double tolerance)
const;
903 {
return bound_[rangeType_*numberRanges_-1];}
906 {
return rangeType_;}
909 {
return numberRanges_;}
915 virtual void resetSequenceEtc(
int numberColumns,
const int * originalColumns);
972 int way ,
double value) ;
int numberBranchesLeft() const
The number of branch arms left for this branching object.
int preferredWay_
Preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
virtual void print(const OsiSolverInterface *=NULL) const
Print something about branch - only if log level high.
void setNumberMembers(int value)
Set number of members.
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
void incrementNumberBranchesLeft()
Increment the number of branch arms left for this branching object.
const int * members() const
Members (indices in range 0 ... numberColumns-1)
virtual int preferredWay() const
Get preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
Branching object for Special ordered sets.
short whichWay_
Computed preferred way to branch.
int rangeType() const
Type - 1 points, 2 ranges.
void setIntegerValued(bool yesNo)
Set whether set is integer valued or not.
int numberBranches() const
The number of branch arms created for this branching object.
virtual bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
int way() const
Way returns -1 on down +1 on up.
short branchIndex_
The state of the branching object.
virtual void updateAfter(const OsiObject *, const OsiObject *)
Updates stuff like pseudocosts after threads finished.
Define a single integer class.
double originalLowerBound() const
Original bounds.
virtual bool canMoveToNearest() const
Return true if object can take part in move to nearest heuristic.
virtual bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
double infeasibility_
data
int whichWay() const
Return current preferred way to branch.
int sosType() const
SOS type.
double * weights_
Weights.
virtual bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
virtual ~OsiObject()
Destructor.
Abstract branching object base class.
int numberRanges() const
Number of points.
int columnNumber_
Column number in solver.
int numberMembers() const
Number of members.
void decrementNumberBranchesLeft()
Decrement the number of branch arms left for this branching object.
OsiObject & operator=(const OsiObject &rhs)
Assignment operator.
int * mutableMembers() const
Members (indices in range 0 ... numberColumns-1)
virtual OsiBranchingObject * createBranch(OsiSolverInterface *, const OsiBranchingInformation *, int) const
Create a branching object and indicate which way to branch first.
double originalUpper_
Original upper bound.
Define Special Ordered Sets of type 1 and 2.
const OsiObject * originalObject_
Pointer back to object which created.
Lotsize branching object.
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
void setBranchingIndex(int branchIndex)
Set the state of the branching object.
Abstract Base Class for describing an interface to a solver.
void setNumberWays(int numberWays)
Set maximum number of ways branch may have.
int branchIndex() const
Get the state of the branching object This is just the branch index.
void setNumberBranchesLeft(int)
Set the number of branch arms left for this branching object Just for forcing.
virtual int preferredWay() const
Get pre-emptive preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
int numberBranches_
Number of branches.
void setOriginalUpperBound(double value)
void setSosType(int value)
Set SOS type.
virtual OsiObject * clone() const =0
Clone.
int priority() const
Return Priority - note 1 is highest priority.
virtual int columnNumber() const
Column number if single column object -1 otherwise, Used by heuristics.
double otherInfeasibility_
"Infeasibility" on other way
virtual void resetBounds(const OsiSolverInterface *)
Reset variable bounds to their original values.
short numberWays_
Maximum number of ways on branch.
virtual void updateBefore(const OsiObject *)
Updates stuff like pseudocosts before threads.
const double * weights() const
Array of weights.
void setOriginalObject(const OsiObject *object)
Set pointer back to object which created.
double * mutableWeights() const
Array of weights.
virtual bool boundBranch() const
Return true if branch should fix variables.
void setOriginalLowerBound(double value)
int numberWays() const
Return maximum number of ways branch may have.
Simple branching object for an integer variable.
virtual double downEstimate() const
Return "down" estimate (default 1.0e-5)
const OsiObject * originalObject() const
Return pointer back to object which created.
Define a class to add a bit of complexity to OsiObject This assumes 2 way branching.
virtual double feasibleRegion(OsiSolverInterface *solver) const
For the variable(s) referenced by the object, look at the current solution and set bounds to match th...
double value() const
Current value.
virtual bool boundBranch() const
Return true if branch should only bound variables.
double originalLower_
data Original lower bound
void setColumnNumber(int value)
Set solver column number.
void setPreferredWay(int value)
Set preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
double originalUpperBound() const
void setPriority(int priority)
Set priority.
virtual bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
virtual void checkIsCutoff(double)
Double checks in case node can change its mind! Returns objective value Can change objective etc...
virtual void resetSequenceEtc(int, const int *)
Change column numbers after preprocessing.
int numberRanges_
Number of points.
double originalLowerBound() const
Original bounds.
int rangeType_
Type - 1 points, 2 ranges.
double infeasibility() const
Return infeasibility.
Abstract base class for `objects'.
virtual double branch()
Execute the actions required to branch, as specified by the current state of the branching object...
double originalUpperBound() const
bool integerValued_
Whether integer valued.
virtual double checkInfeasibility(const OsiBranchingInformation *info) const
void setColumnNumber(int value)
Set solver column number.
int setType() const
SOS type.
int numberMembers_
Number of members.
int firstBranch_
Which way was first branch -1 = down, +1 = up.
double value_
Current value - has some meaning about branch.
double * bound() const
Ranges.
This just adds two-wayness to a branching object.
void setWhichWay(int way)
Return preferred way to branch.
virtual double upEstimate() const
Return "up" estimate (default 1.0e-5)
OsiObject()
Default Constructor.