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