11 #ifndef FAISS_IVFLIB_H
12 #define FAISS_IVFLIB_H
23 namespace faiss {
namespace ivflib {
28 void check_compatible_for_merge (
const Index * index1,
29 const Index * index2);
36 const IndexIVF * extract_index_ivf (
const Index * index);
37 IndexIVF * extract_index_ivf (Index * index);
44 void merge_into(Index *index0, Index *index1,
bool shift_ids);
57 void search_centroid(Index *index,
58 const float* x,
int n,
71 void search_and_return_centroids(Index *index,
77 idx_t* query_centroid_ids,
78 idx_t* result_centroid_ids);
98 std::vector<std::vector<size_t> >
sizes;
107 void step(
const Index *sub_index,
bool remove_oldest);
117 void set_invlist_range (
Index *index,
long i0,
long i1,
123 void search_with_parameters (
const Index *index,
124 idx_t n,
const float *x, idx_t k,
125 float *distances, idx_t *labels,
simple (default) implementation as an array of inverted lists
size_t nlist
same as index->nlist
ArrayInvertedLists * ils
InvertedLists of index.
int n_slice
number of slices currently in index
long idx_t
all indices are this type
std::vector< std::vector< size_t > > sizes
cumulative list sizes at each slice
SlidingIndexWindow(Index *index)
index should be initially empty and trained
void step(const Index *sub_index, bool remove_oldest)
Index * index
common index that contains the sliding window