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


Public Types | |
| typedef Distance::ElementType | ElementType |
| typedef Distance::ResultType | DistanceType |
| typedef NNIndex< Distance > | BaseClass |
| typedef bool | needs_vector_space_distance |
Public Types inherited from flann::NNIndex< Distance > | |
| typedef Distance::ElementType | ElementType |
| typedef Distance::ResultType | DistanceType |
Public Member Functions | |
| flann_algorithm_t | getType () const |
| KMeansIndex (const Matrix< ElementType > &inputData, const IndexParams ¶ms=KMeansIndexParams(), Distance d=Distance()) | |
| KMeansIndex (const IndexParams ¶ms=KMeansIndexParams(), Distance d=Distance()) | |
| KMeansIndex (const KMeansIndex &other) | |
| KMeansIndex & | operator= (KMeansIndex other) |
| void | initCenterChooser () |
| virtual | ~KMeansIndex () |
| BaseClass * | clone () const |
| void | set_cb_index (float index) |
| int | usedMemory () const |
| void | addPoints (const Matrix< ElementType > &points, float rebuild_threshold=2) |
| Incrementally add points to the index. More... | |
| template<typename Archive > | |
| void | serialize (Archive &ar) |
| void | saveIndex (FILE *stream) |
| void | loadIndex (FILE *stream) |
| void | findNeighbors (ResultSet< DistanceType > &result, const ElementType *vec, const SearchParams &searchParams) const |
| int | getClusterCenters (Matrix< DistanceType > ¢ers) |
| virtual void | buildIndex () |
| virtual void | buildIndex (const Matrix< ElementType > &dataset) |
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 | removePoint (size_t id) |
| virtual ElementType * | getPoint (size_t id) |
| 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 () |
Protected Member Functions | |
| void | buildIndexImpl () |
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_ |
Hierarchical kmeans index
Contains a tree constructed through a hierarchical kmeans clustering and other information for indexing a set of points for nearest-neighbour matching.
Definition at line 83 of file kmeans_index.h.
| typedef NNIndex<Distance> flann::KMeansIndex< Distance >::BaseClass |
Definition at line 89 of file kmeans_index.h.
| typedef Distance::ResultType flann::KMeansIndex< Distance >::DistanceType |
Definition at line 87 of file kmeans_index.h.
| typedef Distance::ElementType flann::KMeansIndex< Distance >::ElementType |
Definition at line 86 of file kmeans_index.h.
| typedef bool flann::KMeansIndex< Distance >::needs_vector_space_distance |
Definition at line 91 of file kmeans_index.h.
|
inline |
Index constructor
Params: inputData = dataset with the input features params = parameters passed to the hierarchical k-means algorithm
Definition at line 107 of file kmeans_index.h.
References FLANN_CENTERS_RANDOM, flann::get_param(), flann::KMeansIndex< Distance >::initCenterChooser(), max(), params, and flann::NNIndex< Distance >::setDataset().
Referenced by flann::KMeansIndex< Distance >::clone().
|
inline |
Index constructor
Params: inputData = dataset with the input features params = parameters passed to the hierarchical k-means algorithm
Definition at line 131 of file kmeans_index.h.
References FLANN_CENTERS_RANDOM, flann::get_param(), flann::KMeansIndex< Distance >::initCenterChooser(), max(), and params.
|
inline |
Definition at line 146 of file kmeans_index.h.
References flann::KMeansIndex< Distance >::initCenterChooser().
|
inlinevirtual |
Index destructor.
Release the memory used by the index.
Definition at line 187 of file kmeans_index.h.
|
inlinevirtual |
Incrementally add points to the index.
| points | Matrix with points to be added |
| rebuild_threshold |
Reimplemented from flann::NNIndex< Distance >.
Definition at line 215 of file kmeans_index.h.
References flann::KMeansIndex< Distance >::buildIndex(), dist(), flann::NNIndex< Distance >::distance_, flann::NNIndex< Distance >::extendDataset(), points, flann::NNIndex< Distance >::size_, flann::NNIndex< Distance >::size_at_build_, and flann::NNIndex< Distance >::veclen_.
|
inlinevirtual |
Builds the index
Reimplemented from flann::NNIndex< Distance >.
Definition at line 125 of file nn_index.h.
Referenced by flann::KMeansIndex< Distance >::addPoints(), and flann::hierarchicalClustering().
|
inlinevirtual |
Builds the index using the specified dataset
| dataset | the dataset to use |
Reimplemented from flann::NNIndex< Distance >.
Definition at line 141 of file nn_index.h.
|
inlineprotectedvirtual |
Builds the index
Implements flann::NNIndex< Distance >.
Definition at line 329 of file kmeans_index.h.
References flann::NNIndex< Distance >::size_, and flann::NNIndex< Distance >::veclen_.
|
inlinevirtual |
Implements flann::NNIndex< Distance >.
Definition at line 193 of file kmeans_index.h.
References flann::KMeansIndex< Distance >::KMeansIndex().
|
inlinevirtual |
Find set of nearest neighbors to vec. Their indices are stored inside the result object.
Params: result = the result object in which the indices of the nearest-neighbors are stored vec = the vector for which to search the nearest neighbors searchParams = parameters that influence the search algorithm (checks, cb_index)
Implements flann::NNIndex< Distance >.
Definition at line 283 of file kmeans_index.h.
References flann::NNIndex< Distance >::removed_, and result.
|
inline |
Clustering function that takes a cut in the hierarchical k-means tree and return the clusters centers of that clustering. Params: numClusters = number of clusters to have in the clustering computed Returns: number of cluster centers
Definition at line 301 of file kmeans_index.h.
References flann::Logger::info(), flann::Matrix_::rows, and flann::NNIndex< Distance >::veclen_.
Referenced by flann::hierarchicalClustering().
|
inlinevirtual |
Implements flann::IndexBase.
Definition at line 95 of file kmeans_index.h.
References FLANN_INDEX_KMEANS.
Referenced by flann::KMeansIndex< Distance >::serialize().
|
inline |
Definition at line 165 of file kmeans_index.h.
References flann::NNIndex< Distance >::distance_, FLANN_CENTERS_GONZALES, FLANN_CENTERS_KMEANSPP, FLANN_CENTERS_RANDOM, and flann::NNIndex< Distance >::points_.
Referenced by flann::KMeansIndex< Distance >::KMeansIndex().
|
inlinevirtual |
Implements flann::IndexBase.
Definition at line 266 of file kmeans_index.h.
|
inline |
Definition at line 158 of file kmeans_index.h.
|
inlinevirtual |
Implements flann::IndexBase.
Definition at line 260 of file kmeans_index.h.
|
inline |
Definition at line 234 of file kmeans_index.h.
References flann::KMeansIndex< Distance >::getType(), and flann::NNIndex< Distance >::index_params_.
|
inline |
Definition at line 199 of file kmeans_index.h.
|
inlinevirtual |
Computes the inde memory usage Returns: memory used by the index
Implements flann::IndexBase.
Definition at line 208 of file kmeans_index.h.
References flann::PooledAllocator::usedMemory, and flann::PooledAllocator::wastedMemory.