结构体 faiss::CombinerRangeKNN

template<typename T>
struct CombinerRangeKNN

此类用于组合 contrib.exhaustive_search.range_search_gpu 中的范围和 knn 搜索结果

公共函数

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

是否保留最大值而不是最小值。

void compute_sizes(int64_t *L_res)

大小 nq + 1

void write_result(T *D_res, int64_t *I_res)

阶段 2:调用者分配 D_res 和 I_res(大小 L_res[nq])阶段 3:填充 D_res 和 I_res

公共成员

int64_t nq
size_t k

查询数量

T r2

knn 搜索部分的邻居数量

bool keep_max

范围搜索半径

const int64_t *I = nullptr

Knn 搜索结果。

const T *D = nullptr

大小 nq * k

const bool *mask = nullptr

大小 nq * k

可选:范围搜索结果(如果 mask 为 NULL,则忽略)

const int64_t *lim_remain = nullptr

knn 结果有效的掩码,大小 nq

const T *D_remain = nullptr

大小 nrange + 1

const int64_t *I_remain = nullptr

大小 lim_remain[nrange]

const int64_t *L_res = nullptr

大小 lim_remain[nrange]