CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
KDTreeNodes< DATA > Struct Template Reference

#include <KDTreeLinkerTools.h>

Public Member Functions

void build (int sizeData)
 
void clear ()
 
bool empty () const
 
int getNextNode ()
 
constexpr bool isLeaf (int right) const
 
bool isLeafIndex (int index) const
 
constexpr KDTreeNodes ()
 
int size () const
 

Public Attributes

std::vector< DATA > data
 
std::vector< float > dimOther
 
std::vector< float > median
 
int poolPos
 
int poolSize
 
std::vector< int > right
 

Detailed Description

template<typename DATA>
struct KDTreeNodes< DATA >

Definition at line 38 of file KDTreeLinkerTools.h.

Constructor & Destructor Documentation

template<typename DATA>
constexpr KDTreeNodes< DATA >::KDTreeNodes ( )
inline

Definition at line 47 of file KDTreeLinkerTools.h.

47 : poolSize(-1), poolPos(-1) {}

Member Function Documentation

template<typename DATA>
void KDTreeNodes< DATA >::build ( int  sizeData)
inline

Definition at line 66 of file KDTreeLinkerTools.h.

Referenced by psClasses.BuildThread::run().

66  {
67  poolSize = sizeData * 2 - 1;
68  median.resize(poolSize);
69  right.resize(poolSize);
70  dimOther.resize(poolSize);
71  data.resize(poolSize);
72  };
std::vector< int > right
std::vector< float > dimOther
std::vector< float > median
std::vector< DATA > data
template<typename DATA>
void KDTreeNodes< DATA >::clear ( void  )
inline
template<typename DATA>
bool KDTreeNodes< DATA >::empty ( ) const
inline
template<typename DATA>
int KDTreeNodes< DATA >::getNextNode ( )
inline

Definition at line 61 of file KDTreeLinkerTools.h.

61  {
62  ++poolPos;
63  return poolPos;
64  }
template<typename DATA>
constexpr bool KDTreeNodes< DATA >::isLeaf ( int  right) const
inline

Definition at line 74 of file KDTreeLinkerTools.h.

74  {
75  // Valid values of right are always >= 2
76  // index 0 is the root, and 1 is the first left node
77  // Exploit index values 0 and 1 to mark which of dim1/dim2 is the
78  // current one in recSearch() at the depth of the leaf.
79  return right < 2;
80  }
std::vector< int > right
template<typename DATA>
bool KDTreeNodes< DATA >::isLeafIndex ( int  index) const
inline

Definition at line 82 of file KDTreeLinkerTools.h.

82 { return isLeaf(right[index]); }
constexpr bool isLeaf(int right) const
std::vector< int > right
template<typename DATA>
int KDTreeNodes< DATA >::size ( void  ) const
inline

Member Data Documentation

template<typename DATA>
std::vector<DATA> KDTreeNodes< DATA >::data
template<typename DATA>
std::vector<float> KDTreeNodes< DATA >::dimOther

Definition at line 41 of file KDTreeLinkerTools.h.

template<typename DATA>
std::vector<float> KDTreeNodes< DATA >::median

Definition at line 39 of file KDTreeLinkerTools.h.

template<typename DATA>
int KDTreeNodes< DATA >::poolPos

Definition at line 45 of file KDTreeLinkerTools.h.

template<typename DATA>
int KDTreeNodes< DATA >::poolSize

Definition at line 44 of file KDTreeLinkerTools.h.

template<typename DATA>
std::vector<int> KDTreeNodes< DATA >::right

Definition at line 40 of file KDTreeLinkerTools.h.

Referenced by progressbar.Bar::update(), and progressbar.BouncingBar::update().