![]() |
PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
|
To collect results of nanoflann tree search. Default result output of nanoflann search uses std::vector<std::pair<size_t, double>>. We prefer to get the index and distance in a separate list. More...
#include <nflannSetup.h>
Public Types | |
| typedef _DistanceType | DistanceType |
| Distance type (double, float, etc) | |
| typedef _IndexType | IndexType |
| Index type (int, size_t, etc) | |
Public Member Functions | |
| TreeSearchResult (DistanceType radius_, std::vector< IndexType > &indices, std::vector< DistanceType > &dists) | |
| Constructor. | |
| void | init () |
| Initialize the data (clear) | |
| void | clear () |
| Clear the data. | |
| size_t | size () const |
| Get the size of currently stored (found so far) indices. | |
| bool | full () const |
| Check (not implemented) | |
| bool | addPoint (DistanceType dist, IndexType index) |
| Called during search to add an element matching the criteria. | |
| DistanceType | worstDist () const |
| Return maximum distance for search. | |
| std::pair< IndexType, DistanceType > | worst_item () const |
| Find the worst result (furtherest neighbor) without copying or sorting Pre-conditions: size() > 0. | |
Data Fields | |
| const DistanceType | d_r |
| Define search radius. Note this should be square of radius, where radius is a distance within which we are searching for points. | |
| std::vector< IndexType > & | d_indices |
| Indices within the search radius. | |
| std::vector< DistanceType > & | d_dists |
| Distance of points found within the search radius. | |
To collect results of nanoflann tree search. Default result output of nanoflann search uses std::vector<std::pair<size_t, double>>. We prefer to get the index and distance in a separate list.
Definition at line 86 of file nflannSetup.h.
| typedef _DistanceType nsearch::TreeSearchResult< _DistanceType, _IndexType >::DistanceType |
Distance type (double, float, etc)
Definition at line 89 of file nflannSetup.h.
| typedef _IndexType nsearch::TreeSearchResult< _DistanceType, _IndexType >::IndexType |
Index type (int, size_t, etc)
Definition at line 92 of file nflannSetup.h.
|
inline |
Constructor.
| radius_ | Search radius (square of radius) |
| indices | Reference to index vector |
| dists | Reference to distance vector |
Definition at line 112 of file nflannSetup.h.
References nsearch::TreeSearchResult< _DistanceType, _IndexType >::init().
|
inline |
Called during search to add an element matching the criteria.
| dist | Distance of point from the search point |
| index | Id of point |
Definition at line 152 of file nflannSetup.h.
References nsearch::TreeSearchResult< _DistanceType, _IndexType >::d_dists, nsearch::TreeSearchResult< _DistanceType, _IndexType >::d_indices, and nsearch::TreeSearchResult< _DistanceType, _IndexType >::d_r.
|
inline |
Clear the data.
Definition at line 127 of file nflannSetup.h.
References nsearch::TreeSearchResult< _DistanceType, _IndexType >::d_dists, and nsearch::TreeSearchResult< _DistanceType, _IndexType >::d_indices.
Referenced by nsearch::TreeSearchResult< _DistanceType, _IndexType >::init().
|
inline |
Check (not implemented)
Definition at line 143 of file nflannSetup.h.
|
inline |
Initialize the data (clear)
Definition at line 122 of file nflannSetup.h.
References nsearch::TreeSearchResult< _DistanceType, _IndexType >::clear().
Referenced by nsearch::TreeSearchResult< _DistanceType, _IndexType >::TreeSearchResult().
|
inline |
Get the size of currently stored (found so far) indices.
Definition at line 137 of file nflannSetup.h.
References nsearch::TreeSearchResult< _DistanceType, _IndexType >::d_indices.
|
inline |
Find the worst result (furtherest neighbor) without copying or sorting Pre-conditions: size() > 0.
Currently, we return pair(0, 0.)
Definition at line 174 of file nflannSetup.h.
References nsearch::TreeSearchResult< _DistanceType, _IndexType >::d_indices.
|
inline |
Return maximum distance for search.
Definition at line 164 of file nflannSetup.h.
References nsearch::TreeSearchResult< _DistanceType, _IndexType >::d_r.
| std::vector<DistanceType>& nsearch::TreeSearchResult< _DistanceType, _IndexType >::d_dists |
Distance of points found within the search radius.
Definition at line 103 of file nflannSetup.h.
Referenced by nsearch::TreeSearchResult< _DistanceType, _IndexType >::addPoint(), and nsearch::TreeSearchResult< _DistanceType, _IndexType >::clear().
| std::vector<IndexType>& nsearch::TreeSearchResult< _DistanceType, _IndexType >::d_indices |
Indices within the search radius.
Definition at line 100 of file nflannSetup.h.
Referenced by nsearch::TreeSearchResult< _DistanceType, _IndexType >::addPoint(), nsearch::TreeSearchResult< _DistanceType, _IndexType >::clear(), nsearch::TreeSearchResult< _DistanceType, _IndexType >::size(), and nsearch::TreeSearchResult< _DistanceType, _IndexType >::worst_item().
| const DistanceType nsearch::TreeSearchResult< _DistanceType, _IndexType >::d_r |
Define search radius. Note this should be square of radius, where radius is a distance within which we are searching for points.
Definition at line 97 of file nflannSetup.h.
Referenced by nsearch::TreeSearchResult< _DistanceType, _IndexType >::addPoint(), and nsearch::TreeSearchResult< _DistanceType, _IndexType >::worstDist().