Struct faiss::HeapBlockResultHandler

template<class C, bool use_sel = false>
struct HeapBlockResultHandler : public faiss::BlockResultHandler<C, false>

Public Types

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

Public Functions

inline HeapBlockResultHandler(size_t nq, T *heap_dis_tab, TI *heap_ids_tab, size_t k, const IDSelector *sel = nullptr)
inline virtual void begin_multiple(size_t i0_2, size_t i1_2) final

begin

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

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*)
inline bool is_in_selection(idx_t i) const

Public Members

T *heap_dis_tab
TI *heap_ids_tab
int64_t k
size_t nq
const IDSelector *sel
size_t i0
size_t i1
struct SingleResultHandler : public faiss::ResultHandler<C>

Public Functions

inline explicit SingleResultHandler(HeapBlockResultHandler &hr)
inline void begin(size_t i)

begin results for query # i

inline virtual bool add_result(T dis, TI idx) final

add one result for query i

inline void end()

series of results for query i is done

Public Members

HeapBlockResultHandler &hr
size_t k
T *heap_dis
TI *heap_ids
C::T threshold = C::neutral()