OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
nanoflann::RadiusResultSet< DistanceType, IndexType > Class Template Reference

A result-set class used when performing a radius based search. More...

#include <nanoflann.hpp>

+ Collaboration diagram for nanoflann::RadiusResultSet< DistanceType, IndexType >:

Public Member Functions

 RadiusResultSet (DistanceType radius_, std::vector< std::pair< IndexType, DistanceType > > &indices_dists)
 
 ~RadiusResultSet ()
 
void init ()
 
void clear ()
 
size_t size () const
 
bool full () const
 
void addPoint (DistanceType dist, IndexType index)
 
DistanceType worstDist () const
 
void set_radius_and_clear (const DistanceType r)
 Clears the result set and adjusts the search radius.
 
std::pair< IndexType, DistanceType > worst_item () const
 Find the worst result (furtherest neighbor) without copying or sorting Pre-conditions: size() > 0.
 

Public Attributes

const DistanceType radius
 
std::vector< std::pair< IndexType, DistanceType > > & m_indices_dists
 

Detailed Description

template<typename DistanceType, typename IndexType = size_t>
class nanoflann::RadiusResultSet< DistanceType, IndexType >

A result-set class used when performing a radius based search.

Definition at line 125 of file nanoflann.hpp.

Constructor & Destructor Documentation

◆ RadiusResultSet()

template<typename DistanceType , typename IndexType = size_t>
nanoflann::RadiusResultSet< DistanceType, IndexType >::RadiusResultSet ( DistanceType radius_,
std::vector< std::pair< IndexType, DistanceType > > & indices_dists )
inline

Definition at line 131 of file nanoflann.hpp.

134 : radius(radius_),
135 m_indices_dists(indices_dists) {
136 init();
137 }
const DistanceType radius
std::vector< std::pair< IndexType, DistanceType > > & m_indices_dists

◆ ~RadiusResultSet()

template<typename DistanceType , typename IndexType = size_t>
nanoflann::RadiusResultSet< DistanceType, IndexType >::~RadiusResultSet ( )
inline

Definition at line 139 of file nanoflann.hpp.

139 {
140 }

Member Function Documentation

◆ addPoint()

template<typename DistanceType , typename IndexType = size_t>
void nanoflann::RadiusResultSet< DistanceType, IndexType >::addPoint ( DistanceType dist,
IndexType index )
inline

Definition at line 157 of file nanoflann.hpp.

157 {
158 if (dist < radius)
159 m_indices_dists.push_back(std::make_pair(index, dist));
160 }

◆ clear()

template<typename DistanceType , typename IndexType = size_t>
void nanoflann::RadiusResultSet< DistanceType, IndexType >::clear ( )
inline

Definition at line 145 of file nanoflann.hpp.

145 {
146 m_indices_dists.clear();
147 }

◆ full()

template<typename DistanceType , typename IndexType = size_t>
bool nanoflann::RadiusResultSet< DistanceType, IndexType >::full ( ) const
inline

Definition at line 153 of file nanoflann.hpp.

153 {
154 return true;
155 }

◆ init()

template<typename DistanceType , typename IndexType = size_t>
void nanoflann::RadiusResultSet< DistanceType, IndexType >::init ( )
inline

Definition at line 142 of file nanoflann.hpp.

142 {
143 clear();
144 }

◆ set_radius_and_clear()

template<typename DistanceType , typename IndexType = size_t>
void nanoflann::RadiusResultSet< DistanceType, IndexType >::set_radius_and_clear ( const DistanceType r)
inline

Clears the result set and adjusts the search radius.

Definition at line 167 of file nanoflann.hpp.

167 {
168 radius = r;
169 clear();
170 }

◆ size()

template<typename DistanceType , typename IndexType = size_t>
size_t nanoflann::RadiusResultSet< DistanceType, IndexType >::size ( ) const
inline

Definition at line 149 of file nanoflann.hpp.

149 {
150 return m_indices_dists.size();
151 }
+ Here is the caller graph for this function:

◆ worst_item()

template<typename DistanceType , typename IndexType = size_t>
std::pair< IndexType, DistanceType > nanoflann::RadiusResultSet< DistanceType, IndexType >::worst_item ( ) const
inline

Find the worst result (furtherest neighbor) without copying or sorting Pre-conditions: size() > 0.

Definition at line 176 of file nanoflann.hpp.

176 {
177 if (m_indices_dists.empty())
178 throw std::runtime_error(
179 "Cannot invoke RadiusResultSet::worst_item() on an empty list of results.");
180 typedef typename std::vector<std::pair<IndexType, DistanceType> >::const_iterator DistIt;
181 DistIt it = std::max_element(m_indices_dists.begin(),
182 m_indices_dists.end());
183 return *it;
184 }

◆ worstDist()

template<typename DistanceType , typename IndexType = size_t>
DistanceType nanoflann::RadiusResultSet< DistanceType, IndexType >::worstDist ( ) const
inline

Definition at line 162 of file nanoflann.hpp.

162 {
163 return radius;
164 }

Member Data Documentation

◆ m_indices_dists

template<typename DistanceType , typename IndexType = size_t>
std::vector<std::pair<IndexType, DistanceType> >& nanoflann::RadiusResultSet< DistanceType, IndexType >::m_indices_dists

Definition at line 129 of file nanoflann.hpp.

◆ radius

template<typename DistanceType , typename IndexType = size_t>
const DistanceType nanoflann::RadiusResultSet< DistanceType, IndexType >::radius

Definition at line 127 of file nanoflann.hpp.


The documentation for this class was generated from the following file: