Struct faiss::CombinerRangeKNN

template<typename T>
struct CombinerRangeKNN

This class is used to combine range and knn search results in contrib.exhaustive_search.range_search_gpu

Public Functions

inline CombinerRangeKNN(int64_t nq, size_t k, T r2, bool keep_max)

whether to keep max values instead of min.

void compute_sizes(int64_t *L_res)

size nq + 1

void write_result(T *D_res, int64_t *I_res)

Phase 2: caller allocates D_res and I_res (size L_res[nq]) Phase 3: fill in D_res and I_res

Public Members

int64_t nq
size_t k

nb of queries

T r2

number of neighbors for the knn search part

bool keep_max

range search radius

const int64_t *I = nullptr

Knn search results.

const T *D = nullptr

size nq * k

const bool *mask = nullptr

size nq * k

optional: range search results (ignored if mask is NULL)

const int64_t *lim_remain = nullptr

mask for where knn results are valid, size nq

const T *D_remain = nullptr

size nrange + 1

const int64_t *I_remain = nullptr

size lim_remain[nrange]

const int64_t *L_res = nullptr

size lim_remain[nrange]