knncolle
Collection of KNN methods in C++
|
Wrapper around a search interface with L2 normalization. More...
#include <L2Normalized.hpp>
Public Member Functions | |
L2NormalizedSearcher (std::unique_ptr< Searcher< Index_, Float_ > > searcher, size_t num_dimensions) | |
Public Member Functions inherited from knncolle::Searcher< Index_, Float_ > | |
virtual void | search (Index_ i, Index_ k, std::vector< Index_ > *output_indices, std::vector< Float_ > *output_distances)=0 |
virtual void | search (const Float_ *query, Index_ k, std::vector< Index_ > *output_indices, std::vector< Float_ > *output_distances)=0 |
virtual bool | can_search_all () const |
virtual Index_ | search_all (Index_ i, Float_ distance, std::vector< Index_ > *output_indices, std::vector< Float_ > *output_distances) |
virtual Index_ | search_all (const Float_ *query, Float_ distance, std::vector< Index_ > *output_indices, std::vector< Float_ > *output_distances) |
Wrapper around a search interface with L2 normalization.
This applies L2 normalization to each query vector before running search()
and search_all()
, typically for calculation of cosine distances. Instances of this class are typically constructed with L2NormalizedPrebuilt::initialize()
.
Index_ | Integer type for the indices. For the output of Builder::build , this is set to MockMatrix::index_type . |
Float_ | Floating point type for the query data and output distances. |
|
inline |
searcher | Pointer to a Searcher class for the neighbor search that is to be wrapped. |
num_dimensions | Number of dimensions of the data. |