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

Wrapper around a prebuilt index with L2 normalization. More...

#include <L2Normalized.hpp>

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

Public Member Functions

 L2NormalizedPrebuilt (std::unique_ptr< Prebuilt< Index_, Normalized_, Distance_ > > prebuilt)
 
std::unique_ptr< Searcher< Index_, Data_, Distance_ > > initialize () const
 
- Public Member Functions inherited from knncolle::Prebuilt< Index_, Data_, Distance_ >
virtual Index_ num_observations () const =0
 
virtual std::size_t num_dimensions () const =0
 

Detailed Description

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

Wrapper around a prebuilt index with L2 normalization.

This class's unique_raw() method creates a Searcher instance that L2-normalizes each query vector, typically for calculation of cosine distances. Instances of this class are typically constructed with L2NormalizedBuilder::unique_raw().

Template Parameters
Index_Integer type for the indices.
Data_Floating-point 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

◆ L2NormalizedPrebuilt()

template<typename Index_ , typename Data_ , typename Distance_ , typename Normalized_ >
knncolle::L2NormalizedPrebuilt< Index_, Data_, Distance_, Normalized_ >::L2NormalizedPrebuilt ( std::unique_ptr< Prebuilt< Index_, Normalized_, Distance_ > > prebuilt)
inline
Parameters
prebuiltPointer to a Prebuilt instance for the neighbor search that is to be wrapped.

Member Function Documentation

◆ initialize()

template<typename Index_ , typename Data_ , typename Distance_ , typename Normalized_ >
std::unique_ptr< Searcher< Index_, Data_, Distance_ > > knncolle::L2NormalizedPrebuilt< Index_, Data_, Distance_, Normalized_ >::initialize ( ) const
inlinevirtual

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