<divclass="line"><aname="l00005"></a><spanclass="lineno"> 5</span> <spanclass="comment"> * This source code is licensed under the CC-by-NC license found in the</span></div>
<divclass="line"><aname="l00006"></a><spanclass="lineno"> 6</span> <spanclass="comment"> * LICENSE file in the root directory of this source tree.</span></div>
<divclass="line"><aname="l00009"></a><spanclass="lineno"> 9</span> <spanclass="comment">// Copyright 2004-present Facebook. All Rights Reserved.</span></div>
<divclass="line"><aname="l00010"></a><spanclass="lineno"> 10</span> <spanclass="comment">// -*- c++ -*-</span></div>
<divclass="line"><aname="l00026"></a><spanclass="lineno"> 26</span> <spanclass="comment">/** Inverted file with Product Quantizer encoding. Each residual</span></div>
<divclass="line"><aname="l00027"></a><spanclass="lineno"> 27</span> <spanclass="comment"> * vector is encoded as a product quantizer code.</span></div>
<divclass="line"><aname="l00030"></a><spanclass="lineno"><aclass="line"href="structfaiss_1_1IndexIVFPQ.html#afd13b471df293ae5a6e895704c69a4c3"> 30</a></span> <spanclass="keywordtype">bool</span><aclass="code"href="structfaiss_1_1IndexIVFPQ.html#afd13b471df293ae5a6e895704c69a4c3">by_residual</a>; <spanclass="comment">///< Encode residual or plain vector?</span></div>
<divclass="line"><aname="l00031"></a><spanclass="lineno"><aclass="line"href="structfaiss_1_1IndexIVFPQ.html#a1c66ff073c18a1edbe8444c24d870583"> 31</a></span> <spanclass="comment"></span><spanclass="keywordtype">int</span><aclass="code"href="structfaiss_1_1IndexIVFPQ.html#a1c66ff073c18a1edbe8444c24d870583">use_precomputed_table</a>; <spanclass="comment">///< if by_residual, build precompute tables</span></div>
<divclass="line"><aname="l00032"></a><spanclass="lineno"><aclass="line"href="structfaiss_1_1IndexIVFPQ.html#a31c6fb2faa4dadea4c0594338be7be90"> 32</a></span> <spanclass="comment"></span><spanclass="keywordtype">size_t</span><aclass="code"href="structfaiss_1_1IndexIVFPQ.html#a31c6fb2faa4dadea4c0594338be7be90">code_size</a>; <spanclass="comment">///< code size per vector in bytes</span></div>
<divclass="line"><aname="l00033"></a><spanclass="lineno"><aclass="line"href="structfaiss_1_1IndexIVFPQ.html#a007303be116c8da65b6d058e3fc77d16"> 33</a></span> <spanclass="comment"></span><aclass="code"href="structfaiss_1_1ProductQuantizer.html">ProductQuantizer</a><aclass="code"href="structfaiss_1_1IndexIVFPQ.html#a007303be116c8da65b6d058e3fc77d16">pq</a>; <spanclass="comment">///< produces the codes</span></div>
<divclass="line"><aname="l00035"></a><spanclass="lineno"><aclass="line"href="structfaiss_1_1IndexIVFPQ.html#a9d5373633df7a9bec4de69400b9adeed"> 35</a></span> <spanclass="keywordtype">bool</span><aclass="code"href="structfaiss_1_1IndexIVFPQ.html#a9d5373633df7a9bec4de69400b9adeed">do_polysemous_training</a>; <spanclass="comment">///< reorder PQ centroids after training?</span></div>
<divclass="line"><aname="l00036"></a><spanclass="lineno"><aclass="line"href="structfaiss_1_1IndexIVFPQ.html#a2b14cbb5acb3fc28a4df8fde3f5567cd"> 36</a></span> <spanclass="comment"></span><aclass="code"href="structfaiss_1_1PolysemousTraining.html">PolysemousTraining</a> *<aclass="code"href="structfaiss_1_1IndexIVFPQ.html#a2b14cbb5acb3fc28a4df8fde3f5567cd">polysemous_training</a>; <spanclass="comment">///< if NULL, use default</span></div>
<divclass="line"><aname="l00039"></a><spanclass="lineno"><aclass="line"href="structfaiss_1_1IndexIVFPQ.html#a7430fc4fa030c96497abced3b68358d4"> 39</a></span> <spanclass="keywordtype">size_t</span><aclass="code"href="structfaiss_1_1IndexIVFPQ.html#a7430fc4fa030c96497abced3b68358d4">scan_table_threshold</a>; <spanclass="comment">///< use table computation or on-the-fly?</span></div>
<divclass="line"><aname="l00040"></a><spanclass="lineno"><aclass="line"href="structfaiss_1_1IndexIVFPQ.html#a77501995b3671e377102d2db1a93ade4"> 40</a></span> <spanclass="comment"></span><spanclass="keywordtype">size_t</span><aclass="code"href="structfaiss_1_1IndexIVFPQ.html#a77501995b3671e377102d2db1a93ade4">max_codes</a>; <spanclass="comment">///< max nb of codes to visit to do a query</span></div>
<divclass="line"><aname="l00041"></a><spanclass="lineno"><aclass="line"href="structfaiss_1_1IndexIVFPQ.html#a3093a0a3e128eafce6e0583b75e9662e"> 41</a></span> <spanclass="comment"></span><spanclass="keywordtype">int</span><aclass="code"href="structfaiss_1_1IndexIVFPQ.html#a3093a0a3e128eafce6e0583b75e9662e">polysemous_ht</a>; <spanclass="comment">///< Hamming thresh for polysemous filtering</span></div>
<divclass="line"><aname="l00051"></a><spanclass="lineno"> 51</span> <spanclass="keywordtype">size_t</span> M, <spanclass="keywordtype">size_t</span> nbits_per_idx);</div>
<divclass="line"><aname="l00058"></a><spanclass="lineno"> 58</span> <spanclass="comment"> /// - use precomputed list numbers if precomputed_idx != NULL</span></div>
<divclass="line"><aname="l00059"></a><spanclass="lineno"> 59</span> <spanclass="comment"></span><spanclass="keywordtype">void</span><aclass="code"href="structfaiss_1_1IndexIVFPQ.html#ac0cb8421b9885d691696d2ff4f76894b">add_core_o</a> (<aclass="code"href="structfaiss_1_1Index.html#a040c6aed1f224f3ea7bf58eebc0c31a4">idx_t</a> n, <spanclass="keyword">const</span><spanclass="keywordtype">float</span> *x,</div>
<divclass="line"><aname="l00077"></a><spanclass="lineno"> 77</span> <spanclass="comment"> /// same as train_residual, also output 2nd level residuals</span></div>
<divclass="line"><aname="l00078"></a><spanclass="lineno"> 78</span> <spanclass="comment"></span><spanclass="keywordtype">void</span><aclass="code"href="structfaiss_1_1IndexIVFPQ.html#a4e06f04853dcb424dc393de5f641e917">train_residual_o</a> (<aclass="code"href="structfaiss_1_1Index.html#a040c6aed1f224f3ea7bf58eebc0c31a4">idx_t</a> n, <spanclass="keyword">const</span><spanclass="keywordtype">float</span> *x, <spanclass="keywordtype">float</span> *residuals_2);</div>
<divclass="line"><aname="l00081"></a><spanclass="lineno"> 81</span> <spanclass="comment"> /** Reconstruct a subset of the indexed vectors</span></div>
<divclass="line"><aname="l00093"></a><spanclass="lineno"> 93</span> <spanclass="comment"> * the duplicates are returned in pre-allocated arrays (see the</span></div>
<divclass="line"><aname="l00094"></a><spanclass="lineno"> 94</span> <spanclass="comment"> * max sizes).</span></div>
<divclass="line"><aname="l00096"></a><spanclass="lineno"> 96</span> <spanclass="comment"> * @params lims limits between groups of duplicates</span></div>
<divclass="line"><aname="l00098"></a><spanclass="lineno"> 98</span> <spanclass="comment"> * @params ids ids[lims[i]] : ids[lims[i+1]-1] is a group of</span></div>
<divclass="line"><aname="l00104"></a><spanclass="lineno"> 104</span> <spanclass="comment">// map a vector to a binary code knowning the index</span></div>
<divclass="line"><aname="l00109"></a><spanclass="lineno"> 109</span> <spanclass="comment"> * @param n nb vectors to encode</span></div>
<divclass="line"><aname="l00110"></a><spanclass="lineno"> 110</span> <spanclass="comment"> * @param keys posting list ids for those vectors (size n)</span></div>
<divclass="line"><aname="l00111"></a><spanclass="lineno"> 111</span> <spanclass="comment"> * @param x vectors (size n * d)</span></div>
<divclass="line"><aname="l00124"></a><spanclass="lineno"> 124</span> <spanclass="comment"> /** search a set of vectors, that are pre-quantized by the IVF</span></div>
<divclass="line"><aname="l00125"></a><spanclass="lineno"> 125</span> <spanclass="comment"> * quantizer. Fill in the corresponding heaps with the query</span></div>
<divclass="line"><aname="l00133"></a><spanclass="lineno"> 133</span> <spanclass="comment"> * @param res heaps for all the results, gives the nprobe</span></div>
<divclass="line"><aname="l00134"></a><spanclass="lineno"> 134</span> <spanclass="comment"> * @param store_pairs store inv list index + inv list offset</span></div>
<divclass="line"><aname="l00135"></a><spanclass="lineno"> 135</span> <spanclass="comment"> * instead in upper/lower 32 bit of result,</span></div>
<divclass="line"><aname="l00136"></a><spanclass="lineno"> 136</span> <spanclass="comment"> * instead of ids (used for reranking).</span></div>
<divclass="line"><aname="l00152"></a><spanclass="lineno"> 152</span> <spanclass="comment"> /** copy a subset of the entries index to the other index</span></div>
<divclass="line"><aname="l00154"></a><spanclass="lineno"> 154</span> <spanclass="comment"> * if subset_type == 0: copies ids in [a1, a2)</span></div>
<divclass="line"><aname="l00155"></a><spanclass="lineno"> 155</span> <spanclass="comment"> * if subset_type == 1: copies ids if id % a1 == a2</span></div>
<divclass="line"><aname="l00165"></a><spanclass="lineno"> 165</span> <spanclass="comment">/// statistics are robust to internal threading, but not if</span></div>
<divclass="line"><aname="l00166"></a><spanclass="lineno"> 166</span> <spanclass="comment">/// IndexIVFPQ::search is called by multiple threads</span></div>
<divclass="line"><aname="l00168"></a><spanclass="lineno"> 168</span> <spanclass="keywordtype">size_t</span> nq; <spanclass="comment">// nb of queries run</span></div>
<divclass="line"><aname="l00169"></a><spanclass="lineno"> 169</span> <spanclass="keywordtype">size_t</span> nlist; <spanclass="comment">// nb of inverted lists scanned</span></div>
<divclass="line"><aname="l00170"></a><spanclass="lineno"> 170</span> <spanclass="keywordtype">size_t</span> ncode; <spanclass="comment">// nb of codes visited</span></div>
<divclass="line"><aname="l00171"></a><spanclass="lineno"> 171</span> <spanclass="keywordtype">size_t</span> nrefine; <spanclass="comment">// nb of refines (IVFPQR)</span></div>
<divclass="line"><aname="l00174"></a><spanclass="lineno"> 174</span> <spanclass="comment">// nb of passed Hamming distance tests (for polysemous)</span></div>
<divclass="line"><aname="l00180"></a><spanclass="lineno"> 180</span> <spanclass="keywordtype">size_t</span> refine_cycles; <spanclass="comment">// only for IVFPQR</span></div>
<divclass="line"><aname="l00182"></a><spanclass="lineno"> 182</span> <spanclass="comment">// single thread (double-counted with search_cycles)</span></div>
<divclass="line"><aname="l00197"></a><spanclass="lineno"> 197</span> <spanclass="comment">/** Index with an additional level of PQ refinement */</span></div>
<divclass="line"><aname="l00202"></a><spanclass="lineno"> 202</span> <spanclass="comment"> /// factor between k requested in search and the k requested from the IVFPQ</span></div>
<divclass="line"><aname="l00207"></a><spanclass="lineno"> 207</span> <spanclass="keywordtype">size_t</span> M, <spanclass="keywordtype">size_t</span> nbits_per_idx,</div>
<divclass="line"><aname="l00219"></a><spanclass="lineno"> 219</span> <spanclass="comment"> /// same as add_with_ids, but optionally use the precomputed list ids</span></div>
<divclass="line"><aname="l00220"></a><spanclass="lineno"> 220</span> <spanclass="comment"></span><spanclass="keywordtype">void</span><aclass="code"href="structfaiss_1_1IndexIVFPQR.html#a186b746f22b65ddf416b1e821b0866ec">add_core</a> (<aclass="code"href="structfaiss_1_1Index.html#a040c6aed1f224f3ea7bf58eebc0c31a4">idx_t</a> n, <spanclass="keyword">const</span><spanclass="keywordtype">float</span> *x, <spanclass="keyword">const</span><spanclass="keywordtype">long</span> *xids,</div>
<divclass="line"><aname="l00238"></a><spanclass="lineno"> 238</span> <spanclass="comment">/** Index with 32-bit ids and flat tables. Must be constructed from an</span></div>
<divclass="line"><aname="l00239"></a><spanclass="lineno"> 239</span> <spanclass="comment"> * exisiting IndexIVFPQ. Cannot be copy-constructed/assigned. The</span></div>
<divclass="line"><aname="l00240"></a><spanclass="lineno"> 240</span> <spanclass="comment"> * actual data is stored in the compact_* tables, the ids and codes</span></div>
<divclass="line"><aname="l00241"></a><spanclass="lineno"> 241</span> <spanclass="comment"> * tables are not used. */</span></div>
<divclass="line"><aname="l00246"></a><spanclass="lineno"> 246</span> <spanclass="comment"> /// how were the compact tables allocated?</span></div>
<divclass="line"><aname="l00248"></a><spanclass="lineno"><aclass="line"href="structfaiss_1_1IndexIVFPQCompact.html#ab2698c5d65644a171c53ffe39e420b70a3d58d7b26146791f0fe34b35a9b0fd95"> 248</a></span> <aclass="code"href="structfaiss_1_1IndexIVFPQCompact.html#ab2698c5d65644a171c53ffe39e420b70a3d58d7b26146791f0fe34b35a9b0fd95">Alloc_type_none</a>, <spanclass="comment">///< alloc from outside</span></div>
<divclass="line"><aname="l00249"></a><spanclass="lineno"><aclass="line"href="structfaiss_1_1IndexIVFPQCompact.html#ab2698c5d65644a171c53ffe39e420b70acf2d6ba8878a2778383adc32593ba8e6"> 249</a></span> <spanclass="comment"></span><aclass="code"href="structfaiss_1_1IndexIVFPQCompact.html#ab2698c5d65644a171c53ffe39e420b70acf2d6ba8878a2778383adc32593ba8e6">Alloc_type_new</a>, <spanclass="comment">///< was allocated with new</span></div>
<divclass="line"><aname="l00250"></a><spanclass="lineno"><aclass="line"href="structfaiss_1_1IndexIVFPQCompact.html#ab2698c5d65644a171c53ffe39e420b70a38c1b1ed9ebdbd4b0047be13080094bb"> 250</a></span> <spanclass="comment"></span><aclass="code"href="structfaiss_1_1IndexIVFPQCompact.html#ab2698c5d65644a171c53ffe39e420b70a38c1b1ed9ebdbd4b0047be13080094bb">Alloc_type_mmap</a><spanclass="comment">///< was mmapped</span></div>
<divclass="line"><aname="l00259"></a><spanclass="lineno"> 259</span> <spanclass="comment">// file and buffer this was mmapped (will be unmapped when object</span></div>
<divclass="line"><aname="l00260"></a><spanclass="lineno"> 260</span> <spanclass="comment">// is deleted)</span></div>
<divclass="line"><aname="l00272"></a><spanclass="lineno"> 272</span> <spanclass="comment"> /// the three following functions will fail at runtime</span></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQ_html_af278c710f6c7605f59e1da48a6dea37a"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQ.html#af278c710f6c7605f59e1da48a6dea37a">faiss::IndexIVFPQ::copy_subset_to</a></div><divclass="ttdeci">void copy_subset_to(IndexIVFPQ &other, int subset_type, long a1, long a2) const </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8cpp_source.html#l00332">IndexIVFPQ.cpp:332</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQ_html_a2b14cbb5acb3fc28a4df8fde3f5567cd"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQ.html#a2b14cbb5acb3fc28a4df8fde3f5567cd">faiss::IndexIVFPQ::polysemous_training</a></div><divclass="ttdeci">PolysemousTraining * polysemous_training</div><divclass="ttdoc">if NULL, use default </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8h_source.html#l00036">IndexIVFPQ.h:36</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQCompact_html_ade7b46bbbcaf244ad680104380afb1b8"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQCompact.html#ade7b46bbbcaf244ad680104380afb1b8">faiss::IndexIVFPQCompact::add</a></div><divclass="ttdeci">void add(idx_t, const float *) override</div><divclass="ttdoc">the three following functions will fail at runtime </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8cpp_source.html#l01455">IndexIVFPQ.cpp:1455</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQ_html_a6b8964e2da609a9261a8a35ae347ecb2"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQ.html#a6b8964e2da609a9261a8a35ae347ecb2">faiss::IndexIVFPQ::merge_from_residuals</a></div><divclass="ttdeci">void merge_from_residuals(IndexIVF &other) override</div><divclass="ttdoc">used to implement merging </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8cpp_source.html#l00322">IndexIVFPQ.cpp:322</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQ_html_ae1fb0cc3051dec8e322a78c443f8fc9a"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQ.html#ae1fb0cc3051dec8e322a78c443f8fc9a">faiss::IndexIVFPQ::decode_multiple</a></div><divclass="ttdeci">void decode_multiple(size_t n, const long *keys, const uint8_t *xcodes, float *x) const </div><divclass="ttdoc">inverse of encode_multiple </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8cpp_source.html#l00168">IndexIVFPQ.cpp:168</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQ_html_a4e06f04853dcb424dc393de5f641e917"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQ.html#a4e06f04853dcb424dc393de5f641e917">faiss::IndexIVFPQ::train_residual_o</a></div><divclass="ttdeci">void train_residual_o(idx_t n, const float *x, float *residuals_2)</div><divclass="ttdoc">same as train_residual, also output 2nd level residuals </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8cpp_source.html#l00072">IndexIVFPQ.cpp:72</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQ_html_a9d5373633df7a9bec4de69400b9adeed"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQ.html#a9d5373633df7a9bec4de69400b9adeed">faiss::IndexIVFPQ::do_polysemous_training</a></div><divclass="ttdeci">bool do_polysemous_training</div><divclass="ttdoc">reorder PQ centroids after training? </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8h_source.html#l00035">IndexIVFPQ.h:35</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQ_html_a7430fc4fa030c96497abced3b68358d4"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQ.html#a7430fc4fa030c96497abced3b68358d4">faiss::IndexIVFPQ::scan_table_threshold</a></div><divclass="ttdeci">size_t scan_table_threshold</div><divclass="ttdoc">use table computation or on-the-fly? </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8h_source.html#l00039">IndexIVFPQ.h:39</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQR_html_a68ed7cae5bec89fcdcb6a1d2addbd5a8"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQR.html#a68ed7cae5bec89fcdcb6a1d2addbd5a8">faiss::IndexIVFPQR::train_residual</a></div><divclass="ttdeci">void train_residual(idx_t n, const float *x) override</div><divclass="ttdoc">trains the two product quantizers </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8cpp_source.html#l01213">IndexIVFPQ.cpp:1213</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQR_html_a186b746f22b65ddf416b1e821b0866ec"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQR.html#a186b746f22b65ddf416b1e821b0866ec">faiss::IndexIVFPQR::add_core</a></div><divclass="ttdeci">void add_core(idx_t n, const float *x, const long *xids, const long *precomputed_idx=nullptr)</div><divclass="ttdoc">same as add_with_ids, but optionally use the precomputed list ids </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8cpp_source.html#l01237">IndexIVFPQ.cpp:1237</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQR_html_ae0e979a014a9defe2254e9543657b075"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQR.html#ae0e979a014a9defe2254e9543657b075">faiss::IndexIVFPQR::reset</a></div><divclass="ttdeci">void reset() override</div><divclass="ttdoc">removes all elements from the database. </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8cpp_source.html#l01204">IndexIVFPQ.cpp:1204</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQ_html_a981c2748bfbd9b018494f119279a0342"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQ.html#a981c2748bfbd9b018494f119279a0342">faiss::IndexIVFPQ::add_with_ids</a></div><divclass="ttdeci">void add_with_ids(idx_t n, const float *x, const long *xids=nullptr) override</div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8cpp_source.html#l00185">IndexIVFPQ.cpp:185</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVF_html_af16d325f5bef22b2e5f90ceea796e80d"><divclass="ttname"><ahref="structfaiss_1_1IndexIVF.html#af16d325f5bef22b2e5f90ceea796e80d">faiss::IndexIVF::ids</a></div><divclass="ttdeci">std::vector< std::vector< long >> ids</div><divclass="ttdoc">Inverted lists for indexes. </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVF_8h_source.html#l00055">IndexIVF.h:55</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVF_html_a4b40cc7a70dff41196a3b8769586667a"><divclass="ttname"><ahref="structfaiss_1_1IndexIVF.html#a4b40cc7a70dff41196a3b8769586667a">faiss::IndexIVF::quantizer</a></div><divclass="ttdeci">Index * quantizer</div><divclass="ttdoc">quantizer that maps vectors to inverted lists </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVF_8h_source.html#l00049">IndexIVF.h:49</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQ_html_a77501995b3671e377102d2db1a93ade4"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQ.html#a77501995b3671e377102d2db1a93ade4">faiss::IndexIVFPQ::max_codes</a></div><divclass="ttdeci">size_t max_codes</div><divclass="ttdoc">max nb of codes to visit to do a query </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8h_source.html#l00040">IndexIVFPQ.h:40</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQCompact_html_ab2698c5d65644a171c53ffe39e420b70"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQCompact.html#ab2698c5d65644a171c53ffe39e420b70">faiss::IndexIVFPQCompact::Alloc_type_t</a></div><divclass="ttdeci">Alloc_type_t</div><divclass="ttdoc">how were the compact tables allocated? </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8h_source.html#l00247">IndexIVFPQ.h:247</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQ_html_a1ae6cdd996bbd398fa4e87646c8f3ba6"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQ.html#a1ae6cdd996bbd398fa4e87646c8f3ba6">faiss::IndexIVFPQ::encode_multiple</a></div><divclass="ttdeci">void encode_multiple(size_t n, long *keys, const float *x, uint8_t *codes, bool compute_keys=false) const </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8cpp_source.html#l00149">IndexIVFPQ.cpp:149</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQCompact_html_a0ef8132fae22a50616fe1201c8b20588"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQCompact.html#a0ef8132fae22a50616fe1201c8b20588">faiss::IndexIVFPQCompact::train</a></div><divclass="ttdeci">void train(idx_t, const float *) override</div><divclass="ttdoc">Trains the quantizer and calls train_residual to train sub-quantizers. </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8cpp_source.html#l01463">IndexIVFPQ.cpp:1463</a></div></div>
<divclass="ttc"id="structfaiss_1_1Index_html_a040c6aed1f224f3ea7bf58eebc0c31a4"><divclass="ttname"><ahref="structfaiss_1_1Index.html#a040c6aed1f224f3ea7bf58eebc0c31a4">faiss::Index::idx_t</a></div><divclass="ttdeci">long idx_t</div><divclass="ttdoc">all indices are this type </div><divclass="ttdef"><b>Definition:</b><ahref="Index_8h_source.html#l00062">Index.h:62</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQ_html_acd807799dc56dcef0f221847a2af86f7"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQ.html#acd807799dc56dcef0f221847a2af86f7">faiss::IndexIVFPQ::reset</a></div><divclass="ttdeci">void reset() override</div><divclass="ttdoc">removes all elements from the database. </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8cpp_source.html#l01083">IndexIVFPQ.cpp:1083</a></div></div>
<divclass="ttc"id="structfaiss_1_1PolysemousTraining_html"><divclass="ttname"><ahref="structfaiss_1_1PolysemousTraining.html">faiss::PolysemousTraining</a></div><divclass="ttdoc">optimizes the order of indices in a ProductQuantizer </div><divclass="ttdef"><b>Definition:</b><ahref="PolysemousTraining_8h_source.html#l00125">PolysemousTraining.h:125</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQR_html_af6c7ee3bc917cc5d4ab04ff64269ee06"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQR.html#af6c7ee3bc917cc5d4ab04ff64269ee06">faiss::IndexIVFPQR::merge_from_residuals</a></div><divclass="ttdeci">void merge_from_residuals(IndexIVF &other) override</div><divclass="ttdoc">used to implement merging </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8cpp_source.html#l01362">IndexIVFPQ.cpp:1362</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQ_html_afd13b471df293ae5a6e895704c69a4c3"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQ.html#afd13b471df293ae5a6e895704c69a4c3">faiss::IndexIVFPQ::by_residual</a></div><divclass="ttdeci">bool by_residual</div><divclass="ttdoc">Encode residual or plain vector? </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8h_source.html#l00030">IndexIVFPQ.h:30</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQCompact_html_ab2698c5d65644a171c53ffe39e420b70a3d58d7b26146791f0fe34b35a9b0fd95"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQCompact.html#ab2698c5d65644a171c53ffe39e420b70a3d58d7b26146791f0fe34b35a9b0fd95">faiss::IndexIVFPQCompact::Alloc_type_none</a></div><divclass="ttdoc">alloc from outside </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8h_source.html#l00248">IndexIVFPQ.h:248</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQ_html_a007303be116c8da65b6d058e3fc77d16"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQ.html#a007303be116c8da65b6d058e3fc77d16">faiss::IndexIVFPQ::pq</a></div><divclass="ttdeci">ProductQuantizer pq</div><divclass="ttdoc">produces the codes </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8h_source.html#l00033">IndexIVFPQ.h:33</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVF_html_ab38fde4c923abefc4185eb7450b5b95b"><divclass="ttname"><ahref="structfaiss_1_1IndexIVF.html#ab38fde4c923abefc4185eb7450b5b95b">faiss::IndexIVF::nlist</a></div><divclass="ttdeci">size_t nlist</div><divclass="ttdoc">number of possible key values </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVF_8h_source.html#l00046">IndexIVF.h:46</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQ_html_ac0cb8421b9885d691696d2ff4f76894b"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQ.html#ac0cb8421b9885d691696d2ff4f76894b">faiss::IndexIVFPQ::add_core_o</a></div><divclass="ttdeci">void add_core_o(idx_t n, const float *x, const long *xids, float *residuals_2, const long *precomputed_idx=nullptr)</div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8cpp_source.html#l00191">IndexIVFPQ.cpp:191</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQ_html_a31c6fb2faa4dadea4c0594338be7be90"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQ.html#a31c6fb2faa4dadea4c0594338be7be90">faiss::IndexIVFPQ::code_size</a></div><divclass="ttdeci">size_t code_size</div><divclass="ttdoc">code size per vector in bytes </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8h_source.html#l00032">IndexIVFPQ.h:32</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQCompact_html_a8f5eccfb4d5e4098ff6c00acb3bc40a1"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQCompact.html#a8f5eccfb4d5e4098ff6c00acb3bc40a1">faiss::IndexIVFPQCompact::reset</a></div><divclass="ttdeci">void reset() override</div><divclass="ttdoc">removes all elements from the database. </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8cpp_source.html#l01459">IndexIVFPQ.cpp:1459</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQCompact_html_ab2698c5d65644a171c53ffe39e420b70acf2d6ba8878a2778383adc32593ba8e6"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQCompact.html#ab2698c5d65644a171c53ffe39e420b70acf2d6ba8878a2778383adc32593ba8e6">faiss::IndexIVFPQCompact::Alloc_type_new</a></div><divclass="ttdoc">was allocated with new </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8h_source.html#l00249">IndexIVFPQ.h:249</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQR_html_a4b6154a5194d574d037ba78c137a2fa5"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQR.html#a4b6154a5194d574d037ba78c137a2fa5">faiss::IndexIVFPQR::add_with_ids</a></div><divclass="ttdeci">void add_with_ids(idx_t n, const float *x, const long *xids) override</div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8cpp_source.html#l01233">IndexIVFPQ.cpp:1233</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexIVFPQR_html_a0b02a4151ceacc070352f8b15cc0ee0b"><divclass="ttname"><ahref="structfaiss_1_1IndexIVFPQR.html#a0b02a4151ceacc070352f8b15cc0ee0b">faiss::IndexIVFPQR::k_factor</a></div><divclass="ttdeci">float k_factor</div><divclass="ttdoc">factor between k requested in search and the k requested from the IVFPQ </div><divclass="ttdef"><b>Definition:</b><ahref="IndexIVFPQ_8h_source.html#l00203">IndexIVFPQ.h:203</a></div></div>