14 #ifndef FAISS_AUX_INDEX_STRUCTURES_H
15 #define FAISS_AUX_INDEX_STRUCTURES_H
18 #include <unordered_set>
54 virtual bool is_member (idx_t
id)
const = 0;
65 bool is_member(idx_t
id)
const override;
78 std::unordered_set<idx_t> set;
80 typedef unsigned char uint8_t;
81 std::vector<uint8_t> bloom;
86 bool is_member(idx_t
id)
const override;
108 std::vector<Buffer> buffers;
116 void append_buffer ();
118 inline void add (idx_t
id,
float dis)
120 if (
wp == buffer_size) {
123 Buffer & buf = buffers.back();
132 idx_t * dest_ids,
float *dest_dis);
149 inline void add (
float dis, idx_t
id) {
155 std::vector<QueryResult> queries;
result structure for a single query
void copy_range(size_t ofs, size_t n, idx_t *dest_ids, float *dest_dis)
void set_result(bool incremental=false)
called by range_search after do_allocation
void set_lims()
called by range_search before do_allocation
RangeSearchResult(idx_t nq, bool alloc_lims=true)
lims must be allocated on input to range_search.
size_t wp
write pointer in the last buffer.
float * distances
corresponding distances (not sorted)
long idx_t
all indices are this type
QueryResult & new_result(idx_t qno)
begin a new result
virtual void do_allocation()
the entries in the buffers are split per query
size_t buffer_size
size of the result buffers used
size_t * lims
size (nq + 1)
idx_t * labels
result for query i is labels[lims[i]:lims[i+1]]