knncolle_annoy
Annoy nearest neighbors in knncolle
Loading...
Searching...
No Matches
knncolle_annoy::AnnoySearcher< Index_, Data_, Distance_, AnnoyDistance_, AnnoyIndex_, AnnoyData_, AnnoyRng_, AnnoyThreadPolicy_ > Class Template Referencefinal

Searcher on an Annoy index. More...

#include <knncolle_annoy.hpp>

Inheritance diagram for knncolle_annoy::AnnoySearcher< Index_, Data_, Distance_, AnnoyDistance_, AnnoyIndex_, AnnoyData_, AnnoyRng_, AnnoyThreadPolicy_ >:
knncolle::Searcher< Index_, Data_, Distance_ >

Public Member Functions

void search (Index_ i, Index_ k, std::vector< Index_ > *output_indices, std::vector< Distance_ > *output_distances)
 
void search (const Data_ *query, Index_ k, std::vector< Index_ > *output_indices, std::vector< Distance_ > *output_distances)
 
- Public Member Functions inherited from knncolle::Searcher< Index_, Data_, Distance_ >
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_, class AnnoyDistance_, typename AnnoyIndex_ = Index_, typename AnnoyData_ = float, class AnnoyRng_ = Annoy::Kiss64Random, class AnnoyThreadPolicy_ = Annoy::AnnoyIndexSingleThreadedBuildPolicy>
class knncolle_annoy::AnnoySearcher< Index_, Data_, Distance_, AnnoyDistance_, AnnoyIndex_, AnnoyData_, AnnoyRng_, AnnoyThreadPolicy_ >

Searcher on an Annoy index.

Instances of this class are usually constructed using AnnoyPrebuilt::initialize().

Template Parameters
Index_Integer type for the observation indices.
Data_Numeric type for the input and query data.
Distance_Floating-point type for the distances.
AnnoyDistance_An Annoy-compatible class to compute the distance between vectors, e.g., Annoy::Euclidean, Annoy::Manhattan. Note that this is not the same as knncolle::DistanceMetric.
AnnoyIndex_Integer type for the observation indices in the Annoy index.
AnnoyData_Floating-point type for data in the Annoy index. This defaults to a float instead of a double to sacrifice some accuracy for performance.
AnnoyRng_An Annoy class for random number generation.
AnnoyThreadPolicy_An Annoy class for the threadedness of Annoy index building.

Member Function Documentation

◆ search() [1/2]

template<typename Index_ , typename Data_ , typename Distance_ , class AnnoyDistance_ , typename AnnoyIndex_ = Index_, typename AnnoyData_ = float, class AnnoyRng_ = Annoy::Kiss64Random, class AnnoyThreadPolicy_ = Annoy::AnnoyIndexSingleThreadedBuildPolicy>
void knncolle_annoy::AnnoySearcher< Index_, Data_, Distance_, AnnoyDistance_, AnnoyIndex_, AnnoyData_, AnnoyRng_, AnnoyThreadPolicy_ >::search ( const Data_ * query,
Index_ k,
std::vector< Index_ > * output_indices,
std::vector< Distance_ > * output_distances )
inlinevirtual

◆ search() [2/2]

template<typename Index_ , typename Data_ , typename Distance_ , class AnnoyDistance_ , typename AnnoyIndex_ = Index_, typename AnnoyData_ = float, class AnnoyRng_ = Annoy::Kiss64Random, class AnnoyThreadPolicy_ = Annoy::AnnoyIndexSingleThreadedBuildPolicy>
void knncolle_annoy::AnnoySearcher< Index_, Data_, Distance_, AnnoyDistance_, AnnoyIndex_, AnnoyData_, AnnoyRng_, AnnoyThreadPolicy_ >::search ( Index_ i,
Index_ k,
std::vector< Index_ > * output_indices,
std::vector< Distance_ > * output_distances )
inlinevirtual

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