TGS_tree< base_tree > Class Template Reference

#include <TGS.h>

Inherited by Hilbert_TGS_tree< base_tree >, Hilbert_TGSinsert_tree< base_tree >, and TGS2_tree< base_tree >.

Inheritance diagram for TGS_tree< base_tree >:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 TGS_tree ()
 TGS_tree (R_tree_props *props)
virtual ~TGS_tree ()
virtual void ensureReady ()
void bulkLoad ()
virtual base_tree * insert (BB_container *element)
virtual base_tree * remove (BB_container *element)
virtual base_tree * search (BB_container *element)
virtual vector< int > containedIn (BB_type box) const
virtual vector< int > intersects (const vector< double > begin, const vector< double > end) const
virtual vector< int > intersects (Point point) const
virtual vector< int > intersects (vector< double > a, double b) const
virtual vector< int > neighboursOf (BB_container *item) const

Protected Member Functions

virtual vector< Ordering<
BB_container > * > 
useOrderings () const
virtual double cost_function (const BB_type *x, const BB_type *y) const
base_tree * BulkLoadChunk (vector< BB_container * > *D, unsigned int h)
vector< vector< BB_container * > * > * BestBinarySplit (vector< BB_container * > *D, unsigned int m)
vector< vector< BB_container * > * > * Partition (vector< BB_container * > *D, unsigned int m)

Protected Attributes

bool loaded
vector< BB_containercache

Private Member Functions

virtual bool checkReady () const

Detailed Description

template<typename base_tree>
class TGS_tree< base_tree >

The top-down greedy split bulk-loaded R-tree.

Parameters:
base_tree The type of non-bulkloaded R-tree which this class will bulk-load.

Definition at line 43 of file TGS.h.


Constructor & Destructor Documentation

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

Inherited constructor.

Definition at line 103 of file TGS.h.

References TGS_tree< base_tree >::loaded.

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

Inherited constructor.

Definition at line 106 of file TGS.h.

References TGS_tree< base_tree >::loaded.

template<typename base_tree>
virtual TGS_tree< base_tree >::~TGS_tree (  )  [inline, virtual]

Base deconstructor

Definition at line 109 of file TGS.h.


Member Function Documentation

template<typename base_tree>
virtual bool TGS_tree< base_tree >::checkReady (  )  const [inline, private, virtual]

Checks if the tree is ready for access.

Returns:
Whether or not the data structure is ready for access.

Definition at line 52 of file TGS.h.

References TGS_tree< base_tree >::loaded.

Referenced by TGS_tree< base_tree >::containedIn(), TGS_tree< base_tree >::intersects(), and TGS_tree< base_tree >::neighboursOf().

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

Method returning which orderings should be used. By default uses the low-coordinate x,y,z orderings.

Returns:
A vector containing pointers to the three used orderings.

Reimplemented in Hilbert_TGS_tree< base_tree >, and Hilbert_TGSinsert_tree< base_tree >.

Definition at line 189 of file TGS.h.

References Cubic_Bounding_Box_Container::getDefaultOrdering(), and Cubic_Bounding_Box_Container::getOrderings().

Referenced by TGS_tree< base_tree >::BestBinarySplit(), and TGS_tree< base_tree >::bulkLoad().

template<typename base_tree>
double TGS_tree< base_tree >::cost_function ( const BB_type x,
const BB_type y 
) const [inline, protected, virtual]

The cost function used to determine the best binary split.

Parameters:
x The first bounding box.
y The second bounding box.
Returns:
The cost of having a split resulting in the two given bounding boxes.

Reimplemented in TGS2_tree< base_tree >.

Definition at line 177 of file TGS.h.

References Cart::Volume().

Referenced by TGS_tree< base_tree >::BestBinarySplit().

template<typename base_tree>
base_tree * TGS_tree< base_tree >::BulkLoadChunk ( vector< BB_container * > *  D,
unsigned int  h 
) [inline, protected]

TGS Bulkloading subroutine. See report.

Definition at line 201 of file TGS.h.

References TGS_tree< base_tree >::Partition(), and Cubic_Bounding_Box::unite().

Referenced by TGS_tree< base_tree >::bulkLoad().

template<typename base_tree>
vector< vector< BB_container * > * > * TGS_tree< base_tree >::BestBinarySplit ( vector< BB_container * > *  D,
unsigned int  m 
) [inline, protected]

TGS Bulkloading subroutine. See report.

Definition at line 326 of file TGS.h.

References _TIMINGS, TGS_tree< base_tree >::cost_function(), intertimer, intertimersum, TIMING, Cubic_Bounding_Box::unite(), and TGS_tree< base_tree >::useOrderings().

Referenced by TGS_tree< base_tree >::Partition().

template<typename base_tree>
vector< vector< BB_container * > * > * TGS_tree< base_tree >::Partition ( vector< BB_container * > *  D,
unsigned int  m 
) [inline, protected]

TGS Bulkloading subroutine. See report.

Definition at line 280 of file TGS.h.

References TGS_tree< base_tree >::BestBinarySplit().

Referenced by TGS_tree< base_tree >::BulkLoadChunk().

template<typename base_tree>
void TGS_tree< base_tree >::ensureReady (  )  [inline, virtual]

Checks if the TGS tree is ready for queries. If not, it starts the bulk-loading mechanism automatically (and prints a warning to stderr).

Definition at line 182 of file TGS.h.

References TGS_tree< base_tree >::bulkLoad(), and TGS_tree< base_tree >::loaded.

template<typename base_tree>
void TGS_tree< base_tree >::bulkLoad (  )  [inline]

Starts bulk-loading the inserted elements

Definition at line 428 of file TGS.h.

References TGS_tree< base_tree >::BulkLoadChunk(), TGS_tree< base_tree >::cache, intertimersum, TGS_tree< base_tree >::loaded, TIMER, TIMING, and TGS_tree< base_tree >::useOrderings().

Referenced by TGS_tree< base_tree >::ensureReady().

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

Chaches a given container element for bulk-loading into the R-tree structure.

Parameters:
element The to be bulk-loaded element
Returns:
The root of the element

Reimplemented in Hilbert_TGSinsert_tree< base_tree >.

Definition at line 519 of file TGS.h.

References TGS_tree< base_tree >::cache, and TGS_tree< base_tree >::loaded.

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

Removes a stored polytope from the R-tree structure. A pointer to the polytope must be explicitly given. If the polytope cannot be found within the R-tree, a warning is printed to stderr but no further action is taken.

Parameters:
element The element to be removed from the R-tree.
Returns:
The (new) root of the R-tree.

Definition at line 530 of file TGS.h.

References TGS_tree< base_tree >::cache, Cubic_Bounding_Box_Container::getID(), and TGS_tree< base_tree >::loaded.

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

Searches the R-tree for a given polytope, and returns the leaf node at which it is stored.

Parameters:
element The element to be found
Returns:
The leaf node at which the given polytope is found

Definition at line 543 of file TGS.h.

References TGS_tree< base_tree >::cache, Cubic_Bounding_Box_Container::getID(), and TGS_tree< base_tree >::loaded.

template<typename base_tree>
vector< int > TGS_tree< base_tree >::containedIn ( BB_type  box  )  const [inline, virtual]

See superclass Spatial_Tree

Definition at line 556 of file TGS.h.

References TGS_tree< base_tree >::checkReady().

template<typename base_tree>
vector< int > TGS_tree< base_tree >::intersects ( const vector< double >  begin,
const vector< double >  end 
) const [inline, virtual]

See superclass Spatial_Tree

Definition at line 565 of file TGS.h.

References TGS_tree< base_tree >::checkReady().

template<typename base_tree>
vector< int > TGS_tree< base_tree >::intersects ( Point  point  )  const [inline, virtual]

See superclass Spatial_Tree

Definition at line 574 of file TGS.h.

References TGS_tree< base_tree >::checkReady().

template<typename base_tree>
vector< int > TGS_tree< base_tree >::intersects ( vector< double >  a,
double  b 
) const [inline, virtual]

See superclass Spatial_Tree

Definition at line 583 of file TGS.h.

References TGS_tree< base_tree >::checkReady().

template<typename base_tree>
vector< int > TGS_tree< base_tree >::neighboursOf ( BB_container item  )  const [inline, virtual]

See superclass Spatial_Tree

Definition at line 592 of file TGS.h.

References TGS_tree< base_tree >::checkReady().


Member Data Documentation

template<typename base_tree>
bool TGS_tree< base_tree >::loaded [protected]

Whether or not the tree is bulk-loaded and ready for access

Definition at line 66 of file TGS.h.

Referenced by TGS_tree< base_tree >::bulkLoad(), TGS_tree< base_tree >::checkReady(), TGS_tree< base_tree >::ensureReady(), TGS_tree< base_tree >::insert(), TGS_tree< base_tree >::remove(), TGS_tree< base_tree >::search(), and TGS_tree< base_tree >::TGS_tree().

template<typename base_tree>
vector< BB_container > TGS_tree< base_tree >::cache [protected]

Vector preallocating the leaf nodes. They are copied entirely into the cache in an attempt to gain speed by using a single large allocated chunk of memory for storing the leaf nodes.

Definition at line 71 of file TGS.h.

Referenced by TGS_tree< base_tree >::bulkLoad(), TGS_tree< base_tree >::insert(), Hilbert_TGSinsert_tree< base_tree >::insertionSort(), TGS_tree< base_tree >::remove(), and TGS_tree< base_tree >::search().


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