结构体 faiss::IndexIDMapTemplate
-
template<typename IndexT>
struct IndexIDMapTemplate : public IndexT 将搜索结果转换为 ID 的 Index
被 faiss::IndexIDMap2Template< IndexT > 继承
公共类型
-
using component_t = typename IndexT::component_t
-
using distance_t = typename IndexT::distance_t
公共函数
-
explicit IndexIDMapTemplate(IndexT *index)
-
void add_with_ids(idx_t n, const component_t *x, const idx_t *xids) override
- 参数:
xids – 如果非空,则为要存储的向量的 ID(大小为 n)
-
void add(idx_t n, const component_t *x) override
这将会失败。请使用 add_with_ids
-
void search(idx_t n, const component_t *x, idx_t k, distance_t *distances, idx_t *labels, const SearchParameters *params = nullptr) const override
-
void train(idx_t n, const component_t *x) override
-
void reset() override
-
size_t remove_ids(const IDSelector &sel) override
删除适用于 IndexFlat 的 ID
-
void range_search(idx_t n, const component_t *x, distance_t radius, RangeSearchResult *result, const SearchParameters *params = nullptr) const override
-
void check_compatible_for_merge(const IndexT &otherIndex) const override
-
size_t sa_code_size() const override
-
~IndexIDMapTemplate() override
-
inline IndexIDMapTemplate()
-
using component_t = typename IndexT::component_t