knncolle
Collection of KNN methods in C++
Loading...
Searching...
No Matches
knncolle::L2NormalizedSearcher< Index_, Data_, Distance_, Normalized_ > Class Template Referencefinal

Wrapper around a search interface with L2 normalization. More...

#include <L2Normalized.hpp>

Inheritance diagram for knncolle::L2NormalizedSearcher< Index_, Data_, Distance_, Normalized_ >:
Collaboration diagram for knncolle::L2NormalizedSearcher< Index_, Data_, Distance_, Normalized_ >:

Public Member Functions

 L2NormalizedSearcher (std::unique_ptr< Searcher< Index_, Normalized_, Distance_ > > searcher, std::size_t num_dimensions)
 
- Public Member Functions inherited from knncolle::Searcher< Index_, Data_, Distance_ >
virtual void search (Index_ i, Index_ k, std::vector< Index_ > *output_indices, std::vector< Distance_ > *output_distances)=0
 
virtual void search (const Data_ *query, Index_ k, std::vector< Index_ > *output_indices, std::vector< Distance_ > *output_distances)=0
 
virtual bool can_search_all () const
 
virtual Index_ search_all (Index_ i, Distance_ distance, std::vector< Index_ > *output_indices, std::vector< Distance_ > *output_distances)
 
virtual Index_ search_all (const Data_ *query, Distance_ distance, std::vector< Index_ > *output_indices, std::vector< Distance_ > *output_distances)
 

Detailed Description

template<typename Index_, typename Data_, typename Distance_, typename Normalized_>
class knncolle::L2NormalizedSearcher< Index_, Data_, Distance_, Normalized_ >

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().

Template Parameters
Index_Integer type for the indices.
Data_Numeric type for the input and query data.
Distance_Floating-point type for the distances.
Normalized_Floating-point type for the L2-normalized data.

Constructor & Destructor Documentation

◆ L2NormalizedSearcher()

template<typename Index_ , typename Data_ , typename Distance_ , typename Normalized_ >
knncolle::L2NormalizedSearcher< Index_, Data_, Distance_, Normalized_ >::L2NormalizedSearcher ( std::unique_ptr< Searcher< Index_, Normalized_, Distance_ > > searcher,
std::size_t num_dimensions )
inline
Parameters
searcherPointer to a Searcher class for the neighbor search that is to be wrapped.
num_dimensionsNumber of dimensions of the data.

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