11 #include "IndexBinary.h"
12 #include "ThreadedIndex.h"
19 template <
typename IndexT>
21 using idx_t =
typename IndexT::idx_t;
22 using component_t =
typename IndexT::component_t;
23 using distance_t =
typename IndexT::distance_t;
36 bool successive_ids =
true);
46 bool threaded =
false,
47 bool successive_ids =
true);
52 bool threaded =
false,
53 bool successive_ids =
true);
62 void add(idx_t n,
const component_t* x)
override;
75 void add_with_ids(idx_t n,
const component_t* x,
const idx_t* xids)
override;
77 void search(idx_t n,
const component_t* x, idx_t k,
78 distance_t* distances, idx_t* labels)
const override;
80 void train(idx_t n,
const component_t* x)
override;
84 void sync_with_shard_indexes();
96 using IndexShards = IndexShardsTemplate<Index>;
97 using IndexBinaryShards = IndexShardsTemplate<IndexBinary>;
void removeIndex(IndexT *index)
void add_with_ids(idx_t n, const component_t *x, const idx_t *xids) override
void addIndex(IndexT *index)
void add_shard(IndexT *index)
Alias for addIndex()
IndexShardsTemplate(bool threaded=false, bool successive_ids=true)
void add(idx_t n, const component_t *x) override
supported only for sub-indices that implement add_with_ids
void onAfterAddIndex(IndexT *index) override
Called just after an index is added.
void remove_shard(IndexT *index)
Alias for removeIndex()
void onAfterRemoveIndex(IndexT *index) override
Called just after an index is removed.