Alexandria  2.19
Please provide a description of the project.
KdTree.h
Go to the documentation of this file.
1 
18 #ifndef _SEUTILS_KDTREE_H_
19 #define _SEUTILS_KDTREE_H_
20 
21 #include <vector>
22 #include <memory>
23 #include <algorithm>
24 
25 namespace KdTree {
26 
27 template <typename T>
28 struct KdTreeTraits {
29  static double getCoord(const T& t, size_t index);
30 };
31 
41 template<typename T, size_t N=2, size_t S=100>
42 class KdTree {
43 public:
45 
46  struct Coord {
47  double coord[N];
48  };
49 
50  explicit KdTree(const std::vector<T>& data);
51  std::vector<T> findPointsWithinRadius(Coord coord, double radius) const;
52 
53 private:
54  class Node;
55  class Leaf;
56  class Split;
57 
59 };
60 
61 } // namespace KdTree
62 
63 #include "_impl/KdTree.icpp"
64 
65 #endif /* _SEUTILS_KDTREE_H_ */
std::shared_ptr< Node >
std::vector
STL class.
KdTree::KdTreeTraits
Definition: KdTree.h:28
KdTree::KdTree::findPointsWithinRadius
std::vector< T > findPointsWithinRadius(Coord coord, double radius) const
KdTree.icpp
KdTree::KdTree::KdTree
KdTree(const std::vector< T > &data)
KdTree::KdTree::Coord
Definition: KdTree.h:46
KdTree::KdTree::m_root
std::shared_ptr< Node > m_root
Definition: KdTree.h:56
KdTree::KdTreeTraits::getCoord
static double getCoord(const T &t, size_t index)
KdTree
Definition: KdTree.h:25