Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

SbbCountRowCut Class Reference

OsiRowCut augmented with bookkeeping. More...

#include <SbbCountRowCut.hpp>

Inheritance diagram for SbbCountRowCut:

OsiRowCut OsiCut List of all members.

Public Member Functions

void increment (int change=1)
 Increment the number of references.

int decrement (int change=1)
 Decrement the number of references and return the number left.

void setInfo (SbbNodeInfo *, int whichOne)
 Set the information associating this cut with a node.

int numberPointingToThis ()
 Number of other SbbNodeInfo objects pointing to this row cut.

int whichCutGenerator () const
 Which generator for cuts - as user order.

Constructors & destructors
 SbbCountRowCut ()
 Default Constructor.

 SbbCountRowCut (const OsiRowCut &)
 `Copy' constructor using an OsiRowCut

 SbbCountRowCut (const OsiRowCut &, SbbNodeInfo *, int whichOne, int whichGenerator=-1)
 `Copy' constructor using an OsiRowCut and an SbbNodeInfo

virtual ~SbbCountRowCut ()

Private Member Functions

 SbbCountRowCut (const SbbCountRowCut &)
 Standard copy is illegal (reference counts would be incorrect).

SbbCountRowCutoperator= (const SbbCountRowCut &rhs)
 Standard assignment is illegal (reference counts would be incorrect).


Private Attributes

SbbNodeInfoowner_
 Backward pointer to owning SbbNodeInfo.

int ownerCut_
int numberPointingToThis_
 Number of other SbbNodeInfo objects pointing to this cut.

int whichCutGenerator_
 Which generator created this cut.


Detailed Description

OsiRowCut augmented with bookkeeping.

SbbCountRowCut is an OsiRowCut object augmented with bookkeeping information: a reference count and information that specifies the the generator that created the cut and the node to which it's associated.

The general principles for handling the reference count are as follows:

When all possible uses of a cut have been demonstrated to be unnecessary, the reference count (numberPointingToThis_) will fall to zero. The SbbCountRowCut object (and its included OsiRowCut object) are then deleted.

Definition at line 32 of file SbbCountRowCut.hpp.


Constructor & Destructor Documentation

SbbCountRowCut::~SbbCountRowCut  )  [virtual]
 

Destructor

Note:
The destructor will reach out (via owner_) and NULL the reference to the cut in the owner's cuts_ list.

Definition at line 52 of file SbbCountRowCut.cpp.

References SbbNodeInfo::deleteCut(), numberPointingToThis_, owner_, and ownerCut_.

00053 {
00054 #ifdef CHECK_CUT_COUNTS
00055   printf("SbbCountRowCut destructor %x - references %d\n",this,
00056          numberPointingToThis_);
00057 #endif
00058   // Look at owner and delete
00059   owner_->deleteCut(ownerCut_);
00060 }


Member Function Documentation

void SbbCountRowCut::setInfo SbbNodeInfo ,
int  whichOne
 

Set the information associating this cut with a node.

An SbbNodeInfo object and an index in the cut set of the node. For locally valid cuts, the node will be the search tree node where the cut was generated. For globally valid cuts, it's the node where the cut was activated.

Definition at line 78 of file SbbCountRowCut.cpp.

References owner_, and ownerCut_.

00079 {
00080   owner_=info;
00081   ownerCut_=whichOne;
00082 }


Member Data Documentation

int SbbCountRowCut::ownerCut_ [private]
 

Index of cut in owner's cut set (cuts_ ).

Definition at line 99 of file SbbCountRowCut.hpp.

Referenced by setInfo(), and ~SbbCountRowCut().


The documentation for this class was generated from the following files:
Generated on Wed Dec 3 14:36:23 2003 for Sbb by doxygen 1.3.5