|
pure-cpp 1.0.0
A C++ physics simulation benchmark comparing performance with Python implementations
|
An adapter to allow nanoflann to work directly with our Bodies SoA container.
More...
#include <kdtree.hpp>

Public Member Functions | |
| BodiesAdaptor (const Bodies &in_bodies) | |
| Construct a new Bodies Adaptor object. More... | |
| std::size_t | kdtree_get_point_count () const |
| Returns the number of bodies (points) in the dataset. More... | |
| double | kdtree_get_pt (const std::size_t idx, const std::size_t dim) const |
| Returns the value of a single dimension of a point. More... | |
| template<class BBOX > | |
| bool | kdtree_get_bbox (BBOX &) const |
| Optional bounding box calculation (not used here). More... | |
Private Attributes | |
| const Bodies & | bodies_ |
| A const reference to the bodies container. More... | |
An adapter to allow nanoflann to work directly with our Bodies SoA container.
Note: The method names in this class follow the snake_case convention required by the nanoflann library's adapter interface, rather than the project's standard camelCase.
Definition at line 29 of file kdtree.hpp.
|
inlineexplicit |
Construct a new Bodies Adaptor object.
| in_bodies | The Bodies container. |
Definition at line 35 of file kdtree.hpp.
|
inline |
Optional bounding box calculation (not used here).
| BBOX | The type of the bounding box. |
Definition at line 62 of file kdtree.hpp.
|
inline |
Returns the number of bodies (points) in the dataset.
Definition at line 41 of file kdtree.hpp.

|
inline |
Returns the value of a single dimension of a point.
| idx | The index of the point. |
| dim | The dimension (0 for x, 1 for y, 2 for z). |
Definition at line 51 of file kdtree.hpp.
|
private |
A const reference to the bodies container.
Definition at line 68 of file kdtree.hpp.