kdtree< VALUE >::KDNode Struct Reference

#include <kdtree.h>

List of all members.

Classes

struct  no_specific_order

Public Member Functions

void printLeavesize ()
int size ()
std::list< float * > * findDatasetInterval (unsigned int kdim, unsigned int curlvl, float *min_datavec, float *max_datavec)
std::list< VALUE > * findUsersetInterval (unsigned int kdim, unsigned int curlvl, float *min_datavec, float *max_datavec)
std::list< float * > * findDataset (unsigned int kdim, unsigned int curlvl, float *datavec)
std::list< VALUE > * findUserset (unsigned int kdim, unsigned int curlvl, float *datavec)

Public Attributes

float comparevalue
 Value which splits the data into two halfs along current dimension.
KDNodeleft
 Left subtree contains only datavectors v where v[dim] < comparevalue;.
KDNoderight
 Right subtree contains only datavectors v where v[dim] >= comparevalue;.
std::list< float * > * dataset
 If this node is a leaf then dataset stores same datavectors (or one).
std::list< VALUE > * userset
 If this node is a leaf then userset stores associated userdata.

Detailed Description

template<class VALUE>
struct kdtree< VALUE >::KDNode

KDNode represents a Single KD-Tree node/leaf or a complete tree/subtree as well. This structure is for use in kdtree class only!


Member Function Documentation

template<class VALUE>
std::list<float*>* kdtree< VALUE >::KDNode::findDataset ( unsigned int  kdim,
unsigned int  curlvl,
float *  datavec 
) [inline]

Finds a set of similar or equal vectors to the given data-vector. If the returned set contains more than one vector then they are equal as for the data but the pointers are different (Data-Vectors do have data+identity). Don't delete returned sets!! Returned sets are part of the kd-tree!

template<class VALUE>
std::list<float*>* kdtree< VALUE >::KDNode::findDatasetInterval ( unsigned int  kdim,
unsigned int  curlvl,
float *  min_datavec,
float *  max_datavec 
) [inline]

Search for data vectors near to the given data vector interval (ie. searching for data vectors matching multidimensional Intervals). Note that the result may contain more data than just the data vectors within the interval (false positives, or fuzziness). You should delete returned sets!! Caller responsibility!

template<class VALUE>
std::list<VALUE>* kdtree< VALUE >::KDNode::findUserset ( unsigned int  kdim,
unsigned int  curlvl,
float *  datavec 
) [inline]

Finds a set of similar or equal vectors to the given data-vector and returns their associated userdata (objects related to those vectors). If the returned set contains more than one vector then they are equal as for the data but the pointers are different (Data-Vectors do have data+identity). Don't delete returned sets!! Returned sets are part of the kd-tree!

template<class VALUE>
std::list<VALUE>* kdtree< VALUE >::KDNode::findUsersetInterval ( unsigned int  kdim,
unsigned int  curlvl,
float *  min_datavec,
float *  max_datavec 
) [inline]

Search for data vectors near to the given data vector interval (ie. searching for data vectors matching multidimensional Intervals) and returns their associated userdata (objects related to those vectors). Note that the result may contain more data than just within the interval (false positives, or fuzziness). You should delete returned sets!! Caller responsibility!

template<class VALUE>
void kdtree< VALUE >::KDNode::printLeavesize (  )  [inline]

Print size of KD-Tree leaves.

template<class VALUE>
int kdtree< VALUE >::KDNode::size (  )  [inline]

Returns amount of (not necessarily unique) stored datavectors.


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

Generated on Thu Jan 28 14:11:05 2010 for Linwarrior 3D by  doxygen 1.6.1