SourceXtractorPlusPlus  0.15
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 SourceXtractor {
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 }
62 
63 #include "_impl/KdTree.icpp"
64 
65 #endif /* _SEUTILS_KDTREE_H_ */
KdTree(const std::vector< T > &data)
std::vector< T > findPointsWithinRadius(Coord coord, double radius) const
std::shared_ptr< Node > m_root
Definition: KdTree.h:56
static double getCoord(const T &t, size_t index)