Go to the documentation of this file.
31 #ifndef RTABMAP_FLANN_RESULTSET_H
32 #define RTABMAP_FLANN_RESULTSET_H
49 template <
typename T,
typename DistanceType>
58 bool operator<(
const BranchStruct<T, DistanceType>& rhs)
const
65 template <
typename DistanceType>
74 return (
dist_ < dist_index.dist_) || ((
dist_ == dist_index.dist_) &&
index_ < dist_index.index_);
81 template <
typename DistanceType>
87 virtual bool full()
const = 0;
89 virtual void addPoint(DistanceType dist,
size_t index) = 0;
91 virtual DistanceType
worstDist()
const = 0;
100 template <
typename DistanceType>
151 void addPoint(DistanceType dist,
size_t index)
158 #ifdef FLANN_FIRST_MATCH
180 void copy(
size_t* indices, DistanceType* dists,
size_t num_elements,
bool sorted =
true)
183 for (
size_t i=0;
i<
n; ++
i) {
204 template <
typename DistanceType>
205 class KNNResultSet :
public ResultSet<DistanceType>
243 void addPoint(DistanceType dist,
size_t index)
248 #ifdef FLANN_FIRST_MATCH
279 void copy(
size_t* indices, DistanceType* dists,
size_t num_elements,
bool sorted =
true)
282 for (
size_t i=0;
i<
n; ++
i) {
303 template <
typename DistanceType>
304 class KNNResultSet2 :
public ResultSet<DistanceType>
355 void addPoint(DistanceType dist,
size_t index)
388 void copy(
size_t* indices, DistanceType* dists,
size_t num_elements,
bool sorted =
true)
396 if (num_elements<
size()) {
402 for (
size_t i=0;
i<
n; ++
i) {
425 template <
typename DistanceType>
475 void addPoint(DistanceType dist,
size_t index)
490 void copy(
size_t* indices, DistanceType* dists,
size_t num_elements,
bool sorted =
true)
498 if (num_elements<
size()) {
504 for (
size_t i=0;
i<
n; ++
i) {
526 template <
typename DistanceType>
578 void addPoint(DistanceType dist,
size_t index)
612 void copy(
size_t* indices, DistanceType* dists,
size_t num_elements,
bool sorted =
true)
620 if (num_elements<
size()) {
626 for (
size_t i=0;
i<
n; ++
i) {
651 template <
typename DistanceType>
703 template<
typename DistanceType>
715 return (
dist_ < dist_index.dist_) || ((
dist_ == dist_index.dist_) &&
index_ < dist_index.index_);
730 inline bool full()
const
740 void copy(
size_t* indices, DistanceType* dist,
int n_neighbors,
bool sorted =
true)
744 typedef typename std::set<DistIndex>::const_iterator
Iterator;
746 dist_indices_.end(); (dist_index != dist_index_end) && (i < n_neighbors); ++dist_index, ++indices, ++dist, ++i) {
748 *
dist = dist_index->dist_;
784 template<
typename DistanceType>
801 inline void addPoint(DistanceType dist,
size_t index)
843 template<
typename DistanceType>
860 void addPoint(DistanceType dist,
size_t index)
876 inline bool full()
const
902 template<
typename DistanceType>
911 this->radius_ = radius;
933 #endif //FLANN_RESULTSET_H
void addPoint(DistanceType dist, size_t index)
GLM_FUNC_DECL genType min(genType const &x, genType const &y)
DistanceType worstDist() const
void copy(size_t *indices, DistanceType *dists, size_t num_elements, bool sorted=true)
void addPoint(DistanceType dist, size_t index)
KNNSimpleResultSet(size_t capacity_)
DistanceType worst_distance_
void copy(size_t *indices, DistanceType *dists, size_t num_elements, bool sorted=true)
void addPoint(DistanceType dist, size_t index)
DistanceIndex(DistanceType dist, size_t index)
DistanceIndex< DistanceType > DistIndex
DistanceIndex< DistanceType > DistIndex
DistanceType worst_distance_
bool operator<(const DistanceIndex &dist_index) const
DistanceType worst_distance_
KNNRadiusUniqueResultSet(DistanceType radius, size_t capacity)
virtual bool full() const =0
RadiusResultSet(DistanceType radius_)
CountRadiusResultSet(DistanceType radius_)
DistIndex(DistanceType dist, unsigned int index)
std::vector< DistIndex > dist_index_
std::vector< DistIndex > dist_index_
KNNResultSet(int capacity)
std::set< DistIndex > dist_indices_
GLM_FUNC_DECL genType max(genType const &x, genType const &y)
virtual void addPoint(DistanceType dist, size_t index)=0
bool operator<(const DistIndex dist_index) const
DistanceIndex< DistanceType > DistIndex
void addPoint(DistanceType dist, size_t index)
void addPoint(DistanceType dist, size_t index)
UniqueResultSet< DistanceType >::DistIndex DistIndex
DistanceType worstDist() const
std::vector< DistIndex > dist_index_
UniqueResultSet< DistanceType >::DistIndex DistIndex
void copy(size_t *indices, DistanceType *dist, int n_neighbors, bool sorted=true)
KNNResultSet2(size_t capacity_)
DistanceType worstDist() const
DistanceType worstDist() const
KNNRadiusResultSet(DistanceType radius_, size_t capacity_)
DistanceIndex< DistanceType > DistIndex
RadiusUniqueResultSet(DistanceType radius)
std::vector< DistIndex > dist_index_
DistanceType worstDist() const
void addPoint(DistanceType dist, size_t index)
DistanceType worstDist() const
DistanceType worstDist() const
bool operator<(const BranchStruct< T, DistanceType > &rhs) const
void copy(size_t *indices, DistanceType *dists, size_t num_elements, bool sorted=true)
void copy(size_t *indices, DistanceType *dists, size_t num_elements, bool sorted=true)
KNNUniqueResultSet(unsigned int capacity)
DistanceIndex< DistanceType > DistIndex
std::vector< DistIndex > dist_index_
void copy(size_t *indices, DistanceType *dists, size_t num_elements, bool sorted=true)
void addPoint(DistanceType dist, size_t index)
virtual DistanceType worstDist() const =0
void addPoint(DistanceType dist, size_t index)
DistanceType worstDist() const
rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:15