Cbc  2.9.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
OsiObject Class Referenceabstract

Abstract base class for `objects'. More...

#include <OsiBranchingObject.hpp>

+ Inheritance diagram for OsiObject:

Public Member Functions

 OsiObject ()
 Default Constructor. More...
 
 OsiObject (const OsiObject &)
 Copy constructor. More...
 
OsiObjectoperator= (const OsiObject &rhs)
 Assignment operator. More...
 
virtual OsiObjectclone () const =0
 Clone. More...
 
virtual ~OsiObject ()
 Destructor. More...
 
double infeasibility (const OsiSolverInterface *solver, int &whichWay) const
 Infeasibility of the object. More...
 
virtual double infeasibility (const OsiBranchingInformation *info, int &whichWay) const =0
 
virtual double checkInfeasibility (const OsiBranchingInformation *info) const
 
virtual double feasibleRegion (OsiSolverInterface *solver) const
 For the variable(s) referenced by the object, look at the current solution and set bounds to match the solution. More...
 
virtual double feasibleRegion (OsiSolverInterface *solver, const OsiBranchingInformation *info) const =0
 For the variable(s) referenced by the object, look at the current solution and set bounds to match the solution. More...
 
virtual OsiBranchingObjectcreateBranch (OsiSolverInterface *, const OsiBranchingInformation *, int) const
 Create a branching object and indicate which way to branch first. More...
 
virtual bool canDoHeuristics () const
 Return true if object can take part in normal heuristics. More...
 
virtual bool canMoveToNearest () const
 Return true if object can take part in move to nearest heuristic. More...
 
virtual int columnNumber () const
 Column number if single column object -1 otherwise, Used by heuristics. More...
 
int priority () const
 Return Priority - note 1 is highest priority. More...
 
void setPriority (int priority)
 Set priority. More...
 
virtual bool boundBranch () const
 Return true if branch should only bound variables. More...
 
virtual bool canHandleShadowPrices () const
 Return true if knows how to deal with Pseudo Shadow Prices. More...
 
int numberWays () const
 Return maximum number of ways branch may have. More...
 
void setNumberWays (int numberWays)
 Set maximum number of ways branch may have. More...
 
void setWhichWay (int way)
 Return preferred way to branch. More...
 
int whichWay () const
 Return current preferred way to branch. More...
 
virtual int preferredWay () const
 Get pre-emptive preferred way of branching - -1 off, 0 down, 1 up (for 2-way) More...
 
double infeasibility () const
 Return infeasibility. More...
 
virtual double upEstimate () const
 Return "up" estimate (default 1.0e-5) More...
 
virtual double downEstimate () const
 Return "down" estimate (default 1.0e-5) More...
 
virtual void resetBounds (const OsiSolverInterface *)
 Reset variable bounds to their original values. More...
 
virtual void resetSequenceEtc (int, const int *)
 Change column numbers after preprocessing. More...
 
virtual void updateBefore (const OsiObject *)
 Updates stuff like pseudocosts before threads. More...
 
virtual void updateAfter (const OsiObject *, const OsiObject *)
 Updates stuff like pseudocosts after threads finished. More...
 

Protected Attributes

double infeasibility_
 data More...
 
short whichWay_
 Computed preferred way to branch. More...
 
short numberWays_
 Maximum number of ways on branch. More...
 
int priority_
 Priority. More...
 

Detailed Description

Abstract base class for `objects'.

The branching model used in Osi is based on the idea of an object. In the abstract, an object is something that has a feasible region, can be evaluated for infeasibility, can be branched on (i.e., there's some constructive action to be taken to move toward feasibility), and allows comparison of the effect of branching.

This class (OsiObject) is the base class for an object. To round out the branching model, the class OsiBranchingObject describes how to perform a branch, and the class OsiBranchDecision describes how to compare two OsiBranchingObjects.

To create a new type of object you need to provide three methods: infeasibility(), feasibleRegion(), and createBranch(), described below.

This base class is primarily virtual to allow for any form of structure. Any form of discontinuity is allowed.

As there is an overhead in getting information from solvers and because other useful information is available there is also an OsiBranchingInformation class which can contain pointers to information. If used it must at minimum contain pointers to current value of objective, maximum allowed objective and pointers to arrays for bounds and solution and direction of optimization. Also integer and primal tolerance.

Classes which inherit might have other information such as depth, number of solutions, pseudo-shadow prices etc etc. May be easier just to throw in here - as I keep doing

Definition at line 56 of file OsiBranchingObject.hpp.

Constructor & Destructor Documentation

OsiObject::OsiObject ( )

Default Constructor.

OsiObject::OsiObject ( const OsiObject )

Copy constructor.

virtual OsiObject::~OsiObject ( )
virtual

Destructor.

Member Function Documentation

OsiObject& OsiObject::operator= ( const OsiObject rhs)

Assignment operator.

virtual OsiObject* OsiObject::clone ( ) const
pure virtual
double OsiObject::infeasibility ( const OsiSolverInterface solver,
int &  whichWay 
) const

Infeasibility of the object.

This is some measure of the infeasibility of the object. 0.0 indicates that the object is satisfied.

The preferred branching direction is returned in whichWay, where for normal two-way branching 0 is down, 1 is up

This is used to prepare for strong branching but should also think of case when no strong branching

The object may also compute an estimate of cost of going "up" or "down". This will probably be based on pseudo-cost ideas

This should also set mutable infeasibility_ and whichWay_ This is for instant re-use for speed

Default for this just calls infeasibility with OsiBranchingInformation NOTE - Convention says that an infeasibility of COIN_DBL_MAX means object has worked out it can't be satisfied!

virtual double OsiObject::infeasibility ( const OsiBranchingInformation info,
int &  whichWay 
) const
pure virtual
virtual double OsiObject::checkInfeasibility ( const OsiBranchingInformation info) const
virtual

Reimplemented in OsiBiLinear.

virtual double OsiObject::feasibleRegion ( OsiSolverInterface solver) const
virtual

For the variable(s) referenced by the object, look at the current solution and set bounds to match the solution.

Returns measure of how much it had to move solution to make feasible

Reimplemented in CbcObject.

virtual double OsiObject::feasibleRegion ( OsiSolverInterface solver,
const OsiBranchingInformation info 
) const
pure virtual

For the variable(s) referenced by the object, look at the current solution and set bounds to match the solution.

Returns measure of how much it had to move solution to make feasible Faster version

Implemented in OsiUsesBiLinear, OsiLotsize, OsiBiLinear, OsiSOS, OsiLink, OsiSimpleInteger, OsiOldLink, CbcSimpleInteger, and CbcObject.

virtual OsiBranchingObject* OsiObject::createBranch ( OsiSolverInterface ,
const OsiBranchingInformation ,
int   
) const
inlinevirtual

Create a branching object and indicate which way to branch first.

The branching object has to know how to create branches (fix variables, etc.)

Reimplemented in OsiUsesBiLinear, OsiSimpleFixedInteger, OsiLotsize, OsiBiLinear, OsiSOS, OsiLink, OsiSimpleInteger, OsiOldLink, and CbcObject.

Definition at line 119 of file OsiBranchingObject.hpp.

virtual bool OsiObject::canDoHeuristics ( ) const
inlinevirtual

Return true if object can take part in normal heuristics.

Reimplemented in OsiLotsize, OsiBiLinear, OsiSOS, OsiLink, OsiOldLink, CbcSOS, CbcLotsize, and CbcBranchToFixLots.

Definition at line 125 of file OsiBranchingObject.hpp.

virtual bool OsiObject::canMoveToNearest ( ) const
inlinevirtual

Return true if object can take part in move to nearest heuristic.

Definition at line 129 of file OsiBranchingObject.hpp.

virtual int OsiObject::columnNumber ( ) const
virtual

Column number if single column object -1 otherwise, Used by heuristics.

Reimplemented in OsiLotsize, OsiSimpleInteger, CbcSimpleInteger, and CbcLotsize.

int OsiObject::priority ( ) const
inline

Return Priority - note 1 is highest priority.

Definition at line 136 of file OsiBranchingObject.hpp.

void OsiObject::setPriority ( int  priority)
inline

Set priority.

Definition at line 139 of file OsiBranchingObject.hpp.

virtual bool OsiObject::boundBranch ( ) const
inlinevirtual

Return true if branch should only bound variables.

Reimplemented in OsiBiLinear, OsiLink, OsiOldLink, and CbcBranchCut.

Definition at line 143 of file OsiBranchingObject.hpp.

virtual bool OsiObject::canHandleShadowPrices ( ) const
inlinevirtual

Return true if knows how to deal with Pseudo Shadow Prices.

Reimplemented in OsiLotsize, OsiSOS, and OsiSimpleInteger.

Definition at line 146 of file OsiBranchingObject.hpp.

int OsiObject::numberWays ( ) const
inline

Return maximum number of ways branch may have.

Definition at line 149 of file OsiBranchingObject.hpp.

void OsiObject::setNumberWays ( int  numberWays)
inline

Set maximum number of ways branch may have.

Definition at line 152 of file OsiBranchingObject.hpp.

void OsiObject::setWhichWay ( int  way)
inline

Return preferred way to branch.

If two then way=0 means down and 1 means up, otherwise way points to preferred branch

Definition at line 158 of file OsiBranchingObject.hpp.

int OsiObject::whichWay ( ) const
inline

Return current preferred way to branch.

If two then way=0 means down and 1 means up, otherwise way points to preferred branch

Definition at line 164 of file OsiBranchingObject.hpp.

virtual int OsiObject::preferredWay ( ) const
inlinevirtual

Get pre-emptive preferred way of branching - -1 off, 0 down, 1 up (for 2-way)

Reimplemented in CbcObject, and OsiObject2.

Definition at line 167 of file OsiBranchingObject.hpp.

double OsiObject::infeasibility ( ) const
inline

Return infeasibility.

Definition at line 170 of file OsiBranchingObject.hpp.

virtual double OsiObject::upEstimate ( ) const
virtual

Return "up" estimate (default 1.0e-5)

Reimplemented in OsiLotsize, OsiSOS, OsiSimpleInteger, CbcSimpleIntegerDynamicPseudoCost, and CbcSimpleIntegerPseudoCost.

virtual double OsiObject::downEstimate ( ) const
virtual

Return "down" estimate (default 1.0e-5)

Reimplemented in OsiLotsize, OsiSOS, OsiSimpleInteger, CbcSimpleIntegerDynamicPseudoCost, and CbcSimpleIntegerPseudoCost.

virtual void OsiObject::resetBounds ( const OsiSolverInterface )
inlinevirtual

Reset variable bounds to their original values.

Bounds may be tightened, so it may be good to be able to reset them to their original values.

Reimplemented in OsiLotsize, OsiSimpleInteger, CbcSimpleInteger, CbcObject, and CbcLotsize.

Definition at line 180 of file OsiBranchingObject.hpp.

virtual void OsiObject::resetSequenceEtc ( int  ,
const int *   
)
inlinevirtual

Change column numbers after preprocessing.

Reimplemented in OsiLotsize, OsiBiLinear, OsiSOS, OsiLink, OsiSimpleInteger, OsiOldLink, and CbcSimpleInteger.

Definition at line 183 of file OsiBranchingObject.hpp.

virtual void OsiObject::updateBefore ( const OsiObject )
inlinevirtual

Updates stuff like pseudocosts before threads.

Reimplemented in CbcSimpleIntegerDynamicPseudoCost.

Definition at line 185 of file OsiBranchingObject.hpp.

virtual void OsiObject::updateAfter ( const OsiObject ,
const OsiObject  
)
inlinevirtual

Updates stuff like pseudocosts after threads finished.

Reimplemented in CbcSimpleIntegerDynamicPseudoCost.

Definition at line 187 of file OsiBranchingObject.hpp.

Member Data Documentation

double OsiObject::infeasibility_
mutableprotected

data

Computed infeasibility

Definition at line 193 of file OsiBranchingObject.hpp.

short OsiObject::whichWay_
mutableprotected

Computed preferred way to branch.

Definition at line 195 of file OsiBranchingObject.hpp.

short OsiObject::numberWays_
protected

Maximum number of ways on branch.

Definition at line 197 of file OsiBranchingObject.hpp.

int OsiObject::priority_
protected

Priority.

Definition at line 199 of file OsiBranchingObject.hpp.


The documentation for this class was generated from the following file: