![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
#include <kdtree_cuda_3d_index.h>


Public Types | |
| typedef Distance::ElementType | ElementType |
| typedef Distance::ResultType | DistanceType |
| typedef NNIndex< Distance > | BaseClass |
| typedef bool | needs_kdtree_distance |
Public Types inherited from flann::NNIndex< Distance > | |
| typedef Distance::ElementType | ElementType |
| typedef Distance::ResultType | DistanceType |
Public Member Functions | |
| KDTreeCuda3dIndex (const Matrix< ElementType > &inputData, const IndexParams ¶ms=KDTreeCuda3dIndexParams(), Distance d=Distance()) | |
| KDTreeCuda3dIndex (const KDTreeCuda3dIndex &other) | |
| KDTreeCuda3dIndex | operator= (KDTreeCuda3dIndex other) |
| ~KDTreeCuda3dIndex () | |
| BaseClass * | clone () const |
| void | buildIndex () |
| flann_algorithm_t | getType () const |
| void | removePoint (size_t index) |
| ElementType * | getPoint (size_t id) |
| void | saveIndex (FILE *stream) |
| void | loadIndex (FILE *stream) |
| size_t | veclen () const |
| int | usedMemory () const |
| int | knnSearch (const Matrix< ElementType > &queries, Matrix< int > &indices, Matrix< DistanceType > &dists, size_t knn, const SearchParams ¶ms) const |
| Perform k-nearest neighbor search. More... | |
| int | knnSearch (const Matrix< ElementType > &queries, std::vector< std::vector< int > > &indices, std::vector< std::vector< DistanceType > > &dists, size_t knn, const SearchParams ¶ms) const |
| Perform k-nearest neighbor search. More... | |
| void | knnSearchGpu (const Matrix< ElementType > &queries, Matrix< int > &indices, Matrix< DistanceType > &dists, size_t knn, const SearchParams ¶ms) const |
| Perform k-nearest neighbor search. More... | |
| int | knnSearchGpu (const Matrix< ElementType > &queries, std::vector< std::vector< int > > &indices, std::vector< std::vector< DistanceType > > &dists, size_t knn, const SearchParams ¶ms) const |
| int | radiusSearch (const Matrix< ElementType > &queries, Matrix< int > &indices, Matrix< DistanceType > &dists, float radius, const SearchParams ¶ms) const |
| int | radiusSearch (const Matrix< ElementType > &queries, std::vector< std::vector< int > > &indices, std::vector< std::vector< DistanceType > > &dists, float radius, const SearchParams ¶ms) const |
| int | radiusSearchGpu (const Matrix< ElementType > &queries, Matrix< int > &indices, Matrix< DistanceType > &dists, float radius, const SearchParams ¶ms) const |
| int | radiusSearchGpu (const Matrix< ElementType > &queries, std::vector< std::vector< int > > &indices, std::vector< std::vector< DistanceType > > &dists, float radius, const SearchParams ¶ms) const |
| void | findNeighbors (ResultSet< DistanceType > &result, const ElementType *vec, const SearchParams &searchParams) const |
Public Member Functions inherited from flann::NNIndex< Distance > | |
| NNIndex (Distance d) | |
| NNIndex (const IndexParams ¶ms, Distance d) | |
| NNIndex (const NNIndex &other) | |
| virtual | ~NNIndex () |
| virtual void | buildIndex (const Matrix< ElementType > &dataset) |
| virtual void | addPoints (const Matrix< ElementType > &points, float rebuild_threshold=2) |
| Incrementally add points to the index. More... | |
| size_t | size () const |
| size_t | veclen () const |
| IndexParams | getParameters () const |
| template<typename Archive > | |
| void | serialize (Archive &ar) |
| virtual int | knnSearch (const Matrix< ElementType > &queries, Matrix< size_t > &indices, Matrix< DistanceType > &dists, size_t knn, const SearchParams ¶ms) const |
| Perform k-nearest neighbor search. More... | |
| int | knnSearch (const Matrix< ElementType > &queries, Matrix< int > &indices, Matrix< DistanceType > &dists, size_t knn, const SearchParams ¶ms) const |
| int | knnSearch (const Matrix< ElementType > &queries, std::vector< std::vector< size_t > > &indices, std::vector< std::vector< DistanceType > > &dists, size_t knn, const SearchParams ¶ms) const |
| Perform k-nearest neighbor search. More... | |
| int | knnSearch (const Matrix< ElementType > &queries, std::vector< std::vector< int > > &indices, std::vector< std::vector< DistanceType > > &dists, size_t knn, const SearchParams ¶ms) const |
| int | radiusSearch (const Matrix< ElementType > &queries, Matrix< size_t > &indices, Matrix< DistanceType > &dists, float radius, const SearchParams ¶ms) const |
| Perform radius search. More... | |
| int | radiusSearch (const Matrix< ElementType > &queries, Matrix< int > &indices, Matrix< DistanceType > &dists, float radius, const SearchParams ¶ms) const |
| int | radiusSearch (const Matrix< ElementType > &queries, std::vector< std::vector< size_t > > &indices, std::vector< std::vector< DistanceType > > &dists, float radius, const SearchParams ¶ms) const |
| Perform radius search. More... | |
| int | radiusSearch (const Matrix< ElementType > &queries, std::vector< std::vector< int > > &indices, std::vector< std::vector< DistanceType > > &dists, float radius, const SearchParams ¶ms) const |
Public Member Functions inherited from flann::IndexBase | |
| virtual | ~IndexBase () |
Public Attributes | |
| int | visited_leafs |
Protected Member Functions | |
| void | buildIndexImpl () |
| void | freeIndex () |
Protected Member Functions inherited from flann::NNIndex< Distance > | |
| size_t | id_to_index (size_t id) |
| void | indices_to_ids (const size_t *in, size_t *out, size_t size) const |
| void | setDataset (const Matrix< ElementType > &dataset) |
| void | extendDataset (const Matrix< ElementType > &new_points) |
| void | cleanRemovedPoints () |
| void | swap (NNIndex &other) |
Additional Inherited Members | |
Protected Attributes inherited from flann::NNIndex< Distance > | |
| Distance | distance_ |
| size_t | last_id_ |
| size_t | size_ |
| size_t | size_at_build_ |
| size_t | veclen_ |
| IndexParams | index_params_ |
| bool | removed_ |
| DynamicBitset | removed_points_ |
| size_t | removed_count_ |
| std::vector< size_t > | ids_ |
| std::vector< ElementType * > | points_ |
| ElementType * | data_ptr_ |
Cuda KD Tree. Tree is built with GPU assistance and search is performed on the GPU, too.
Usually faster than the CPU search for data (and query) sets larger than 250000-300000 points, depending on your CPU and GPU.
Definition at line 70 of file kdtree_cuda_3d_index.h.
| typedef NNIndex<Distance> flann::KDTreeCuda3dIndex< Distance >::BaseClass |
Definition at line 76 of file kdtree_cuda_3d_index.h.
| typedef Distance::ResultType flann::KDTreeCuda3dIndex< Distance >::DistanceType |
Definition at line 74 of file kdtree_cuda_3d_index.h.
| typedef Distance::ElementType flann::KDTreeCuda3dIndex< Distance >::ElementType |
Definition at line 73 of file kdtree_cuda_3d_index.h.
| typedef bool flann::KDTreeCuda3dIndex< Distance >::needs_kdtree_distance |
Definition at line 80 of file kdtree_cuda_3d_index.h.
|
inline |
KDTree constructor
Params: inputData = dataset with the input features params = parameters passed to the kdtree algorithm
Definition at line 89 of file kdtree_cuda_3d_index.h.
References flann::Matrix_::cols, flann::get_param(), params, flann::Matrix_::rows, and flann::NNIndex< Distance >::size_.
| flann::KDTreeCuda3dIndex< Distance >::KDTreeCuda3dIndex | ( | const KDTreeCuda3dIndex< Distance > & | other | ) |
|
inline |
Standard destructor
Definition at line 108 of file kdtree_cuda_3d_index.h.
References flann::Matrix< T >::ptr().
|
inlinevirtual |
Builds the index
Reimplemented from flann::NNIndex< Distance >.
Definition at line 122 of file kdtree_cuda_3d_index.h.
References flann::Matrix< T >::ptr(), and flann::NNIndex< Distance >::size_.
|
inlineprotectedvirtual |
Implements flann::NNIndex< Distance >.
Definition at line 277 of file kdtree_cuda_3d_index.h.
|
inlinevirtual |
Implements flann::NNIndex< Distance >.
Definition at line 114 of file kdtree_cuda_3d_index.h.
|
inlinevirtual |
Not implemented, since it is only used by single-element searches. (but is needed b/c it is abstract in the base class)
Implements flann::NNIndex< Distance >.
Definition at line 272 of file kdtree_cuda_3d_index.h.
|
inlineprotectedvirtual |
Implements flann::NNIndex< Distance >.
Definition at line 282 of file kdtree_cuda_3d_index.h.
|
inlinevirtual |
Get point with specific id
| id |
Reimplemented from flann::NNIndex< Distance >.
Definition at line 152 of file kdtree_cuda_3d_index.h.
|
inlinevirtual |
Implements flann::IndexBase.
Definition at line 141 of file kdtree_cuda_3d_index.h.
References FLANN_INDEX_KDTREE_SINGLE.
|
inline |
Perform k-nearest neighbor search.
| [in] | queries | The query points for which to find the nearest neighbors |
| [out] | indices | The indices of the nearest neighbors found |
| [out] | dists | Distances to the nearest neighbors found |
| [in] | knn | Number of nearest neighbors to return |
| [in] | params | Search parameters |
Definition at line 194 of file kdtree_cuda_3d_index.h.
References flann::KDTreeCuda3dIndex< Distance >::knnSearchGpu(), params, and flann::Matrix_::rows.
|
inline |
Perform k-nearest neighbor search.
| [in] | queries | The query points for which to find the nearest neighbors |
| [out] | indices | The indices of the nearest neighbors found |
| [out] | dists | Distances to the nearest neighbors found |
| [in] | knn | Number of nearest neighbors to return |
| [in] | params | Search parameters |
Definition at line 208 of file kdtree_cuda_3d_index.h.
References flann::KDTreeCuda3dIndex< Distance >::knnSearchGpu(), params, and flann::Matrix_::rows.
| void flann::KDTreeCuda3dIndex< Distance >::knnSearchGpu | ( | const Matrix< ElementType > & | queries, |
| Matrix< int > & | indices, | ||
| Matrix< DistanceType > & | dists, | ||
| size_t | knn, | ||
| const SearchParams & | params | ||
| ) | const |
Perform k-nearest neighbor search.
| [in] | queries | The query points for which to find the nearest neighbors |
| [out] | indices | The indices of the nearest neighbors found |
| [out] | dists | Distances to the nearest neighbors found |
| [in] | knn | Number of nearest neighbors to return |
| [in] | params | Search parameters |
Referenced by flann::KDTreeCuda3dIndex< Distance >::knnSearch(), and flann::KDTreeCuda3dIndex< Distance >::knnSearchGpu().
|
inline |
Definition at line 228 of file kdtree_cuda_3d_index.h.
References dist(), flann::KDTreeCuda3dIndex< Distance >::knnSearchGpu(), params, flann::Matrix< T >::ptr(), and flann::Matrix_::rows.
|
inlinevirtual |
Implements flann::IndexBase.
Definition at line 164 of file kdtree_cuda_3d_index.h.
| KDTreeCuda3dIndex flann::KDTreeCuda3dIndex< Distance >::operator= | ( | KDTreeCuda3dIndex< Distance > | other | ) |
|
inline |
Definition at line 250 of file kdtree_cuda_3d_index.h.
References params, and flann::KDTreeCuda3dIndex< Distance >::radiusSearchGpu().
|
inline |
Definition at line 256 of file kdtree_cuda_3d_index.h.
References params, and flann::KDTreeCuda3dIndex< Distance >::radiusSearchGpu().
| int flann::KDTreeCuda3dIndex< Distance >::radiusSearchGpu | ( | const Matrix< ElementType > & | queries, |
| Matrix< int > & | indices, | ||
| Matrix< DistanceType > & | dists, | ||
| float | radius, | ||
| const SearchParams & | params | ||
| ) | const |
Referenced by flann::KDTreeCuda3dIndex< Distance >::radiusSearch().
| int flann::KDTreeCuda3dIndex< Distance >::radiusSearchGpu | ( | const Matrix< ElementType > & | queries, |
| std::vector< std::vector< int > > & | indices, | ||
| std::vector< std::vector< DistanceType > > & | dists, | ||
| float | radius, | ||
| const SearchParams & | params | ||
| ) | const |
|
inlinevirtual |
Remove point from the index
| index | Index of point to be removed |
Reimplemented from flann::NNIndex< Distance >.
Definition at line 147 of file kdtree_cuda_3d_index.h.
|
inlinevirtual |
Implements flann::IndexBase.
Definition at line 157 of file kdtree_cuda_3d_index.h.
|
inlinevirtual |
Computes the inde memory usage Returns: memory used by the index TODO: return system or gpu RAM or both?
Implements flann::IndexBase.
Definition at line 179 of file kdtree_cuda_3d_index.h.
|
inlinevirtual |
Implements flann::IndexBase.
Definition at line 169 of file kdtree_cuda_3d_index.h.
| int flann::KDTreeCuda3dIndex< Distance >::visited_leafs |
Definition at line 78 of file kdtree_cuda_3d_index.h.