Struct faiss::ReservoirBlockResultHandler

template<class C>
struct ReservoirBlockResultHandler : public faiss::BlockResultHandler<C>

Public Types

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

Public Functions

inline ReservoirBlockResultHandler(size_t nq, T *heap_dis_tab, TI *heap_ids_tab, size_t k)
inline virtual void begin_multiple(size_t i0_2, size_t i1_2)

begin

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

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

inline virtual void end_multiple() final

series of results for queries i0..i1 is done

inline virtual void add_results(size_t, size_t, const typename C::T*)

Public Members

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

Public Types

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

Public Functions

inline explicit SingleResultHandler(ReservoirBlockResultHandler &hr)
inline void begin(size_t qno_2)

begin results for query # i

inline void end()

series of results for query qno is done

inline virtual bool add_result(T val, TI id) final
inline void add(T val, TI id)
inline void shrink_fuzzy()
inline void shrink()
inline void to_result(T *heap_dis, TI *heap_ids) const

Public Members

ReservoirBlockResultHandler &hr
std::vector<T> reservoir_dis
std::vector<TI> reservoir_ids
size_t qno
T *vals
TI *ids
size_t i
size_t n
size_t capacity
C::T threshold = 0