SourceXtractorPlusPlus
0.15
Please provide a description of the project.
SEUtils
SEUtils
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
:
44
using
Traits
=
KdTreeTraits<T>
;
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
58
std::shared_ptr<Node>
m_root
;
59
};
60
61
}
62
63
#include "_impl/KdTree.icpp"
64
65
#endif
/* _SEUTILS_KDTREE_H_ */
SourceXtractor::KdTreeTraits::getCoord
static double getCoord(const T &t, size_t index)
std::shared_ptr< Node >
SourceXtractor::KdTreeTraits
Definition:
KdTree.h:28
std::vector
STL class.
SourceXtractor
Definition:
Aperture.h:30
SourceXtractor::KdTree::findPointsWithinRadius
std::vector< T > findPointsWithinRadius(Coord coord, double radius) const
SourceXtractor::KdTree::m_root
std::shared_ptr< Node > m_root
Definition:
KdTree.h:56
SourceXtractor::KdTree::KdTree
KdTree(const std::vector< T > &data)
SourceXtractor::KdTree::Coord
Definition:
KdTree.h:46
SourceXtractor::KdTree::Coord::coord
double coord[N]
Definition:
KdTree.h:47
KdTree
Generated by
1.8.20