10 #ifndef FAISS_ON_DISK_INVERTED_LISTS_H
11 #define FAISS_ON_DISK_INVERTED_LISTS_H
61 std::vector<List> lists;
66 Slot (
size_t offset,
size_t capacity);
71 std::list<Slot> slots;
79 const char *filename);
81 size_t list_size(
size_t list_no)
const override;
82 const uint8_t *
get_codes (
size_t list_no)
const override;
83 const idx_t *
get_ids (
size_t list_no)
const override;
86 size_t list_no,
size_t n_entry,
87 const idx_t* ids,
const uint8_t *code)
override;
89 void update_entries (
size_t list_no,
size_t offset,
size_t n_entry,
90 const idx_t *ids,
const uint8_t *code)
override;
92 void resize (
size_t list_no,
size_t new_size)
override;
96 size_t merge_from (
const InvertedLists **ils,
int n_il,
bool verbose=
false);
112 int prefetch_nthread;
115 void update_totsize (
size_t new_totsize);
116 void resize_locked (
size_t list_no,
size_t new_size);
117 size_t allocate_slot (
size_t capacity);
118 void free_slot (
size_t offset,
size_t capacity);
void crop_invlists(size_t l0, size_t l1)
restrict the inverted lists to l0:l1 without touching the mmapped region
const idx_t * get_ids(size_t list_no) const override
void prefetch_lists(const idx_t *list_nos, int nlist) const override
size_t code_size
code size per vector in bytes
const uint8_t * get_codes(size_t list_no) const override
size_t list_size(size_t list_no) const override
get the size of a list
size_t nlist
number of possible key values