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 preferredWay_
Preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
virtual bool boundBranch() const
Return true if branch should fix variables.
void setNumberMembers(int value)
Set number of members.
double originalUpperBound() const
const OsiObject * originalObject() const
Return pointer back to object which created.
double originalLowerBound() const
Original bounds.
void incrementNumberBranchesLeft()
Increment the number of branch arms left for this branching object.
int numberRanges() const
Number of points.
int priority() const
Return Priority - note 1 is highest priority.
Branching object for Special ordered sets.
short whichWay_
Computed preferred way to branch.
void setIntegerValued(bool yesNo)
Set whether set is integer valued or not.
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.
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
virtual bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
double infeasibility_
data
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
double * weights_
Weights.
virtual ~OsiObject()
Destructor.
virtual bool canMoveToNearest() const
Return true if object can take part in move to nearest heuristic.
Abstract branching object base class.
virtual int columnNumber() const
Column number if single column object -1 otherwise, Used by heuristics.
int columnNumber_
Column number in solver.
void decrementNumberBranchesLeft()
Decrement the number of branch arms left for this branching object.
double * bound() const
Ranges.
int numberWays() const
Return maximum number of ways branch may have.
OsiObject & operator=(const OsiObject &rhs)
Assignment operator.
double value() const
Current value.
double originalUpper_
Original upper bound.
int whichWay() const
Return current preferred way to branch.
Define Special Ordered Sets of type 1 and 2.
const OsiObject * originalObject_
Pointer back to object which created.
Lotsize branching object.
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.
void setNumberBranchesLeft(int)
Set the number of branch arms left for this branching object Just for forcing.
virtual void print(const OsiSolverInterface *=NULL) const
Print something about branch - only if log level high.
virtual bool boundBranch() const
Return true if branch should only bound variables.
int numberBranches_
Number of branches.
void setOriginalUpperBound(double value)
void setSosType(int value)
Set SOS type.
double infeasibility() const
Return infeasibility.
virtual OsiObject * clone() const =0
Clone.
virtual bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
virtual int preferredWay() const
Get preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
double otherInfeasibility_
"Infeasibility" on other way
int numberMembers() const
Number of members.
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...
virtual void resetBounds(const OsiSolverInterface *)
Reset variable bounds to their original values.
virtual bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
double originalUpperBound() const
short numberWays_
Maximum number of ways on branch.
virtual void updateBefore(const OsiObject *)
Updates stuff like pseudocosts before threads.
void setOriginalObject(const OsiObject *object)
Set pointer back to object which created.
virtual double downEstimate() const
Return "down" estimate (default 1.0e-5)
int sosType() const
SOS type.
virtual OsiBranchingObject * createBranch(OsiSolverInterface *, const OsiBranchingInformation *, int) const
Create a branching object and indicate which way to branch first.
virtual bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
void setOriginalLowerBound(double value)
int numberBranchesLeft() const
The number of branch arms left for this branching object.
Simple branching object for an integer variable.
Define a class to add a bit of complexity to OsiObject This assumes 2 way branching.
virtual double checkInfeasibility(const OsiBranchingInformation *info) const
double originalLowerBound() const
Original bounds.
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 * mutableWeights() const
Array of weights.
int branchIndex() const
Get the state of the branching object This is just the branch index.
int rangeType() const
Type - 1 points, 2 ranges.
const int * members() const
Members (indices in range 0 ... numberColumns-1)
int * mutableMembers() const
Members (indices in range 0 ... numberColumns-1)
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
const double * weights() const
Array of weights.
void setPriority(int priority)
Set priority.
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.
int rangeType_
Type - 1 points, 2 ranges.
int way() const
Way returns -1 on down +1 on up.
Abstract base class for `objects'.
virtual double branch()
Execute the actions required to branch, as specified by the current state of the branching object...
int numberBranches() const
The number of branch arms created for this branching object.
bool integerValued_
Whether integer valued.
void setColumnNumber(int value)
Set solver column number.
virtual double upEstimate() const
Return "up" estimate (default 1.0e-5)
virtual int preferredWay() const
Get pre-emptive preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
int numberMembers_
Number of members.
int firstBranch_
Which way was first branch -1 = down, +1 = up.
int setType() const
SOS type.
double value_
Current value - has some meaning about branch.
This just adds two-wayness to a branching object.
void setWhichWay(int way)
Return preferred way to branch.
OsiObject()
Default Constructor.