Documentation for 341ed50da8

This commit is contained in:
github-actions
2021-09-03 19:56:17 +00:00
parent 52d0c55145
commit 08e8eb037e
3432 changed files with 71392 additions and 72953 deletions

View File

@@ -2,8 +2,8 @@
<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 http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: range_queries::heavy_light_decomposition::Tree&lt; X &gt; Class Template Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -17,9 +17,9 @@
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
@@ -32,8 +32,7 @@
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Algorithms_in_C++
&#160;<span id="projectnumber">1.0.0</span>
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
</td>
@@ -42,21 +41,22 @@
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<!-- Generated by Doxygen 1.9.2 -->
<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 magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'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 */
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('../../',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
@@ -70,7 +70,7 @@ $(function() {
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html','../../'); initResizable(); });
/* @license-end */
</script>
@@ -96,8 +96,7 @@ $(document).ready(function(){initNavTree('d1/d51/classrange__queries_1_1heavy__l
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="../../d9/d4e/classrange__queries_1_1heavy__light__decomposition_1_1_tree-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">range_queries::heavy_light_decomposition::Tree&lt; X &gt; Class Template Reference</div> </div>
<div class="headertitle"><div class="title">range_queries::heavy_light_decomposition::Tree&lt; X &gt; Class Template Reference</div></div>
</div><!--header-->
<div class="contents">
@@ -109,14 +108,8 @@ Inheritance diagram for range_queries::heavy_light_decomposition::Tree&lt; X &gt
<div class="center"><iframe scrolling="no" frameborder="0" src="../../da/dcc/classrange__queries_1_1heavy__light__decomposition_1_1_tree__inherit__graph.svg" width="162" height="171"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a target="top" href="../../graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for range_queries::heavy_light_decomposition::Tree&lt; X &gt;:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../de/d4c/classrange__queries_1_1heavy__light__decomposition_1_1_tree__coll__graph.svg" width="627" height="231"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a target="top" href="../../graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a835fb2bbb27307b8cacad9b287968bc1"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a835fb2bbb27307b8cacad9b287968bc1">Tree</a> (int nodes)</td></tr>
<tr class="memdesc:a835fb2bbb27307b8cacad9b287968bc1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Class parameterized constructor, resizes the and initializes the data members. <a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a835fb2bbb27307b8cacad9b287968bc1">More...</a><br /></td></tr>
@@ -143,7 +136,7 @@ Public Member Functions</h2></td></tr>
<tr class="memdesc:ae2b407e64aaf9878fbee7ee6efe9c7d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">The function returns the least common ancestor of two nodes. <a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae2b407e64aaf9878fbee7ee6efe9c7d4">More...</a><br /></td></tr>
<tr class="separator:ae2b407e64aaf9878fbee7ee6efe9c7d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-methods"></a>
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-methods" name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr class="memitem:aa339c31ec74cd86a4842a8b09653d460"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa339c31ec74cd86a4842a8b09653d460">dfs_size</a> (int u, int p=-1)</td></tr>
<tr class="memdesc:aa339c31ec74cd86a4842a8b09653d460"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility function to compute sub-tree sizes. <a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa339c31ec74cd86a4842a8b09653d460">More...</a><br /></td></tr>
@@ -152,53 +145,51 @@ Private Member Functions</h2></td></tr>
<tr class="memdesc:ae8de7aefcb6635d3dacdd174cd4890c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility function to populate the t_par vector. <a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae8de7aefcb6635d3dacdd174cd4890c4">More...</a><br /></td></tr>
<tr class="separator:ae8de7aefcb6635d3dacdd174cd4890c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-attribs" name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:ab1aeaefa1bd97b867c652ba916fbdb43"><td class="memItemLeft" align="right" valign="top"><a id="ab1aeaefa1bd97b867c652ba916fbdb43"></a>
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list.html">std::list</a>&lt; int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43">t_adj</a></td></tr>
<tr class="memitem:ab1aeaefa1bd97b867c652ba916fbdb43"><td class="memItemLeft" align="right" valign="top"><a id="ab1aeaefa1bd97b867c652ba916fbdb43" name="ab1aeaefa1bd97b867c652ba916fbdb43"></a>
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list.html">std::list</a>&lt; int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>t_adj</b></td></tr>
<tr class="memdesc:ab1aeaefa1bd97b867c652ba916fbdb43"><td class="mdescLeft">&#160;</td><td class="mdescRight">an adjacency list to stores the tree edges <br /></td></tr>
<tr class="separator:ab1aeaefa1bd97b867c652ba916fbdb43"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae4630fa70a80a1dc65a875488a67178a"><td class="memItemLeft" align="right" valign="top"><a id="ae4630fa70a80a1dc65a875488a67178a"></a>
const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a></td></tr>
<tr class="memitem:ae4630fa70a80a1dc65a875488a67178a"><td class="memItemLeft" align="right" valign="top"><a id="ae4630fa70a80a1dc65a875488a67178a" name="ae4630fa70a80a1dc65a875488a67178a"></a>
const int&#160;</td><td class="memItemRight" valign="bottom"><b>t_nodes</b></td></tr>
<tr class="memdesc:ae4630fa70a80a1dc65a875488a67178a"><td class="mdescLeft">&#160;</td><td class="mdescRight">number of nodes <br /></td></tr>
<tr class="separator:ae4630fa70a80a1dc65a875488a67178a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab2ab020f798d00be2613ecf63074b7c1"><td class="memItemLeft" align="right" valign="top"><a id="ab2ab020f798d00be2613ecf63074b7c1"></a>
const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab2ab020f798d00be2613ecf63074b7c1">t_maxlift</a></td></tr>
<tr class="memitem:ab2ab020f798d00be2613ecf63074b7c1"><td class="memItemLeft" align="right" valign="top"><a id="ab2ab020f798d00be2613ecf63074b7c1" name="ab2ab020f798d00be2613ecf63074b7c1"></a>
const int&#160;</td><td class="memItemRight" valign="bottom"><b>t_maxlift</b></td></tr>
<tr class="memdesc:ab2ab020f798d00be2613ecf63074b7c1"><td class="mdescLeft">&#160;</td><td class="mdescRight">maximum possible height of the tree <br /></td></tr>
<tr class="separator:ab2ab020f798d00be2613ecf63074b7c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a350157a5fb79f76fceae33fc84171203"><td class="memItemLeft" align="right" valign="top"><a id="a350157a5fb79f76fceae33fc84171203"></a>
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a></td></tr>
<tr class="memitem:a350157a5fb79f76fceae33fc84171203"><td class="memItemLeft" align="right" valign="top"><a id="a350157a5fb79f76fceae33fc84171203" name="a350157a5fb79f76fceae33fc84171203"></a>
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>t_par</b></td></tr>
<tr class="memdesc:a350157a5fb79f76fceae33fc84171203"><td class="mdescLeft">&#160;</td><td class="mdescRight">a matrix to store every node's 2^kth parent <br /></td></tr>
<tr class="separator:a350157a5fb79f76fceae33fc84171203"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0efd0b9c564092f443ca97030d866ef1"><td class="memItemLeft" align="right" valign="top"><a id="a0efd0b9c564092f443ca97030d866ef1"></a>
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a></td></tr>
<tr class="memitem:a0efd0b9c564092f443ca97030d866ef1"><td class="memItemLeft" align="right" valign="top"><a id="a0efd0b9c564092f443ca97030d866ef1" name="a0efd0b9c564092f443ca97030d866ef1"></a>
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>t_depth</b></td></tr>
<tr class="memdesc:a0efd0b9c564092f443ca97030d866ef1"><td class="mdescLeft">&#160;</td><td class="mdescRight">a vector to store the depth of a node, <br /></td></tr>
<tr class="separator:a0efd0b9c564092f443ca97030d866ef1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ada1494fccbc7f1f07b2f9be9f7e07ad5"><td class="memItemLeft" align="right" valign="top"><a id="ada1494fccbc7f1f07b2f9be9f7e07ad5"></a>
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ada1494fccbc7f1f07b2f9be9f7e07ad5">t_size</a></td></tr>
<tr class="memitem:ada1494fccbc7f1f07b2f9be9f7e07ad5"><td class="memItemLeft" align="right" valign="top"><a id="ada1494fccbc7f1f07b2f9be9f7e07ad5" name="ada1494fccbc7f1f07b2f9be9f7e07ad5"></a>
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>t_size</b></td></tr>
<tr class="memdesc:ada1494fccbc7f1f07b2f9be9f7e07ad5"><td class="mdescLeft">&#160;</td><td class="mdescRight">a vector to store the subtree size rooted at node <br /></td></tr>
<tr class="separator:ada1494fccbc7f1f07b2f9be9f7e07ad5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6c37e840355b9fb2105181c578694e8"><td class="memItemLeft" align="right" valign="top"><a id="aa6c37e840355b9fb2105181c578694e8"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">t_root</a></td></tr>
<tr class="memitem:aa6c37e840355b9fb2105181c578694e8"><td class="memItemLeft" align="right" valign="top"><a id="aa6c37e840355b9fb2105181c578694e8" name="aa6c37e840355b9fb2105181c578694e8"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>t_root</b></td></tr>
<tr class="memdesc:aa6c37e840355b9fb2105181c578694e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">the root of the tree <br /></td></tr>
<tr class="separator:aa6c37e840355b9fb2105181c578694e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a135b7952593c9b1aae38fcaf1cc1abf7"><td class="memItemLeft" align="right" valign="top"><a id="a135b7952593c9b1aae38fcaf1cc1abf7"></a>
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; X &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">t_val</a></td></tr>
<tr class="memitem:a135b7952593c9b1aae38fcaf1cc1abf7"><td class="memItemLeft" align="right" valign="top"><a id="a135b7952593c9b1aae38fcaf1cc1abf7" name="a135b7952593c9b1aae38fcaf1cc1abf7"></a>
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; X &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>t_val</b></td></tr>
<tr class="memdesc:a135b7952593c9b1aae38fcaf1cc1abf7"><td class="mdescLeft">&#160;</td><td class="mdescRight">values of nodes <br /></td></tr>
<tr class="separator:a135b7952593c9b1aae38fcaf1cc1abf7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="friends" name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:afcdadbdea1e2391cebbb17d2c1ae2f0b"><td class="memTemplParams" colspan="2"><a id="afcdadbdea1e2391cebbb17d2c1ae2f0b"></a>
<tr class="memitem:afcdadbdea1e2391cebbb17d2c1ae2f0b"><td class="memTemplParams" colspan="2"><a id="afcdadbdea1e2391cebbb17d2c1ae2f0b" name="afcdadbdea1e2391cebbb17d2c1ae2f0b"></a>
template&lt;typename T &gt; </td></tr>
<tr class="memitem:afcdadbdea1e2391cebbb17d2c1ae2f0b"><td class="memTemplItemLeft" align="right" valign="top">class&#160;</td><td class="memTemplItemRight" valign="bottom"><b>HLD</b></td></tr>
<tr class="separator:afcdadbdea1e2391cebbb17d2c1ae2f0b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename X&gt;<br />
class range_queries::heavy_light_decomposition::Tree&lt; X &gt;</h3>
<p>A Basic <a class="el" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html" title="A Basic Tree, which supports binary lifting.">Tree</a>, which supports binary lifting. </p>
<div class="textblock"><div class="compoundTemplParams">template&lt;typename X&gt;<br />
class range_queries::heavy_light_decomposition::Tree&lt; X &gt;</div><p >A Basic <a class="el" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html" title="A Basic Tree, which supports binary lifting.">Tree</a>, which supports binary lifting. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">the</td><td>data type of the values stored in the tree nodes</td></tr>
@@ -207,7 +198,7 @@ class range_queries::heavy_light_decomposition::Tree&lt; X &gt;</h3>
</dl>
<p>Deleting the default constructor An instance can only be created with the number of nodes Defaults: t_node indexing are zero based t_root is 0 depth of root_node is 0 Supports: lift :- lift a node k units up the tree kth_ancestor :- returns the kth ancestor lca :- returns the least common ancestor </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a835fb2bbb27307b8cacad9b287968bc1"></a>
<a id="a835fb2bbb27307b8cacad9b287968bc1" name="a835fb2bbb27307b8cacad9b287968bc1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a835fb2bbb27307b8cacad9b287968bc1">&#9670;&nbsp;</a></span>Tree()</h2>
<div class="memitem">
@@ -240,16 +231,15 @@ template&lt;typename X &gt; </div>
</table>
</dd>
</dl>
<div class="fragment"><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; : <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a>(nodes), <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab2ab020f798d00be2613ecf63074b7c1">t_maxlift</a>(<span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/floor.html">floor</a>(log2(nodes))) + 1) {</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="comment">/* Initialize and resize all the vectors */</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">t_root</a> = 0; <span class="comment">/* Default */</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43">t_adj</a>.<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/resize.html">resize</a>(<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a>);</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>.<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/assign.html">assign</a>(<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a>, <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;int&gt;</a>(<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab2ab020f798d00be2613ecf63074b7c1">t_maxlift</a>, -1));</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>.<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/assign.html">assign</a>(<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a>, 0);</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ada1494fccbc7f1f07b2f9be9f7e07ad5">t_size</a>.<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/assign.html">assign</a>(<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a>, 1);</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">t_val</a>.<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/resize.html">resize</a>(<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a>);</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; }</div>
<div class="ttc" id="aassign_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/assign.html">std::vector::assign</a></div><div class="ttdeci">T assign(T... args)</div></div>
<div class="fragment"><div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> : <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a>(nodes), <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab2ab020f798d00be2613ecf63074b7c1">t_maxlift</a>(<span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/floor.html">floor</a>(log2(nodes))) + 1) {</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="comment">/* Initialize and resize all the vectors */</span></div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">t_root</a> = 0; <span class="comment">/* Default */</span></div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43">t_adj</a>.resize(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a>);</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>.assign(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a>, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;int&gt;</a>(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab2ab020f798d00be2613ecf63074b7c1">t_maxlift</a>, -1));</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>.assign(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a>, 0);</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ada1494fccbc7f1f07b2f9be9f7e07ad5">t_size</a>.assign(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a>, 1);</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">t_val</a>.resize(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a>);</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> }</div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_tree_html_a0efd0b9c564092f443ca97030d866ef1"><div class="ttname"><a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">range_queries::heavy_light_decomposition::Tree::t_depth</a></div><div class="ttdeci">std::vector&lt; int &gt; t_depth</div><div class="ttdoc">a vector to store the depth of a node,</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:88</div></div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_tree_html_a135b7952593c9b1aae38fcaf1cc1abf7"><div class="ttname"><a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">range_queries::heavy_light_decomposition::Tree::t_val</a></div><div class="ttdeci">std::vector&lt; X &gt; t_val</div><div class="ttdoc">values of nodes</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:92</div></div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_tree_html_a350157a5fb79f76fceae33fc84171203"><div class="ttname"><a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">range_queries::heavy_light_decomposition::Tree::t_par</a></div><div class="ttdeci">std::vector&lt; std::vector&lt; int &gt; &gt; t_par</div><div class="ttdoc">a matrix to store every node's 2^kth parent</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:87</div></div>
@@ -259,19 +249,12 @@ template&lt;typename X &gt; </div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_tree_html_ada1494fccbc7f1f07b2f9be9f7e07ad5"><div class="ttname"><a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ada1494fccbc7f1f07b2f9be9f7e07ad5">range_queries::heavy_light_decomposition::Tree::t_size</a></div><div class="ttdeci">std::vector&lt; int &gt; t_size</div><div class="ttdoc">a vector to store the subtree size rooted at node</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:89</div></div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_tree_html_ae4630fa70a80a1dc65a875488a67178a"><div class="ttname"><a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">range_queries::heavy_light_decomposition::Tree::t_nodes</a></div><div class="ttdeci">const int t_nodes</div><div class="ttdoc">number of nodes</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:84</div></div>
<div class="ttc" id="afloor_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/floor.html">std::floor</a></div><div class="ttdeci">T floor(T... args)</div></div>
<div class="ttc" id="aresize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/resize.html">std::vector::resize</a></div><div class="ttdeci">T resize(T... args)</div></div>
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt; int &gt;</a></div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a835fb2bbb27307b8cacad9b287968bc1_cgraph.svg" width="339" height="88"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a79ab4601c4a95c0902ac04e779e5f54d"></a>
<a id="a79ab4601c4a95c0902ac04e779e5f54d" name="a79ab4601c4a95c0902ac04e779e5f54d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a79ab4601c4a95c0902ac04e779e5f54d">&#9670;&nbsp;</a></span>add_edge()</h2>
<div class="memitem">
@@ -316,21 +299,14 @@ template&lt;typename X &gt; </div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; {</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43">t_adj</a>[u].<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(v);</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43">t_adj</a>[v].<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(u);</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; }</div>
<div class="ttc" id="apush_back_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">std::vector::push_back</a></div><div class="ttdeci">T push_back(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a79ab4601c4a95c0902ac04e779e5f54d_cgraph.svg" width="366" height="67"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
<div class="fragment"><div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> {</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43">t_adj</a>[u].push_back(v);</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43">t_adj</a>[v].push_back(u);</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> }</div>
</div><!-- fragment -->
</div>
</div>
</div>
</div>
<a id="ab916d554afa8ca5230b4310c2c69fae0"></a>
<a id="ab916d554afa8ca5230b4310c2c69fae0" name="ab916d554afa8ca5230b4310c2c69fae0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab916d554afa8ca5230b4310c2c69fae0">&#9670;&nbsp;</a></span>change_root()</h2>
<div class="memitem">
@@ -364,11 +340,11 @@ template&lt;typename X &gt; </div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160;{ <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">t_root</a> = new_root; }</div>
<div class="fragment"><div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span>{ <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">t_root</a> = new_root; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="ae8de7aefcb6635d3dacdd174cd4890c4"></a>
<a id="ae8de7aefcb6635d3dacdd174cd4890c4" name="ae8de7aefcb6635d3dacdd174cd4890c4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae8de7aefcb6635d3dacdd174cd4890c4">&#9670;&nbsp;</a></span>dfs_lca()</h2>
<div class="memitem">
@@ -413,28 +389,34 @@ template&lt;typename X &gt; </div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><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; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[u][0] = p;</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="keywordflow">if</span> (p != -1) {</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[u] = 1 + <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[p];</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="keywordflow">for</span> (<span class="keywordtype">int</span> k = 1; k &lt; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab2ab020f798d00be2613ecf63074b7c1">t_maxlift</a>; k++) {</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[u][k - 1] != -1) {</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[u][k] = <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[u][k - 1]][k - 1];</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; }</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; <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keywordtype">int</span> &amp;v : <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43">t_adj</a>[u]) {</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="keywordflow">if</span> (v ^ p) {</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae8de7aefcb6635d3dacdd174cd4890c4">dfs_lca</a>(v, u);</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; }</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="fragment"><div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> {</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[u][0] = p;</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordflow">if</span> (p != -1) {</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[u] = 1 + <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[p];</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> }</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k = 1; k &lt; <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab2ab020f798d00be2613ecf63074b7c1">t_maxlift</a>; k++) {</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[u][k - 1] != -1) {</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[u][k] = <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[u][k - 1]][k - 1];</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> }</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> }</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> </div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keywordtype">int</span> &amp;v : <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43">t_adj</a>[u]) {</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <span class="keywordflow">if</span> (v ^ p) {</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <a class="code hl_function" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae8de7aefcb6635d3dacdd174cd4890c4">dfs_lca</a>(v, u);</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> }</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> }</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> }</div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_tree_html_ae8de7aefcb6635d3dacdd174cd4890c4"><div class="ttname"><a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae8de7aefcb6635d3dacdd174cd4890c4">range_queries::heavy_light_decomposition::Tree::dfs_lca</a></div><div class="ttdeci">void dfs_lca(int u, int p=-1)</div><div class="ttdoc">Utility function to populate the t_par vector.</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:116</div></div>
</div><!-- fragment -->
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ae8de7aefcb6635d3dacdd174cd4890c4_cgraph.svg" width="162" height="91"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
<a id="aa339c31ec74cd86a4842a8b09653d460"></a>
</div>
</div>
<a id="aa339c31ec74cd86a4842a8b09653d460" name="aa339c31ec74cd86a4842a8b09653d460"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa339c31ec74cd86a4842a8b09653d460">&#9670;&nbsp;</a></span>dfs_size()</h2>
<div class="memitem">
@@ -480,19 +462,25 @@ template&lt;typename X &gt; </div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><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="keywordflow">for</span> (<span class="keyword">const</span> <span class="keywordtype">int</span> &amp;v : <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43">t_adj</a>[u]) {</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="keywordflow">if</span> (v ^ p) {</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa339c31ec74cd86a4842a8b09653d460">dfs_size</a>(v, u);</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ada1494fccbc7f1f07b2f9be9f7e07ad5">t_size</a>[u] += <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ada1494fccbc7f1f07b2f9be9f7e07ad5">t_size</a>[v];</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; }</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; }</div>
<div class="fragment"><div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> {</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keywordtype">int</span> &amp;v : <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43">t_adj</a>[u]) {</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="keywordflow">if</span> (v ^ p) {</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <a class="code hl_function" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa339c31ec74cd86a4842a8b09653d460">dfs_size</a>(v, u);</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ada1494fccbc7f1f07b2f9be9f7e07ad5">t_size</a>[u] += <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ada1494fccbc7f1f07b2f9be9f7e07ad5">t_size</a>[v];</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> }</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> }</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> }</div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_tree_html_aa339c31ec74cd86a4842a8b09653d460"><div class="ttname"><a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa339c31ec74cd86a4842a8b09653d460">range_queries::heavy_light_decomposition::Tree::dfs_size</a></div><div class="ttdeci">void dfs_size(int u, int p=-1)</div><div class="ttdoc">Utility function to compute sub-tree sizes.</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:101</div></div>
</div><!-- fragment -->
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_aa339c31ec74cd86a4842a8b09653d460_cgraph.svg" width="162" height="91"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
<a id="ad22d760a5a33545a70e7ea5e1786c8dc"></a>
</div>
</div>
<a id="ad22d760a5a33545a70e7ea5e1786c8dc" name="ad22d760a5a33545a70e7ea5e1786c8dc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad22d760a5a33545a70e7ea5e1786c8dc">&#9670;&nbsp;</a></span>init()</h2>
<div class="memitem">
@@ -519,21 +507,21 @@ template&lt;typename X &gt; </div>
<p>This function must be called after the tree adjacency list and node values are populated The function initializes the required parameters, and populates the segment tree. </p>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; {</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; assert(<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a> &gt; 0);</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa339c31ec74cd86a4842a8b09653d460">dfs_size</a>(<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">t_root</a>);</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae8de7aefcb6635d3dacdd174cd4890c4">dfs_lca</a>(<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">t_root</a>);</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; }</div>
<div class="fragment"><div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> {</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> assert(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a> &gt; 0);</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> <a class="code hl_function" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa339c31ec74cd86a4842a8b09653d460">dfs_size</a>(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">t_root</a>);</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> <a class="code hl_function" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae8de7aefcb6635d3dacdd174cd4890c4">dfs_lca</a>(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">t_root</a>);</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> }</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ad22d760a5a33545a70e7ea5e1786c8dc_cgraph.svg" width="360" height="147"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ad22d760a5a33545a70e7ea5e1786c8dc_cgraph.svg" width="360" height="195"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</div>
</div>
<a id="a8f7bca1746d40f21ad832fcea59aa6c6"></a>
<a id="a8f7bca1746d40f21ad832fcea59aa6c6" name="a8f7bca1746d40f21ad832fcea59aa6c6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8f7bca1746d40f21ad832fcea59aa6c6">&#9670;&nbsp;</a></span>kth_ancestor()</h2>
<div class="memitem">
@@ -578,10 +566,10 @@ template&lt;typename X &gt; </div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the kth ancestor of node </dd></dl>
<div class="fragment"><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; {</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ac7761255f2ba06b398b9aae5e4dce5f3">lift</a>(&amp;p, dist);</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <span class="keywordflow">return</span> p;</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; }</div>
<div class="fragment"><div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> {</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> <a class="code hl_function" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ac7761255f2ba06b398b9aae5e4dce5f3">lift</a>(&amp;p, dist);</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> <span class="keywordflow">return</span> p;</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> }</div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_tree_html_ac7761255f2ba06b398b9aae5e4dce5f3"><div class="ttname"><a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ac7761255f2ba06b398b9aae5e4dce5f3">range_queries::heavy_light_decomposition::Tree::lift</a></div><div class="ttdeci">void lift(int *const p, int dist)</div><div class="ttdoc">The function lifts a node, k units up the tree. The lifting is done in place, and the result is store...</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:200</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
@@ -592,7 +580,7 @@ Here is the call graph for this function:</div>
</div>
</div>
<a id="ae2b407e64aaf9878fbee7ee6efe9c7d4"></a>
<a id="ae2b407e64aaf9878fbee7ee6efe9c7d4" name="ae2b407e64aaf9878fbee7ee6efe9c7d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae2b407e64aaf9878fbee7ee6efe9c7d4">&#9670;&nbsp;</a></span>lca()</h2>
<div class="memitem">
@@ -637,25 +625,25 @@ template&lt;typename X &gt; </div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the least common ancestor of node a, and node b </dd></dl>
<div class="fragment"><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; {</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; assert(a &gt;= 0 and b &gt;= 0 and a &lt; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a> and b &lt; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a>);</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[a] &gt; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[b]) {</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ac7761255f2ba06b398b9aae5e4dce5f3">lift</a>(&amp;a, <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[a] - <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[b]);</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; <span class="keywordflow">if</span> (<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[b] &gt; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[a]) {</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ac7761255f2ba06b398b9aae5e4dce5f3">lift</a>(&amp;b, <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[b] - <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[a]);</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; }</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; <span class="keywordflow">if</span> (a == b) {</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; <span class="keywordflow">return</span> a;</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; }</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k = <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab2ab020f798d00be2613ecf63074b7c1">t_maxlift</a> - 1; k &gt;= 0; k--) {</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[a][k] != <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[b][k]) {</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; a = <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[a][k];</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; b = <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[b][k];</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; }</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; }</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; <span class="keywordflow">return</span> <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[a][0];</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; }</div>
<div class="fragment"><div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> {</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> assert(a &gt;= 0 and b &gt;= 0 and a &lt; <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a> and b &lt; <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a>);</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[a] &gt; <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[b]) {</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> <a class="code hl_function" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ac7761255f2ba06b398b9aae5e4dce5f3">lift</a>(&amp;a, <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[a] - <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[b]);</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> }</div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[b] &gt; <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[a]) {</div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> <a class="code hl_function" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ac7761255f2ba06b398b9aae5e4dce5f3">lift</a>(&amp;b, <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[b] - <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">t_depth</a>[a]);</div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> }</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> <span class="keywordflow">if</span> (a == b) {</div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> <span class="keywordflow">return</span> a;</div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> }</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k = <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab2ab020f798d00be2613ecf63074b7c1">t_maxlift</a> - 1; k &gt;= 0; k--) {</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[a][k] != <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[b][k]) {</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> a = <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[a][k];</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> b = <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[b][k];</div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> }</div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> }</div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> <span class="keywordflow">return</span> <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[a][0];</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> }</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
@@ -665,7 +653,7 @@ Here is the call graph for this function:</div>
</div>
</div>
<a id="ac7761255f2ba06b398b9aae5e4dce5f3"></a>
<a id="ac7761255f2ba06b398b9aae5e4dce5f3" name="ac7761255f2ba06b398b9aae5e4dce5f3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac7761255f2ba06b398b9aae5e4dce5f3">&#9670;&nbsp;</a></span>lift()</h2>
<div class="memitem">
@@ -710,21 +698,21 @@ template&lt;typename X &gt; </div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; {</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k = 0; k &lt; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab2ab020f798d00be2613ecf63074b7c1">t_maxlift</a>; k++) {</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <span class="keywordflow">if</span> (*p == -1) {</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; }</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="keywordflow">if</span> (dist &amp; 1) {</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; *p = <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[*p][k];</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; }</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; dist &gt;&gt;= 1;</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; }</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; }</div>
<div class="fragment"><div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> {</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k = 0; k &lt; <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab2ab020f798d00be2613ecf63074b7c1">t_maxlift</a>; k++) {</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> <span class="keywordflow">if</span> (*p == -1) {</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> }</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> <span class="keywordflow">if</span> (dist &amp; 1) {</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> *p = <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">t_par</a>[*p][k];</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> }</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> dist &gt;&gt;= 1;</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> }</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a04cd96efaba147b19d3afc769b90ff70"></a>
<a id="a04cd96efaba147b19d3afc769b90ff70" name="a04cd96efaba147b19d3afc769b90ff70"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a04cd96efaba147b19d3afc769b90ff70">&#9670;&nbsp;</a></span>set_node_val()</h2>
<div class="memitem">
@@ -758,10 +746,10 @@ template&lt;typename X &gt; </div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; {</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; assert(<span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(node_val.<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>()) == <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a>);</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">t_val</a> = node_val;</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; }</div>
<div class="fragment"><div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> {</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> assert(<span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(node_val.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>()) == <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">t_nodes</a>);</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">t_val</a> = node_val;</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> }</div>
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/size.html">std::vector::size</a></div><div class="ttdeci">T size(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
@@ -781,7 +769,7 @@ Here is the call graph for this function:</div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dd/d69/namespacerange__queries.html">range_queries</a></li><li class="navelem"><b>heavy_light_decomposition</b></li><li class="navelem"><a class="el" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html">Tree</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
</ul>
</div>
</body>

View File

@@ -10,7 +10,6 @@ var classrange__queries_1_1heavy__light__decomposition_1_1_tree =
[ "lca", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae2b407e64aaf9878fbee7ee6efe9c7d4", null ],
[ "lift", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ac7761255f2ba06b398b9aae5e4dce5f3", null ],
[ "set_node_val", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a04cd96efaba147b19d3afc769b90ff70", null ],
[ "HLD", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#afcdadbdea1e2391cebbb17d2c1ae2f0b", null ],
[ "t_adj", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43", null ],
[ "t_depth", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1", null ],
[ "t_maxlift", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab2ab020f798d00be2613ecf63074b7c1", null ],

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.48.0 (20210717.1556)
<!-- Generated by graphviz version 2.49.0 (20210828.1703)
-->
<!-- Title: range_queries::heavy_light_decomposition::Tree::set_node_val Pages: 1 -->
<svg width="243pt" height="50pt"

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -1,4 +0,0 @@
<map id="range_queries::heavy_light_decomposition::Tree::add_edge" name="range_queries::heavy_light_decomposition::Tree::add_edge">
<area shape="rect" id="node1" title="Adds an undirected edge from node u to node v in the tree." alt="" coords="5,5,156,61"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/push_back.html#" title=" " alt="" coords="204,20,360,47"/>
</map>

View File

@@ -1,39 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.48.0 (20210717.1556)
-->
<!-- Title: range_queries::heavy_light_decomposition::Tree::add_edge Pages: 1 -->
<svg width="274pt" height="50pt"
viewBox="0.00 0.00 274.00 50.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 46)">
<title>range_queries::heavy_light_decomposition::Tree::add_edge</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-46 270,-46 270,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="Adds an undirected edge from node u to node v in the tree.">
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-41.5 113,-41.5 113,-0.5 0,-0.5"/>
<text text-anchor="start" x="8" y="-29.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="8" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="56.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">::Tree::add_edge</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back.html#" xlink:title=" ">
<polygon fill="white" stroke="black" points="149,-11.5 149,-30.5 266,-30.5 266,-11.5 149,-11.5"/>
<text text-anchor="middle" x="207.5" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::push_back</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1" class="edge">
<title>Node1&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M113.41,-21C121.62,-21 130.17,-21 138.59,-21"/>
<polygon fill="midnightblue" stroke="midnightblue" points="138.79,-24.5 148.79,-21 138.79,-17.5 138.79,-24.5"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -1,5 +0,0 @@
<map id="range_queries::heavy_light_decomposition::Tree::Tree" name="range_queries::heavy_light_decomposition::Tree::Tree">
<area shape="rect" id="node1" title="Class parameterized constructor, resizes the and initializes the data members." alt="" coords="5,16,156,72"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/assign.html#" title=" " alt="" coords="204,5,333,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/resize.html#" title=" " alt="" coords="205,56,332,83"/>
</map>

View File

@@ -1,54 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.48.0 (20210717.1556)
-->
<!-- Title: range_queries::heavy_light_decomposition::Tree::Tree Pages: 1 -->
<svg width="254pt" height="66pt"
viewBox="0.00 0.00 254.00 66.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 62)">
<title>range_queries::heavy_light_decomposition::Tree::Tree</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-62 250,-62 250,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="Class parameterized constructor, resizes the and initializes the data members.">
<polygon fill="#bfbfbf" stroke="black" points="0,-8.5 0,-49.5 113,-49.5 113,-8.5 0,-8.5"/>
<text text-anchor="start" x="8" y="-37.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="8" y="-26.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="56.5" y="-15.5" font-family="Helvetica,sans-Serif" font-size="10.00">::Tree::Tree</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/assign.html#" xlink:title=" ">
<polygon fill="white" stroke="black" points="149,-38.5 149,-57.5 246,-57.5 246,-38.5 149,-38.5"/>
<text text-anchor="middle" x="197.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::assign</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1" class="edge">
<title>Node1&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M113.24,-36.62C121.61,-37.76 130.27,-38.95 138.69,-40.1"/>
<polygon fill="midnightblue" stroke="midnightblue" points="138.42,-43.59 148.8,-41.48 139.37,-36.66 138.42,-43.59"/>
</g>
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/resize.html#" xlink:title=" ">
<polygon fill="white" stroke="black" points="150,-0.5 150,-19.5 245,-19.5 245,-0.5 150,-0.5"/>
<text text-anchor="middle" x="197.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::resize</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge2" class="edge">
<title>Node1&#45;&gt;Node3</title>
<path fill="none" stroke="midnightblue" d="M113.24,-21.38C121.92,-20.19 130.91,-18.97 139.62,-17.78"/>
<polygon fill="midnightblue" stroke="midnightblue" points="140.25,-21.22 149.68,-16.4 139.3,-14.29 140.25,-21.22"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.48.0 (20210717.1556)
<!-- Generated by graphviz version 2.49.0 (20210828.1703)
-->
<!-- Title: range_queries::heavy_light_decomposition::Tree::kth_ancestor Pages: 1 -->
<svg width="270pt" height="50pt"

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -0,0 +1,3 @@
<map id="range_queries::heavy_light_decomposition::Tree::dfs_size" name="range_queries::heavy_light_decomposition::Tree::dfs_size">
<area shape="rect" id="node1" title="Utility function to compute sub&#45;tree sizes." alt="" coords="5,29,156,85"/>
</map>

View File

@@ -0,0 +1 @@
0a4f1b21c1e4b7ce0a4a4048205a2ddc

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.49.0 (20210828.1703)
-->
<!-- Title: range_queries::heavy_light_decomposition::Tree::dfs_size Pages: 1 -->
<svg width="121pt" height="68pt"
viewBox="0.00 0.00 121.00 68.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 64)">
<title>range_queries::heavy_light_decomposition::Tree::dfs_size</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-64 117,-64 117,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="Utility function to compute sub&#45;tree sizes.">
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-41.5 113,-41.5 113,-0.5 0,-0.5"/>
<text text-anchor="start" x="8" y="-29.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="8" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="56.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">::Tree::dfs_size</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge1" class="edge">
<title>Node1&#45;&gt;Node1</title>
<path fill="none" stroke="midnightblue" d="M35.92,-41.86C33.67,-51.54 40.53,-60 56.5,-60 66.48,-60 72.9,-56.7 75.77,-51.86"/>
<polygon fill="midnightblue" stroke="midnightblue" points="79.25,-52.24 77.08,-41.86 72.31,-51.32 79.25,-52.24"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -1,5 +1,5 @@
<map id="range_queries::heavy_light_decomposition::Tree::init" name="range_queries::heavy_light_decomposition::Tree::init">
<area shape="rect" id="node1" title="This function must be called after the tree adjacency list and node values are populated The function..." alt="" coords="5,45,156,101"/>
<area shape="rect" id="node2" href="$d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae8de7aefcb6635d3dacdd174cd4890c4" title="Utility function to populate the t_par vector." alt="" coords="204,5,355,61"/>
<area shape="rect" id="node3" href="$d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa339c31ec74cd86a4842a8b09653d460" title="Utility function to compute sub&#45;tree sizes." alt="" coords="204,85,355,141"/>
<area shape="rect" id="node1" title="This function must be called after the tree adjacency list and node values are populated The function..." alt="" coords="5,81,156,137"/>
<area shape="rect" id="node2" href="$d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae8de7aefcb6635d3dacdd174cd4890c4" title="Utility function to populate the t_par vector." alt="" coords="204,29,355,85"/>
<area shape="rect" id="node3" href="$d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa339c31ec74cd86a4842a8b09653d460" title="Utility function to compute sub&#45;tree sizes." alt="" coords="204,133,355,189"/>
</map>

View File

@@ -1 +1 @@
41e2a595a15a8cfb2d32c9b139971bf2
c8dcad78aea294fb2f8875485054ec76

View File

@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.48.0 (20210717.1556)
<!-- Generated by graphviz version 2.49.0 (20210828.1703)
-->
<!-- Title: range_queries::heavy_light_decomposition::Tree::init Pages: 1 -->
<svg width="270pt" height="110pt"
viewBox="0.00 0.00 270.00 110.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 106)">
<svg width="270pt" height="146pt"
viewBox="0.00 0.00 270.00 146.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 142)">
<title>range_queries::heavy_light_decomposition::Tree::init</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-106 266,-106 266,4 -4,4"/>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-142 266,-142 266,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="This function must be called after the tree adjacency list and node values are populated The function...">
<polygon fill="#bfbfbf" stroke="black" points="0,-30.5 0,-71.5 113,-71.5 113,-30.5 0,-30.5"/>
<text text-anchor="start" x="8" y="-59.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="8" y="-48.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="56.5" y="-37.5" font-family="Helvetica,sans-Serif" font-size="10.00">::Tree::init</text>
<polygon fill="#bfbfbf" stroke="black" points="0,-39.5 0,-80.5 113,-80.5 113,-39.5 0,-39.5"/>
<text text-anchor="start" x="8" y="-68.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="8" y="-57.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="56.5" y="-46.5" font-family="Helvetica,sans-Serif" font-size="10.00">::Tree::init</text>
</a>
</g>
</g>
@@ -24,18 +24,18 @@
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a xlink:href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae8de7aefcb6635d3dacdd174cd4890c4" target="_top" xlink:title="Utility function to populate the t_par vector.">
<polygon fill="white" stroke="black" points="149,-60.5 149,-101.5 262,-101.5 262,-60.5 149,-60.5"/>
<text text-anchor="start" x="157" y="-89.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="157" y="-78.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="205.5" y="-67.5" font-family="Helvetica,sans-Serif" font-size="10.00">::Tree::dfs_lca</text>
<polygon fill="white" stroke="black" points="149,-78.5 149,-119.5 262,-119.5 262,-78.5 149,-78.5"/>
<text text-anchor="start" x="157" y="-107.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="157" y="-96.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="205.5" y="-85.5" font-family="Helvetica,sans-Serif" font-size="10.00">::Tree::dfs_lca</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1" class="edge">
<title>Node1&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M113.07,-62.34C121.49,-64.06 130.24,-65.84 138.84,-67.6"/>
<polygon fill="midnightblue" stroke="midnightblue" points="138.35,-71.07 148.85,-69.64 139.75,-64.21 138.35,-71.07"/>
<path fill="none" stroke="midnightblue" d="M113.07,-74.74C121.58,-77 130.43,-79.35 139.12,-81.65"/>
<polygon fill="midnightblue" stroke="midnightblue" points="138.28,-85.05 148.85,-84.23 140.08,-78.29 138.28,-85.05"/>
</g>
<!-- Node3 -->
<g id="node3" class="node">
@@ -49,10 +49,22 @@
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge2" class="edge">
<g id="edge3" class="edge">
<title>Node1&#45;&gt;Node3</title>
<path fill="none" stroke="midnightblue" d="M113.07,-39.66C121.49,-37.94 130.24,-36.16 138.84,-34.4"/>
<polygon fill="midnightblue" stroke="midnightblue" points="139.75,-37.79 148.85,-32.36 138.35,-30.93 139.75,-37.79"/>
<path fill="none" stroke="midnightblue" d="M113.07,-45.26C121.58,-43 130.43,-40.65 139.12,-38.35"/>
<polygon fill="midnightblue" stroke="midnightblue" points="140.08,-41.71 148.85,-35.77 138.28,-34.95 140.08,-41.71"/>
</g>
<!-- Node2&#45;&gt;Node2 -->
<g id="edge2" class="edge">
<title>Node2&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M178.3,-119.86C175.33,-129.54 184.4,-138 205.5,-138 218.69,-138 227.18,-134.7 230.96,-129.86"/>
<polygon fill="midnightblue" stroke="midnightblue" points="234.43,-130.32 232.7,-119.86 227.54,-129.12 234.43,-130.32"/>
</g>
<!-- Node3&#45;&gt;Node3 -->
<g id="edge4" class="edge">
<title>Node3&#45;&gt;Node3</title>
<path fill="none" stroke="midnightblue" d="M178.3,-41.86C175.33,-51.54 184.4,-60 205.5,-60 218.69,-60 227.18,-56.7 230.96,-51.86"/>
<polygon fill="midnightblue" stroke="midnightblue" points="234.43,-52.32 232.7,-41.86 227.54,-51.12 234.43,-52.32"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.48.0 (20210717.1556)
<!-- Generated by graphviz version 2.49.0 (20210828.1703)
-->
<!-- Title: range_queries::heavy_light_decomposition::Tree::lca Pages: 1 -->
<svg width="270pt" height="50pt"

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -0,0 +1,3 @@
<map id="range_queries::heavy_light_decomposition::Tree::dfs_lca" name="range_queries::heavy_light_decomposition::Tree::dfs_lca">
<area shape="rect" id="node1" title="Utility function to populate the t_par vector." alt="" coords="5,29,156,85"/>
</map>

View File

@@ -0,0 +1 @@
68d41660285659f320d68143912e27ff

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.49.0 (20210828.1703)
-->
<!-- Title: range_queries::heavy_light_decomposition::Tree::dfs_lca Pages: 1 -->
<svg width="121pt" height="68pt"
viewBox="0.00 0.00 121.00 68.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 64)">
<title>range_queries::heavy_light_decomposition::Tree::dfs_lca</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-64 117,-64 117,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="Utility function to populate the t_par vector.">
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-41.5 113,-41.5 113,-0.5 0,-0.5"/>
<text text-anchor="start" x="8" y="-29.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="8" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="56.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">::Tree::dfs_lca</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge1" class="edge">
<title>Node1&#45;&gt;Node1</title>
<path fill="none" stroke="midnightblue" d="M35.92,-41.86C33.67,-51.54 40.53,-60 56.5,-60 66.48,-60 72.9,-56.7 75.77,-51.86"/>
<polygon fill="midnightblue" stroke="midnightblue" points="79.25,-52.24 77.08,-41.86 72.31,-51.32 79.25,-52.24"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB