NCollection_UBTreeFiller< TheObjType, TheBndType > Class Template Reference
#include <NCollection_UBTreeFiller.hxx>
Detailed Description
template<class TheObjType, class TheBndType>
class NCollection_UBTreeFiller< TheObjType, TheBndType >
This class is used to fill an UBTree in a random order. The quality of a tree is much better (from the point of view of the search time) if objects are added to it in a random order to avoid adding a chain of neerby objects one following each other.
This class collects objects to be added, and then add them to the tree in a random order.
Member Typedef Documentation
template<class TheObjType , class TheBndType >
template<class TheObjType , class TheBndType >
Constructor & Destructor Documentation
template<class TheObjType , class TheBndType >
Constructor.
- Parameters:
-
| theTree | Tree instance that is to be filled. |
| isFullRandom | Takes effect when the number of items is large (order of 50,000). When it is True, the code uses the maximal randomization allowing a better balanced tree. If False, the randomization/tree balance are worse but the tree filling is faster due to better utilisation of CPU L1/L2 cache. |
template<class TheObjType , class TheBndType >
Destructor. Fills the tree with accumulated items if they have not been passed by a previous call of method Fill().
Member Function Documentation
template<class TheObjType , class TheBndType >
| void NCollection_UBTreeFiller< TheObjType, TheBndType >::Add |
( |
const TheObjType & |
theObj, |
|
|
const TheBndType & |
theBnd | |
|
) |
| | [inline] |
template<class TheObjType , class TheBndType >
Check the filled tree for the total number of items and the balance outputting these results to ostream.
- Returns:
- the tree size (the same value is returned by method Fill()).
template<class TheObjType , class TheBndType >
Fills the tree with the objects from my sequence. This method clears the internal buffer of added items making sure that no item would be added twice.
- Returns:
- the number of objects added to the tree.
The documentation for this class was generated from the following file: