<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="l00012"></a><spanclass="lineno"> 12</span> <spanclass="comment">// Auxiliary index structures, that are used in indexes but that can</span></div>
<divclass="line"><aname="l00013"></a><spanclass="lineno"> 13</span> <spanclass="comment">// be forward-declared</span></div>
<divclass="line"><aname="l00031"></a><spanclass="lineno"> 31</span> <spanclass="comment">/** The objective is to have a simple result structure while</span></div>
<divclass="line"><aname="l00032"></a><spanclass="lineno"> 32</span> <spanclass="comment"> * minimizing the number of mem copies in the result. The method</span></div>
<divclass="line"><aname="l00033"></a><spanclass="lineno"> 33</span> <spanclass="comment"> * do_allocation can be overloaded to allocate the result tables in</span></div>
<divclass="line"><aname="l00034"></a><spanclass="lineno"> 34</span> <spanclass="comment"> * the matrix type of a srcipting language like Lua or Python. */</span></div>
<divclass="line"><aname="l00036"></a><spanclass="lineno"><aclass="line"href="structfaiss_1_1RangeSearchResult.html#a29269b98c33af874d379ca4f62408b90"> 36</a></span> <spanclass="keywordtype">size_t</span><aclass="code"href="structfaiss_1_1RangeSearchResult.html#a29269b98c33af874d379ca4f62408b90">nq</a>; <spanclass="comment">///< nb of queries</span></div>
<divclass="line"><aname="l00041"></a><spanclass="lineno"><aclass="line"href="structfaiss_1_1RangeSearchResult.html#aa8ff848474a4cc16c5464cc4ec187824"> 41</a></span>  idx_t *<aclass="code"href="structfaiss_1_1RangeSearchResult.html#aa8ff848474a4cc16c5464cc4ec187824">labels</a>; <spanclass="comment">///< result for query i is labels[lims[i]:lims[i+1]]</span></div>
<divclass="line"><aname="l00044"></a><spanclass="lineno"><aclass="line"href="structfaiss_1_1RangeSearchResult.html#a39342ad2e9ad8b90f6e95dafd3287f49"> 44</a></span> <spanclass="keywordtype">size_t</span><aclass="code"href="structfaiss_1_1RangeSearchResult.html#a39342ad2e9ad8b90f6e95dafd3287f49">buffer_size</a>; <spanclass="comment">///< size of the result buffers used</span></div>
<divclass="line"><aname="l00046"></a><spanclass="lineno"> 46</span> <spanclass="comment"> /// lims must be allocated on input to range_search.</span></div>
<divclass="line"><aname="l00049"></a><spanclass="lineno"> 49</span> <spanclass="comment"> /// called when lims contains the nb of elements result entries</span></div>
<divclass="line"><aname="l00050"></a><spanclass="lineno"> 50</span> <spanclass="comment"> /// for each query</span></div>
<divclass="line"><aname="l00077"></a><spanclass="lineno"> 77</span> <spanclass="comment">/** Remove ids from a set. Repetitions of ids in the indices set</span></div>
<divclass="line"><aname="l00078"></a><spanclass="lineno"> 78</span> <spanclass="comment"> * passed to the constructor does not hurt performance. The hash</span></div>
<divclass="line"><aname="l00079"></a><spanclass="lineno"> 79</span> <spanclass="comment"> * function used for the bloom filter and GCC's implementation of</span></div>
<divclass="line"><aname="l00080"></a><spanclass="lineno"> 80</span> <spanclass="comment"> * unordered_set are just the least significant bits of the id. This</span></div>
<divclass="line"><aname="l00081"></a><spanclass="lineno"> 81</span> <spanclass="comment"> * works fine for random ids or ids in sequences but will produce many</span></div>
<divclass="line"><aname="l00082"></a><spanclass="lineno"> 82</span> <spanclass="comment"> * hash collisions if lsb's are always the same */</span></div>
<divclass="line"><aname="l00092"></a><spanclass="lineno"> 92</span>  std::vector<uint8_t> bloom; <spanclass="comment">// assumes low bits of id are a good hash value</span></div>
<divclass="line"><aname="l00103"></a><spanclass="lineno"> 103</span> <spanclass="comment">// Below are structures used only by Index implementations</span></div>
<divclass="line"><aname="l00107"></a><spanclass="lineno"> 107</span> <spanclass="comment">/** List of temporary buffers used to store results before they are</span></div>
<divclass="line"><aname="l00108"></a><spanclass="lineno"> 108</span> <spanclass="comment"> * copied to the RangeSearchResult object. */</span></div>
<divclass="line"><aname="l00121"></a><spanclass="lineno"><aclass="line"href="structfaiss_1_1BufferList.html#af4d7ddcd77f328a12a7da89d8febe5d9"> 121</a></span> <spanclass="keywordtype">size_t</span><aclass="code"href="structfaiss_1_1BufferList.html#af4d7ddcd77f328a12a7da89d8febe5d9">wp</a>; <spanclass="comment">///< write pointer in the last buffer.</span></div>
<divclass="line"><aname="l00132"></a><spanclass="lineno"> 132</span> <spanclass="keywordflow">if</span> (<aclass="code"href="structfaiss_1_1BufferList.html#af4d7ddcd77f328a12a7da89d8febe5d9">wp</a> == buffer_size) { <spanclass="comment">// need new buffer</span></div>
<divclass="line"><aname="l00141"></a><spanclass="lineno"> 141</span> <spanclass="comment"> /// copy elemnts ofs:ofs+n-1 seen as linear data in the buffers to</span></div>
<divclass="line"><aname="l00150"></a><spanclass="lineno"> 150</span> <spanclass="comment">/// the entries in the buffers are split per query</span></div>
<divclass="line"><aname="l00176"></a><spanclass="lineno"> 176</span> <spanclass="comment"> /// called by range_search before do_allocation</span></div>
<divclass="line"><aname="l00179"></a><spanclass="lineno"> 179</span> <spanclass="comment"> /// called by range_search after do_allocation</span></div>
<divclass="ttc"id="structfaiss_1_1RangeSearchResult_html_a29269b98c33af874d379ca4f62408b90"><divclass="ttname"><ahref="structfaiss_1_1RangeSearchResult.html#a29269b98c33af874d379ca4f62408b90">faiss::RangeSearchResult::nq</a></div><divclass="ttdeci">size_t nq</div><divclass="ttdoc">nb of queries </div><divclass="ttdef"><b>Definition:</b><ahref="AuxIndexStructures_8h_source.html#l00036">AuxIndexStructures.h:36</a></div></div>
<divclass="ttc"id="structfaiss_1_1RangeSearchPartialResult_1_1QueryResult_html"><divclass="ttname"><ahref="structfaiss_1_1RangeSearchPartialResult_1_1QueryResult.html">faiss::RangeSearchPartialResult::QueryResult</a></div><divclass="ttdoc">result structure for a single query </div><divclass="ttdef"><b>Definition:</b><ahref="AuxIndexStructures_8h_source.html#l00157">AuxIndexStructures.h:157</a></div></div>
<divclass="ttc"id="structfaiss_1_1BufferList_html_a78b70417a9ba5b27553b3134f1190958"><divclass="ttname"><ahref="structfaiss_1_1BufferList.html#a78b70417a9ba5b27553b3134f1190958">faiss::BufferList::copy_range</a></div><divclass="ttdeci">void copy_range(size_t ofs, size_t n, idx_t *dest_ids, float *dest_dis)</div><divclass="ttdef"><b>Definition:</b><ahref="AuxIndexStructures_8cpp_source.html#l00082">AuxIndexStructures.cpp:82</a></div></div>
<divclass="ttc"id="structfaiss_1_1RangeSearchPartialResult_html_aa6639358995ac081f8a931a7790d0caf"><divclass="ttname"><ahref="structfaiss_1_1RangeSearchPartialResult.html#aa6639358995ac081f8a931a7790d0caf">faiss::RangeSearchPartialResult::set_result</a></div><divclass="ttdeci">void set_result(bool incremental=false)</div><divclass="ttdoc">called by range_search after do_allocation </div><divclass="ttdef"><b>Definition:</b><ahref="AuxIndexStructures_8cpp_source.html#l00145">AuxIndexStructures.cpp:145</a></div></div>
<divclass="ttc"id="structfaiss_1_1RangeSearchPartialResult_html_ab6a385008493c7b630e4e7bc56e3da74"><divclass="ttname"><ahref="structfaiss_1_1RangeSearchPartialResult.html#ab6a385008493c7b630e4e7bc56e3da74">faiss::RangeSearchPartialResult::set_lims</a></div><divclass="ttdeci">void set_lims()</div><divclass="ttdoc">called by range_search before do_allocation </div><divclass="ttdef"><b>Definition:</b><ahref="AuxIndexStructures_8cpp_source.html#l00136">AuxIndexStructures.cpp:136</a></div></div>
<divclass="ttc"id="structfaiss_1_1BufferList_html_af4d7ddcd77f328a12a7da89d8febe5d9"><divclass="ttname"><ahref="structfaiss_1_1BufferList.html#af4d7ddcd77f328a12a7da89d8febe5d9">faiss::BufferList::wp</a></div><divclass="ttdeci">size_t wp</div><divclass="ttdoc">write pointer in the last buffer. </div><divclass="ttdef"><b>Definition:</b><ahref="AuxIndexStructures_8h_source.html#l00121">AuxIndexStructures.h:121</a></div></div>
<divclass="ttc"id="structfaiss_1_1RangeSearchResult_html_a46e9fa31c3e232249cef508f357d856c"><divclass="ttname"><ahref="structfaiss_1_1RangeSearchResult.html#a46e9fa31c3e232249cef508f357d856c">faiss::RangeSearchResult::RangeSearchResult</a></div><divclass="ttdeci">RangeSearchResult(size_t nq)</div><divclass="ttdoc">lims must be allocated on input to range_search. </div><divclass="ttdef"><b>Definition:</b><ahref="AuxIndexStructures_8cpp_source.html#l00024">AuxIndexStructures.cpp:24</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_1RangeSearchPartialResult_html_a954c26beebb561a6c2b0f399c48a9db3"><divclass="ttname"><ahref="structfaiss_1_1RangeSearchPartialResult.html#a954c26beebb561a6c2b0f399c48a9db3">faiss::RangeSearchPartialResult::new_result</a></div><divclass="ttdeci">QueryResult & new_result(idx_t qno)</div><divclass="ttdoc">begin a new result </div><divclass="ttdef"><b>Definition:</b><ahref="AuxIndexStructures_8cpp_source.html#l00114">AuxIndexStructures.cpp:114</a></div></div>
<divclass="ttc"id="structfaiss_1_1RangeSearchPartialResult_html"><divclass="ttname"><ahref="structfaiss_1_1RangeSearchPartialResult.html">faiss::RangeSearchPartialResult</a></div><divclass="ttdoc">the entries in the buffers are split per query </div><divclass="ttdef"><b>Definition:</b><ahref="AuxIndexStructures_8h_source.html#l00151">AuxIndexStructures.h:151</a></div></div>
<divclass="ttc"id="structfaiss_1_1RangeSearchResult_html_a39342ad2e9ad8b90f6e95dafd3287f49"><divclass="ttname"><ahref="structfaiss_1_1RangeSearchResult.html#a39342ad2e9ad8b90f6e95dafd3287f49">faiss::RangeSearchResult::buffer_size</a></div><divclass="ttdeci">size_t buffer_size</div><divclass="ttdoc">size of the result buffers used </div><divclass="ttdef"><b>Definition:</b><ahref="AuxIndexStructures_8h_source.html#l00044">AuxIndexStructures.h:44</a></div></div>
<divclass="ttc"id="structfaiss_1_1RangeSearchResult_html_aa8ff848474a4cc16c5464cc4ec187824"><divclass="ttname"><ahref="structfaiss_1_1RangeSearchResult.html#aa8ff848474a4cc16c5464cc4ec187824">faiss::RangeSearchResult::labels</a></div><divclass="ttdeci">idx_t * labels</div><divclass="ttdoc">result for query i is labels[lims[i]:lims[i+1]] </div><divclass="ttdef"><b>Definition:</b><ahref="AuxIndexStructures_8h_source.html#l00041">AuxIndexStructures.h:41</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hrclass="footer"/><addressclass="footer"><small>
Generated by  <ahref="http://www.doxygen.org/index.html">