11 #ifndef FAISS_INDEX_IVF_FLAT_H
12 #define FAISS_INDEX_IVF_FLAT_H
14 #include <unordered_map>
32 virtual void add_core (
idx_t n,
const float * x,
const long *xids,
33 const long *precomputed_idx);
39 const idx_t *list_nos,
40 uint8_t * codes)
const override;
71 float* recons)
const override;
89 void train(idx_t n,
const float* x)
override;
92 void add_with_ids(idx_t n,
const float* x,
const long* xids)
override;
96 const float *centroid_dis,
97 float *distances, idx_t *labels,
112 void update_vectors (
int nv, idx_t *idx,
const float *v)
override;
117 float* recons)
const override;
void train(idx_t n, const float *x) override
also dedups the training set
void reconstruct_from_offset(long list_no, long offset, float *recons) const override
not implemented
void encode_vectors(idx_t n, const float *x, const idx_t *list_nos, uint8_t *codes) const override
void assign(idx_t n, const float *x, idx_t *labels, idx_t k=1)
void range_search(idx_t n, const float *x, float radius, RangeSearchResult *result) const override
void add_with_ids(idx_t n, const float *x, const long *xids) override
implemented for all IndexIVF* classes
void search_preassigned(idx_t n, const float *x, idx_t k, const idx_t *assign, const float *centroid_dis, float *distances, idx_t *labels, bool store_pairs, const IVFSearchParameters *params=nullptr) const override
void add_with_ids(idx_t n, const float *x, const long *xids) override
implemented for all IndexIVF* classes
long idx_t
all indices are this type
void reconstruct_from_offset(long list_no, long offset, float *recons) const override
virtual void update_vectors(int nv, idx_t *idx, const float *v)
void range_search(idx_t n, const float *x, float radius, RangeSearchResult *result) const override
not implemented
void update_vectors(int nv, idx_t *idx, const float *v) override
not implemented
Index * quantizer
quantizer that maps vectors to inverted lists
long remove_ids(const IDSelector &sel) override
Dataset manipulation functions.
MetricType
Some algorithms support both an inner product version and a L2 search version.
InvertedListScanner * get_InvertedListScanner(bool store_pairs) const override
get a scanner for this index (store_pairs means ignore labels)
virtual void add_core(idx_t n, const float *x, const long *xids, const long *precomputed_idx)
same as add_with_ids, with precomputed coarse quantizer
std::unordered_multimap< idx_t, idx_t > instances