12 #ifndef META_INDEXES_H
13 #define META_INDEXES_H
37 void add(
idx_t n,
const float* x)
override;
44 idx_t* labels)
const override;
48 void reset()
override;
62 std::vector<Index*> shard_indexes;
75 bool successive_ids =
true);
77 void add_shard (
Index *);
81 void sync_with_shard_indexes ();
83 Index *at(
int i) {
return shard_indexes[i]; }
86 void add(
idx_t n,
const float* x)
override;
95 idx_t* labels)
const override;
99 void reset()
override;
111 std::vector<Index*> sub_indexes;
116 void add_sub_index (
Index *);
117 void sync_with_sub_indexes ();
119 void add(
idx_t n,
const float* x)
override;
126 idx_t* labels)
const override;
130 void reset()
override;
void train(idx_t n, const float *x) override
IndexShards(idx_t d, bool threaded=false, bool successive_ids=true)
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 search(idx_t n, const float *x, idx_t k, float *distances, idx_t *labels) const 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
std::vector< long > id_map
! whether pointers are deleted in destructo
void train(idx_t n, const float *x) override
void add(idx_t n, const float *x) override
supported only for sub-indices that implement add_with_ids
long idx_t
all indices are this type
void add(idx_t n, const float *x) override
bool threaded
should the sub-indexes be deleted along with this?
void reset() override
removes all elements from the database.
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 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