5 #ifndef OsiBranchingObject_H
6 #define OsiBranchingObject_H
121 int )
const {
throw CoinError(
"Need code",
"createBranch",
"OsiBranchingObject");
return NULL; }
159 {
whichWay_ =
static_cast<short int>(way) ; }
581 virtual void resetSequenceEtc(
int numberColumns,
const int * originalColumns);
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);
838 int numberPoints,
const double * points,
bool range=
false);
892 bool findRange(
double value,
double integerTolerance)
const;
896 virtual void floorCeiling(
double & floorLotsize,
double & ceilingLotsize,
double value,
897 double tolerance)
const;
915 virtual void resetSequenceEtc(
int numberColumns,
const int * originalColumns);
virtual int preferredWay() const
Get pre-emptive preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
virtual void print(const OsiSolverInterface *solver=NULL)
Print something about branch - only if log level high.
Branching object for Special ordered sets.
void setNumberBranchesLeft(int)
Set the number of branch arms left for this branching object Just for forcing.
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
virtual void resetSequenceEtc(int, const int *)
Change column numbers after preprocessing.
const int * members() const
Members (indices in range 0 ... numberColumns-1)
int numberBranchesLeft() const
The number of branch arms left for this branching object.
void incrementNumberBranchesLeft()
Increment the number of branch arms left for this branching object.
double originalUpperBound() const
double up_[2]
Lower [0] and upper [1] bounds for the up arm (way_ = 1)
int setType() const
SOS type.
double down_[2]
Lower [0] and upper [1] bounds for the down arm (way_ = -1)
int numberMembers() const
Number of members.
virtual bool boundBranch() const
Return true if branch should fix variables.
OsiLotsizeBranchingObject()
Default constructor.
OsiObject2 & operator=(const OsiObject2 &rhs)
Assignment operator.
int branchIndex() const
Get the state of the branching object This is just the branch index.
Define a single integer class.
virtual ~OsiObject2()
Destructor.
int sosType() const
SOS type.
virtual bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
bool findRange(double value, double integerTolerance) const
Finds range of interest so value is feasible in range range_ or infeasible between hi[range_] and lo[...
virtual double upEstimate() const
Return "up" estimate (default 1.0e-5)
double * mutableWeights() const
Array of weights.
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
virtual ~OsiLotsizeBranchingObject()
Destructor.
Define a class to add a bit of complexity to OsiObject This assumes 2 way branching.
void setWhichWay(int way)
Return preferred way to branch.
virtual void updateBefore(const OsiObject *)
Updates stuff like pseudocosts before threads.
short branchIndex_
The state of the branching object.
Simple branching object for an integer variable.
Define Special Ordered Sets of type 1 and 2.
double originalUpper_
Original upper bound.
bool integerValued_
Whether integer valued.
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
void setSosType(int value)
Set SOS type.
int * mutableMembers() const
Members (indices in range 0 ... numberColumns-1)
double infeasibility_
data
void setColumnNumber(int value)
Set solver column number.
double value_
Current value - has some meaning about branch.
void setPriority(int priority)
Set priority.
virtual void floorCeiling(double &floorLotsize, double &ceilingLotsize, double value, double tolerance) const
Returns floor and ceiling.
virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const
Set bounds to contain the current solution.
short whichWay_
Computed preferred way to branch.
virtual OsiObject * clone() const
Clone.
void setBranchingIndex(int branchIndex)
Set the state of the branching object.
virtual void checkIsCutoff(double)
Double checks in case node can change its mind! Returns objective value Can change objective etc...
virtual int columnNumber() const
Column number if single column object -1 otherwise, Used by heuristics.
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 bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
virtual bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
double infeasibility() const
Return infeasibility.
virtual double downEstimate() const
Return "down" estimate (default 1.0e-5)
virtual OsiObject * clone() const =0
Clone.
int numberMembers_
Number of members.
void setOriginalUpperBound(double value)
OsiIntegerBranchingObject & operator=(const OsiIntegerBranchingObject &rhs)
Assignment operator.
virtual ~OsiSimpleInteger()
Destructor.
Lotsize branching object.
OsiSOS & operator=(const OsiSOS &rhs)
virtual OsiBranchingObject * clone() const
Clone.
OsiTwoWayBranchingObject & operator=(const OsiTwoWayBranchingObject &rhs)
Assignment operator.
void setPreferredWay(int value)
Set preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
const OsiObject * originalObject() const
Return pointer back to object which created.
virtual double downEstimate() const
Return "down" estimate (default 1.0e-5)
virtual double upEstimate() const
Return "up" estimate (default 1.0e-5)
double originalUpperBound() const
double up_[2]
Lower [0] and upper [1] bounds for the up arm (way_ = 1)
int numberBranches_
Number of branches.
double value() const
Current value.
OsiBranchingObject()
Default Constructor.
int way() const
Way returns -1 on down +1 on up.
int firstBranch_
Which way was first branch -1 = down, +1 = up.
virtual double branch()
Execute the actions required to branch, as specified by the current state of the branching object...
virtual void resetSequenceEtc(int numberColumns, const int *originalColumns)
Redoes data when sequence numbers change.
OsiObject & operator=(const OsiObject &rhs)
Assignment operator.
virtual void print(const OsiSolverInterface *solver=NULL)
Print something about branch - only if log level high.
OsiObject2()
Default Constructor.
virtual ~OsiSOSBranchingObject()
virtual int columnNumber() const
Column number if single column object -1 otherwise, so returns >= 0 Used by heuristics.
OsiLotsizeBranchingObject & operator=(const OsiLotsizeBranchingObject &rhs)
Assignment operator.
virtual ~OsiTwoWayBranchingObject()
Destructor.
void setNumberMembers(int value)
Set number of members.
virtual OsiBranchingObject * clone() const
Clone.
OsiLotsize & operator=(const OsiLotsize &rhs)
int numberRanges_
Number of points.
short numberWays_
Maximum number of ways on branch.
virtual int columnNumber() const
Column number if single column object -1 otherwise, so returns >= 0 Used by heuristics.
virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const
Set bounds to fix the variable at the current (integer) value.
virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const
Set bounds to fix the variable at the current (integer) value.
int priority() const
Return Priority - note 1 is highest priority.
const OsiObject * originalObject_
Pointer back to object which created.
int rangeType() const
Type - 1 points, 2 ranges.
virtual OsiBranchingObject * clone() const
Clone.
virtual void resetSequenceEtc(int numberColumns, const int *originalColumns)
Change column numbers after preprocessing.
OsiBranchingObject & operator=(const OsiBranchingObject &rhs)
Assignment operator.
virtual double downEstimate() const
Return "down" estimate (default 1.0e-5)
virtual ~OsiObject()
Destructor.
void setColumnNumber(int value)
Set solver column number.
virtual void updateAfter(const OsiObject *, const OsiObject *)
Updates stuff like pseudocosts after threads finished.
const double * weights() const
Array of weights.
virtual OsiBranchingObject * clone() const =0
Clone.
virtual OsiObject * clone() const
Clone.
This just adds two-wayness to a branching object.
Abstract Base Class for describing an interface to a solver.
virtual bool canMoveToNearest() const
Return true if object can take part in move to nearest heuristic.
virtual double upEstimate() const
Return "up" estimate (default 1.0e-5)
OsiObject()
Default Constructor.
double down_[2]
Lower [0] and upper [1] bounds for the down arm (way_ = -1)
OsiIntegerBranchingObject()
Default constructor.
void setOriginalLowerBound(double value)
virtual double upEstimate() const
Return "up" estimate (default 1.0e-5)
virtual double checkInfeasibility(const OsiBranchingInformation *info) const
virtual void resetBounds(const OsiSolverInterface *)
Reset variable bounds to their original values.
virtual void print(const OsiSolverInterface *solver=NULL)
Print something about branch - only if log level high.
int whichWay() const
Return current preferred way to branch.
virtual ~OsiIntegerBranchingObject()
Destructor.
double * weights_
Weights.
virtual bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
int preferredWay_
Preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
int rangeType_
Type - 1 points, 2 ranges.
OsiTwoWayBranchingObject()
Default constructor.
double originalLowerBound() const
Original bounds.
Error Class thrown by an exception.
virtual double downEstimate() const
Return "down" estimate (default 1.0e-5)
int numberWays() const
Return maximum number of ways branch may have.
double originalLower_
data Original lower bound
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
void setNumberWays(int numberWays)
Set maximum number of ways branch may have.
OsiSimpleInteger()
Default Constructor.
int numberBranches() const
The number of branch arms created for this branching object.
virtual void resetSequenceEtc(int numberColumns, const int *originalColumns)
Change column numbers after preprocessing.
int columnNumber() const
For debug.
virtual bool boundBranch() const
Return true if branch should only bound variables.
virtual OsiObject * clone() const
Clone.
virtual OsiBranchingObject * createBranch(OsiSolverInterface *, const OsiBranchingInformation *, int) const
Create a branching object and indicate which way to branch first.
OsiSimpleInteger & operator=(const OsiSimpleInteger &rhs)
Assignment operator.
double originalLowerBound() const
Original bounds.
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
virtual void resetBounds(const OsiSolverInterface *solver)
Reset variable bounds to their original values.
void setOriginalObject(const OsiObject *object)
Set pointer back to object which created.
int numberRanges() const
Number of points.
double * bound() const
Ranges.
int columnNumber_
Column number in solver.
void setIntegerValued(bool yesNo)
Set whether set is integer valued or not.
Abstract base class for `objects'.
virtual ~OsiBranchingObject()
Destructor.
double otherInfeasibility_
"Infeasibility" on other way
virtual int preferredWay() const
Get preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
virtual void resetBounds(const OsiSolverInterface *solver)
Reset original upper and lower bound values from the solver.
OsiSOSBranchingObject & operator=(const OsiSOSBranchingObject &rhs)
virtual void print(const OsiSolverInterface *=NULL) const
Print something about branch - only if log level high.
void decrementNumberBranchesLeft()
Decrement the number of branch arms left for this branching object.
Abstract branching object base class.