Krotos Modules 3
Loading...
Searching...
No Matches
krotos::NearestNeighbourSearch Class Reference

#include <NearestNeighbourSearch.h>

Public Member Functions

 NearestNeighbourSearch (std::string datasetPath)
 
 ~NearestNeighbourSearch ()
 
void getNearestNeighbours (const std::string &query, const int numMatches, std::vector< std::string > &returnResults)
 

Private Member Functions

std::vector< std::pair< float, hnswlib::labeltype > > knnQuery (std::string query, int k)
 
void addDatasetItems ()
 

Private Attributes

Dataset dataset
 
std::unique_ptr< hnswlib::BruteforceSearch< float > > alg
 
hnswlib::SpaceInterface< float > * space
 
std::unique_ptr< hnswlib::InnerProductSpacem_spaceInstance
 

Constructor & Destructor Documentation

◆ NearestNeighbourSearch()

krotos::NearestNeighbourSearch::NearestNeighbourSearch ( std::string datasetPath)

◆ ~NearestNeighbourSearch()

krotos::NearestNeighbourSearch::~NearestNeighbourSearch ( )

Member Function Documentation

◆ addDatasetItems()

void krotos::NearestNeighbourSearch::addDatasetItems ( )
private

◆ getNearestNeighbours()

void krotos::NearestNeighbourSearch::getNearestNeighbours ( const std::string & query,
const int numMatches,
std::vector< std::string > & returnResults )

◆ knnQuery()

std::vector< std::pair< float, hnswlib::labeltype > > krotos::NearestNeighbourSearch::knnQuery ( std::string query,
int k )
private

Member Data Documentation

◆ alg

std::unique_ptr<hnswlib::BruteforceSearch<float> > krotos::NearestNeighbourSearch::alg
private

◆ dataset

Dataset krotos::NearestNeighbourSearch::dataset
private

◆ m_spaceInstance

std::unique_ptr<hnswlib::InnerProductSpace> krotos::NearestNeighbourSearch::m_spaceInstance
private

◆ space

hnswlib::SpaceInterface<float>* krotos::NearestNeighbourSearch::space
private

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