Struct faiss::Top1BlockResultHandler

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

Public Types

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

Public Functions

inline Top1BlockResultHandler(size_t nq, T *dis_tab, TI *ids_tab, const IDSelector *sel = nullptr)
inline virtual void begin_multiple(size_t i0, size_t i1) final

begin

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

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

inline void add_result(const size_t i, const T dis, const TI idx)
inline virtual void add_results(size_t, size_t, const typename C::T*)
inline virtual void end_multiple()
inline bool is_in_selection(idx_t i) const

Public Members

T *dis_tab
TI *ids_tab
size_t nq
const IDSelector *sel
size_t i0
size_t i1
struct SingleResultHandler : public faiss::ResultHandler<C>

Public Functions

inline explicit SingleResultHandler(Top1BlockResultHandler &hr)
inline void begin(const size_t current_idx_2)

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

Top1BlockResultHandler &hr
TI min_idx
size_t current_idx = 0
C::T threshold = C::neutral()