SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
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
25namespace SourceXtractor {
26
27template <typename T>
29 static double getCoord(const T& t, size_t index);
30};
31
41template<typename T, size_t N=2, size_t S=100>
42class KdTree {
43public:
45
46 struct Coord {
47 double coord[N];
48 };
49
50 explicit KdTree(const std::vector<T>& data);
52
53private:
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:58
static double getCoord(const T &t, size_t index)