5 #ifndef OsiBranchingObject_H 6 #define OsiBranchingObject_H 122 throw CoinError(
"Need code",
"createBranch",
"OsiBranchingObject");
179 whichWay_ =
static_cast< short int >(way);
249 preferredWay_ = value;
255 return preferredWay_;
306 return numberBranches_;
312 return numberBranches_ - branchIndex_;
365 branchIndex_ =
static_cast< short int >(branchIndex);
377 return originalObject_;
382 originalObject_ = object;
526 int way,
double value);
549 return !branchIndex_ ? firstBranch_ : -firstBranch_;
603 columnNumber_ = value;
615 return originalLower_;
619 originalLower_ = value;
623 return originalUpper_;
627 originalUpper_ = value;
636 virtual void resetSequenceEtc(
int numberColumns,
const int *originalColumns);
678 int way,
double value);
687 int way,
double value,
double downUpperBound,
double upLowerBound);
739 const int *which,
const double *weights,
int type = 1);
776 virtual void resetSequenceEtc(
int numberColumns,
const int *originalColumns);
781 return numberMembers_;
812 return (sosType_ == 1 && integerValued_);
817 integerValued_ = yesNo;
827 numberMembers_ = value;
914 int numberPoints,
const double *points,
bool range =
false);
951 columnNumber_ = value;
969 bool findRange(
double value,
double integerTolerance)
const;
973 virtual void floorCeiling(
double &floorLotsize,
double &ceilingLotsize,
double value,
974 double tolerance)
const;
983 return bound_[rangeType_ * numberRanges_ - 1];
993 return numberRanges_;
1002 virtual void resetSequenceEtc(
int numberColumns,
const int *originalColumns);
1061 int way,
double value);
int numberBranchesLeft() const
The number of branch arms left for this branching object.
Error Class thrown by an exception.
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 print(const char *fmt,...)
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.