779 lines
54 KiB
HTML
779 lines
54 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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.8.11"/>
|
|
<title>mlpack: mlpack::tree::ExampleTree< MetricType, StatisticType, MatType > Class Template Reference</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>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() { init_search(); });
|
|
</script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="extra-stylesheet.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">mlpack
|
|
 <span id="projectnumber">master</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.11 -->
|
|
<script type="text/javascript">
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
</script>
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
|
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
<li>
|
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
|
<span class="left">
|
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
alt=""/>
|
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
|
</span><span class="right">
|
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
|
</span>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div id="navrow2" class="tabs2">
|
|
<ul class="tablist">
|
|
<li><a href="annotated.html"><span>Class List</span></a></li>
|
|
<li><a href="classes.html"><span>Class Index</span></a></li>
|
|
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
|
|
<li><a href="functions.html"><span>Class Members</span></a></li>
|
|
</ul>
|
|
</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="namespacemlpack.html">mlpack</a></li><li class="navelem"><a class="el" href="namespacemlpack_1_1tree.html">tree</a></li><li class="navelem"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">ExampleTree</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="#pri-attribs">Private Attributes</a> |
|
|
<a href="classmlpack_1_1tree_1_1ExampleTree-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">mlpack::tree::ExampleTree< MetricType, StatisticType, MatType > Class Template Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>This is not an actual space tree but instead an example tree that exists to show and document all the functions that mlpack trees must implement.
|
|
<a href="classmlpack_1_1tree_1_1ExampleTree.html#details">More...</a></p>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
|
|
Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:abaaf19b1a2b919d4e2d28bb90525ae91"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#abaaf19b1a2b919d4e2d28bb90525ae91">ExampleTree</a> (const MatType &dataset, MetricType &<a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#a4b4eb828f7492ebafa97a7991c04c315">metric</a>)</td></tr>
|
|
<tr class="memdesc:abaaf19b1a2b919d4e2d28bb90525ae91"><td class="mdescLeft"> </td><td class="mdescRight">This constructor will build the tree given a dataset and an instantiated metric. <a href="#abaaf19b1a2b919d4e2d28bb90525ae91">More...</a><br /></td></tr>
|
|
<tr class="separator:abaaf19b1a2b919d4e2d28bb90525ae91"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a89587cb6e4700f219ee2d157e89d9044"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#a89587cb6e4700f219ee2d157e89d9044">Centroid</a> (arma::vec &centroid) const </td></tr>
|
|
<tr class="memdesc:a89587cb6e4700f219ee2d157e89d9044"><td class="mdescLeft"> </td><td class="mdescRight">Fill the given vector with the center of the node. <a href="#a89587cb6e4700f219ee2d157e89d9044">More...</a><br /></td></tr>
|
|
<tr class="separator:a89587cb6e4700f219ee2d157e89d9044"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ad1a4181cc3e07c758d3294e84037aafd"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">ExampleTree</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#ad1a4181cc3e07c758d3294e84037aafd">Child</a> (const size_t i) const </td></tr>
|
|
<tr class="memdesc:ad1a4181cc3e07c758d3294e84037aafd"><td class="mdescLeft"> </td><td class="mdescRight">Return a particular child of this node. <a href="#ad1a4181cc3e07c758d3294e84037aafd">More...</a><br /></td></tr>
|
|
<tr class="separator:ad1a4181cc3e07c758d3294e84037aafd"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ab44308fa6063a394e0bbf56970348313"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">ExampleTree</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#ab44308fa6063a394e0bbf56970348313">Child</a> (const size_t i)</td></tr>
|
|
<tr class="memdesc:ab44308fa6063a394e0bbf56970348313"><td class="mdescLeft"> </td><td class="mdescRight">Modify a particular child of this node. <a href="#ab44308fa6063a394e0bbf56970348313">More...</a><br /></td></tr>
|
|
<tr class="separator:ab44308fa6063a394e0bbf56970348313"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac73da82b85245cf1dc044decebb204e6"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#ac73da82b85245cf1dc044decebb204e6">Descendant</a> (const size_t i) const </td></tr>
|
|
<tr class="memdesc:ac73da82b85245cf1dc044decebb204e6"><td class="mdescLeft"> </td><td class="mdescRight">Get the index of a particular descendant point. <a href="#ac73da82b85245cf1dc044decebb204e6">More...</a><br /></td></tr>
|
|
<tr class="separator:ac73da82b85245cf1dc044decebb204e6"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ae470d95ccb6058f848cd8e6f94c21974"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#ae470d95ccb6058f848cd8e6f94c21974">FurthestDescendantDistance</a> () const </td></tr>
|
|
<tr class="memdesc:ae470d95ccb6058f848cd8e6f94c21974"><td class="mdescLeft"> </td><td class="mdescRight">Get the distance from the center of the node to the furthest descendant point of this node. <a href="#ae470d95ccb6058f848cd8e6f94c21974">More...</a><br /></td></tr>
|
|
<tr class="separator:ae470d95ccb6058f848cd8e6f94c21974"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a6f7b0f22d5b042fefa548afe59ba4656"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#a6f7b0f22d5b042fefa548afe59ba4656">MaxDistance</a> (const MatType &point) const </td></tr>
|
|
<tr class="memdesc:a6f7b0f22d5b042fefa548afe59ba4656"><td class="mdescLeft"> </td><td class="mdescRight">Return the maximum distance between this node and a point. <a href="#a6f7b0f22d5b042fefa548afe59ba4656">More...</a><br /></td></tr>
|
|
<tr class="separator:a6f7b0f22d5b042fefa548afe59ba4656"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a08c2148558faf8b8baccca16b069afbb"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#a08c2148558faf8b8baccca16b069afbb">MaxDistance</a> (const <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">ExampleTree</a> &other) const </td></tr>
|
|
<tr class="memdesc:a08c2148558faf8b8baccca16b069afbb"><td class="mdescLeft"> </td><td class="mdescRight">Return the maximum distance between this node and another node. <a href="#a08c2148558faf8b8baccca16b069afbb">More...</a><br /></td></tr>
|
|
<tr class="separator:a08c2148558faf8b8baccca16b069afbb"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:acae2d391cfc2e6a1ab0e3db6a0219bb0"><td class="memItemLeft" align="right" valign="top">const MetricType & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#acae2d391cfc2e6a1ab0e3db6a0219bb0">Metric</a> () const </td></tr>
|
|
<tr class="memdesc:acae2d391cfc2e6a1ab0e3db6a0219bb0"><td class="mdescLeft"> </td><td class="mdescRight">Get the instantiated metric for this node. <a href="#acae2d391cfc2e6a1ab0e3db6a0219bb0">More...</a><br /></td></tr>
|
|
<tr class="separator:acae2d391cfc2e6a1ab0e3db6a0219bb0"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a685237eef81085d8c7b140c71ec87776"><td class="memItemLeft" align="right" valign="top">MetricType & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#a685237eef81085d8c7b140c71ec87776">Metric</a> ()</td></tr>
|
|
<tr class="memdesc:a685237eef81085d8c7b140c71ec87776"><td class="mdescLeft"> </td><td class="mdescRight">Modify the instantiated metric for this node. <a href="#a685237eef81085d8c7b140c71ec87776">More...</a><br /></td></tr>
|
|
<tr class="separator:a685237eef81085d8c7b140c71ec87776"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a6d09b7624a33c4476892aaee57c21a24"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#a6d09b7624a33c4476892aaee57c21a24">MinDistance</a> (const MatType &point) const </td></tr>
|
|
<tr class="memdesc:a6d09b7624a33c4476892aaee57c21a24"><td class="mdescLeft"> </td><td class="mdescRight">Return the minimum distance between this node and a point. <a href="#a6d09b7624a33c4476892aaee57c21a24">More...</a><br /></td></tr>
|
|
<tr class="separator:a6d09b7624a33c4476892aaee57c21a24"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aadac61e3dbbe44c200c50bd3be7e520f"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#aadac61e3dbbe44c200c50bd3be7e520f">MinDistance</a> (const <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">ExampleTree</a> &other) const </td></tr>
|
|
<tr class="memdesc:aadac61e3dbbe44c200c50bd3be7e520f"><td class="mdescLeft"> </td><td class="mdescRight">Return the minimum distance between this node and another node. <a href="#aadac61e3dbbe44c200c50bd3be7e520f">More...</a><br /></td></tr>
|
|
<tr class="separator:aadac61e3dbbe44c200c50bd3be7e520f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:af6a98cb805e6d08ffc088e21a69f706a"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#af6a98cb805e6d08ffc088e21a69f706a">NumChildren</a> () const </td></tr>
|
|
<tr class="memdesc:af6a98cb805e6d08ffc088e21a69f706a"><td class="mdescLeft"> </td><td class="mdescRight">Return the number of children of this node. <a href="#af6a98cb805e6d08ffc088e21a69f706a">More...</a><br /></td></tr>
|
|
<tr class="separator:af6a98cb805e6d08ffc088e21a69f706a"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a4bea7680d3005d77f4db5cf80cae3a3c"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#a4bea7680d3005d77f4db5cf80cae3a3c">NumDescendants</a> () const </td></tr>
|
|
<tr class="memdesc:a4bea7680d3005d77f4db5cf80cae3a3c"><td class="mdescLeft"> </td><td class="mdescRight">Get the number of descendant points. <a href="#a4bea7680d3005d77f4db5cf80cae3a3c">More...</a><br /></td></tr>
|
|
<tr class="separator:a4bea7680d3005d77f4db5cf80cae3a3c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac436acbced3cd0b99ff5f4223e1554c4"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#ac436acbced3cd0b99ff5f4223e1554c4">NumPoints</a> () const </td></tr>
|
|
<tr class="memdesc:ac436acbced3cd0b99ff5f4223e1554c4"><td class="mdescLeft"> </td><td class="mdescRight">Return the number of points held in this node. <a href="#ac436acbced3cd0b99ff5f4223e1554c4">More...</a><br /></td></tr>
|
|
<tr class="separator:ac436acbced3cd0b99ff5f4223e1554c4"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac2e6342ed4556f5130e4e9b369af6aa2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">ExampleTree</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#ac2e6342ed4556f5130e4e9b369af6aa2">Parent</a> () const </td></tr>
|
|
<tr class="memdesc:ac2e6342ed4556f5130e4e9b369af6aa2"><td class="mdescLeft"> </td><td class="mdescRight">Return the parent node (NULL if this is the root of the tree). <a href="#ac2e6342ed4556f5130e4e9b369af6aa2">More...</a><br /></td></tr>
|
|
<tr class="separator:ac2e6342ed4556f5130e4e9b369af6aa2"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a88dca3b346bc48c177d515674db42029"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#a88dca3b346bc48c177d515674db42029">ParentDistance</a> () const </td></tr>
|
|
<tr class="memdesc:a88dca3b346bc48c177d515674db42029"><td class="mdescLeft"> </td><td class="mdescRight">Get the distance from the center of this node to the center of the parent node. <a href="#a88dca3b346bc48c177d515674db42029">More...</a><br /></td></tr>
|
|
<tr class="separator:a88dca3b346bc48c177d515674db42029"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a20d1e0a047f46caabff14ccaec2ac1a8"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#a20d1e0a047f46caabff14ccaec2ac1a8">Point</a> (const size_t i) const </td></tr>
|
|
<tr class="memdesc:a20d1e0a047f46caabff14ccaec2ac1a8"><td class="mdescLeft"> </td><td class="mdescRight">Return the index of a particular point of this node. <a href="#a20d1e0a047f46caabff14ccaec2ac1a8">More...</a><br /></td></tr>
|
|
<tr class="separator:a20d1e0a047f46caabff14ccaec2ac1a8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:afbe951155756bc116fde10fcc9506959"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacemlpack_1_1math.html#a927179bb8d2d0fb6164df385ab51cbce">math::Range</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#afbe951155756bc116fde10fcc9506959">RangeDistance</a> (const MatType &point) const </td></tr>
|
|
<tr class="memdesc:afbe951155756bc116fde10fcc9506959"><td class="mdescLeft"> </td><td class="mdescRight">Return both the minimum and maximum distances between this node and a point as a <a class="el" href="namespacemlpack_1_1math.html#a927179bb8d2d0fb6164df385ab51cbce" title="3.0.0 TODO: break reverse-compatibility by changing RangeType to Range. ">math::Range</a> object. <a href="#afbe951155756bc116fde10fcc9506959">More...</a><br /></td></tr>
|
|
<tr class="separator:afbe951155756bc116fde10fcc9506959"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a58fb0f98d309a09d3631621467725f7c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacemlpack_1_1math.html#a927179bb8d2d0fb6164df385ab51cbce">math::Range</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#a58fb0f98d309a09d3631621467725f7c">RangeDistance</a> (const <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">ExampleTree</a> &other) const </td></tr>
|
|
<tr class="memdesc:a58fb0f98d309a09d3631621467725f7c"><td class="mdescLeft"> </td><td class="mdescRight">Return both the minimum and maximum distances between this node and another node as a <a class="el" href="namespacemlpack_1_1math.html#a927179bb8d2d0fb6164df385ab51cbce" title="3.0.0 TODO: break reverse-compatibility by changing RangeType to Range. ">math::Range</a> object. <a href="#a58fb0f98d309a09d3631621467725f7c">More...</a><br /></td></tr>
|
|
<tr class="separator:a58fb0f98d309a09d3631621467725f7c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a6f834a749cdf32773e8fd2ce8a49364b"><td class="memItemLeft" align="right" valign="top">const StatisticType & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#a6f834a749cdf32773e8fd2ce8a49364b">Stat</a> () const </td></tr>
|
|
<tr class="memdesc:a6f834a749cdf32773e8fd2ce8a49364b"><td class="mdescLeft"> </td><td class="mdescRight">Get the statistic for this node. <a href="#a6f834a749cdf32773e8fd2ce8a49364b">More...</a><br /></td></tr>
|
|
<tr class="separator:a6f834a749cdf32773e8fd2ce8a49364b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a2b5d05dd720049d3580d425f62bdb27f"><td class="memItemLeft" align="right" valign="top">StatisticType & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#a2b5d05dd720049d3580d425f62bdb27f">Stat</a> ()</td></tr>
|
|
<tr class="memdesc:a2b5d05dd720049d3580d425f62bdb27f"><td class="mdescLeft"> </td><td class="mdescRight">Modify the statistic for this node. <a href="#a2b5d05dd720049d3580d425f62bdb27f">More...</a><br /></td></tr>
|
|
<tr class="separator:a2b5d05dd720049d3580d425f62bdb27f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
|
|
Private Attributes</h2></td></tr>
|
|
<tr class="memitem:a4b4eb828f7492ebafa97a7991c04c315"><td class="memItemLeft" align="right" valign="top">MetricType & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#a4b4eb828f7492ebafa97a7991c04c315">metric</a></td></tr>
|
|
<tr class="memdesc:a4b4eb828f7492ebafa97a7991c04c315"><td class="mdescLeft"> </td><td class="mdescRight">This member is just here so the <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html" title="This is not an actual space tree but instead an example tree that exists to show and document all the...">ExampleTree</a> compiles without warnings. <a href="#a4b4eb828f7492ebafa97a7991c04c315">More...</a><br /></td></tr>
|
|
<tr class="separator:a4b4eb828f7492ebafa97a7991c04c315"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a32eea6c74781112a993ed0ca8693e47b"><td class="memItemLeft" align="right" valign="top">StatisticType </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#a32eea6c74781112a993ed0ca8693e47b">stat</a></td></tr>
|
|
<tr class="memdesc:a32eea6c74781112a993ed0ca8693e47b"><td class="mdescLeft"> </td><td class="mdescRight">This member is just here so the <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html" title="This is not an actual space tree but instead an example tree that exists to show and document all the...">ExampleTree</a> compiles without warnings. <a href="#a32eea6c74781112a993ed0ca8693e47b">More...</a><br /></td></tr>
|
|
<tr class="separator:a32eea6c74781112a993ed0ca8693e47b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><h3>template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat><br />
|
|
class mlpack::tree::ExampleTree< MetricType, StatisticType, MatType ></h3>
|
|
|
|
<p>This is not an actual space tree but instead an example tree that exists to show and document all the functions that mlpack trees must implement. </p>
|
|
<p>For a better overview of trees, see <a class="el" href="trees.html">The TreeType policy in mlpack</a>. Also be aware that the implementations of each of the methods in this example tree are entirely fake and do not work; this example tree exists for its API, not its implementation.</p>
|
|
<p>Note that trees often have different properties. These properties are known at compile-time through the <a class="el" href="classmlpack_1_1tree_1_1TreeTraits.html" title="The TreeTraits class provides compile-time information on the characteristics of a given tree type...">mlpack::tree::TreeTraits</a> class, and some properties may imply the existence (or non-existence) of certain functions. Refer to the <a class="el" href="classmlpack_1_1tree_1_1TreeTraits.html" title="The TreeTraits class provides compile-time information on the characteristics of a given tree type...">TreeTraits</a> for more documentation on that.</p>
|
|
<p>The three template parameters below must be template parameters to the tree, in the order given below. More template parameters are fine, but they must come after the first three.</p>
|
|
<dl class="tparams"><dt>Template Parameters</dt><dd>
|
|
<table class="tparams">
|
|
<tr><td class="paramname">MetricType</td><td>This defines the space in which the tree will be built. For some trees, arbitrary metrics cannot be used, and a template metaprogramming approach should be used to issue a compile-time error if a metric cannot be used with a specific tree type. One example is the <a class="el" href="classmlpack_1_1tree_1_1BinarySpaceTree.html" title="A binary space partitioning tree, such as a KD-tree or a ball tree. ">tree::BinarySpaceTree</a> tree type, which cannot work with the <a class="el" href="classmlpack_1_1metric_1_1IPMetric.html" title="The inner product metric, IPMetric, takes a given Mercer kernel (KernelType), and when Evaluate() is ...">metric::IPMetric</a> class. </td></tr>
|
|
<tr><td class="paramname">StatisticType</td><td>A tree node can hold a statistic, which is sometimes useful for various dual-tree algorithms. The tree itself does not need to know anything about how the statistic works, but it needs to hold a StatisticType in each node. It can be assumed that the StatisticType class has a constructor StatisticType(const ExampleTree&). </td></tr>
|
|
<tr><td class="paramname">MatType</td><td>A tree could be built on a dense matrix or a sparse matrix. All mlpack trees should be able to support any Armadillo-compatible matrix type. When the tree is written it should be assumed that MatType has the same functionality as arma::mat. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p>Definition at line <a class="el" href="example__tree_8hpp_source.html#l00056">56</a> of file <a class="el" href="example__tree_8hpp_source.html">example_tree.hpp</a>.</p>
|
|
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a class="anchor" id="abaaf19b1a2b919d4e2d28bb90525ae91"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::<a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">ExampleTree</a> </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const MatType & </td>
|
|
<td class="paramname"><em>dataset</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">MetricType & </td>
|
|
<td class="paramname"><em>metric</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>This constructor will build the tree given a dataset and an instantiated metric. </p>
|
|
<p>Note that the parameter is a MatType& and not an arma::mat&. The dataset is not modified by the tree-building process (if it is, see the documentation for <a class="el" href="classmlpack_1_1tree_1_1TreeTraits.html#ae6207c6ccffcc6ff51e60f5edbe40d05" title="This is true if the tree rearranges points in the dataset when it is built. ">mlpack::tree::TreeTraits::RearrangesDataset</a> for how to deal with that situation). The MetricType parameter is necessary even though some metrics do not hold any state. This is so that the tree does not have to worry about instantiating the metric (if the tree had to worry about this, this would almost certainly incur additional runtime complexity and a larger runtime size of the tree node objects, which is to be avoided). The metric can't be const, in case MetricType::Evaluate() is non-const.</p>
|
|
<p>When this constructor is finished, the entire tree will be built and ready to use. The constructor should call the constructor of the statistic for each node that is built (see <a class="el" href="classmlpack_1_1tree_1_1EmptyStatistic.html" title="Empty statistic if you are not interested in storing statistics in your tree. ">tree::EmptyStatistic</a> for more information).</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">dataset</td><td>The dataset that the tree will be built on. </td></tr>
|
|
<tr><td class="paramname">metric</td><td>The instantiated metric to use to build the dataset. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a class="anchor" id="a89587cb6e4700f219ee2d157e89d9044"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::Centroid </td>
|
|
<td>(</td>
|
|
<td class="paramtype">arma::vec & </td>
|
|
<td class="paramname"><em>centroid</em></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Fill the given vector with the center of the node. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">centroid</td><td>Vector to be filled with the center of the node. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ad1a4181cc3e07c758d3294e84037aafd"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">ExampleTree</a>& <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::Child </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const size_t </td>
|
|
<td class="paramname"><em>i</em></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Return a particular child of this node. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ab44308fa6063a394e0bbf56970348313"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">ExampleTree</a>& <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::Child </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const size_t </td>
|
|
<td class="paramname"><em>i</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Modify a particular child of this node. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ac73da82b85245cf1dc044decebb204e6"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::Descendant </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const size_t </td>
|
|
<td class="paramname"><em>i</em></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the index of a particular descendant point. </p>
|
|
<p>The ordering of the descendants does not matter, as long as calling Descendant(0) through Descendant(<a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#a4bea7680d3005d77f4db5cf80cae3a3c" title="Get the number of descendant points. ">NumDescendants()</a> - 1) will return the indices of every unique descendant point of the node. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ae470d95ccb6058f848cd8e6f94c21974"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::FurthestDescendantDistance </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the distance from the center of the node to the furthest descendant point of this node. </p>
|
|
<p>This does not necessarily need to be the exact furthest descendant distance but instead can be an upper bound. See the definitions in <a class="el" href="trees.html">The TreeType policy in mlpack</a> for more information. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a6f7b0f22d5b042fefa548afe59ba4656"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::MaxDistance </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const MatType & </td>
|
|
<td class="paramname"><em>point</em></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Return the maximum distance between this node and a point. </p>
|
|
<p>It is not required that the exact maximum distance between the node and the point is returned but instead an upper bound on the maximum distance will suffice. See the definitions in <a class="el" href="trees.html">The TreeType policy in mlpack</a> for more information.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">point</td><td>Point to return [upper bound on] maximum distance to. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a08c2148558faf8b8baccca16b069afbb"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::MaxDistance </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">ExampleTree</a>< MetricType, StatisticType, MatType > & </td>
|
|
<td class="paramname"><em>other</em></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Return the maximum distance between this node and another node. </p>
|
|
<p>It is not required that the exact maximum distance between the two nodes be returned but instead an upper bound on the maximum distance will suffice. See the definitions in <a class="el" href="trees.html">The TreeType policy in mlpack</a> for more information.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">node</td><td>Node to return [upper bound on] maximum distance to. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="acae2d391cfc2e6a1ab0e3db6a0219bb0"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const MetricType& <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::Metric </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the instantiated metric for this node. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a685237eef81085d8c7b140c71ec87776"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">MetricType& <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::Metric </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Modify the instantiated metric for this node. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a6d09b7624a33c4476892aaee57c21a24"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::MinDistance </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const MatType & </td>
|
|
<td class="paramname"><em>point</em></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Return the minimum distance between this node and a point. </p>
|
|
<p>It is not required that the exact minimum distance between the node and the point is returned but instead a lower bound on the minimum distance will suffice. See the definitions in <a class="el" href="trees.html">The TreeType policy in mlpack</a> for more information.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">point</td><td>Point to return [lower bound on] minimum distance to. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="aadac61e3dbbe44c200c50bd3be7e520f"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::MinDistance </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">ExampleTree</a>< MetricType, StatisticType, MatType > & </td>
|
|
<td class="paramname"><em>other</em></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Return the minimum distance between this node and another node. </p>
|
|
<p>It is not required that the exact minimum distance between the two nodes be returned but instead a lower bound on the minimum distance will suffice. See the definitions in <a class="el" href="trees.html">The TreeType policy in mlpack</a> for more information.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">node</td><td>Node to return [lower bound on] minimum distance to. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="af6a98cb805e6d08ffc088e21a69f706a"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::NumChildren </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Return the number of children of this node. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a4bea7680d3005d77f4db5cf80cae3a3c"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::NumDescendants </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the number of descendant points. </p>
|
|
<p>This is the number of unique points held in this node plus the number of points held in all descendant nodes. This could be calculated at build-time and cached, or could be calculated at run-time. This may be harder to calculate for trees that may hold points in multiple nodes (like cover trees and spill trees, for instance). </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ac436acbced3cd0b99ff5f4223e1554c4"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::NumPoints </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Return the number of points held in this node. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ac2e6342ed4556f5130e4e9b369af6aa2"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">ExampleTree</a>* <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::Parent </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Return the parent node (NULL if this is the root of the tree). </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a88dca3b346bc48c177d515674db42029"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::ParentDistance </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the distance from the center of this node to the center of the parent node. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a20d1e0a047f46caabff14ccaec2ac1a8"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::Point </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const size_t </td>
|
|
<td class="paramname"><em>i</em></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Return the index of a particular point of this node. </p>
|
|
<p>mlpack trees do not, in general, hold the actual dataset, and instead just hold the indices of the points they contain. Thus, you might use this function in code like this:</p>
|
|
<div class="fragment"><div class="line">arma::vec thirdPoint = dataset.col(treeNode.Point(2));</div></div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="afbe951155756bc116fde10fcc9506959"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="namespacemlpack_1_1math.html#a927179bb8d2d0fb6164df385ab51cbce">math::Range</a> <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::RangeDistance </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const MatType & </td>
|
|
<td class="paramname"><em>point</em></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Return both the minimum and maximum distances between this node and a point as a <a class="el" href="namespacemlpack_1_1math.html#a927179bb8d2d0fb6164df385ab51cbce" title="3.0.0 TODO: break reverse-compatibility by changing RangeType to Range. ">math::Range</a> object. </p>
|
|
<p>This overload is given because it is possible that, for some tree types, calculation of both at once is faster than a call to <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#a6d09b7624a33c4476892aaee57c21a24" title="Return the minimum distance between this node and a point. ">MinDistance()</a> then <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#a6f7b0f22d5b042fefa548afe59ba4656" title="Return the maximum distance between this node and a point. ">MaxDistance()</a>. It is not necessary that the minimum and maximum distances be exact; it is sufficient to return a lower bound on the minimum distance and an upper bound on the maximum distance. See the definitions in <a class="el" href="trees.html">The TreeType policy in mlpack</a> for more information.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">point</td><td>Point to return [bounds on] minimum and maximum distances to. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a58fb0f98d309a09d3631621467725f7c"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="namespacemlpack_1_1math.html#a927179bb8d2d0fb6164df385ab51cbce">math::Range</a> <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::RangeDistance </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">ExampleTree</a>< MetricType, StatisticType, MatType > & </td>
|
|
<td class="paramname"><em>other</em></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Return both the minimum and maximum distances between this node and another node as a <a class="el" href="namespacemlpack_1_1math.html#a927179bb8d2d0fb6164df385ab51cbce" title="3.0.0 TODO: break reverse-compatibility by changing RangeType to Range. ">math::Range</a> object. </p>
|
|
<p>This overload is given because it is possible that, for some tree types, calculation of both at once is faster than a call to <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#a6d09b7624a33c4476892aaee57c21a24" title="Return the minimum distance between this node and a point. ">MinDistance()</a> then <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html#a6f7b0f22d5b042fefa548afe59ba4656" title="Return the maximum distance between this node and a point. ">MaxDistance()</a>. It is not necessary that the minimum and maximum distances be exact; it is sufficient to return a lower bound on the minimum distance and an upper bound on the maximum distance. See the definitions in <a class="el" href="trees.html">The TreeType policy in mlpack</a> for more information.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">node</td><td>Node to return [bounds on] minimum and maximum distances to. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a6f834a749cdf32773e8fd2ce8a49364b"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const StatisticType& <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::Stat </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the statistic for this node. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a2b5d05dd720049d3580d425f62bdb27f"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">StatisticType& <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::Stat </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Modify the statistic for this node. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Data Documentation</h2>
|
|
<a class="anchor" id="a4b4eb828f7492ebafa97a7991c04c315"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">MetricType& <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::metric</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>This member is just here so the <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html" title="This is not an actual space tree but instead an example tree that exists to show and document all the...">ExampleTree</a> compiles without warnings. </p>
|
|
<p>It is not required to be a member in every type of tree. Be aware that storing the metric as a member and not a reference may mean that for some metrics (such as <a class="el" href="classmlpack_1_1metric_1_1MahalanobisDistance.html" title="The Mahalanobis distance, which is essentially a stretched Euclidean distance. ">metric::MahalanobisDistance</a> in high dimensionality) may incur lots of unnecessary matrix copying. </p>
|
|
|
|
<p>Definition at line <a class="el" href="example__tree_8hpp_source.html#l00234">234</a> of file <a class="el" href="example__tree_8hpp_source.html">example_tree.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a32eea6c74781112a993ed0ca8693e47b"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename MetricType = metric::LMetric<2, true>, typename StatisticType = EmptyStatistic, typename MatType = arma::mat> </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">StatisticType <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html">mlpack::tree::ExampleTree</a>< MetricType, StatisticType, MatType >::stat</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>This member is just here so the <a class="el" href="classmlpack_1_1tree_1_1ExampleTree.html" title="This is not an actual space tree but instead an example tree that exists to show and document all the...">ExampleTree</a> compiles without warnings. </p>
|
|
<p>It is not required to be a member in every type of tree. </p>
|
|
|
|
<p>Definition at line <a class="el" href="example__tree_8hpp_source.html#l00225">225</a> of file <a class="el" href="example__tree_8hpp_source.html">example_tree.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
|
<li>src/mlpack/core/tree/<a class="el" href="example__tree_8hpp_source.html">example_tree.hpp</a></li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.11
|
|
</small></address>
|
|
</body>
|
|
<script type="text/javascript">
|
|
var x = document.getElementsByClassName("formulaDsp");
|
|
var i;
|
|
for (i = 0; i < x.length; i++)
|
|
{
|
|
x[i].width /= 4;
|
|
}
|
|
</script>
|
|
</html>
|