small_gicp/doc_cpp/kdtree_8hpp_source.html

387 lines
78 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>small_gicp: /home/runner/work/small_gicp/small_gicp/include/small_gicp/ann/kdtree.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">small_gicp
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_8f93768a68ffc2367e7100c40b4e616a.html">small_gicp</a></li><li class="navelem"><a class="el" href="dir_c59a592f06e82849d331f7a80f9235b4.html">ann</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">kdtree.hpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="kdtree_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Kenji Koide</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160; </div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">// While the following KdTree code is written from scratch, it is heavily inspired by the nanoflann library.</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment">// Thus, the following original license of nanoflann is included to be sure.</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160; </div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment">// https://github.com/jlblancoc/nanoflann/blob/master/include/nanoflann.hpp</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment">/***********************************************************************</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * Software License Agreement (BSD License)</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved.</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> * Copyright 2011-2024 Jose Luis Blanco (joseluisblancoc@gmail.com).</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * All rights reserved.</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * THE BSD LICENSE</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * Redistribution and use in source and binary forms, with or without</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> * modification, are permitted provided that the following conditions</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="comment"> * are met:</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="comment"> * 1. Redistributions of source code must retain the above copyright</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="comment"> * notice, this list of conditions and the following disclaimer.</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="comment"> * notice, this list of conditions and the following disclaimer in the</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="comment"> * documentation and/or other materials provided with the distribution.</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS&#39;&#39; AND ANY EXPRESS OR</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="comment"> * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="comment"> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="comment"> * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="comment"> * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="comment"> * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="comment"> * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="comment"> * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="comment"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="comment"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="comment"> *************************************************************************/</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; </div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;<span class="preprocessor">#include &lt;numeric&gt;</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;<span class="preprocessor">#include &lt;Eigen/Core&gt;</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; </div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="points_2traits_8hpp.html">small_gicp/points/traits.hpp</a>&gt;</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="ann_2traits_8hpp.html">small_gicp/ann/traits.hpp</a>&gt;</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="projection_8hpp.html">small_gicp/ann/projection.hpp</a>&gt;</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="knn__result_8hpp.html">small_gicp/ann/knn_result.hpp</a>&gt;</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacesmall__gicp.html">small_gicp</a> {</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; </div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="namespacesmall__gicp.html#a0fcc071f1f9cc9ea2f79068231c9053a"> 52</a></span>&#160;<span class="keyword">using</span> <a class="code" href="namespacesmall__gicp.html#a0fcc071f1f9cc9ea2f79068231c9053a">NodeIndexType</a> = std::uint32_t;</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="keyword">static</span> constexpr <a class="code" href="namespacesmall__gicp.html#a0fcc071f1f9cc9ea2f79068231c9053a">NodeIndexType</a> INVALID_NODE = std::numeric_limits&lt;NodeIndexType&gt;::max();</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; </div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> Projection&gt;</div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTreeNode.html"> 57</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structsmall__gicp_1_1KdTreeNode.html">KdTreeNode</a> {</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="keyword">union </span>{</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <span class="keyword">struct </span>Leaf {</div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTreeNode.html#a1b119b280b37622c41556e08a2b70819"> 60</a></span>&#160; <a class="code" href="namespacesmall__gicp.html#a0fcc071f1f9cc9ea2f79068231c9053a">NodeIndexType</a> <a class="code" href="structsmall__gicp_1_1KdTreeNode.html#a1b119b280b37622c41556e08a2b70819">first</a>; </div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTreeNode.html#a2da8a154a6c9d8dfd8fd3a2c9018e0aa"> 61</a></span>&#160; <a class="code" href="namespacesmall__gicp.html#a0fcc071f1f9cc9ea2f79068231c9053a">NodeIndexType</a> <a class="code" href="structsmall__gicp_1_1KdTreeNode.html#a2da8a154a6c9d8dfd8fd3a2c9018e0aa">last</a>; </div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTreeNode.html#a517c4c1a0d669f3c55b419b35467df50"> 62</a></span>&#160; } <a class="code" href="structsmall__gicp_1_1KdTreeNode.html#a517c4c1a0d669f3c55b419b35467df50">lr</a>; </div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="keyword">struct </span>NonLeaf {</div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTreeNode.html#a18168bb6ff0823c8b5addedee27af2ee"> 64</a></span>&#160; Projection <a class="code" href="structsmall__gicp_1_1KdTreeNode.html#a18168bb6ff0823c8b5addedee27af2ee">proj</a>; </div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTreeNode.html#a46849548df9b4fc38a92a139aebfd39b"> 65</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="structsmall__gicp_1_1KdTreeNode.html#a46849548df9b4fc38a92a139aebfd39b">thresh</a>; </div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTreeNode.html#aa429c4179b30e6f7c04cead1aea5574f"> 66</a></span>&#160; } <a class="code" href="structsmall__gicp_1_1KdTreeNode.html#aa429c4179b30e6f7c04cead1aea5574f">sub</a>; </div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTreeNode.html#a070e6c621ed3ca89e37bc5a3058de863"> 67</a></span>&#160; } <a class="code" href="structsmall__gicp_1_1KdTreeNode.html#a070e6c621ed3ca89e37bc5a3058de863">node_type</a>;</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; </div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTreeNode.html#a5f766ec7f97bc468ac82b5fea9a6a91d"> 69</a></span>&#160; <a class="code" href="namespacesmall__gicp.html#a0fcc071f1f9cc9ea2f79068231c9053a">NodeIndexType</a> <a class="code" href="structsmall__gicp_1_1KdTreeNode.html#a5f766ec7f97bc468ac82b5fea9a6a91d">left</a> = INVALID_NODE; </div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTreeNode.html#a167d1620e39459334605991ef10ae53b"> 70</a></span>&#160; <a class="code" href="namespacesmall__gicp.html#a0fcc071f1f9cc9ea2f79068231c9053a">NodeIndexType</a> <a class="code" href="structsmall__gicp_1_1KdTreeNode.html#a167d1620e39459334605991ef10ae53b">right</a> = INVALID_NODE; </div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;};</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; </div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTreeBuilder.html"> 74</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structsmall__gicp_1_1KdTreeBuilder.html">KdTreeBuilder</a> {</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> KdTree, <span class="keyword">typename</span> Po<span class="keywordtype">int</span>Cloud&gt;</div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTreeBuilder.html#aebbc718d567041dbb1513d09d0a428d6"> 80</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="structsmall__gicp_1_1KdTreeBuilder.html#aebbc718d567041dbb1513d09d0a428d6">build_tree</a>(<a class="code" href="structsmall__gicp_1_1KdTree.html">KdTree</a>&amp; kdtree, <span class="keyword">const</span> <a class="code" href="structsmall__gicp_1_1PointCloud.html">PointCloud</a>&amp; points)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; kdtree.indices.resize(<a class="code" href="namespacesmall__gicp_1_1traits.html#a3c4ae38ff52330d6e624f4971c291fac">traits::size</a>(points));</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; std::iota(kdtree.indices.begin(), kdtree.indices.end(), 0);</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; </div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordtype">size_t</span> node_count = 0;</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; kdtree.nodes.resize(<a class="code" href="namespacesmall__gicp_1_1traits.html#a3c4ae38ff52330d6e624f4971c291fac">traits::size</a>(points));</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; kdtree.root = <a class="code" href="structsmall__gicp_1_1KdTreeBuilder.html#a1369e1961ff0ff4076c2806ffc38e259">create_node</a>(kdtree, node_count, points, kdtree.indices.begin(), kdtree.indices.begin(), kdtree.indices.end());</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; kdtree.nodes.resize(node_count);</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; }</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; </div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Po<span class="keywordtype">int</span>Cloud, <span class="keyword">typename</span> KdTree, <span class="keyword">typename</span> IndexConstIterator&gt;</div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTreeBuilder.html#a1369e1961ff0ff4076c2806ffc38e259"> 96</a></span>&#160; <a class="code" href="namespacesmall__gicp.html#a0fcc071f1f9cc9ea2f79068231c9053a">NodeIndexType</a> <a class="code" href="structsmall__gicp_1_1KdTreeBuilder.html#a1369e1961ff0ff4076c2806ffc38e259">create_node</a>(<a class="code" href="structsmall__gicp_1_1KdTree.html">KdTree</a>&amp; kdtree, <span class="keywordtype">size_t</span>&amp; node_count, <span class="keyword">const</span> <a class="code" href="structsmall__gicp_1_1PointCloud.html">PointCloud</a>&amp; points, IndexConstIterator global_first, IndexConstIterator first, IndexConstIterator last)<span class="keyword"></span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="keyword">const</span> <span class="keywordtype">size_t</span> N = std::distance(first, last);</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keyword">const</span> <a class="code" href="namespacesmall__gicp.html#a0fcc071f1f9cc9ea2f79068231c9053a">NodeIndexType</a> node_index = node_count++;</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="keyword">auto</span>&amp; node = kdtree.nodes[node_index];</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="comment">// Create a leaf node.</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="keywordflow">if</span> (N &lt;= <a class="code" href="structsmall__gicp_1_1KdTreeBuilder.html#a410ed2297af81a6332f1d9afd70eb720">max_leaf_size</a>) {</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="comment">// std::sort(first, last);</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; node.node_type.lr.first = std::distance(global_first, first);</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; node.node_type.lr.last = std::distance(global_first, last);</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; </div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="keywordflow">return</span> node_index;</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; }</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; </div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="comment">// Find the best axis to split the input points.</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="keyword">using</span> Projection = <span class="keyword">typename</span> KdTree::Projection;</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keyword">const</span> <span class="keyword">auto</span> proj = Projection::find_axis(points, first, last, <a class="code" href="structsmall__gicp_1_1KdTreeBuilder.html#a7d526354a34af25810dccb551e60c700">projection_setting</a>);</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="keyword">const</span> <span class="keyword">auto</span> median_itr = first + N / 2;</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; std::nth_element(first, median_itr, last, [&amp;](<span class="keywordtype">size_t</span> i, <span class="keywordtype">size_t</span> j) { <span class="keywordflow">return</span> proj(<a class="code" href="namespacesmall__gicp_1_1traits.html#a66b660d3a0c2e81cdf06abc8efebdad1">traits::point</a>(points, i)) &lt; proj(<a class="code" href="namespacesmall__gicp_1_1traits.html#a66b660d3a0c2e81cdf06abc8efebdad1">traits::point</a>(points, j)); });</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; </div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="comment">// Create a non-leaf node.</span></div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; node.node_type.sub.proj = proj;</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; node.node_type.sub.thresh = proj(<a class="code" href="namespacesmall__gicp_1_1traits.html#a66b660d3a0c2e81cdf06abc8efebdad1">traits::point</a>(points, *median_itr));</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; </div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <span class="comment">// Create left and right child nodes.</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; node.left = <a class="code" href="structsmall__gicp_1_1KdTreeBuilder.html#a1369e1961ff0ff4076c2806ffc38e259">create_node</a>(kdtree, node_count, points, global_first, first, median_itr);</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; node.right = <a class="code" href="structsmall__gicp_1_1KdTreeBuilder.html#a1369e1961ff0ff4076c2806ffc38e259">create_node</a>(kdtree, node_count, points, global_first, median_itr, last);</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; </div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <span class="keywordflow">return</span> node_index;</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; }</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; </div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00129"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTreeBuilder.html#a410ed2297af81a6332f1d9afd70eb720"> 129</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="structsmall__gicp_1_1KdTreeBuilder.html#a410ed2297af81a6332f1d9afd70eb720">max_leaf_size</a> = 20; </div>
<div class="line"><a name="l00130"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTreeBuilder.html#a7d526354a34af25810dccb551e60c700"> 130</a></span>&#160; <a class="code" href="structsmall__gicp_1_1ProjectionSetting.html">ProjectionSetting</a> <a class="code" href="structsmall__gicp_1_1KdTreeBuilder.html#a7d526354a34af25810dccb551e60c700">projection_setting</a>; </div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;};</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; </div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> Po<span class="keywordtype">int</span>Cloud, <span class="keyword">typename</span> Projection_ = AxisAlignedProjection&gt;</div>
<div class="line"><a name="l00137"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1UnsafeKdTree.html"> 137</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html">UnsafeKdTree</a> {</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1UnsafeKdTree.html#a4a6bbda5d83aa96f60db4698b996854a"> 139</a></span>&#160; <span class="keyword">using</span> <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#a4a6bbda5d83aa96f60db4698b996854a">Projection</a> = Projection_;</div>
<div class="line"><a name="l00140"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1UnsafeKdTree.html#a508d2e1be7088c02d2e21798ad1c8334"> 140</a></span>&#160; <span class="keyword">using</span> <a class="code" href="structsmall__gicp_1_1KdTreeNode.html">Node</a> = <a class="code" href="structsmall__gicp_1_1KdTreeNode.html">KdTreeNode&lt;Projection&gt;</a>;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; </div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Builder = KdTreeBuilder&gt;</div>
<div class="line"><a name="l00146"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1UnsafeKdTree.html#a0723b0f5e9bd7062b6ef2a0ea9bf98ba"> 146</a></span>&#160; <span class="keyword">explicit</span> <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#a0723b0f5e9bd7062b6ef2a0ea9bf98ba">UnsafeKdTree</a>(<span class="keyword">const</span> <a class="code" href="structsmall__gicp_1_1PointCloud.html">PointCloud</a>&amp; <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#a9419369eaee866725444855752a264a5">points</a>, <span class="keyword">const</span> Builder&amp; builder = <a class="code" href="structsmall__gicp_1_1KdTreeBuilder.html">KdTreeBuilder</a>()) : <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#a9419369eaee866725444855752a264a5">points</a>(<a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#a9419369eaee866725444855752a264a5">points</a>) {</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="namespacesmall__gicp_1_1traits.html#a3c4ae38ff52330d6e624f4971c291fac">traits::size</a>(<a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#a9419369eaee866725444855752a264a5">points</a>) == 0) {</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; std::cerr &lt;&lt; <span class="stringliteral">&quot;warning: Empty point cloud&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; }</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; </div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; builder.build_tree(*<span class="keyword">this</span>, <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#a9419369eaee866725444855752a264a5">points</a>);</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; }</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; </div>
<div class="line"><a name="l00161"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1UnsafeKdTree.html#ae09b9562e85f27982eb49657c8c714bc"> 161</a></span>&#160; <span class="keywordtype">size_t</span> <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#ae09b9562e85f27982eb49657c8c714bc">nearest_neighbor_search</a>(<span class="keyword">const</span> Eigen::Vector4d&amp; query, <span class="keywordtype">size_t</span>* k_indices, <span class="keywordtype">double</span>* k_sq_dists, <span class="keyword">const</span> <a class="code" href="structsmall__gicp_1_1KnnSetting.html">KnnSetting</a>&amp; setting = <a class="code" href="structsmall__gicp_1_1KnnSetting.html">KnnSetting</a>())<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <span class="keywordflow">return</span> knn_search&lt;1&gt;(query, k_indices, k_sq_dists, setting);</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; }</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; </div>
<div class="line"><a name="l00172"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1UnsafeKdTree.html#af5635c87b03a4f84c4fa6637cfbefa48"> 172</a></span>&#160; <span class="keywordtype">size_t</span> <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#af5635c87b03a4f84c4fa6637cfbefa48">knn_search</a>(<span class="keyword">const</span> Eigen::Vector4d&amp; query, <span class="keywordtype">int</span> k, <span class="keywordtype">size_t</span>* k_indices, <span class="keywordtype">double</span>* k_sq_dists, <span class="keyword">const</span> <a class="code" href="structsmall__gicp_1_1KnnSetting.html">KnnSetting</a>&amp; setting = <a class="code" href="structsmall__gicp_1_1KnnSetting.html">KnnSetting</a>())<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <a class="code" href="structsmall__gicp_1_1KnnResult.html">KnnResult</a>&lt;-1&gt; result(k_indices, k_sq_dists, k);</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#af5635c87b03a4f84c4fa6637cfbefa48">knn_search</a>(query, <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#a0ebf7f33b7bdccffd0bf2b09dd791bc9">root</a>, result, setting);</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keywordflow">return</span> result.<a class="code" href="structsmall__gicp_1_1KnnResult.html#a98726a0269ad1bcc4b330176a1566a28">num_found</a>();</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; }</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; </div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <span class="keyword">template</span> &lt;<span class="keywordtype">int</span> N&gt;</div>
<div class="line"><a name="l00185"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1UnsafeKdTree.html#aa42e4136085ce830a53fe759cb2915f9"> 185</a></span>&#160; <span class="keywordtype">size_t</span> <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#aa42e4136085ce830a53fe759cb2915f9">knn_search</a>(<span class="keyword">const</span> Eigen::Vector4d&amp; query, <span class="keywordtype">size_t</span>* k_indices, <span class="keywordtype">double</span>* k_sq_dists, <span class="keyword">const</span> <a class="code" href="structsmall__gicp_1_1KnnSetting.html">KnnSetting</a>&amp; setting = <a class="code" href="structsmall__gicp_1_1KnnSetting.html">KnnSetting</a>())<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <a class="code" href="structsmall__gicp_1_1KnnResult.html">KnnResult&lt;N&gt;</a> result(k_indices, k_sq_dists);</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#af5635c87b03a4f84c4fa6637cfbefa48">knn_search</a>(query, <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#a0ebf7f33b7bdccffd0bf2b09dd791bc9">root</a>, result, setting);</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; <span class="keywordflow">return</span> result.<a class="code" href="structsmall__gicp_1_1KnnResult.html#a98726a0269ad1bcc4b330176a1566a28">num_found</a>();</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; }</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; </div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Result&gt;</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#af5635c87b03a4f84c4fa6637cfbefa48">knn_search</a>(<span class="keyword">const</span> Eigen::Vector4d&amp; query, <a class="code" href="namespacesmall__gicp.html#a0fcc071f1f9cc9ea2f79068231c9053a">NodeIndexType</a> node_index, Result&amp; result, <span class="keyword">const</span> <a class="code" href="structsmall__gicp_1_1KnnSetting.html">KnnSetting</a>&amp; setting)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; <span class="keyword">const</span> <span class="keyword">auto</span>&amp; node = <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#af44da5fdea9f539c3d65319853f5e179">nodes</a>[node_index];</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; </div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <span class="comment">// Check if it&#39;s a leaf node.</span></div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <span class="keywordflow">if</span> (node.left == INVALID_NODE) {</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; <span class="comment">// Compare the query point with all points in the leaf node.</span></div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = node.node_type.lr.first; i &lt; node.node_type.lr.last; i++) {</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <span class="keyword">const</span> <span class="keywordtype">double</span> sq_dist = (<a class="code" href="namespacesmall__gicp_1_1traits.html#a66b660d3a0c2e81cdf06abc8efebdad1">traits::point</a>(<a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#a9419369eaee866725444855752a264a5">points</a>, <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#a33bc5389c2ae61ac6202108c5bf1f080">indices</a>[i]) - query).squaredNorm();</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; result.push(<a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#a33bc5389c2ae61ac6202108c5bf1f080">indices</a>[i], sq_dist);</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; }</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; <span class="keywordflow">return</span> !setting.<a class="code" href="structsmall__gicp_1_1KnnSetting.html#ac71f9e05909a6b40586abfc064bd5688">fulfilled</a>(result);</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; }</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; </div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; <span class="keyword">const</span> <span class="keywordtype">double</span> val = node.node_type.sub.proj(query);</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; <span class="keyword">const</span> <span class="keywordtype">double</span> diff = val - node.node_type.sub.thresh;</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <span class="keyword">const</span> <span class="keywordtype">double</span> cut_sq_dist = diff * diff;</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; </div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; <a class="code" href="namespacesmall__gicp.html#a0fcc071f1f9cc9ea2f79068231c9053a">NodeIndexType</a> best_child;</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; <a class="code" href="namespacesmall__gicp.html#a0fcc071f1f9cc9ea2f79068231c9053a">NodeIndexType</a> other_child;</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; </div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <span class="keywordflow">if</span> (diff &lt; 0.0) {</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; best_child = node.left;</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; other_child = node.right;</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; best_child = node.right;</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; other_child = node.left;</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; }</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; </div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <span class="comment">// Check the best child node first.</span></div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; <span class="keywordflow">if</span> (!<a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#af5635c87b03a4f84c4fa6637cfbefa48">knn_search</a>(query, best_child, result, setting)) {</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; }</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; </div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <span class="comment">// Check if the other child node needs to be tested.</span></div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <span class="keywordflow">if</span> (result.worst_distance() &gt; cut_sq_dist) {</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; <span class="keywordflow">return</span> <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#af5635c87b03a4f84c4fa6637cfbefa48">knn_search</a>(query, other_child, result, setting);</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; }</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; </div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; }</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; </div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00236"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1UnsafeKdTree.html#a9419369eaee866725444855752a264a5"> 236</a></span>&#160; <span class="keyword">const</span> <a class="code" href="structsmall__gicp_1_1PointCloud.html">PointCloud</a>&amp; <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#a9419369eaee866725444855752a264a5">points</a>; </div>
<div class="line"><a name="l00237"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1UnsafeKdTree.html#a33bc5389c2ae61ac6202108c5bf1f080"> 237</a></span>&#160; std::vector&lt;size_t&gt; <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#a33bc5389c2ae61ac6202108c5bf1f080">indices</a>; </div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; </div>
<div class="line"><a name="l00239"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1UnsafeKdTree.html#a0ebf7f33b7bdccffd0bf2b09dd791bc9"> 239</a></span>&#160; <a class="code" href="namespacesmall__gicp.html#a0fcc071f1f9cc9ea2f79068231c9053a">NodeIndexType</a> <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#a0ebf7f33b7bdccffd0bf2b09dd791bc9">root</a>; </div>
<div class="line"><a name="l00240"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1UnsafeKdTree.html#af44da5fdea9f539c3d65319853f5e179"> 240</a></span>&#160; std::vector&lt;Node&gt; <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#af44da5fdea9f539c3d65319853f5e179">nodes</a>; </div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160;};</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; </div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> Po<span class="keywordtype">int</span>Cloud, <span class="keyword">typename</span> Projection = AxisAlignedProjection&gt;</div>
<div class="line"><a name="l00245"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTree.html"> 245</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structsmall__gicp_1_1KdTree.html">KdTree</a> {</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00247"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTree.html#a74e2a34297bd8fd1e686caf59896e338"> 247</a></span>&#160; <span class="keyword">using</span> <a class="code" href="structsmall__gicp_1_1KdTree.html#a74e2a34297bd8fd1e686caf59896e338">Ptr</a> = std::shared_ptr&lt;KdTree&lt;PointCloud, Projection&gt;&gt;;</div>
<div class="line"><a name="l00248"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTree.html#a644dcce803d8a11418865ae0dbd2511c"> 248</a></span>&#160; <span class="keyword">using</span> <a class="code" href="structsmall__gicp_1_1KdTree.html#a644dcce803d8a11418865ae0dbd2511c">ConstPtr</a> = std::shared_ptr&lt;const KdTree&lt;PointCloud, Projection&gt;&gt;;</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; </div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Builder = KdTreeBuilder&gt;</div>
<div class="line"><a name="l00251"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTree.html#aa4bf333fcd41c2f8a71d4b9ad788e345"> 251</a></span>&#160; <span class="keyword">explicit</span> <a class="code" href="structsmall__gicp_1_1KdTree.html#aa4bf333fcd41c2f8a71d4b9ad788e345">KdTree</a>(std::shared_ptr&lt;const PointCloud&gt; <a class="code" href="structsmall__gicp_1_1KdTree.html#a302bdc6c65797e5c16b33e7c4fe30cd2">points</a>, <span class="keyword">const</span> Builder&amp; builder = Builder()) : <a class="code" href="structsmall__gicp_1_1KdTree.html#a302bdc6c65797e5c16b33e7c4fe30cd2">points</a>(<a class="code" href="structsmall__gicp_1_1KdTree.html#a302bdc6c65797e5c16b33e7c4fe30cd2">points</a>),</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; <a class="code" href="structsmall__gicp_1_1KdTree.html#a3b447e07aee322594e4eb67dece8b2e7">kdtree</a>(*<a class="code" href="structsmall__gicp_1_1KdTree.html#a302bdc6c65797e5c16b33e7c4fe30cd2">points</a>, builder) {}</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; </div>
<div class="line"><a name="l00261"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTree.html#aa5310187d9b174189f3e62db2f2f4bca"> 261</a></span>&#160; <span class="keywordtype">size_t</span> <a class="code" href="structsmall__gicp_1_1KdTree.html#aa5310187d9b174189f3e62db2f2f4bca">nearest_neighbor_search</a>(<span class="keyword">const</span> Eigen::Vector4d&amp; query, <span class="keywordtype">size_t</span>* k_indices, <span class="keywordtype">double</span>* k_sq_dists, <span class="keyword">const</span> <a class="code" href="structsmall__gicp_1_1KnnSetting.html">KnnSetting</a>&amp; setting = <a class="code" href="structsmall__gicp_1_1KnnSetting.html">KnnSetting</a>())<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; <span class="keywordflow">return</span> <a class="code" href="structsmall__gicp_1_1KdTree.html#a3b447e07aee322594e4eb67dece8b2e7">kdtree</a>.nearest_neighbor_search(query, k_indices, k_sq_dists, setting);</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; }</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160; </div>
<div class="line"><a name="l00272"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTree.html#a5be7cffa4ac041c6e909f3a729fbba5e"> 272</a></span>&#160; <span class="keywordtype">size_t</span> <a class="code" href="structsmall__gicp_1_1KdTree.html#a5be7cffa4ac041c6e909f3a729fbba5e">knn_search</a>(<span class="keyword">const</span> Eigen::Vector4d&amp; query, <span class="keywordtype">size_t</span> k, <span class="keywordtype">size_t</span>* k_indices, <span class="keywordtype">double</span>* k_sq_dists, <span class="keyword">const</span> <a class="code" href="structsmall__gicp_1_1KnnSetting.html">KnnSetting</a>&amp; setting = <a class="code" href="structsmall__gicp_1_1KnnSetting.html">KnnSetting</a>())<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; <span class="keywordflow">return</span> <a class="code" href="structsmall__gicp_1_1KdTree.html#a3b447e07aee322594e4eb67dece8b2e7">kdtree</a>.knn_search(query, k, k_indices, k_sq_dists, setting);</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; }</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; </div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00277"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTree.html#a302bdc6c65797e5c16b33e7c4fe30cd2"> 277</a></span>&#160; <span class="keyword">const</span> std::shared_ptr&lt;const PointCloud&gt; <a class="code" href="structsmall__gicp_1_1KdTree.html#a302bdc6c65797e5c16b33e7c4fe30cd2">points</a>; </div>
<div class="line"><a name="l00278"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1KdTree.html#a3b447e07aee322594e4eb67dece8b2e7"> 278</a></span>&#160; <span class="keyword">const</span> <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html">UnsafeKdTree&lt;PointCloud, Projection&gt;</a> <a class="code" href="structsmall__gicp_1_1KdTree.html#a3b447e07aee322594e4eb67dece8b2e7">kdtree</a>; </div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160;};</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; </div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160;<span class="keyword">namespace </span>traits {</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; </div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> Po<span class="keywordtype">int</span>Cloud, <span class="keyword">typename</span> Projection&gt;</div>
<div class="line"><a name="l00284"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1traits_1_1Traits_3_01UnsafeKdTree_3_01PointCloud_00_01Projection_01_4_01_4.html"> 284</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structsmall__gicp_1_1traits_1_1Traits.html">Traits</a>&lt;<a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html">UnsafeKdTree</a>&lt;<a class="code" href="structsmall__gicp_1_1PointCloud.html">PointCloud</a>, Projection&gt;&gt; {</div>
<div class="line"><a name="l00285"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1traits_1_1Traits_3_01UnsafeKdTree_3_01PointCloud_00_01Projection_01_4_01_4.html#aac7b0c9a35e3a2544bcecc640cb770d4"> 285</a></span>&#160; <span class="keyword">static</span> <span class="keywordtype">size_t</span> <a class="code" href="structsmall__gicp_1_1traits_1_1Traits_3_01UnsafeKdTree_3_01PointCloud_00_01Projection_01_4_01_4.html#aac7b0c9a35e3a2544bcecc640cb770d4">nearest_neighbor_search</a>(<span class="keyword">const</span> <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html">UnsafeKdTree&lt;PointCloud, Projection&gt;</a>&amp; tree, <span class="keyword">const</span> Eigen::Vector4d&amp; <a class="code" href="namespacesmall__gicp_1_1traits.html#a66b660d3a0c2e81cdf06abc8efebdad1">point</a>, <span class="keywordtype">size_t</span>* k_indices, <span class="keywordtype">double</span>* k_sq_dists) {</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; <span class="keywordflow">return</span> tree.<a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#ae09b9562e85f27982eb49657c8c714bc">nearest_neighbor_search</a>(<a class="code" href="namespacesmall__gicp_1_1traits.html#a66b660d3a0c2e81cdf06abc8efebdad1">point</a>, k_indices, k_sq_dists);</div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160; }</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; </div>
<div class="line"><a name="l00289"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1traits_1_1Traits_3_01UnsafeKdTree_3_01PointCloud_00_01Projection_01_4_01_4.html#aad38ffbc96ec5425e3beb59ca95f7b92"> 289</a></span>&#160; <span class="keyword">static</span> <span class="keywordtype">size_t</span> <a class="code" href="structsmall__gicp_1_1traits_1_1Traits_3_01UnsafeKdTree_3_01PointCloud_00_01Projection_01_4_01_4.html#aad38ffbc96ec5425e3beb59ca95f7b92">knn_search</a>(<span class="keyword">const</span> <a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html">UnsafeKdTree&lt;PointCloud, Projection&gt;</a>&amp; tree, <span class="keyword">const</span> Eigen::Vector4d&amp; <a class="code" href="namespacesmall__gicp_1_1traits.html#a66b660d3a0c2e81cdf06abc8efebdad1">point</a>, <span class="keywordtype">size_t</span> k, <span class="keywordtype">size_t</span>* k_indices, <span class="keywordtype">double</span>* k_sq_dists) {</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; <span class="keywordflow">return</span> tree.<a class="code" href="structsmall__gicp_1_1UnsafeKdTree.html#af5635c87b03a4f84c4fa6637cfbefa48">knn_search</a>(<a class="code" href="namespacesmall__gicp_1_1traits.html#a66b660d3a0c2e81cdf06abc8efebdad1">point</a>, k, k_indices, k_sq_dists);</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; }</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160;};</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; </div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> Po<span class="keywordtype">int</span>Cloud, <span class="keyword">typename</span> Projection&gt;</div>
<div class="line"><a name="l00295"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1traits_1_1Traits_3_01KdTree_3_01PointCloud_00_01Projection_01_4_01_4.html"> 295</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structsmall__gicp_1_1traits_1_1Traits.html">Traits</a>&lt;<a class="code" href="structsmall__gicp_1_1KdTree.html">KdTree</a>&lt;<a class="code" href="structsmall__gicp_1_1PointCloud.html">PointCloud</a>, Projection&gt;&gt; {</div>
<div class="line"><a name="l00296"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1traits_1_1Traits_3_01KdTree_3_01PointCloud_00_01Projection_01_4_01_4.html#ab2c8348ad67ba9ce80f707d625fc1796"> 296</a></span>&#160; <span class="keyword">static</span> <span class="keywordtype">size_t</span> <a class="code" href="structsmall__gicp_1_1traits_1_1Traits_3_01KdTree_3_01PointCloud_00_01Projection_01_4_01_4.html#ab2c8348ad67ba9ce80f707d625fc1796">nearest_neighbor_search</a>(<span class="keyword">const</span> <a class="code" href="structsmall__gicp_1_1KdTree.html">KdTree&lt;PointCloud, Projection&gt;</a>&amp; tree, <span class="keyword">const</span> Eigen::Vector4d&amp; <a class="code" href="namespacesmall__gicp_1_1traits.html#a66b660d3a0c2e81cdf06abc8efebdad1">point</a>, <span class="keywordtype">size_t</span>* k_indices, <span class="keywordtype">double</span>* k_sq_dists) {</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160; <span class="keywordflow">return</span> tree.<a class="code" href="structsmall__gicp_1_1KdTree.html#aa5310187d9b174189f3e62db2f2f4bca">nearest_neighbor_search</a>(<a class="code" href="namespacesmall__gicp_1_1traits.html#a66b660d3a0c2e81cdf06abc8efebdad1">point</a>, k_indices, k_sq_dists);</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; }</div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; </div>
<div class="line"><a name="l00300"></a><span class="lineno"><a class="line" href="structsmall__gicp_1_1traits_1_1Traits_3_01KdTree_3_01PointCloud_00_01Projection_01_4_01_4.html#a31f00cf0990b7bfafbaefb81a00e9684"> 300</a></span>&#160; <span class="keyword">static</span> <span class="keywordtype">size_t</span> <a class="code" href="structsmall__gicp_1_1traits_1_1Traits_3_01KdTree_3_01PointCloud_00_01Projection_01_4_01_4.html#a31f00cf0990b7bfafbaefb81a00e9684">knn_search</a>(<span class="keyword">const</span> <a class="code" href="structsmall__gicp_1_1KdTree.html">KdTree&lt;PointCloud, Projection&gt;</a>&amp; tree, <span class="keyword">const</span> Eigen::Vector4d&amp; <a class="code" href="namespacesmall__gicp_1_1traits.html#a66b660d3a0c2e81cdf06abc8efebdad1">point</a>, <span class="keywordtype">size_t</span> k, <span class="keywordtype">size_t</span>* k_indices, <span class="keywordtype">double</span>* k_sq_dists) {</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160; <span class="keywordflow">return</span> tree.<a class="code" href="structsmall__gicp_1_1KdTree.html#a5be7cffa4ac041c6e909f3a729fbba5e">knn_search</a>(<a class="code" href="namespacesmall__gicp_1_1traits.html#a66b660d3a0c2e81cdf06abc8efebdad1">point</a>, k, k_indices, k_sq_dists);</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; }</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160;};</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; </div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160;} <span class="comment">// namespace traits</span></div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160; </div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160;} <span class="comment">// namespace small_gicp</span></div>
<div class="ttc" id="aann_2traits_8hpp_html"><div class="ttname"><a href="ann_2traits_8hpp.html">traits.hpp</a></div></div>
<div class="ttc" id="aknn__result_8hpp_html"><div class="ttname"><a href="knn__result_8hpp.html">knn_result.hpp</a></div></div>
<div class="ttc" id="anamespacesmall__gicp_1_1traits_html_a3c4ae38ff52330d6e624f4971c291fac"><div class="ttname"><a href="namespacesmall__gicp_1_1traits.html#a3c4ae38ff52330d6e624f4971c291fac">small_gicp::traits::size</a></div><div class="ttdeci">size_t size(const T &amp;points)</div><div class="ttdoc">Get the number of points.</div><div class="ttdef"><b>Definition:</b> traits.hpp:16</div></div>
<div class="ttc" id="anamespacesmall__gicp_1_1traits_html_a66b660d3a0c2e81cdf06abc8efebdad1"><div class="ttname"><a href="namespacesmall__gicp_1_1traits.html#a66b660d3a0c2e81cdf06abc8efebdad1">small_gicp::traits::point</a></div><div class="ttdeci">auto point(const T &amp;points, size_t i)</div><div class="ttdoc">Get i-th point. 4D vector is used to take advantage of SIMD intrinsics. The last element must be fill...</div><div class="ttdef"><b>Definition:</b> traits.hpp:40</div></div>
<div class="ttc" id="anamespacesmall__gicp_html"><div class="ttname"><a href="namespacesmall__gicp.html">small_gicp</a></div><div class="ttdef"><b>Definition:</b> flat_container.hpp:12</div></div>
<div class="ttc" id="anamespacesmall__gicp_html_a0fcc071f1f9cc9ea2f79068231c9053a"><div class="ttname"><a href="namespacesmall__gicp.html#a0fcc071f1f9cc9ea2f79068231c9053a">small_gicp::NodeIndexType</a></div><div class="ttdeci">std::uint32_t NodeIndexType</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:52</div></div>
<div class="ttc" id="apoints_2traits_8hpp_html"><div class="ttname"><a href="points_2traits_8hpp.html">traits.hpp</a></div></div>
<div class="ttc" id="aprojection_8hpp_html"><div class="ttname"><a href="projection_8hpp.html">projection.hpp</a></div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTreeBuilder_html"><div class="ttname"><a href="structsmall__gicp_1_1KdTreeBuilder.html">small_gicp::KdTreeBuilder</a></div><div class="ttdoc">Single thread Kd-tree builder.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:74</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTreeBuilder_html_a1369e1961ff0ff4076c2806ffc38e259"><div class="ttname"><a href="structsmall__gicp_1_1KdTreeBuilder.html#a1369e1961ff0ff4076c2806ffc38e259">small_gicp::KdTreeBuilder::create_node</a></div><div class="ttdeci">NodeIndexType create_node(KdTree &amp;kdtree, size_t &amp;node_count, const PointCloud &amp;points, IndexConstIterator global_first, IndexConstIterator first, IndexConstIterator last) const</div><div class="ttdoc">Create a Kd-tree node from the given point indices.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:96</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTreeBuilder_html_a410ed2297af81a6332f1d9afd70eb720"><div class="ttname"><a href="structsmall__gicp_1_1KdTreeBuilder.html#a410ed2297af81a6332f1d9afd70eb720">small_gicp::KdTreeBuilder::max_leaf_size</a></div><div class="ttdeci">int max_leaf_size</div><div class="ttdoc">Maximum number of points in a leaf node.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:129</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTreeBuilder_html_a7d526354a34af25810dccb551e60c700"><div class="ttname"><a href="structsmall__gicp_1_1KdTreeBuilder.html#a7d526354a34af25810dccb551e60c700">small_gicp::KdTreeBuilder::projection_setting</a></div><div class="ttdeci">ProjectionSetting projection_setting</div><div class="ttdoc">Projection setting.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:130</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTreeBuilder_html_aebbc718d567041dbb1513d09d0a428d6"><div class="ttname"><a href="structsmall__gicp_1_1KdTreeBuilder.html#aebbc718d567041dbb1513d09d0a428d6">small_gicp::KdTreeBuilder::build_tree</a></div><div class="ttdeci">void build_tree(KdTree &amp;kdtree, const PointCloud &amp;points) const</div><div class="ttdoc">Build KdTree.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:80</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTreeNode_html"><div class="ttname"><a href="structsmall__gicp_1_1KdTreeNode.html">small_gicp::KdTreeNode</a></div><div class="ttdoc">KdTree node.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:57</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTreeNode_html_a070e6c621ed3ca89e37bc5a3058de863"><div class="ttname"><a href="structsmall__gicp_1_1KdTreeNode.html#a070e6c621ed3ca89e37bc5a3058de863">small_gicp::KdTreeNode::node_type</a></div><div class="ttdeci">union small_gicp::KdTreeNode::@0 node_type</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTreeNode_html_a167d1620e39459334605991ef10ae53b"><div class="ttname"><a href="structsmall__gicp_1_1KdTreeNode.html#a167d1620e39459334605991ef10ae53b">small_gicp::KdTreeNode::right</a></div><div class="ttdeci">NodeIndexType right</div><div class="ttdoc">Right child node index.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:70</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTreeNode_html_a18168bb6ff0823c8b5addedee27af2ee"><div class="ttname"><a href="structsmall__gicp_1_1KdTreeNode.html#a18168bb6ff0823c8b5addedee27af2ee">small_gicp::KdTreeNode::proj</a></div><div class="ttdeci">Projection proj</div><div class="ttdoc">Projection axis.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:64</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTreeNode_html_a1b119b280b37622c41556e08a2b70819"><div class="ttname"><a href="structsmall__gicp_1_1KdTreeNode.html#a1b119b280b37622c41556e08a2b70819">small_gicp::KdTreeNode::first</a></div><div class="ttdeci">NodeIndexType first</div><div class="ttdoc">First point index in the leaf node.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:60</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTreeNode_html_a2da8a154a6c9d8dfd8fd3a2c9018e0aa"><div class="ttname"><a href="structsmall__gicp_1_1KdTreeNode.html#a2da8a154a6c9d8dfd8fd3a2c9018e0aa">small_gicp::KdTreeNode::last</a></div><div class="ttdeci">NodeIndexType last</div><div class="ttdoc">Last point index in the leaf node.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:61</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTreeNode_html_a46849548df9b4fc38a92a139aebfd39b"><div class="ttname"><a href="structsmall__gicp_1_1KdTreeNode.html#a46849548df9b4fc38a92a139aebfd39b">small_gicp::KdTreeNode::thresh</a></div><div class="ttdeci">double thresh</div><div class="ttdoc">Threshold value.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:65</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTreeNode_html_a517c4c1a0d669f3c55b419b35467df50"><div class="ttname"><a href="structsmall__gicp_1_1KdTreeNode.html#a517c4c1a0d669f3c55b419b35467df50">small_gicp::KdTreeNode::lr</a></div><div class="ttdeci">struct small_gicp::KdTreeNode::@0::Leaf lr</div><div class="ttdoc">Leaf node.</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTreeNode_html_a5f766ec7f97bc468ac82b5fea9a6a91d"><div class="ttname"><a href="structsmall__gicp_1_1KdTreeNode.html#a5f766ec7f97bc468ac82b5fea9a6a91d">small_gicp::KdTreeNode::left</a></div><div class="ttdeci">NodeIndexType left</div><div class="ttdoc">Left child node index.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:69</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTreeNode_html_aa429c4179b30e6f7c04cead1aea5574f"><div class="ttname"><a href="structsmall__gicp_1_1KdTreeNode.html#aa429c4179b30e6f7c04cead1aea5574f">small_gicp::KdTreeNode::sub</a></div><div class="ttdeci">struct small_gicp::KdTreeNode::@0::NonLeaf sub</div><div class="ttdoc">Non-leaf node.</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTree_html"><div class="ttname"><a href="structsmall__gicp_1_1KdTree.html">small_gicp::KdTree</a></div><div class="ttdoc">&quot;Safe&quot; KdTree that holds the ownership of the input points.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:245</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTree_html_a302bdc6c65797e5c16b33e7c4fe30cd2"><div class="ttname"><a href="structsmall__gicp_1_1KdTree.html#a302bdc6c65797e5c16b33e7c4fe30cd2">small_gicp::KdTree::points</a></div><div class="ttdeci">const std::shared_ptr&lt; const PointCloud &gt; points</div><div class="ttdoc">Points.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:277</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTree_html_a3b447e07aee322594e4eb67dece8b2e7"><div class="ttname"><a href="structsmall__gicp_1_1KdTree.html#a3b447e07aee322594e4eb67dece8b2e7">small_gicp::KdTree::kdtree</a></div><div class="ttdeci">const UnsafeKdTree&lt; PointCloud, Projection &gt; kdtree</div><div class="ttdoc">KdTree.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:278</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTree_html_a5be7cffa4ac041c6e909f3a729fbba5e"><div class="ttname"><a href="structsmall__gicp_1_1KdTree.html#a5be7cffa4ac041c6e909f3a729fbba5e">small_gicp::KdTree::knn_search</a></div><div class="ttdeci">size_t knn_search(const Eigen::Vector4d &amp;query, size_t k, size_t *k_indices, double *k_sq_dists, const KnnSetting &amp;setting=KnnSetting()) const</div><div class="ttdoc">Find k-nearest neighbors. This method uses dynamic memory allocation.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:272</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTree_html_a644dcce803d8a11418865ae0dbd2511c"><div class="ttname"><a href="structsmall__gicp_1_1KdTree.html#a644dcce803d8a11418865ae0dbd2511c">small_gicp::KdTree::ConstPtr</a></div><div class="ttdeci">std::shared_ptr&lt; const KdTree&lt; PointCloud, Projection &gt; &gt; ConstPtr</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:248</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTree_html_a74e2a34297bd8fd1e686caf59896e338"><div class="ttname"><a href="structsmall__gicp_1_1KdTree.html#a74e2a34297bd8fd1e686caf59896e338">small_gicp::KdTree::Ptr</a></div><div class="ttdeci">std::shared_ptr&lt; KdTree&lt; PointCloud, Projection &gt; &gt; Ptr</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:247</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTree_html_aa4bf333fcd41c2f8a71d4b9ad788e345"><div class="ttname"><a href="structsmall__gicp_1_1KdTree.html#aa4bf333fcd41c2f8a71d4b9ad788e345">small_gicp::KdTree::KdTree</a></div><div class="ttdeci">KdTree(std::shared_ptr&lt; const PointCloud &gt; points, const Builder &amp;builder=Builder())</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:251</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KdTree_html_aa5310187d9b174189f3e62db2f2f4bca"><div class="ttname"><a href="structsmall__gicp_1_1KdTree.html#aa5310187d9b174189f3e62db2f2f4bca">small_gicp::KdTree::nearest_neighbor_search</a></div><div class="ttdeci">size_t nearest_neighbor_search(const Eigen::Vector4d &amp;query, size_t *k_indices, double *k_sq_dists, const KnnSetting &amp;setting=KnnSetting()) const</div><div class="ttdoc">Find k-nearest neighbors. This method uses dynamic memory allocation.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:261</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KnnResult_html"><div class="ttname"><a href="structsmall__gicp_1_1KnnResult.html">small_gicp::KnnResult</a></div><div class="ttdoc">K-nearest neighbor search result container.</div><div class="ttdef"><b>Definition:</b> knn_result.hpp:33</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KnnResult_html_a98726a0269ad1bcc4b330176a1566a28"><div class="ttname"><a href="structsmall__gicp_1_1KnnResult.html#a98726a0269ad1bcc4b330176a1566a28">small_gicp::KnnResult::num_found</a></div><div class="ttdeci">size_t num_found() const</div><div class="ttdoc">Number of found neighbors.</div><div class="ttdef"><b>Definition:</b> knn_result.hpp:73</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KnnSetting_html"><div class="ttname"><a href="structsmall__gicp_1_1KnnSetting.html">small_gicp::KnnSetting</a></div><div class="ttdoc">K-nearest neighbor search setting.</div><div class="ttdef"><b>Definition:</b> knn_result.hpp:13</div></div>
<div class="ttc" id="astructsmall__gicp_1_1KnnSetting_html_ac71f9e05909a6b40586abfc064bd5688"><div class="ttname"><a href="structsmall__gicp_1_1KnnSetting.html#ac71f9e05909a6b40586abfc064bd5688">small_gicp::KnnSetting::fulfilled</a></div><div class="ttdeci">bool fulfilled(const Result &amp;result) const</div><div class="ttdoc">Check if the result satisfies the early termination condition.</div><div class="ttdef"><b>Definition:</b> knn_result.hpp:17</div></div>
<div class="ttc" id="astructsmall__gicp_1_1PointCloud_html"><div class="ttname"><a href="structsmall__gicp_1_1PointCloud.html">small_gicp::PointCloud</a></div><div class="ttdoc">Point cloud.</div><div class="ttdef"><b>Definition:</b> point_cloud.hpp:15</div></div>
<div class="ttc" id="astructsmall__gicp_1_1ProjectionSetting_html"><div class="ttname"><a href="structsmall__gicp_1_1ProjectionSetting.html">small_gicp::ProjectionSetting</a></div><div class="ttdoc">Parameters to control the projection axis search.</div><div class="ttdef"><b>Definition:</b> projection.hpp:12</div></div>
<div class="ttc" id="astructsmall__gicp_1_1UnsafeKdTree_html"><div class="ttname"><a href="structsmall__gicp_1_1UnsafeKdTree.html">small_gicp::UnsafeKdTree</a></div><div class="ttdoc">&quot;Unsafe&quot; KdTree.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:137</div></div>
<div class="ttc" id="astructsmall__gicp_1_1UnsafeKdTree_html_a0723b0f5e9bd7062b6ef2a0ea9bf98ba"><div class="ttname"><a href="structsmall__gicp_1_1UnsafeKdTree.html#a0723b0f5e9bd7062b6ef2a0ea9bf98ba">small_gicp::UnsafeKdTree::UnsafeKdTree</a></div><div class="ttdeci">UnsafeKdTree(const PointCloud &amp;points, const Builder &amp;builder=KdTreeBuilder())</div><div class="ttdoc">Constructor.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:146</div></div>
<div class="ttc" id="astructsmall__gicp_1_1UnsafeKdTree_html_a0ebf7f33b7bdccffd0bf2b09dd791bc9"><div class="ttname"><a href="structsmall__gicp_1_1UnsafeKdTree.html#a0ebf7f33b7bdccffd0bf2b09dd791bc9">small_gicp::UnsafeKdTree::root</a></div><div class="ttdeci">NodeIndexType root</div><div class="ttdoc">Root node index (should be zero)</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:239</div></div>
<div class="ttc" id="astructsmall__gicp_1_1UnsafeKdTree_html_a33bc5389c2ae61ac6202108c5bf1f080"><div class="ttname"><a href="structsmall__gicp_1_1UnsafeKdTree.html#a33bc5389c2ae61ac6202108c5bf1f080">small_gicp::UnsafeKdTree::indices</a></div><div class="ttdeci">std::vector&lt; size_t &gt; indices</div><div class="ttdoc">Point indices refered by nodes.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:237</div></div>
<div class="ttc" id="astructsmall__gicp_1_1UnsafeKdTree_html_a4a6bbda5d83aa96f60db4698b996854a"><div class="ttname"><a href="structsmall__gicp_1_1UnsafeKdTree.html#a4a6bbda5d83aa96f60db4698b996854a">small_gicp::UnsafeKdTree::Projection</a></div><div class="ttdeci">Projection_ Projection</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:139</div></div>
<div class="ttc" id="astructsmall__gicp_1_1UnsafeKdTree_html_a9419369eaee866725444855752a264a5"><div class="ttname"><a href="structsmall__gicp_1_1UnsafeKdTree.html#a9419369eaee866725444855752a264a5">small_gicp::UnsafeKdTree::points</a></div><div class="ttdeci">const PointCloud &amp; points</div><div class="ttdoc">Input points.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:236</div></div>
<div class="ttc" id="astructsmall__gicp_1_1UnsafeKdTree_html_aa42e4136085ce830a53fe759cb2915f9"><div class="ttname"><a href="structsmall__gicp_1_1UnsafeKdTree.html#aa42e4136085ce830a53fe759cb2915f9">small_gicp::UnsafeKdTree::knn_search</a></div><div class="ttdeci">size_t knn_search(const Eigen::Vector4d &amp;query, size_t *k_indices, double *k_sq_dists, const KnnSetting &amp;setting=KnnSetting()) const</div><div class="ttdoc">Find k-nearest neighbors. This method uses fixed and static memory allocation. Might be faster for sm...</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:185</div></div>
<div class="ttc" id="astructsmall__gicp_1_1UnsafeKdTree_html_ae09b9562e85f27982eb49657c8c714bc"><div class="ttname"><a href="structsmall__gicp_1_1UnsafeKdTree.html#ae09b9562e85f27982eb49657c8c714bc">small_gicp::UnsafeKdTree::nearest_neighbor_search</a></div><div class="ttdeci">size_t nearest_neighbor_search(const Eigen::Vector4d &amp;query, size_t *k_indices, double *k_sq_dists, const KnnSetting &amp;setting=KnnSetting()) const</div><div class="ttdoc">Find the nearest neighbor.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:161</div></div>
<div class="ttc" id="astructsmall__gicp_1_1UnsafeKdTree_html_af44da5fdea9f539c3d65319853f5e179"><div class="ttname"><a href="structsmall__gicp_1_1UnsafeKdTree.html#af44da5fdea9f539c3d65319853f5e179">small_gicp::UnsafeKdTree::nodes</a></div><div class="ttdeci">std::vector&lt; Node &gt; nodes</div><div class="ttdoc">Kd-tree nodes.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:240</div></div>
<div class="ttc" id="astructsmall__gicp_1_1UnsafeKdTree_html_af5635c87b03a4f84c4fa6637cfbefa48"><div class="ttname"><a href="structsmall__gicp_1_1UnsafeKdTree.html#af5635c87b03a4f84c4fa6637cfbefa48">small_gicp::UnsafeKdTree::knn_search</a></div><div class="ttdeci">size_t knn_search(const Eigen::Vector4d &amp;query, int k, size_t *k_indices, double *k_sq_dists, const KnnSetting &amp;setting=KnnSetting()) const</div><div class="ttdoc">Find k-nearest neighbors. This method uses dynamic memory allocation.</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:172</div></div>
<div class="ttc" id="astructsmall__gicp_1_1traits_1_1Traits_3_01KdTree_3_01PointCloud_00_01Projection_01_4_01_4_html_a31f00cf0990b7bfafbaefb81a00e9684"><div class="ttname"><a href="structsmall__gicp_1_1traits_1_1Traits_3_01KdTree_3_01PointCloud_00_01Projection_01_4_01_4.html#a31f00cf0990b7bfafbaefb81a00e9684">small_gicp::traits::Traits&lt; KdTree&lt; PointCloud, Projection &gt; &gt;::knn_search</a></div><div class="ttdeci">static size_t knn_search(const KdTree&lt; PointCloud, Projection &gt; &amp;tree, const Eigen::Vector4d &amp;point, size_t k, size_t *k_indices, double *k_sq_dists)</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:300</div></div>
<div class="ttc" id="astructsmall__gicp_1_1traits_1_1Traits_3_01KdTree_3_01PointCloud_00_01Projection_01_4_01_4_html_ab2c8348ad67ba9ce80f707d625fc1796"><div class="ttname"><a href="structsmall__gicp_1_1traits_1_1Traits_3_01KdTree_3_01PointCloud_00_01Projection_01_4_01_4.html#ab2c8348ad67ba9ce80f707d625fc1796">small_gicp::traits::Traits&lt; KdTree&lt; PointCloud, Projection &gt; &gt;::nearest_neighbor_search</a></div><div class="ttdeci">static size_t nearest_neighbor_search(const KdTree&lt; PointCloud, Projection &gt; &amp;tree, const Eigen::Vector4d &amp;point, size_t *k_indices, double *k_sq_dists)</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:296</div></div>
<div class="ttc" id="astructsmall__gicp_1_1traits_1_1Traits_3_01UnsafeKdTree_3_01PointCloud_00_01Projection_01_4_01_4_html_aac7b0c9a35e3a2544bcecc640cb770d4"><div class="ttname"><a href="structsmall__gicp_1_1traits_1_1Traits_3_01UnsafeKdTree_3_01PointCloud_00_01Projection_01_4_01_4.html#aac7b0c9a35e3a2544bcecc640cb770d4">small_gicp::traits::Traits&lt; UnsafeKdTree&lt; PointCloud, Projection &gt; &gt;::nearest_neighbor_search</a></div><div class="ttdeci">static size_t nearest_neighbor_search(const UnsafeKdTree&lt; PointCloud, Projection &gt; &amp;tree, const Eigen::Vector4d &amp;point, size_t *k_indices, double *k_sq_dists)</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:285</div></div>
<div class="ttc" id="astructsmall__gicp_1_1traits_1_1Traits_3_01UnsafeKdTree_3_01PointCloud_00_01Projection_01_4_01_4_html_aad38ffbc96ec5425e3beb59ca95f7b92"><div class="ttname"><a href="structsmall__gicp_1_1traits_1_1Traits_3_01UnsafeKdTree_3_01PointCloud_00_01Projection_01_4_01_4.html#aad38ffbc96ec5425e3beb59ca95f7b92">small_gicp::traits::Traits&lt; UnsafeKdTree&lt; PointCloud, Projection &gt; &gt;::knn_search</a></div><div class="ttdeci">static size_t knn_search(const UnsafeKdTree&lt; PointCloud, Projection &gt; &amp;tree, const Eigen::Vector4d &amp;point, size_t k, size_t *k_indices, double *k_sq_dists)</div><div class="ttdef"><b>Definition:</b> kdtree.hpp:289</div></div>
<div class="ttc" id="astructsmall__gicp_1_1traits_1_1Traits_html"><div class="ttname"><a href="structsmall__gicp_1_1traits_1_1Traits.html">small_gicp::traits::Traits</a></div><div class="ttdef"><b>Definition:</b> traits.hpp:13</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>