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

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

#include <L2Normalized.hpp>

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

Public Member Functions

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

Detailed Description

template<typename Dim_, typename Index_, typename Float_>
class knncolle::L2NormalizedPrebuilt< Dim_, Index_, Float_ >

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

◆ L2NormalizedPrebuilt()

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

Member Function Documentation

◆ initialize()

template<typename Dim_ , typename Index_ , typename Float_ >
std::unique_ptr< Searcher< Index_, Float_ > > knncolle::L2NormalizedPrebuilt< Dim_, Index_, Float_ >::initialize ( ) const
inlinevirtual

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