SourceXtractorPlusPlus
0.15
Please provide a description of the project.
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
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::KdTree::Coord
Definition:
KdTree.h:46
std::shared_ptr
SourceXtractor::KdTreeTraits
Definition:
KdTree.h:28
SourceXtractor::KdTree::Node
Definition:
KdTree.icpp:21
SourceXtractor::KdTree::KdTree
KdTree(const std::vector< T > &data)
Definition:
KdTree.icpp:113
SourceXtractor::KdTree
A simple N-dimensional KdTree for speeding-up elements within range types of queries.
Definition:
KdTree.h:42
SourceXtractor::KdTree::Leaf
Definition:
KdTree.icpp:28
SourceXtractor::KdTree::findPointsWithinRadius
std::vector< T > findPointsWithinRadius(Coord coord, double radius) const
Definition:
KdTree.icpp:123
std::vector
STL class.
SourceXtractor::KdTreeTraits::getCoord
static double getCoord(const T &t, size_t index)
SourceXtractor::KdTree::Coord::coord
double coord[N]
Definition:
KdTree.h:47
SourceXtractor::KdTree::m_root
std::shared_ptr< Node > m_root
Definition:
KdTree.h:56
Generated by
1.8.5