5 #ifndef OsiBranchingObject_H
6 #define OsiBranchingObject_H
122 throw CoinError(
"Need code",
"createBranch",
"OsiBranchingObject");
179 whichWay_ =
static_cast< short int >(way);
636 virtual void resetSequenceEtc(
int numberColumns,
const int *originalColumns);
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);
914 int numberPoints,
const double *points,
bool range =
false);
969 bool findRange(
double value,
double integerTolerance)
const;
973 virtual void floorCeiling(
double &floorLotsize,
double &ceilingLotsize,
double value,
974 double tolerance)
const;
1002 virtual void resetSequenceEtc(
int numberColumns,
const int *originalColumns);
virtual void resetSequenceEtc(int numberColumns, const int *originalColumns)
Redoes data when sequence numbers change.
Error Class thrown by an exception.
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.
OsiSimpleInteger & operator=(const OsiSimpleInteger &rhs)
Assignment operator.
OsiSOS & operator=(const OsiSOS &rhs)
void setNumberMembers(int value)
Set number of members.
double originalUpperBound() const
const OsiObject * originalObject() const
Return pointer back to object which created.
OsiLotsizeBranchingObject()
Default constructor.
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.
OsiLotsize & operator=(const OsiLotsize &rhs)
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.
OsiIntegerBranchingObject & operator=(const OsiIntegerBranchingObject &rhs)
Assignment operator.
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[...
OsiIntegerBranchingObject()
Default constructor.
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 ~OsiTwoWayBranchingObject()
Destructor.
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 ~OsiSOSBranchingObject()
virtual int columnNumber() const
Column number if single column object -1 otherwise, so returns >= 0 Used by heuristics.
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
double * weights_
Weights.
double up_[2]
Lower [0] and upper [1] bounds for the up arm (way_ = 1)
virtual ~OsiObject2()
Destructor.
double down_[2]
Lower [0] and upper [1] bounds for the down arm (way_ = -1)
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.
OsiTwoWayBranchingObject()
Default constructor.
virtual void resetBounds(const OsiSolverInterface *solver)
Reset original upper and lower bound values from the solver.
int columnNumber_
Column number in solver.
OsiSimpleInteger()
Default Constructor.
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.
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
double originalUpper_
Original upper bound.
int whichWay() const
Return current preferred way to branch.
OsiSOSBranchingObject & operator=(const OsiSOSBranchingObject &rhs)
Define Special Ordered Sets of type 1 and 2.
virtual OsiBranchingObject * clone() const
Clone.
virtual int columnNumber() const
Column number if single column object -1 otherwise, so returns >= 0 Used by heuristics.
const OsiObject * originalObject_
Pointer back to object which created.
OsiLotsizeBranchingObject & operator=(const OsiLotsizeBranchingObject &rhs)
Assignment operator.
OsiBranchingObject()
Default Constructor.
Lotsize branching object.
void setBranchingIndex(int branchIndex)
Set the state of the branching object.
OsiBranchingObject & operator=(const OsiBranchingObject &rhs)
Assignment operator.
Abstract Base Class for describing an interface to a solver.
void setNumberWays(int numberWays)
Set maximum number of ways branch may have.
double down_[2]
Lower [0] and upper [1] bounds for the down arm (way_ = -1)
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 OsiBranchingObject * clone() const
Clone.
virtual bool boundBranch() const
Return true if branch should only bound variables.
int numberBranches_
Number of branches.
double up_[2]
Lower [0] and upper [1] bounds for the up arm (way_ = 1)
virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const
Set bounds to contain the current solution.
void setOriginalUpperBound(double value)
void setSosType(int value)
Set SOS type.
virtual ~OsiSimpleInteger()
Destructor.
virtual void print(const OsiSolverInterface *solver=NULL)
Print something about branch - only if log level high.
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)
OsiObject2()
Default Constructor.
virtual ~OsiBranchingObject()
Destructor.
virtual double downEstimate() const
Return "down" estimate (default 1.0e-5)
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.
virtual double downEstimate() const
Return "down" estimate (default 1.0e-5)
double originalUpperBound() const
short numberWays_
Maximum number of ways on branch.
virtual void updateBefore(const OsiObject *)
Updates stuff like pseudocosts before threads.
virtual double downEstimate() const
Return "down" estimate (default 1.0e-5)
void setOriginalObject(const OsiObject *object)
Set pointer back to object which created.
virtual double downEstimate() const
Return "down" estimate (default 1.0e-5)
virtual OsiObject * clone() const
Clone.
virtual OsiBranchingObject * clone() const
Clone.
virtual ~OsiLotsizeBranchingObject()
Destructor.
OsiTwoWayBranchingObject & operator=(const OsiTwoWayBranchingObject &rhs)
Assignment operator.
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.
virtual void resetBounds(const OsiSolverInterface *solver)
Reset variable bounds to their original values.
virtual double upEstimate() const
Return "up" estimate (default 1.0e-5)
void setOriginalLowerBound(double value)
int numberBranchesLeft() const
The number of branch arms left for this branching object.
Simple branching object for an integer variable.
virtual void print(const OsiSolverInterface *solver=NULL)
Print something about branch - only if log level high.
int columnNumber() const
For debug.
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.
virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const
Set bounds to fix the variable at the current (integer) value.
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
double originalLower_
data Original lower bound
virtual void print(const OsiSolverInterface *solver=NULL)
Print something about branch - only if log level high.
virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const
Set bounds to fix the variable at the current (integer) value.
virtual void resetSequenceEtc(int numberColumns, const int *originalColumns)
Change column numbers after preprocessing.
virtual double upEstimate() const
Return "up" estimate (default 1.0e-5)
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)
virtual void floorCeiling(double &floorLotsize, double &ceilingLotsize, double value, double tolerance) const
Returns floor and ceiling.
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
double * mutableWeights() const
Array of weights.
virtual void resetSequenceEtc(int numberColumns, const int *originalColumns)
Change column numbers after preprocessing.
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.
virtual OsiObject * clone() const
Clone.
const double * weights() const
Array of weights.
void setPriority(int priority)
Set priority.
virtual double upEstimate() const
Return "up" estimate (default 1.0e-5)
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.
virtual ~OsiIntegerBranchingObject()
Destructor.
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.
virtual OsiObject * clone() const
Clone.
virtual OsiBranchingObject * clone() const =0
Clone.
bool integerValued_
Whether integer valued.
void setColumnNumber(int value)
Set solver column number.
virtual double upEstimate() const
Return "up" estimate (default 1.0e-5)
OsiObject2 & operator=(const OsiObject2 &rhs)
Assignment operator.
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.