<divclass="line"><aname="l00006"></a><spanclass="lineno"> 6</span> <spanclass="comment"> * This source code is licensed under the CC-by-NC license found in the</span></div>
<divclass="line"><aname="l00007"></a><spanclass="lineno"> 7</span> <spanclass="comment"> * LICENSE file in the root directory of this source tree.</span></div>
<divclass="line"><aname="l00010"></a><spanclass="lineno"> 10</span> <spanclass="comment">// Copyright 2004-present Facebook. All Rights Reserved.</span></div>
<divclass="line"><aname="l00011"></a><spanclass="lineno"> 11</span> <spanclass="comment">// -*- c++ -*-</span></div>
<divclass="line"><aname="l00027"></a><spanclass="lineno"> 27</span> <spanclass="comment">/** Index based on a product quantizer. Stored vectors are</span></div>
<divclass="line"><aname="l00028"></a><spanclass="lineno"> 28</span> <spanclass="comment"> * approximated by PQ codes. */</span></div>
<divclass="line"><aname="l00031"></a><spanclass="lineno"> 31</span> <spanclass="comment"> /// The product quantizer used to encode the vectors</span></div>
<divclass="line"><aname="l00039"></a><spanclass="lineno"> 39</span> <spanclass="comment"> * @param d dimensionality of the input vectors</span></div>
<divclass="line"><aname="l00040"></a><spanclass="lineno"> 40</span> <spanclass="comment"> * @param M number of subquantizers</span></div>
<divclass="line"><aname="l00041"></a><spanclass="lineno"> 41</span> <spanclass="comment"> * @param nbits number of bit per subvector index</span></div>
<divclass="line"><aname="l00043"></a><spanclass="lineno"> 43</span> <aclass="code"href="structfaiss_1_1IndexPQ.html">IndexPQ</a> (<spanclass="keywordtype">int</span><aclass="code"href="structfaiss_1_1Index.html#a2a002388d2c081c2dbab8508dcefe73d">d</a>, <spanclass="comment">///< dimensionality of the input vectors</span></div>
<divclass="line"><aname="l00044"></a><spanclass="lineno"> 44</span> <spanclass="comment"></span><spanclass="keywordtype">size_t</span> M, <spanclass="comment">///< number of subquantizers</span></div>
<divclass="line"><aname="l00045"></a><spanclass="lineno"> 45</span> <spanclass="comment"></span><spanclass="keywordtype">size_t</span> nbits, <spanclass="comment">///< number of bit per subvector index</span></div>
<divclass="line"><aname="l00073"></a><spanclass="lineno"> 73</span> <spanclass="comment"> /// parameters used for the polysemous training</span></div>
<divclass="line"><aname="l00076"></a><spanclass="lineno"> 76</span> <spanclass="comment"> /// how to perform the search in search_core</span></div>
<divclass="line"><aname="l00079"></a><spanclass="lineno"><aclass="line"href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fea903849f87cca2e7fbbfe034edbb81718"> 79</a></span> <spanclass="comment"></span><aclass="code"href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fea903849f87cca2e7fbbfe034edbb81718">ST_HE</a>, <spanclass="comment">///< Hamming distance on codes</span></div>
<divclass="line"><aname="l00080"></a><spanclass="lineno"><aclass="line"href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fea237afca36629dae511c0ac56effbfaa6"> 80</a></span> <spanclass="comment"></span><aclass="code"href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fea237afca36629dae511c0ac56effbfaa6">ST_generalized_HE</a>, <spanclass="comment">///< nb of same codes</span></div>
<divclass="line"><aname="l00088"></a><spanclass="lineno"> 88</span> <spanclass="comment">// just encode the sign of the components, instead of using the PQ encoder</span></div>
<divclass="line"><aname="l00089"></a><spanclass="lineno"> 89</span> <spanclass="comment">// used only for the queries</span></div>
<divclass="line"><aname="l00099"></a><spanclass="lineno"> 99</span> <spanclass="comment"> /// prepare query for a polysemous search, but instead of</span></div>
<divclass="line"><aname="l00100"></a><spanclass="lineno"> 100</span> <spanclass="comment"> /// computing the result, just get the histogram of Hamming</span></div>
<divclass="line"><aname="l00101"></a><spanclass="lineno"> 101</span> <spanclass="comment"> /// distances. May be computed on a provided dataset if xb != NULL</span></div>
<divclass="line"><aname="l00107"></a><spanclass="lineno"> 107</span> <spanclass="comment"> /** compute pairwise distances between queries and database</span></div>
<divclass="line"><aname="l00119"></a><spanclass="lineno"> 119</span> <spanclass="comment">/// statistics are robust to internal threading, but not if</span></div>
<divclass="line"><aname="l00120"></a><spanclass="lineno"> 120</span> <spanclass="comment">/// IndexPQ::search is called by multiple threads</span></div>
<divclass="line"><aname="l00122"></a><spanclass="lineno"> 122</span> <spanclass="keywordtype">size_t</span> nq; <spanclass="comment">// nb of queries run</span></div>
<divclass="line"><aname="l00123"></a><spanclass="lineno"> 123</span> <spanclass="keywordtype">size_t</span> ncode; <spanclass="comment">// nb of codes visited</span></div>
<divclass="line"><aname="l00135"></a><spanclass="lineno"> 135</span> <spanclass="comment">/** Quantizer where centroids are virtual: they are the Cartesian</span></div>
<divclass="line"><aname="l00136"></a><spanclass="lineno"> 136</span> <spanclass="comment"> * product of sub-centroids. */</span></div>
<divclass="line"><aname="l00140"></a><spanclass="lineno"> 140</span> <aclass="code"href="structfaiss_1_1MultiIndexQuantizer.html">MultiIndexQuantizer</a> (<spanclass="keywordtype">int</span><aclass="code"href="structfaiss_1_1Index.html#a2a002388d2c081c2dbab8508dcefe73d">d</a>, <spanclass="comment">///< dimension of the input vectors</span></div>
<divclass="line"><aname="l00141"></a><spanclass="lineno"> 141</span> <spanclass="comment"></span><spanclass="keywordtype">size_t</span> M, <spanclass="comment">///< number of subquantizers</span></div>
<divclass="line"><aname="l00142"></a><spanclass="lineno"> 142</span> <spanclass="comment"></span><spanclass="keywordtype">size_t</span> nbits); <spanclass="comment">///< number of bit per subvector index</span></div>
<divclass="ttc"id="structfaiss_1_1IndexPQ_html_a4fa05430935a02b62b7c15c9840c42fea903849f87cca2e7fbbfe034edbb81718"><divclass="ttname"><ahref="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fea903849f87cca2e7fbbfe034edbb81718">faiss::IndexPQ::ST_HE</a></div><divclass="ttdoc">Hamming distance on codes. </div><divclass="ttdef"><b>Definition:</b><ahref="IndexPQ_8h_source.html#l00079">IndexPQ.h:79</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexPQ_html_af616e1f3c7bff7f62c2607b8079da43f"><divclass="ttname"><ahref="structfaiss_1_1IndexPQ.html#af616e1f3c7bff7f62c2607b8079da43f">faiss::IndexPQ::do_polysemous_training</a></div><divclass="ttdeci">bool do_polysemous_training</div><divclass="ttdoc">false = standard PQ </div><divclass="ttdef"><b>Definition:</b><ahref="IndexPQ_8h_source.html#l00071">IndexPQ.h:71</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexPQ_html_a87898add5ab4d86ba901ca79778fc11e"><divclass="ttname"><ahref="structfaiss_1_1IndexPQ.html#a87898add5ab4d86ba901ca79778fc11e">faiss::IndexPQ::train</a></div><divclass="ttdeci">virtual void train(idx_t n, const float *x) override</div><divclass="ttdef"><b>Definition:</b><ahref="IndexPQ_8cpp_source.html#l00064">IndexPQ.cpp:64</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexPQ_html_ada06f5db85c91a4c140119a5897c6064"><divclass="ttname"><ahref="structfaiss_1_1IndexPQ.html#ada06f5db85c91a4c140119a5897c6064">faiss::IndexPQ::hamming_distance_histogram</a></div><divclass="ttdeci">void hamming_distance_histogram(idx_t n, const float *x, idx_t nb, const float *xb, long *dist_histogram)</div><divclass="ttdef"><b>Definition:</b><ahref="IndexPQ_8cpp_source.html#l00394">IndexPQ.cpp:394</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexPQ_html_a4fa05430935a02b62b7c15c9840c42fe"><divclass="ttname"><ahref="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fe">faiss::IndexPQ::Search_type_t</a></div><divclass="ttdeci">Search_type_t</div><divclass="ttdoc">how to perform the search in search_core </div><divclass="ttdef"><b>Definition:</b><ahref="IndexPQ_8h_source.html#l00077">IndexPQ.h:77</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexPQ_html_a4fa05430935a02b62b7c15c9840c42feaef79af61798670a362434b7bc9ced45e"><divclass="ttname"><ahref="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42feaef79af61798670a362434b7bc9ced45e">faiss::IndexPQ::ST_polysemous_generalize</a></div><divclass="ttdoc">Filter on generalized Hamming. </div><divclass="ttdef"><b>Definition:</b><ahref="IndexPQ_8h_source.html#l00083">IndexPQ.h:83</a></div></div>
<divclass="ttc"id="structfaiss_1_1MultiIndexQuantizer_html_a129efcd48371cbae124dee03b26a3176"><divclass="ttname"><ahref="structfaiss_1_1MultiIndexQuantizer.html#a129efcd48371cbae124dee03b26a3176">faiss::MultiIndexQuantizer::reset</a></div><divclass="ttdeci">virtual void reset()</div><divclass="ttdoc">removes all elements from the database. </div><divclass="ttdef"><b>Definition:</b><ahref="IndexPQ_8cpp_source.html#l00877">IndexPQ.cpp:877</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#l00064">Index.h:64</a></div></div>
<divclass="ttc"id="structfaiss_1_1MultiIndexQuantizer_html_ac7943184d37e953cb0c1ab589202afa8"><divclass="ttname"><ahref="structfaiss_1_1MultiIndexQuantizer.html#ac7943184d37e953cb0c1ab589202afa8">faiss::MultiIndexQuantizer::train</a></div><divclass="ttdeci">virtual void train(idx_t n, const float *x)</div><divclass="ttdef"><b>Definition:</b><ahref="IndexPQ_8cpp_source.html#l00814">IndexPQ.cpp:814</a></div></div>
<divclass="ttc"id="structfaiss_1_1MultiIndexQuantizer_html_ad2d45625186b2daf6044f9266e6c1b93"><divclass="ttname"><ahref="structfaiss_1_1MultiIndexQuantizer.html#ad2d45625186b2daf6044f9266e6c1b93">faiss::MultiIndexQuantizer::add</a></div><divclass="ttdeci">virtual void add(idx_t n, const float *x)</div><divclass="ttdoc">add and reset will crash at runtime </div><divclass="ttdef"><b>Definition:</b><ahref="IndexPQ_8cpp_source.html#l00872">IndexPQ.cpp:872</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexPQ_html_aa7b7cfe0c8dfd37c8a940fd93d12dc88"><divclass="ttname"><ahref="structfaiss_1_1IndexPQ.html#aa7b7cfe0c8dfd37c8a940fd93d12dc88">faiss::IndexPQ::pq</a></div><divclass="ttdeci">ProductQuantizer pq</div><divclass="ttdoc">The product quantizer used to encode the vectors. </div><divclass="ttdef"><b>Definition:</b><ahref="IndexPQ_8h_source.html#l00032">IndexPQ.h:32</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexPQ_html_ac72c9b93f8fe7e5ec27fbe26bb38a7bf"><divclass="ttname"><ahref="structfaiss_1_1IndexPQ.html#ac72c9b93f8fe7e5ec27fbe26bb38a7bf">faiss::IndexPQ::add</a></div><divclass="ttdeci">virtual void add(idx_t n, const float *x) override</div><divclass="ttdef"><b>Definition:</b><ahref="IndexPQ_8cpp_source.html#l00088">IndexPQ.cpp:88</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexPQ_html_a4fa05430935a02b62b7c15c9840c42fea237afca36629dae511c0ac56effbfaa6"><divclass="ttname"><ahref="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fea237afca36629dae511c0ac56effbfaa6">faiss::IndexPQ::ST_generalized_HE</a></div><divclass="ttdoc">nb of same codes </div><divclass="ttdef"><b>Definition:</b><ahref="IndexPQ_8h_source.html#l00080">IndexPQ.h:80</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#l00127">PolysemousTraining.h:127</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexPQ_html_aa131767383619bb5848b131502ada9cf"><divclass="ttname"><ahref="structfaiss_1_1IndexPQ.html#aa131767383619bb5848b131502ada9cf">faiss::IndexPQ::hamming_distance_table</a></div><divclass="ttdeci">void hamming_distance_table(idx_t n, const float *x, int32_t *dis) const </div><divclass="ttdef"><b>Definition:</b><ahref="IndexPQ_8cpp_source.html#l00381">IndexPQ.cpp:381</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexPQ_html_a25e17da885cf55d84b176b46f3ad25b1"><divclass="ttname"><ahref="structfaiss_1_1IndexPQ.html#a25e17da885cf55d84b176b46f3ad25b1">faiss::IndexPQ::reset</a></div><divclass="ttdeci">virtual void reset() override</div><divclass="ttdoc">removes all elements from the database. </div><divclass="ttdef"><b>Definition:</b><ahref="IndexPQ_8cpp_source.html#l00098">IndexPQ.cpp:98</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexPQ_html_aff455f2adff6064939494dad6e3017bc"><divclass="ttname"><ahref="structfaiss_1_1IndexPQ.html#aff455f2adff6064939494dad6e3017bc">faiss::IndexPQ::polysemous_ht</a></div><divclass="ttdeci">int polysemous_ht</div><divclass="ttdoc">Hamming threshold used for polysemy. </div><divclass="ttdef"><b>Definition:</b><ahref="IndexPQ_8h_source.html#l00093">IndexPQ.h:93</a></div></div>
<divclass="ttc"id="structfaiss_1_1IndexPQ_html_a820cec27d1ef14bf59fb288b2e143b6a"><divclass="ttname"><ahref="structfaiss_1_1IndexPQ.html#a820cec27d1ef14bf59fb288b2e143b6a">faiss::IndexPQ::polysemous_training</a></div><divclass="ttdeci">PolysemousTraining polysemous_training</div><divclass="ttdoc">parameters used for the polysemous training </div><divclass="ttdef"><b>Definition:</b><ahref="IndexPQ_8h_source.html#l00074">IndexPQ.h:74</a></div></div>
<divclass="ttc"id="namespacefaiss_html_afd12191c638da74760ff397cf319752c"><divclass="ttname"><ahref="namespacefaiss.html#afd12191c638da74760ff397cf319752c">faiss::MetricType</a></div><divclass="ttdeci">MetricType</div><divclass="ttdoc">Some algorithms support both an inner product vetsion and a L2 search version. </div><divclass="ttdef"><b>Definition:</b><ahref="Index_8h_source.html#l00044">Index.h:44</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hrclass="footer"/><addressclass="footer"><small>
Generated by  <ahref="http://www.doxygen.org/index.html">