Galois::Graph::SpatialTree2d< T > Class Template Reference

Stores sets of objects at specific spatial coordinates in a quad tree. More...

#include <SpatialTree.h>

List of all members.

Classes

struct  Box2d
struct  Node

Public Member Functions

 SpatialTree2d (double xmin=0.0, double ymin=0.0, double xmax=0.0, double ymax=0.0)
 ~SpatialTree2d ()
void init (double xmin, double ymin, double xmax, double ymax)
T * find (double x, double y)
 Returns null if tree is empty.
void insert (double x, double y, const T &v)
 Insert an element.

Private Member Functions

bool closer (double x, double y, double testx, double testy, double oldx, double oldy) const
T * recfind (Node *n, double x, double y)
void recinsert (Node **pos, Box2d b, Node *node)
NodemkNode (const T &v, double x, double y)
void delNode (Node *n)
void freeTree (Node *n)

Private Attributes

Galois::Runtime::MM::FSBGaloisAllocator
< Node
nodeAlloc
Noderoot
Box2d bounds

Detailed Description

template<typename T>
class Galois::Graph::SpatialTree2d< T >

Stores sets of objects at specific spatial coordinates in a quad tree.

Lookup returns an approximation of the closest item


Constructor & Destructor Documentation

template<typename T >
Galois::Graph::SpatialTree2d< T >::SpatialTree2d ( double  xmin = 0.0,
double  ymin = 0.0,
double  xmax = 0.0,
double  ymax = 0.0 
) [inline]
template<typename T >
Galois::Graph::SpatialTree2d< T >::~SpatialTree2d (  )  [inline]

Member Function Documentation

template<typename T >
bool Galois::Graph::SpatialTree2d< T >::closer ( double  x,
double  y,
double  testx,
double  testy,
double  oldx,
double  oldy 
) const [inline, private]
template<typename T >
void Galois::Graph::SpatialTree2d< T >::delNode ( Node n  )  [inline, private]
template<typename T >
T* Galois::Graph::SpatialTree2d< T >::find ( double  x,
double  y 
) [inline]

Returns null if tree is empty.

template<typename T >
void Galois::Graph::SpatialTree2d< T >::freeTree ( Node n  )  [inline, private]
template<typename T >
void Galois::Graph::SpatialTree2d< T >::init ( double  xmin,
double  ymin,
double  xmax,
double  ymax 
) [inline]
template<typename T >
void Galois::Graph::SpatialTree2d< T >::insert ( double  x,
double  y,
const T &  v 
) [inline]

Insert an element.

Will always insert and never roll back and thus must be used after failsafe point.

template<typename T >
Node* Galois::Graph::SpatialTree2d< T >::mkNode ( const T &  v,
double  x,
double  y 
) [inline, private]
template<typename T >
T* Galois::Graph::SpatialTree2d< T >::recfind ( Node n,
double  x,
double  y 
) [inline, private]
template<typename T >
void Galois::Graph::SpatialTree2d< T >::recinsert ( Node **  pos,
Box2d  b,
Node node 
) [inline, private]

Member Data Documentation

template<typename T >
Box2d Galois::Graph::SpatialTree2d< T >::bounds [private]
template<typename T >
Node* Galois::Graph::SpatialTree2d< T >::root [private]

The documentation for this class was generated from the following file:

Generated on 2 Nov 2013 for Galois by  doxygen 1.6.1