10 #ifndef FAISS_IVFLIB_H
11 #define FAISS_IVFLIB_H
22 namespace faiss {
namespace ivflib {
27 void check_compatible_for_merge (
const Index * index1,
28 const Index * index2);
35 const IndexIVF * extract_index_ivf (
const Index * index);
36 IndexIVF * extract_index_ivf (Index * index);
43 void merge_into(Index *index0, Index *index1,
bool shift_ids);
56 void search_centroid(Index *index,
57 const float* x,
int n,
70 void search_and_return_centroids(Index *index,
76 idx_t* query_centroid_ids,
77 idx_t* result_centroid_ids);
97 std::vector<std::vector<size_t> >
sizes;
106 void step(
const Index *sub_index,
bool remove_oldest);
116 void set_invlist_range (
Index *index,
long i0,
long i1,
122 void search_with_parameters (
const Index *index,
123 idx_t n,
const float *x, idx_t k,
124 float *distances, idx_t *labels,
simple (default) implementation as an array of inverted lists
size_t nlist
same as index->nlist
long idx_t
all indices are this type
ArrayInvertedLists * ils
InvertedLists of index.
int n_slice
number of slices currently in index
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