pulsatrix 1.1.0
Loading...
Searching...
No Matches
pulsatrix::Neighbors Struct Reference

Each query's k nearest points, nearest first. More...

#include <nearest_neighbors.hpp>

Public Member Functions

int64_t index (int64_t row, int64_t rank) const
 
double score (int64_t row, int64_t rank) const
 

Public Attributes

int64_t rows = 0
 the number of queries
 
int64_t k = 0
 
NeighborMetric metric = NeighborMetric::Cosine
 
std::vector< int64_t > indices
 Row-major rows × k: indices[q * k + r] is query q's r-th nearest point.
 
std::vector< double > scores
 The same layout: cosine similarity, or Euclidean distance.
 

Detailed Description

Each query's k nearest points, nearest first.

Member Function Documentation

◆ index()

int64_t pulsatrix::Neighbors::index ( int64_t  row,
int64_t  rank 
) const

◆ score()

double pulsatrix::Neighbors::score ( int64_t  row,
int64_t  rank 
) const

Member Data Documentation

◆ indices

std::vector<int64_t> pulsatrix::Neighbors::indices

Row-major rows × k: indices[q * k + r] is query q's r-th nearest point.

◆ k

int64_t pulsatrix::Neighbors::k = 0

◆ metric

NeighborMetric pulsatrix::Neighbors::metric = NeighborMetric::Cosine

◆ rows

int64_t pulsatrix::Neighbors::rows = 0

the number of queries

◆ scores

std::vector<double> pulsatrix::Neighbors::scores

The same layout: cosine similarity, or Euclidean distance.


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