|
pure-cpp 1.0.0
A C++ physics simulation benchmark comparing performance with Python implementations
|
A k-d tree for fast nearest neighbour searches, specialized for our Bodies container.
More...
#include <kdtree.hpp>

Public Types | |
| using | TreeType = nanoflann::KDTreeSingleIndexAdaptor< nanoflann::L2_Simple_Adaptor< double, BodiesAdaptor >, BodiesAdaptor, 3, std::size_t > |
| The specific KD-Tree type using our adapter. More... | |
Public Member Functions | |
| KDTree (const Bodies &in_bodies) | |
| Construct a new KDTree object and build the index. More... | |
| template<typename VectorOfPairs > | |
| std::size_t | radiusSearch (const double *query_point, const double search_radius, VectorOfPairs &out_results) |
| Finds all bodies within a given radius of a query point. More... | |
Private Attributes | |
| BodiesAdaptor | adaptor_ |
| The adapter that lets nanoflann access our data. More... | |
| TreeType | tree_ |
| The underlying nanoflann k-d tree index. More... | |
A k-d tree for fast nearest neighbour searches, specialized for our Bodies container.
Definition at line 75 of file kdtree.hpp.
| using Model::KDTree::TreeType = nanoflann::KDTreeSingleIndexAdaptor< nanoflann::L2_Simple_Adaptor<double, BodiesAdaptor>, BodiesAdaptor, 3 , std::size_t > |
The specific KD-Tree type using our adapter.
Definition at line 78 of file kdtree.hpp.
|
inlineexplicit |
Construct a new KDTree object and build the index.
| in_bodies | The Bodies container to build the tree from. |
Definition at line 87 of file kdtree.hpp.
|
inline |
Finds all bodies within a given radius of a query point.
| query_point | The centre point of the search. |
| search_radius | The radius of the search sphere. |
| out_results | A vector to store the results (pairs of index and squared distance). |
Definition at line 106 of file kdtree.hpp.
|
private |
The adapter that lets nanoflann access our data.
Definition at line 126 of file kdtree.hpp.
|
private |
The underlying nanoflann k-d tree index.
Definition at line 128 of file kdtree.hpp.