Hilbert_TGSinsert_tree< base_tree > Class Template Reference

#include <HilbertTGSinsert.h>

Inherits TGS_tree< base_tree >< base_tree >.

Inheritance diagram for Hilbert_TGSinsert_tree< base_tree >:

Inheritance graph
[legend]
Collaboration diagram for Hilbert_TGSinsert_tree< base_tree >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Hilbert_TGSinsert_tree ()
 Hilbert_TGSinsert_tree (R_tree_props *props)
virtual base_tree * insert (BB_container *element)

Protected Member Functions

virtual vector< Ordering<
BB_container > * > 
useOrderings () const

Private Member Functions

void insertionSort (BB_container *element)
unsigned int lowestGeqThan (const double currentVal, const unsigned int left, const unsigned int right) const

Private Attributes

vector< double > hilbertCache

Detailed Description

template<typename base_tree>
class Hilbert_TGSinsert_tree< base_tree >

Same as Hilbert_TGS_tree, but instead of pre-caching and then applying quicksort, we now apply insertion sort.

NOTE: Due to implementation using a vector, this method is outperformed by the original Hilbert_TGS_tree. A linked-list would be better, but then the insertion sort algorithm is harder to implement efficiently.

Definition at line 27 of file HilbertTGSinsert.h.


Constructor & Destructor Documentation

template<typename base_tree>
Hilbert_TGSinsert_tree< base_tree >::Hilbert_TGSinsert_tree (  )  [inline]

Inherited constructor.

Definition at line 59 of file HilbertTGSinsert.h.

template<typename base_tree>
Hilbert_TGSinsert_tree< base_tree >::Hilbert_TGSinsert_tree ( R_tree_props props  )  [inline]

Inherited constructor.

Definition at line 62 of file HilbertTGSinsert.h.


Member Function Documentation

template<typename base_tree>
void Hilbert_TGSinsert_tree< base_tree >::insertionSort ( BB_container element  )  [inline, private]

The actual insertion sort algorithm.

Parameters:
element Pointer to the element needed to be inserted into the cache.

Definition at line 85 of file HilbertTGSinsert.h.

References TGS_tree< base_tree >::cache, Cubic_Bounding_Box::getCenterCoordinate(), Hilbert_TGSinsert_tree< base_tree >::hilbertCache, Hilbert_TGSinsert_tree< base_tree >::lowestGeqThan(), and HilbertCoordinateMapper::toHilbert3D().

Referenced by Hilbert_TGSinsert_tree< base_tree >::insert().

template<typename base_tree>
unsigned int Hilbert_TGSinsert_tree< base_tree >::lowestGeqThan ( const double  currentVal,
const unsigned int  left,
const unsigned int  right 
) const [inline, private]

Searches and returns the index of the first element in the cache with a higher Hilbert value. Hilbert values are not continuously re-calculated - they are cached.

Parameters:
currentVal The Hilbert value to compare to.
left Left bound of the Hilbert-cache to check for.
right Right bounbd of the Hilbert-cache to check for.
Returns:
The requested cache index.

Definition at line 70 of file HilbertTGSinsert.h.

References Hilbert_TGSinsert_tree< base_tree >::hilbertCache.

Referenced by Hilbert_TGSinsert_tree< base_tree >::insertionSort().

template<typename base_tree>
vector< Ordering< BB_container > * > Hilbert_TGSinsert_tree< base_tree >::useOrderings (  )  const [inline, protected, virtual]

See also:
Hilbert_TGS_tree::useOrderings()

Reimplemented from TGS_tree< base_tree >.

Definition at line 112 of file HilbertTGSinsert.h.

References Cubic_Bounding_Box_Container::NO_ORDERING.

template<typename base_tree>
base_tree * Hilbert_TGSinsert_tree< base_tree >::insert ( BB_container element  )  [inline, virtual]

Overrided insertion method. Now applies insertion sort.

Parameters:
element The element to be inserted.

Reimplemented from TGS_tree< base_tree >.

Definition at line 101 of file HilbertTGSinsert.h.

References Hilbert_TGSinsert_tree< base_tree >::insertionSort().


Member Data Documentation

template<typename base_tree>
vector< double > Hilbert_TGSinsert_tree< base_tree >::hilbertCache [private]

Vector used to cache the Hilbert values. The actual cache and this cache are kept in sync.

Definition at line 49 of file HilbertTGSinsert.h.

Referenced by Hilbert_TGSinsert_tree< base_tree >::insertionSort(), and Hilbert_TGSinsert_tree< base_tree >::lowestGeqThan().


The documentation for this class was generated from the following file:
Generated on Sat Oct 13 17:34:43 2007 for R-Tree by  doxygen 1.5.2