10 #ifndef META_INDEXES_H
11 #define META_INDEXES_H
14 #include <unordered_map>
16 #include "IndexShards.h"
17 #include "IndexReplicas.h"
34 void add(
idx_t n,
const float* x)
override;
41 idx_t* labels)
const override;
45 void reset()
override;
61 std::unordered_map<idx_t, idx_t> rev_map;
68 void add_with_ids(idx_t n,
const float* x,
const long* xids)
override;
72 void reconstruct (idx_t key,
float * recons)
const override;
85 std::vector<Index*> sub_indexes;
90 void add_sub_index (
Index *);
91 void sync_with_sub_indexes ();
93 void add(
idx_t n,
const float* x)
override;
100 idx_t* labels)
const override;
104 void reset()
override;
void search(idx_t n, const float *x, idx_t k, float *distances, idx_t *labels) const override
void add_with_ids(idx_t n, const float *x, const long *xids) override
void reset() override
removes all elements from the database.
void add(idx_t n, const float *x) override
this will fail. Use add_with_ids
long idx_t
all indices are this type
std::vector< long > id_map
! whether pointers are deleted in destructo
void range_search(idx_t n, const float *x, float radius, RangeSearchResult *result) const override
void train(idx_t n, const float *x) override
void construct_rev_map()
make the rev_map from scratch
void add(idx_t n, const float *x) override
long remove_ids(const IDSelector &sel) override
remove ids adapted to IndexFlat
void reset() override
removes all elements from the database.
void search(idx_t n, const float *x, idx_t k, float *distances, idx_t *labels) const override
long remove_ids(const IDSelector &sel) override
remove ids adapted to IndexFlat
void reconstruct(idx_t key, float *recons) const override
void train(idx_t n, const float *x) override
void add_with_ids(idx_t n, const float *x, const long *xids) override
IndexSplitVectors(idx_t d, bool threaded=false)
sum of dimensions seen so far
bool own_fields
! the sub-index