Struct faiss::ReservoirResultHandler

template<class C>
struct ReservoirResultHandler

Public Types

using T = typename C::T
using TI = typename C::TI

Public Functions

inline ReservoirResultHandler(size_t nq, T *heap_dis_tab, TI *heap_ids_tab, size_t k)
inline void begin_multiple(size_t i0, size_t i1)


inline void add_results(size_t j0, size_t j1, const T *dis_tab)

add results for query i0..i1 and j0..j1

inline void end_multiple()

series of results for queries i0..i1 is done

Public Members

int nq
T *heap_dis_tab
TI *heap_ids_tab
int64_t k
size_t capacity
size_t i0
size_t i1
std::vector<T> reservoir_dis
std::vector<TI> reservoir_ids
std::vector<ReservoirTopN<C>> reservoirs
struct SingleResultHandler

Public Functions

inline SingleResultHandler(ReservoirResultHandler &hr)
inline void begin(size_t i)

begin results for query # i

inline void add_result(T dis, TI idx)

add one result for query i

inline void end()

series of results for query i is done

Public Members

ReservoirResultHandler &hr
std::vector<T> reservoir_dis
std::vector<TI> reservoir_ids
ReservoirTopN<C> res1
size_t i