#include <HilbertTGSinsert.h>
Inherits TGS_tree< base_tree >< base_tree >.
Inheritance diagram for Hilbert_TGSinsert_tree< base_tree >:
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 |
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.
Hilbert_TGSinsert_tree< base_tree >::Hilbert_TGSinsert_tree | ( | ) | [inline] |
Inherited constructor.
Definition at line 59 of file HilbertTGSinsert.h.
Hilbert_TGSinsert_tree< base_tree >::Hilbert_TGSinsert_tree | ( | R_tree_props * | props | ) | [inline] |
Inherited constructor.
Definition at line 62 of file HilbertTGSinsert.h.
void Hilbert_TGSinsert_tree< base_tree >::insertionSort | ( | BB_container * | element | ) | [inline, private] |
The actual insertion sort algorithm.
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().
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.
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. |
Definition at line 70 of file HilbertTGSinsert.h.
References Hilbert_TGSinsert_tree< base_tree >::hilbertCache.
Referenced by Hilbert_TGSinsert_tree< base_tree >::insertionSort().
vector< Ordering< BB_container > * > Hilbert_TGSinsert_tree< base_tree >::useOrderings | ( | ) | const [inline, protected, virtual] |
Reimplemented from TGS_tree< base_tree >.
Definition at line 112 of file HilbertTGSinsert.h.
References Cubic_Bounding_Box_Container::NO_ORDERING.
base_tree * Hilbert_TGSinsert_tree< base_tree >::insert | ( | BB_container * | element | ) | [inline, virtual] |
Overrided insertion method. Now applies insertion sort.
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().
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().