结构体 faiss::DirectMap
-
struct DirectMap
直接映射:一种从 ID 映射回倒排列表的方法
公共类型
-
enum Type
值
-
enumerator NoMap
-
enumerator Array
-
enumerator Hashtable
-
enumerator NoMap
公共函数
-
DirectMap()
-
void set_type(Type new_type, const InvertedLists *invlists, size_t ntotal)
设置类型并初始化
-
inline bool no() const
用于快速检查
-
void check_can_add(const idx_t *ids)
如果类型为 Array 且 ids 不为 NULL,则抛出异常
更新 direct_map
-
void clear()
删除所有条目
-
size_t remove_ids(const IDSelector &sel, InvertedLists *invlists)
从 InvertedLists 中删除 ID,可能使用 direct map
倒排列表上的操作,需要使用 DirectMap 进行转换
-
void update_codes(InvertedLists *invlists, int n, const idx_t *ids, const idx_t *list_nos, const uint8_t *codes)
使用 direct map 更新条目
-
enum Type