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

#include <nanoflann.hpp>

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

Public Member Functions

 RadiusResultList (DistanceType radius_, std::list< IndexType > &indices_list)
 
 ~RadiusResultList ()
 
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::list< IndexType > & m_indices_list
 

Detailed Description

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

Definition at line 188 of file nanoflann.hpp.

Constructor & Destructor Documentation

◆ RadiusResultList()

template<typename DistanceType , typename IndexType = size_t>
nanoflann::RadiusResultList< DistanceType, IndexType >::RadiusResultList ( DistanceType radius_,
std::list< IndexType > & indices_list )
inline

Definition at line 195 of file nanoflann.hpp.

197 : radius(radius_),
198 m_indices_list(indices_list) {
199 init();
200 }
const DistanceType radius
std::list< IndexType > & m_indices_list

◆ ~RadiusResultList()

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

Definition at line 202 of file nanoflann.hpp.

202 {
203 }

Member Function Documentation

◆ addPoint()

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

Definition at line 220 of file nanoflann.hpp.

220 {
221 if (dist < radius)
222 m_indices_list.push_back(index);
223 }

◆ clear()

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

Definition at line 208 of file nanoflann.hpp.

208 {
209 m_indices_list.clear();
210 }

◆ full()

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

Definition at line 216 of file nanoflann.hpp.

216 {
217 return true;
218 }

◆ init()

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

Definition at line 205 of file nanoflann.hpp.

205 {
206 clear();
207 }

◆ set_radius_and_clear()

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

Clears the result set and adjusts the search radius.

Definition at line 230 of file nanoflann.hpp.

230 {
231 radius = r;
232 clear();
233 }

◆ size()

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

Definition at line 212 of file nanoflann.hpp.

212 {
213 return m_indices_list.size();
214 }
+ Here is the caller graph for this function:

◆ worst_item()

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

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

Definition at line 239 of file nanoflann.hpp.

239 {
240 if (m_indices_list.empty())
241 throw std::runtime_error(
242 "Cannot invoke RadiusResultSet::worst_item() on an empty list of results.");
243 typedef typename std::vector<std::pair<IndexType, DistanceType> >::const_iterator DistIt;
244 DistIt it = std::max_element(m_indices_list.begin(), m_indices_list.end());
245 return *it;
246 }

◆ worstDist()

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

Definition at line 225 of file nanoflann.hpp.

225 {
226 return radius;
227 }

Member Data Documentation

◆ m_indices_list

template<typename DistanceType , typename IndexType = size_t>
std::list<IndexType>& nanoflann::RadiusResultList< DistanceType, IndexType >::m_indices_list

Definition at line 193 of file nanoflann.hpp.

◆ radius

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

Definition at line 190 of file nanoflann.hpp.


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