knncolle
Collection of KNN methods in C++
Loading...
Searching...
No Matches
Public Member Functions | List of all members
knncolle::L2NormalizedSearcher< Index_, Float_ > Class Template Reference

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

#include <L2Normalized.hpp>

Inheritance diagram for knncolle::L2NormalizedSearcher< Index_, Float_ >:
Inheritance graph
[legend]
Collaboration diagram for knncolle::L2NormalizedSearcher< Index_, Float_ >:
Collaboration graph
[legend]

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)
 

Detailed Description

template<typename Index_, typename Float_>
class knncolle::L2NormalizedSearcher< Index_, Float_ >

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. For the output of Builder::build, this is set to MockMatrix::index_type.
Float_Floating point type for the query data and output distances.

Constructor & Destructor Documentation

◆ L2NormalizedSearcher()

knncolle::L2NormalizedSearcher< Index_, Float_ >::L2NormalizedSearcher ( std::unique_ptr< Searcher< Index_, Float_ > >  searcher,
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: