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::HLD&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('d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html','../../'); initResizable(); });
/* @license-end */
</script>
@@ -95,8 +95,7 @@ $(document).ready(function(){initNavTree('d2/d8a/classrange__queries_1_1heavy__l
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="../../dd/dfc/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">range_queries::heavy_light_decomposition::HLD&lt; X &gt; Class Template Reference</div> </div>
<div class="headertitle"><div class="title">range_queries::heavy_light_decomposition::HLD&lt; X &gt; Class Template Reference</div></div>
</div><!--header-->
<div class="contents">
@@ -111,11 +110,11 @@ Inheritance diagram for range_queries::heavy_light_decomposition::HLD&lt; X &gt;
<div class="dynheader">
Collaboration diagram for range_queries::heavy_light_decomposition::HLD&lt; X &gt;:</div>
<div class="dyncontent">
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph.svg" width="100%" height="511"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph.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>
<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:a6e486767434e44076c1ac374a22da726"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a6e486767434e44076c1ac374a22da726">HLD</a> (int nodes)</td></tr>
<tr class="memdesc:a6e486767434e44076c1ac374a22da726"><td class="mdescLeft">&#160;</td><td class="mdescRight">Class parameterized constructor. Resizes the and initilizes the data members. <a href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a6e486767434e44076c1ac374a22da726">More...</a><br /></td></tr>
@@ -155,7 +154,7 @@ Public Member Functions</h2></td></tr>
<tr class="memdesc:ae2b407e64aaf9878fbee7ee6efe9c7d4 inherit pub_methods_classrange__queries_1_1heavy__light__decomposition_1_1_tree"><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 inherit pub_methods_classrange__queries_1_1heavy__light__decomposition_1_1_tree"><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:af64848d6630c39d0f09ce2359cc7c4f8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#af64848d6630c39d0f09ce2359cc7c4f8">dfs_hc</a> (int u, int p=-1)</td></tr>
<tr class="memdesc:af64848d6630c39d0f09ce2359cc7c4f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility function to assign heavy child to each node (-1 for a leaf node) <a href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#af64848d6630c39d0f09ce2359cc7c4f8">More...</a><br /></td></tr>
@@ -170,30 +169,28 @@ Private Member Functions</h2></td></tr>
<tr class="memdesc:a7d5b40c076347a6aabfb37a0590f2f24"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility function to break down a path query into two chain queries. <a href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a7d5b40c076347a6aabfb37a0590f2f24">More...</a><br /></td></tr>
<tr class="separator:a7d5b40c076347a6aabfb37a0590f2f24"><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:a722cc7cf2c3e4d15583601a48b09776f"><td class="memItemLeft" align="right" valign="top"><a id="a722cc7cf2c3e4d15583601a48b09776f"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a722cc7cf2c3e4d15583601a48b09776f">label</a></td></tr>
<tr class="memitem:a722cc7cf2c3e4d15583601a48b09776f"><td class="memItemLeft" align="right" valign="top"><a id="a722cc7cf2c3e4d15583601a48b09776f" name="a722cc7cf2c3e4d15583601a48b09776f"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>label</b></td></tr>
<tr class="memdesc:a722cc7cf2c3e4d15583601a48b09776f"><td class="mdescLeft">&#160;</td><td class="mdescRight">utility member to assign labels in <a class="el" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a0579062b384e54b611b80c6337c7f2c8" title="Utility function to lable the nodes so that heavy chains have a contigous lable.">dfs_labels()</a> <br /></td></tr>
<tr class="separator:a722cc7cf2c3e4d15583601a48b09776f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa86a91ae0cd7898990a8170a2f2c9cda"><td class="memItemLeft" align="right" valign="top"><a id="aa86a91ae0cd7898990a8170a2f2c9cda"></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="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a></td></tr>
<tr class="memitem:aa86a91ae0cd7898990a8170a2f2c9cda"><td class="memItemLeft" align="right" valign="top"><a id="aa86a91ae0cd7898990a8170a2f2c9cda" name="aa86a91ae0cd7898990a8170a2f2c9cda"></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>h_label</b></td></tr>
<tr class="memdesc:aa86a91ae0cd7898990a8170a2f2c9cda"><td class="mdescLeft">&#160;</td><td class="mdescRight">stores the label of a node <br /></td></tr>
<tr class="separator:aa86a91ae0cd7898990a8170a2f2c9cda"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a84424f180f12b514eaab57a6aa20b104"><td class="memItemLeft" align="right" valign="top"><a id="a84424f180f12b514eaab57a6aa20b104"></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="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a></td></tr>
<tr class="memitem:a84424f180f12b514eaab57a6aa20b104"><td class="memItemLeft" align="right" valign="top"><a id="a84424f180f12b514eaab57a6aa20b104" name="a84424f180f12b514eaab57a6aa20b104"></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>h_heavychlid</b></td></tr>
<tr class="memdesc:a84424f180f12b514eaab57a6aa20b104"><td class="mdescLeft">&#160;</td><td class="mdescRight">stores the heavy child of a node <br /></td></tr>
<tr class="separator:a84424f180f12b514eaab57a6aa20b104"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1b336474d17eff1aa4be73d4068dc725"><td class="memItemLeft" align="right" valign="top"><a id="a1b336474d17eff1aa4be73d4068dc725"></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="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a></td></tr>
<tr class="memitem:a1b336474d17eff1aa4be73d4068dc725"><td class="memItemLeft" align="right" valign="top"><a id="a1b336474d17eff1aa4be73d4068dc725" name="a1b336474d17eff1aa4be73d4068dc725"></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>h_parent</b></td></tr>
<tr class="memdesc:a1b336474d17eff1aa4be73d4068dc725"><td class="mdescLeft">&#160;</td><td class="mdescRight">stores the top of the heavy chain from a node <br /></td></tr>
<tr class="separator:a1b336474d17eff1aa4be73d4068dc725"><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::HLD&lt; X &gt;</h3>
<p>The Heavy-Light Decomposition class. </p>
<div class="textblock"><div class="compoundTemplParams">template&lt;typename X&gt;<br />
class range_queries::heavy_light_decomposition::HLD&lt; X &gt;</div><p >The Heavy-Light Decomposition class. </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>
@@ -201,7 +198,7 @@ class range_queries::heavy_light_decomposition::HLD&lt; X &gt;</h3>
</dd>
</dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a6e486767434e44076c1ac374a22da726"></a>
<a id="a6e486767434e44076c1ac374a22da726" name="a6e486767434e44076c1ac374a22da726"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6e486767434e44076c1ac374a22da726">&#9670;&nbsp;</a></span>HLD()</h2>
<div class="memitem">
@@ -234,29 +231,25 @@ template&lt;typename X &gt; </div>
</table>
</dd>
</dl>
<div class="fragment"><div class="line"><a name="l00435"></a><span class="lineno"> 435</span>&#160; : Tree&lt;X&gt;(nodes), SG&lt;X&gt;(nodes) {</div>
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>&#160; <span class="comment">/* Initialization and resize vectors */</span></div>
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span>&#160; <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a722cc7cf2c3e4d15583601a48b09776f">label</a> = 0;</div>
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span>&#160; <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</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">Tree&lt;X&gt;::t_nodes</a>, -1);</div>
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>&#160; <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</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">Tree&lt;X&gt;::t_nodes</a>, -1);</div>
<div class="line"><a name="l00440"></a><span class="lineno"> 440</span>&#160; <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</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">Tree&lt;X&gt;::t_nodes</a>);</div>
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span>&#160; <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/iota.html">iota</a>(<a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>.<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/begin.html">begin</a>(), <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>.<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/end.html">end</a>(), 0);</div>
<div class="line"><a name="l00442"></a><span class="lineno"> 442</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="ttc" id="abegin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/begin.html">std::vector::begin</a></div><div class="ttdeci">T begin(T... args)</div></div>
<div class="fragment"><div class="line"><a id="l00435" name="l00435"></a><span class="lineno"> 435</span> : Tree&lt;X&gt;(nodes), SG&lt;X&gt;(nodes) {</div>
<div class="line"><a id="l00436" name="l00436"></a><span class="lineno"> 436</span> <span class="comment">/* Initialization and resize vectors */</span></div>
<div class="line"><a id="l00437" name="l00437"></a><span class="lineno"> 437</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a722cc7cf2c3e4d15583601a48b09776f">label</a> = 0;</div>
<div class="line"><a id="l00438" name="l00438"></a><span class="lineno"> 438</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>.assign(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">Tree&lt;X&gt;::t_nodes</a>, -1);</div>
<div class="line"><a id="l00439" name="l00439"></a><span class="lineno"> 439</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>.assign(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">Tree&lt;X&gt;::t_nodes</a>, -1);</div>
<div class="line"><a id="l00440" name="l00440"></a><span class="lineno"> 440</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>.resize(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">Tree&lt;X&gt;::t_nodes</a>);</div>
<div class="line"><a id="l00441" name="l00441"></a><span class="lineno"> 441</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/iota.html">iota</a>(<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>.begin(), <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>.end(), 0);</div>
<div class="line"><a id="l00442" name="l00442"></a><span class="lineno"> 442</span> }</div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_html_a1b336474d17eff1aa4be73d4068dc725"><div class="ttname"><a href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">range_queries::heavy_light_decomposition::HLD::h_parent</a></div><div class="ttdeci">std::vector&lt; int &gt; h_parent</div><div class="ttdoc">stores the top of the heavy chain from a node</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:341</div></div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_html_a722cc7cf2c3e4d15583601a48b09776f"><div class="ttname"><a href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a722cc7cf2c3e4d15583601a48b09776f">range_queries::heavy_light_decomposition::HLD::label</a></div><div class="ttdeci">int label</div><div class="ttdoc">utility member to assign labels in dfs_labels()</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:338</div></div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_html_a84424f180f12b514eaab57a6aa20b104"><div class="ttname"><a href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">range_queries::heavy_light_decomposition::HLD::h_heavychlid</a></div><div class="ttdeci">std::vector&lt; int &gt; h_heavychlid</div><div class="ttdoc">stores the heavy child of a node</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:340</div></div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_html_aa86a91ae0cd7898990a8170a2f2c9cda"><div class="ttname"><a href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">range_queries::heavy_light_decomposition::HLD::h_label</a></div><div class="ttdeci">std::vector&lt; int &gt; h_label</div><div class="ttdoc">stores the label of a node</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:339</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="aend_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/end.html">std::vector::end</a></div><div class="ttdeci">T end(T... args)</div></div>
<div class="ttc" id="aiota_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/iota.html">std::iota</a></div><div class="ttdeci">T iota(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><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a7d5b40c076347a6aabfb37a0590f2f24"></a>
<a id="a7d5b40c076347a6aabfb37a0590f2f24" name="a7d5b40c076347a6aabfb37a0590f2f24"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7d5b40c076347a6aabfb37a0590f2f24">&#9670;&nbsp;</a></span>chain_query()</h2>
<div class="memitem">
@@ -301,25 +294,25 @@ template&lt;typename X &gt; </div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the sum of ndoe values in the simple path from a to b </dd></dl>
<div class="fragment"><div class="line"><a name="l00409"></a><span class="lineno"> 409</span>&#160; {</div>
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span>&#160; X ret = <a class="code" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#aa7f93971a9f891e0bbb7023081f379d5">SG&lt;X&gt;::sret_init</a>;</div>
<div class="line"><a name="l00411"></a><span class="lineno"> 411</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree&lt;X&gt;::t_depth</a>[a] &lt; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree&lt;X&gt;::t_depth</a>[b]) {</div>
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>&#160; <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/swap.html">std::swap</a>(a, b);</div>
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>&#160; }</div>
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>&#160; <span class="keywordflow">while</span> (<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree&lt;X&gt;::t_depth</a>[a] &gt;= <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree&lt;X&gt;::t_depth</a>[b]) {</div>
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span>&#160; <span class="keywordtype">int</span> l = <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[<a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[a]];</div>
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>&#160; <span class="keywordtype">int</span> r = <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[a];</div>
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree&lt;X&gt;::t_depth</a>[<a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[a]] &lt; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree&lt;X&gt;::t_depth</a>[b]) {</div>
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>&#160; l += <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree&lt;X&gt;::t_depth</a>[b] - <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree&lt;X&gt;::t_depth</a>[<a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[a]];</div>
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>&#160; }</div>
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>&#160; ret = <a class="code" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a41c733f5f5e262b308f7cb95c88c1e74">SG&lt;X&gt;::combine</a>(ret, <a class="code" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a1fda852e6e522707fd97f61cdb0a2591">SG&lt;X&gt;::query</a>(l, r));</div>
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>&#160; a = <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">Tree&lt;X&gt;::t_par</a>[<a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[a]][0];</div>
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>&#160; <span class="keywordflow">if</span> (a == -1) {</div>
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00424"></a><span class="lineno"> 424</span>&#160; }</div>
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>&#160; }</div>
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span>&#160; <span class="keywordflow">return</span> ret;</div>
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>&#160; }</div>
<div class="fragment"><div class="line"><a id="l00409" name="l00409"></a><span class="lineno"> 409</span> {</div>
<div class="line"><a id="l00410" name="l00410"></a><span class="lineno"> 410</span> X ret = <a class="code hl_variable" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#aa7f93971a9f891e0bbb7023081f379d5">SG&lt;X&gt;::sret_init</a>;</div>
<div class="line"><a id="l00411" name="l00411"></a><span class="lineno"> 411</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">Tree&lt;X&gt;::t_depth</a>[a] &lt; <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree&lt;X&gt;::t_depth</a>[b]) {</div>
<div class="line"><a id="l00412" name="l00412"></a><span class="lineno"> 412</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/swap.html">std::swap</a>(a, b);</div>
<div class="line"><a id="l00413" name="l00413"></a><span class="lineno"> 413</span> }</div>
<div class="line"><a id="l00414" name="l00414"></a><span class="lineno"> 414</span> <span class="keywordflow">while</span> (<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree&lt;X&gt;::t_depth</a>[a] &gt;= <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree&lt;X&gt;::t_depth</a>[b]) {</div>
<div class="line"><a id="l00415" name="l00415"></a><span class="lineno"> 415</span> <span class="keywordtype">int</span> l = <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[a]];</div>
<div class="line"><a id="l00416" name="l00416"></a><span class="lineno"> 416</span> <span class="keywordtype">int</span> r = <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[a];</div>
<div class="line"><a id="l00417" name="l00417"></a><span class="lineno"> 417</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">Tree&lt;X&gt;::t_depth</a>[<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[a]] &lt; <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree&lt;X&gt;::t_depth</a>[b]) {</div>
<div class="line"><a id="l00418" name="l00418"></a><span class="lineno"> 418</span> l += <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree&lt;X&gt;::t_depth</a>[b] - <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree&lt;X&gt;::t_depth</a>[<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[a]];</div>
<div class="line"><a id="l00419" name="l00419"></a><span class="lineno"> 419</span> }</div>
<div class="line"><a id="l00420" name="l00420"></a><span class="lineno"> 420</span> ret = <a class="code hl_function" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a41c733f5f5e262b308f7cb95c88c1e74">SG&lt;X&gt;::combine</a>(ret, <a class="code hl_function" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a1fda852e6e522707fd97f61cdb0a2591">SG&lt;X&gt;::query</a>(l, r));</div>
<div class="line"><a id="l00421" name="l00421"></a><span class="lineno"> 421</span> a = <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">Tree&lt;X&gt;::t_par</a>[<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[a]][0];</div>
<div class="line"><a id="l00422" name="l00422"></a><span class="lineno"> 422</span> <span class="keywordflow">if</span> (a == -1) {</div>
<div class="line"><a id="l00423" name="l00423"></a><span class="lineno"> 423</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00424" name="l00424"></a><span class="lineno"> 424</span> }</div>
<div class="line"><a id="l00425" name="l00425"></a><span class="lineno"> 425</span> }</div>
<div class="line"><a id="l00426" name="l00426"></a><span class="lineno"> 426</span> <span class="keywordflow">return</span> ret;</div>
<div class="line"><a id="l00427" name="l00427"></a><span class="lineno"> 427</span> }</div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_s_g_html_a1fda852e6e522707fd97f61cdb0a2591"><div class="ttname"><a href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a1fda852e6e522707fd97f61cdb0a2591">range_queries::heavy_light_decomposition::SG::query</a></div><div class="ttdeci">X query(int l, int r)</div><div class="ttdoc">Make a range query from node label l to node label r.</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:305</div></div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_s_g_html_a41c733f5f5e262b308f7cb95c88c1e74"><div class="ttname"><a href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a41c733f5f5e262b308f7cb95c88c1e74">range_queries::heavy_light_decomposition::SG::combine</a></div><div class="ttdeci">X combine(X lhs, X rhs)</div><div class="ttdoc">Function that specifies the type of operation involved when segments are combined.</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:274</div></div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_s_g_html_aa7f93971a9f891e0bbb7023081f379d5"><div class="ttname"><a href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#aa7f93971a9f891e0bbb7023081f379d5">range_queries::heavy_light_decomposition::SG::sret_init</a></div><div class="ttdeci">X sret_init</div><div class="ttdoc">inital query return value</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:264</div></div>
@@ -335,7 +328,7 @@ Here is the call graph for this function:</div>
</div>
</div>
<a id="af64848d6630c39d0f09ce2359cc7c4f8"></a>
<a id="af64848d6630c39d0f09ce2359cc7c4f8" name="af64848d6630c39d0f09ce2359cc7c4f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af64848d6630c39d0f09ce2359cc7c4f8">&#9670;&nbsp;</a></span>dfs_hc()</h2>
<div class="memitem">
@@ -380,26 +373,32 @@ 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="l00350"></a><span class="lineno"> 350</span>&#160; {</div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>&#160; <span class="keywordtype">int</span> hc_size = -1, hc_id = -1;</div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</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">Tree&lt;X&gt;::t_adj</a>[u]) {</div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>&#160; <span class="keywordflow">if</span> (v ^ p) {</div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>&#160; <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#af64848d6630c39d0f09ce2359cc7c4f8">dfs_hc</a>(v, u);</div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ada1494fccbc7f1f07b2f9be9f7e07ad5">Tree&lt;X&gt;::t_size</a>[v] &gt; hc_size) {</div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>&#160; hc_size = <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ada1494fccbc7f1f07b2f9be9f7e07ad5">Tree&lt;X&gt;::t_size</a>[v];</div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>&#160; hc_id = v;</div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>&#160; }</div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>&#160; }</div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>&#160; }</div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>&#160; <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u] = hc_id;</div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>&#160; }</div>
<div class="fragment"><div class="line"><a id="l00350" name="l00350"></a><span class="lineno"> 350</span> {</div>
<div class="line"><a id="l00351" name="l00351"></a><span class="lineno"> 351</span> <span class="keywordtype">int</span> hc_size = -1, hc_id = -1;</div>
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno"> 352</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">Tree&lt;X&gt;::t_adj</a>[u]) {</div>
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno"> 353</span> <span class="keywordflow">if</span> (v ^ p) {</div>
<div class="line"><a id="l00354" name="l00354"></a><span class="lineno"> 354</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#af64848d6630c39d0f09ce2359cc7c4f8">dfs_hc</a>(v, u);</div>
<div class="line"><a id="l00355" name="l00355"></a><span class="lineno"> 355</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ada1494fccbc7f1f07b2f9be9f7e07ad5">Tree&lt;X&gt;::t_size</a>[v] &gt; hc_size) {</div>
<div class="line"><a id="l00356" name="l00356"></a><span class="lineno"> 356</span> hc_size = <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ada1494fccbc7f1f07b2f9be9f7e07ad5">Tree&lt;X&gt;::t_size</a>[v];</div>
<div class="line"><a id="l00357" name="l00357"></a><span class="lineno"> 357</span> hc_id = v;</div>
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno"> 358</span> }</div>
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno"> 359</span> }</div>
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno"> 360</span> }</div>
<div class="line"><a id="l00361" name="l00361"></a><span class="lineno"> 361</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u] = hc_id;</div>
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno"> 362</span> }</div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_html_af64848d6630c39d0f09ce2359cc7c4f8"><div class="ttname"><a href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#af64848d6630c39d0f09ce2359cc7c4f8">range_queries::heavy_light_decomposition::HLD::dfs_hc</a></div><div class="ttdeci">void dfs_hc(int u, int p=-1)</div><div class="ttdoc">Utility function to assign heavy child to each node (-1 for a leaf node)</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:350</div></div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_tree_html_ab1aeaefa1bd97b867c652ba916fbdb43"><div class="ttname"><a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43">range_queries::heavy_light_decomposition::Tree::t_adj</a></div><div class="ttdeci">std::vector&lt; std::list&lt; int &gt; &gt; t_adj</div><div class="ttdoc">an adjacency list to stores the tree edges</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:83</div></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><!-- 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="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_af64848d6630c39d0f09ce2359cc7c4f8_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="a0579062b384e54b611b80c6337c7f2c8"></a>
</div>
</div>
<a id="a0579062b384e54b611b80c6337c7f2c8" name="a0579062b384e54b611b80c6337c7f2c8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0579062b384e54b611b80c6337c7f2c8">&#9670;&nbsp;</a></span>dfs_labels()</h2>
<div class="memitem">
@@ -444,22 +443,28 @@ 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="l00390"></a><span class="lineno"> 390</span>&#160; {</div>
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>&#160; <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[u] = <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a722cc7cf2c3e4d15583601a48b09776f">label</a>++;</div>
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u] != -1) {</div>
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>&#160; <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a0579062b384e54b611b80c6337c7f2c8">dfs_labels</a>(<a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u], u);</div>
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>&#160; }</div>
<div class="line"><a name="l00395"></a><span class="lineno"> 395</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">Tree&lt;X&gt;::t_adj</a>[u]) {</div>
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>&#160; <span class="keywordflow">if</span> (v ^ p and v ^ <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u]) {</div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>&#160; <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a0579062b384e54b611b80c6337c7f2c8">dfs_labels</a>(v, u);</div>
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>&#160; }</div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>&#160; }</div>
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>&#160; }</div>
<div class="fragment"><div class="line"><a id="l00390" name="l00390"></a><span class="lineno"> 390</span> {</div>
<div class="line"><a id="l00391" name="l00391"></a><span class="lineno"> 391</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[u] = <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a722cc7cf2c3e4d15583601a48b09776f">label</a>++;</div>
<div class="line"><a id="l00392" name="l00392"></a><span class="lineno"> 392</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u] != -1) {</div>
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno"> 393</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a0579062b384e54b611b80c6337c7f2c8">dfs_labels</a>(<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u], u);</div>
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno"> 394</span> }</div>
<div class="line"><a id="l00395" name="l00395"></a><span class="lineno"> 395</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">Tree&lt;X&gt;::t_adj</a>[u]) {</div>
<div class="line"><a id="l00396" name="l00396"></a><span class="lineno"> 396</span> <span class="keywordflow">if</span> (v ^ p and v ^ <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u]) {</div>
<div class="line"><a id="l00397" name="l00397"></a><span class="lineno"> 397</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a0579062b384e54b611b80c6337c7f2c8">dfs_labels</a>(v, u);</div>
<div class="line"><a id="l00398" name="l00398"></a><span class="lineno"> 398</span> }</div>
<div class="line"><a id="l00399" name="l00399"></a><span class="lineno"> 399</span> }</div>
<div class="line"><a id="l00400" name="l00400"></a><span class="lineno"> 400</span> }</div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_html_a0579062b384e54b611b80c6337c7f2c8"><div class="ttname"><a href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a0579062b384e54b611b80c6337c7f2c8">range_queries::heavy_light_decomposition::HLD::dfs_labels</a></div><div class="ttdeci">void dfs_labels(int u, int p=-1)</div><div class="ttdoc">Utility function to lable the nodes so that heavy chains have a contigous lable.</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:390</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="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a0579062b384e54b611b80c6337c7f2c8_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="a2dfbda148aad0bfaba2ebfda9ebc915a"></a>
</div>
</div>
<a id="a2dfbda148aad0bfaba2ebfda9ebc915a" name="a2dfbda148aad0bfaba2ebfda9ebc915a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2dfbda148aad0bfaba2ebfda9ebc915a">&#9670;&nbsp;</a></span>dfs_par()</h2>
<div class="memitem">
@@ -504,22 +509,28 @@ 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="l00371"></a><span class="lineno"> 371</span>&#160; {</div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u] != -1) {</div>
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span>&#160; <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[<a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u]] = <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[u];</div>
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>&#160; <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a2dfbda148aad0bfaba2ebfda9ebc915a">dfs_par</a>(<a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u], u);</div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>&#160; }</div>
<div class="line"><a name="l00376"></a><span class="lineno"> 376</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">Tree&lt;X&gt;::t_adj</a>[u]) {</div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>&#160; <span class="keywordflow">if</span> (v ^ p and v ^ <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u]) {</div>
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>&#160; <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a2dfbda148aad0bfaba2ebfda9ebc915a">dfs_par</a>(v, u);</div>
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>&#160; }</div>
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>&#160; }</div>
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>&#160; }</div>
<div class="fragment"><div class="line"><a id="l00371" name="l00371"></a><span class="lineno"> 371</span> {</div>
<div class="line"><a id="l00372" name="l00372"></a><span class="lineno"> 372</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u] != -1) {</div>
<div class="line"><a id="l00373" name="l00373"></a><span class="lineno"> 373</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u]] = <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[u];</div>
<div class="line"><a id="l00374" name="l00374"></a><span class="lineno"> 374</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a2dfbda148aad0bfaba2ebfda9ebc915a">dfs_par</a>(<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u], u);</div>
<div class="line"><a id="l00375" name="l00375"></a><span class="lineno"> 375</span> }</div>
<div class="line"><a id="l00376" name="l00376"></a><span class="lineno"> 376</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">Tree&lt;X&gt;::t_adj</a>[u]) {</div>
<div class="line"><a id="l00377" name="l00377"></a><span class="lineno"> 377</span> <span class="keywordflow">if</span> (v ^ p and v ^ <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u]) {</div>
<div class="line"><a id="l00378" name="l00378"></a><span class="lineno"> 378</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a2dfbda148aad0bfaba2ebfda9ebc915a">dfs_par</a>(v, u);</div>
<div class="line"><a id="l00379" name="l00379"></a><span class="lineno"> 379</span> }</div>
<div class="line"><a id="l00380" name="l00380"></a><span class="lineno"> 380</span> }</div>
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno"> 381</span> }</div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_html_a2dfbda148aad0bfaba2ebfda9ebc915a"><div class="ttname"><a href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a2dfbda148aad0bfaba2ebfda9ebc915a">range_queries::heavy_light_decomposition::HLD::dfs_par</a></div><div class="ttdeci">void dfs_par(int u, int p=-1)</div><div class="ttdoc">Utility function to assign highest parent that can be reached though heavy chains.</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:371</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="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a2dfbda148aad0bfaba2ebfda9ebc915a_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="ae9e979edd69678b85665c01e2ee97828"></a>
</div>
</div>
<a id="ae9e979edd69678b85665c01e2ee97828" name="ae9e979edd69678b85665c01e2ee97828"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae9e979edd69678b85665c01e2ee97828">&#9670;&nbsp;</a></span>init()</h2>
<div class="memitem">
@@ -546,24 +557,24 @@ 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 parametes, 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="l00450"></a><span class="lineno"> 450</span>&#160; {</div>
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ad22d760a5a33545a70e7ea5e1786c8dc">Tree&lt;X&gt;::init</a>();</div>
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span>&#160; </div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span>&#160; <span class="comment">// Fill the heavy child, greatest parent, and labels</span></div>
<div class="line"><a name="l00454"></a><span class="lineno"> 454</span>&#160; <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a722cc7cf2c3e4d15583601a48b09776f">label</a> = 0;</div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>&#160; <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#af64848d6630c39d0f09ce2359cc7c4f8">dfs_hc</a>(<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">Tree&lt;X&gt;::t_root</a>);</div>
<div class="line"><a name="l00456"></a><span class="lineno"> 456</span>&#160; <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a2dfbda148aad0bfaba2ebfda9ebc915a">dfs_par</a>(<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">Tree&lt;X&gt;::t_root</a>);</div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160; <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a0579062b384e54b611b80c6337c7f2c8">dfs_labels</a>(<a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">Tree&lt;X&gt;::t_root</a>);</div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160; </div>
<div class="line"><a name="l00459"></a><span class="lineno"> 459</span>&#160; <span class="comment">// Segment Tree Initialization</span></div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; Tree&lt;X&gt;::t_nodes; i++) {</div>
<div class="line"><a name="l00461"></a><span class="lineno"> 461</span>&#160; <a class="code" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#afbf8a9cb9449d5ca844f4e141a801e6a">SG&lt;X&gt;::s_tree</a>[<a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[i] + <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">Tree&lt;X&gt;::t_nodes</a>] = <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">Tree&lt;X&gt;::t_val</a>[i];</div>
<div class="line"><a name="l00462"></a><span class="lineno"> 462</span>&#160; }</div>
<div class="line"><a name="l00463"></a><span class="lineno"> 463</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">Tree&lt;X&gt;::t_nodes</a> - 1; i &gt; 0; i--) {</div>
<div class="line"><a name="l00464"></a><span class="lineno"> 464</span>&#160; <a class="code" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#afbf8a9cb9449d5ca844f4e141a801e6a">SG&lt;X&gt;::s_tree</a>[i] =</div>
<div class="line"><a name="l00465"></a><span class="lineno"> 465</span>&#160; <a class="code" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a41c733f5f5e262b308f7cb95c88c1e74">SG&lt;X&gt;::combine</a>(<a class="code" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#afbf8a9cb9449d5ca844f4e141a801e6a">SG&lt;X&gt;::s_tree</a>[i &lt;&lt; 1], <a class="code" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#afbf8a9cb9449d5ca844f4e141a801e6a">SG&lt;X&gt;::s_tree</a>[i &lt;&lt; 1 | 1]);</div>
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span>&#160; }</div>
<div class="line"><a name="l00467"></a><span class="lineno"> 467</span>&#160; }</div>
<div class="fragment"><div class="line"><a id="l00450" name="l00450"></a><span class="lineno"> 450</span> {</div>
<div class="line"><a id="l00451" name="l00451"></a><span class="lineno"> 451</span> <a class="code hl_function" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ad22d760a5a33545a70e7ea5e1786c8dc">Tree&lt;X&gt;::init</a>();</div>
<div class="line"><a id="l00452" name="l00452"></a><span class="lineno"> 452</span> </div>
<div class="line"><a id="l00453" name="l00453"></a><span class="lineno"> 453</span> <span class="comment">// Fill the heavy child, greatest parent, and labels</span></div>
<div class="line"><a id="l00454" name="l00454"></a><span class="lineno"> 454</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a722cc7cf2c3e4d15583601a48b09776f">label</a> = 0;</div>
<div class="line"><a id="l00455" name="l00455"></a><span class="lineno"> 455</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#af64848d6630c39d0f09ce2359cc7c4f8">dfs_hc</a>(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">Tree&lt;X&gt;::t_root</a>);</div>
<div class="line"><a id="l00456" name="l00456"></a><span class="lineno"> 456</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a2dfbda148aad0bfaba2ebfda9ebc915a">dfs_par</a>(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">Tree&lt;X&gt;::t_root</a>);</div>
<div class="line"><a id="l00457" name="l00457"></a><span class="lineno"> 457</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a0579062b384e54b611b80c6337c7f2c8">dfs_labels</a>(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">Tree&lt;X&gt;::t_root</a>);</div>
<div class="line"><a id="l00458" name="l00458"></a><span class="lineno"> 458</span> </div>
<div class="line"><a id="l00459" name="l00459"></a><span class="lineno"> 459</span> <span class="comment">// Segment Tree Initialization</span></div>
<div class="line"><a id="l00460" name="l00460"></a><span class="lineno"> 460</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; Tree&lt;X&gt;::t_nodes; i++) {</div>
<div class="line"><a id="l00461" name="l00461"></a><span class="lineno"> 461</span> <a class="code hl_variable" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#afbf8a9cb9449d5ca844f4e141a801e6a">SG&lt;X&gt;::s_tree</a>[<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[i] + <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">Tree&lt;X&gt;::t_nodes</a>] = <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">Tree&lt;X&gt;::t_val</a>[i];</div>
<div class="line"><a id="l00462" name="l00462"></a><span class="lineno"> 462</span> }</div>
<div class="line"><a id="l00463" name="l00463"></a><span class="lineno"> 463</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">Tree&lt;X&gt;::t_nodes</a> - 1; i &gt; 0; i--) {</div>
<div class="line"><a id="l00464" name="l00464"></a><span class="lineno"> 464</span> <a class="code hl_variable" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#afbf8a9cb9449d5ca844f4e141a801e6a">SG&lt;X&gt;::s_tree</a>[i] =</div>
<div class="line"><a id="l00465" name="l00465"></a><span class="lineno"> 465</span> <a class="code hl_function" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a41c733f5f5e262b308f7cb95c88c1e74">SG&lt;X&gt;::combine</a>(<a class="code hl_variable" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#afbf8a9cb9449d5ca844f4e141a801e6a">SG&lt;X&gt;::s_tree</a>[i &lt;&lt; 1], <a class="code hl_variable" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#afbf8a9cb9449d5ca844f4e141a801e6a">SG&lt;X&gt;::s_tree</a>[i &lt;&lt; 1 | 1]);</div>
<div class="line"><a id="l00466" name="l00466"></a><span class="lineno"> 466</span> }</div>
<div class="line"><a id="l00467" name="l00467"></a><span class="lineno"> 467</span> }</div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_s_g_html_afbf8a9cb9449d5ca844f4e141a801e6a"><div class="ttname"><a href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#afbf8a9cb9449d5ca844f4e141a801e6a">range_queries::heavy_light_decomposition::SG::s_tree</a></div><div class="ttdeci">std::vector&lt; X &gt; s_tree</div><div class="ttdoc">Everything here is private, and can only be accessed through the methods, in the derived class (HLD)</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:262</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_aa6c37e840355b9fb2105181c578694e8"><div class="ttname"><a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">range_queries::heavy_light_decomposition::Tree::t_root</a></div><div class="ttdeci">int t_root</div><div class="ttdoc">the root of the tree</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:91</div></div>
@@ -571,13 +582,13 @@ template&lt;typename X &gt; </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="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_ae9e979edd69678b85665c01e2ee97828_cgraph.svg" width="559" height="427"><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="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_ae9e979edd69678b85665c01e2ee97828_cgraph.svg" width="559" height="511"><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="a4dfbf5d9df825eeb63b294c6849bdcab"></a>
<a id="a4dfbf5d9df825eeb63b294c6849bdcab" name="a4dfbf5d9df825eeb63b294c6849bdcab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4dfbf5d9df825eeb63b294c6849bdcab">&#9670;&nbsp;</a></span>query()</h2>
<div class="memitem">
@@ -622,14 +633,14 @@ template&lt;typename X &gt; </div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the sum of node values in the simple path from a to b </dd></dl>
<div class="fragment"><div class="line"><a name="l00489"></a><span class="lineno"> 489</span>&#160; {</div>
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span>&#160; <span class="keywordtype">int</span> lc = <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae2b407e64aaf9878fbee7ee6efe9c7d4">Tree&lt;X&gt;::lca</a>(a, b);</div>
<div class="line"><a name="l00491"></a><span class="lineno"> 491</span>&#160; X ret = <a class="code" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#aa7f93971a9f891e0bbb7023081f379d5">SG&lt;X&gt;::sret_init</a>;</div>
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span>&#160; assert(lc != -1);</div>
<div class="line"><a name="l00493"></a><span class="lineno"> 493</span>&#160; ret += <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a7d5b40c076347a6aabfb37a0590f2f24">chain_query</a>(a, lc);</div>
<div class="line"><a name="l00494"></a><span class="lineno"> 494</span>&#160; ret += <a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a7d5b40c076347a6aabfb37a0590f2f24">chain_query</a>(b, lc);</div>
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span>&#160; <span class="keywordflow">return</span> ret - <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">Tree&lt;X&gt;::t_val</a>[lc];</div>
<div class="line"><a name="l00496"></a><span class="lineno"> 496</span>&#160; }</div>
<div class="fragment"><div class="line"><a id="l00489" name="l00489"></a><span class="lineno"> 489</span> {</div>
<div class="line"><a id="l00490" name="l00490"></a><span class="lineno"> 490</span> <span class="keywordtype">int</span> lc = <a class="code hl_function" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae2b407e64aaf9878fbee7ee6efe9c7d4">Tree&lt;X&gt;::lca</a>(a, b);</div>
<div class="line"><a id="l00491" name="l00491"></a><span class="lineno"> 491</span> X ret = <a class="code hl_variable" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#aa7f93971a9f891e0bbb7023081f379d5">SG&lt;X&gt;::sret_init</a>;</div>
<div class="line"><a id="l00492" name="l00492"></a><span class="lineno"> 492</span> assert(lc != -1);</div>
<div class="line"><a id="l00493" name="l00493"></a><span class="lineno"> 493</span> ret += <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a7d5b40c076347a6aabfb37a0590f2f24">chain_query</a>(a, lc);</div>
<div class="line"><a id="l00494" name="l00494"></a><span class="lineno"> 494</span> ret += <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a7d5b40c076347a6aabfb37a0590f2f24">chain_query</a>(b, lc);</div>
<div class="line"><a id="l00495" name="l00495"></a><span class="lineno"> 495</span> <span class="keywordflow">return</span> ret - <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">Tree&lt;X&gt;::t_val</a>[lc];</div>
<div class="line"><a id="l00496" name="l00496"></a><span class="lineno"> 496</span> }</div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_html_a7d5b40c076347a6aabfb37a0590f2f24"><div class="ttname"><a href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a7d5b40c076347a6aabfb37a0590f2f24">range_queries::heavy_light_decomposition::HLD::chain_query</a></div><div class="ttdeci">X chain_query(int a, int b)</div><div class="ttdoc">Utility function to break down a path query into two chain queries.</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:409</div></div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_tree_html_ae2b407e64aaf9878fbee7ee6efe9c7d4"><div class="ttname"><a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae2b407e64aaf9878fbee7ee6efe9c7d4">range_queries::heavy_light_decomposition::Tree::lca</a></div><div class="ttdeci">int lca(int a, int b)</div><div class="ttdoc">The function returns the least common ancestor of two nodes.</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:229</div></div>
</div><!-- fragment --><div class="dynheader">
@@ -641,7 +652,7 @@ Here is the call graph for this function:</div>
</div>
</div>
<a id="a9f1cb54ed09fde931bf3220d75ee4c57"></a>
<a id="a9f1cb54ed09fde931bf3220d75ee4c57" name="a9f1cb54ed09fde931bf3220d75ee4c57"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9f1cb54ed09fde931bf3220d75ee4c57">&#9670;&nbsp;</a></span>update()</h2>
<div class="memitem">
@@ -686,11 +697,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="l00475"></a><span class="lineno"> 475</span>&#160; {</div>
<div class="line"><a name="l00476"></a><span class="lineno"> 476</span>&#160; X diff = val - <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">Tree&lt;X&gt;::t_val</a>[<a class="code" href="../../d1/df3/hash__search_8cpp.html#a8ca8dcb494104d273679e219e53d0555">node</a>];</div>
<div class="line"><a name="l00477"></a><span class="lineno"> 477</span>&#160; <a class="code" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a3c75bf5770790f8eba8cc92227b5400c">SG&lt;X&gt;::update</a>(<a class="code" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[<a class="code" href="../../d5/da1/structnode.html">node</a>], diff);</div>
<div class="line"><a name="l00478"></a><span class="lineno"> 478</span>&#160; <a class="code" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">Tree&lt;X&gt;::t_val</a>[<a class="code" href="../../d1/df3/hash__search_8cpp.html#a8ca8dcb494104d273679e219e53d0555">node</a>] = val;</div>
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span>&#160; }</div>
<div class="fragment"><div class="line"><a id="l00475" name="l00475"></a><span class="lineno"> 475</span> {</div>
<div class="line"><a id="l00476" name="l00476"></a><span class="lineno"> 476</span> X diff = val - <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">Tree&lt;X&gt;::t_val</a>[<a class="code hl_typedef" href="../../d1/df3/hash__search_8cpp.html#a8ca8dcb494104d273679e219e53d0555">node</a>];</div>
<div class="line"><a id="l00477" name="l00477"></a><span class="lineno"> 477</span> <a class="code hl_function" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a3c75bf5770790f8eba8cc92227b5400c">SG&lt;X&gt;::update</a>(<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>], diff);</div>
<div class="line"><a id="l00478" name="l00478"></a><span class="lineno"> 478</span> <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">Tree&lt;X&gt;::t_val</a>[<a class="code hl_typedef" href="../../d1/df3/hash__search_8cpp.html#a8ca8dcb494104d273679e219e53d0555">node</a>] = val;</div>
<div class="line"><a id="l00479" name="l00479"></a><span class="lineno"> 479</span> }</div>
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_s_g_html_a3c75bf5770790f8eba8cc92227b5400c"><div class="ttname"><a href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a3c75bf5770790f8eba8cc92227b5400c">range_queries::heavy_light_decomposition::SG::update</a></div><div class="ttdeci">void update(int p, X v)</div><div class="ttdoc">Update the value at a node.</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:293</div></div>
<div class="ttc" id="ahash__search_8cpp_html_a8ca8dcb494104d273679e219e53d0555"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a8ca8dcb494104d273679e219e53d0555">node</a></div><div class="ttdeci">struct list node</div></div>
<div class="ttc" id="astructnode_html"><div class="ttname"><a href="../../d5/da1/structnode.html">node</a></div><div class="ttdef"><b>Definition:</b> avltree.cpp:13</div></div>
@@ -712,7 +723,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="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html">HLD</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

@@ -0,0 +1,3 @@
<map id="range_queries::heavy_light_decomposition::HLD::dfs_labels" name="range_queries::heavy_light_decomposition::HLD::dfs_labels">
<area shape="rect" id="node1" title="Utility function to lable the nodes so that heavy chains have a contigous lable." alt="" coords="5,29,156,85"/>
</map>

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::HLD::dfs_labels 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::HLD::dfs_labels</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 lable the nodes so that heavy chains have a contigous lable.">
<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">::HLD::dfs_labels</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

@@ -0,0 +1,3 @@
<map id="range_queries::heavy_light_decomposition::HLD::dfs_par" name="range_queries::heavy_light_decomposition::HLD::dfs_par">
<area shape="rect" id="node1" title="Utility function to assign highest parent that can be reached though heavy chains." alt="" coords="5,29,156,85"/>
</map>

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::HLD::dfs_par 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::HLD::dfs_par</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 assign highest parent that can be reached though heavy chains.">
<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">::HLD::dfs_par</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,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::HLD::query Pages: 1 -->
<svg width="419pt" height="153pt"

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 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::HLD::chain_query Pages: 1 -->
<svg width="270pt" height="88pt"

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.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::HLD::update Pages: 1 -->
<svg width="270pt" height="50pt"

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -1,10 +1,10 @@
<map id="range_queries::heavy_light_decomposition::HLD::init" name="range_queries::heavy_light_decomposition::HLD::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,165,156,221"/>
<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,213,156,269"/>
<area shape="rect" id="node2" href="$d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a41c733f5f5e262b308f7cb95c88c1e74" title="Function that specifies the type of operation involved when segments are combined." alt="" coords="204,5,355,61"/>
<area shape="rect" id="node3" href="$d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#af64848d6630c39d0f09ce2359cc7c4f8" title="Utility function to assign heavy child to each node (&#45;1 for a leaf node)" alt="" coords="204,85,355,141"/>
<area shape="rect" id="node4" href="$d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a0579062b384e54b611b80c6337c7f2c8" title="Utility function to lable the nodes so that heavy chains have a contigous lable." alt="" coords="204,165,355,221"/>
<area shape="rect" id="node5" href="$d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a2dfbda148aad0bfaba2ebfda9ebc915a" title="Utility function to assign highest parent that can be reached though heavy chains." alt="" coords="204,245,355,301"/>
<area shape="rect" id="node6" href="$d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ad22d760a5a33545a70e7ea5e1786c8dc" title="This function must be called after the tree adjacency list and node values are populated The function..." alt="" coords="204,325,355,381"/>
<area shape="rect" id="node7" 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="403,285,553,341"/>
<area shape="rect" id="node8" 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="403,365,553,421"/>
<area shape="rect" id="node3" href="$d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#af64848d6630c39d0f09ce2359cc7c4f8" title="Utility function to assign heavy child to each node (&#45;1 for a leaf node)" alt="" coords="204,109,355,165"/>
<area shape="rect" id="node4" href="$d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a0579062b384e54b611b80c6337c7f2c8" title="Utility function to lable the nodes so that heavy chains have a contigous lable." alt="" coords="204,213,355,269"/>
<area shape="rect" id="node5" href="$d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a2dfbda148aad0bfaba2ebfda9ebc915a" title="Utility function to assign highest parent that can be reached though heavy chains." alt="" coords="204,317,355,373"/>
<area shape="rect" id="node6" href="$d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ad22d760a5a33545a70e7ea5e1786c8dc" title="This function must be called after the tree adjacency list and node values are populated The function..." alt="" coords="204,397,355,453"/>
<area shape="rect" id="node7" 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="403,345,553,401"/>
<area shape="rect" id="node8" 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="403,449,553,505"/>
</map>

View File

@@ -1 +1 @@
1d3a59fdba7e391132e6cdc60cbcc3fa
fd79112d1e449bba49c4e48f39774bf4

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::HLD::init Pages: 1 -->
<svg width="419pt" height="320pt"
viewBox="0.00 0.00 419.00 320.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 316)">
<svg width="419pt" height="383pt"
viewBox="0.00 0.00 419.00 383.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 379)">
<title>range_queries::heavy_light_decomposition::HLD::init</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-316 415,-316 415,4 -4,4"/>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-379 415,-379 415,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,-150.5 0,-191.5 113,-191.5 113,-150.5 0,-150.5"/>
<text text-anchor="start" x="8" y="-179.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="8" y="-168.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="56.5" y="-157.5" font-family="Helvetica,sans-Serif" font-size="10.00">::HLD::init</text>
<polygon fill="#bfbfbf" stroke="black" points="0,-177.5 0,-218.5 113,-218.5 113,-177.5 0,-177.5"/>
<text text-anchor="start" x="8" y="-206.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="8" y="-195.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="56.5" y="-184.5" font-family="Helvetica,sans-Serif" font-size="10.00">::HLD::init</text>
</a>
</g>
</g>
@@ -24,103 +24,121 @@
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a xlink:href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a41c733f5f5e262b308f7cb95c88c1e74" target="_top" xlink:title="Function that specifies the type of operation involved when segments are combined.">
<polygon fill="white" stroke="black" points="149,-270.5 149,-311.5 262,-311.5 262,-270.5 149,-270.5"/>
<text text-anchor="start" x="157" y="-299.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="157" y="-288.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="205.5" y="-277.5" font-family="Helvetica,sans-Serif" font-size="10.00">::SG::combine</text>
<polygon fill="white" stroke="black" points="149,-333.5 149,-374.5 262,-374.5 262,-333.5 149,-333.5"/>
<text text-anchor="start" x="157" y="-362.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="157" y="-351.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="205.5" y="-340.5" font-family="Helvetica,sans-Serif" font-size="10.00">::SG::combine</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="M75.34,-191.64C92.82,-211.07 120.86,-240.21 149,-261 150.83,-262.35 152.72,-263.68 154.66,-264.98"/>
<polygon fill="midnightblue" stroke="midnightblue" points="153.05,-268.1 163.37,-270.48 156.79,-262.18 153.05,-268.1"/>
<path fill="none" stroke="midnightblue" d="M68.49,-218.5C83.72,-245.4 113.4,-292.84 149,-324 150.33,-325.17 151.72,-326.3 153.14,-327.41"/>
<polygon fill="midnightblue" stroke="midnightblue" points="151.48,-330.53 161.67,-333.44 155.53,-324.81 151.48,-330.53"/>
</g>
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a xlink:href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#af64848d6630c39d0f09ce2359cc7c4f8" target="_top" xlink:title="Utility function to assign heavy child to each node (&#45;1 for a leaf node)">
<polygon fill="white" stroke="black" points="149,-210.5 149,-251.5 262,-251.5 262,-210.5 149,-210.5"/>
<text text-anchor="start" x="157" y="-239.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="157" y="-228.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="205.5" y="-217.5" font-family="Helvetica,sans-Serif" font-size="10.00">::HLD::dfs_hc</text>
<polygon fill="white" stroke="black" points="149,-255.5 149,-296.5 262,-296.5 262,-255.5 149,-255.5"/>
<text text-anchor="start" x="157" y="-284.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="157" y="-273.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="205.5" y="-262.5" font-family="Helvetica,sans-Serif" font-size="10.00">::HLD::dfs_hc</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="M108.09,-191.65C119.75,-196.41 132.27,-201.52 144.3,-206.43"/>
<polygon fill="midnightblue" stroke="midnightblue" points="143.24,-209.77 153.82,-210.31 145.88,-203.29 143.24,-209.77"/>
<path fill="none" stroke="midnightblue" d="M96.51,-218.7C115.01,-228.52 137.29,-240.34 156.79,-250.68"/>
<polygon fill="midnightblue" stroke="midnightblue" points="155.35,-253.88 165.82,-255.48 158.63,-247.7 155.35,-253.88"/>
</g>
<!-- Node4 -->
<g id="node4" class="node">
<title>Node4</title>
<g id="a_node4"><a xlink:href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a0579062b384e54b611b80c6337c7f2c8" target="_top" xlink:title="Utility function to lable the nodes so that heavy chains have a contigous lable.">
<polygon fill="white" stroke="black" points="149,-150.5 149,-191.5 262,-191.5 262,-150.5 149,-150.5"/>
<text text-anchor="start" x="157" y="-179.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="157" y="-168.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="205.5" y="-157.5" font-family="Helvetica,sans-Serif" font-size="10.00">::HLD::dfs_labels</text>
<polygon fill="white" stroke="black" points="149,-177.5 149,-218.5 262,-218.5 262,-177.5 149,-177.5"/>
<text text-anchor="start" x="157" y="-206.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="157" y="-195.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="205.5" y="-184.5" font-family="Helvetica,sans-Serif" font-size="10.00">::HLD::dfs_labels</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node4 -->
<g id="edge3" class="edge">
<g id="edge4" class="edge">
<title>Node1&#45;&gt;Node4</title>
<path fill="none" stroke="midnightblue" d="M113.07,-171C121.49,-171 130.24,-171 138.84,-171"/>
<polygon fill="midnightblue" stroke="midnightblue" points="138.85,-174.5 148.85,-171 138.85,-167.5 138.85,-174.5"/>
<path fill="none" stroke="midnightblue" d="M113.07,-198C121.49,-198 130.24,-198 138.84,-198"/>
<polygon fill="midnightblue" stroke="midnightblue" points="138.85,-201.5 148.85,-198 138.85,-194.5 138.85,-201.5"/>
</g>
<!-- Node5 -->
<g id="node5" class="node">
<title>Node5</title>
<g id="a_node5"><a xlink:href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a2dfbda148aad0bfaba2ebfda9ebc915a" target="_top" xlink:title="Utility function to assign highest parent that can be reached though heavy chains.">
<polygon fill="white" stroke="black" points="149,-90.5 149,-131.5 262,-131.5 262,-90.5 149,-90.5"/>
<text text-anchor="start" x="157" y="-119.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="157" y="-108.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="205.5" y="-97.5" font-family="Helvetica,sans-Serif" font-size="10.00">::HLD::dfs_par</text>
<polygon fill="white" stroke="black" points="149,-99.5 149,-140.5 262,-140.5 262,-99.5 149,-99.5"/>
<text text-anchor="start" x="157" y="-128.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="157" y="-117.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="205.5" y="-106.5" font-family="Helvetica,sans-Serif" font-size="10.00">::HLD::dfs_par</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node5 -->
<g id="edge4" class="edge">
<g id="edge6" class="edge">
<title>Node1&#45;&gt;Node5</title>
<path fill="none" stroke="midnightblue" d="M108.09,-150.35C119.75,-145.59 132.27,-140.48 144.3,-135.57"/>
<polygon fill="midnightblue" stroke="midnightblue" points="145.88,-138.71 153.82,-131.69 143.24,-132.23 145.88,-138.71"/>
<path fill="none" stroke="midnightblue" d="M96.51,-177.3C115.01,-167.48 137.29,-155.66 156.79,-145.32"/>
<polygon fill="midnightblue" stroke="midnightblue" points="158.63,-148.3 165.82,-140.52 155.35,-142.12 158.63,-148.3"/>
</g>
<!-- Node6 -->
<g id="node6" class="node">
<title>Node6</title>
<g id="a_node6"><a xlink:href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ad22d760a5a33545a70e7ea5e1786c8dc" target="_top" xlink:title="This function must be called after the tree adjacency list and node values are populated The function...">
<polygon fill="white" stroke="black" points="149,-30.5 149,-71.5 262,-71.5 262,-30.5 149,-30.5"/>
<text text-anchor="start" x="157" y="-59.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="157" y="-48.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="205.5" y="-37.5" font-family="Helvetica,sans-Serif" font-size="10.00">::Tree::init</text>
<polygon fill="white" stroke="black" points="149,-39.5 149,-80.5 262,-80.5 262,-39.5 149,-39.5"/>
<text text-anchor="start" x="157" y="-68.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="157" y="-57.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="205.5" y="-46.5" font-family="Helvetica,sans-Serif" font-size="10.00">::Tree::init</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node6 -->
<g id="edge5" class="edge">
<g id="edge8" class="edge">
<title>Node1&#45;&gt;Node6</title>
<path fill="none" stroke="midnightblue" d="M75.34,-150.36C92.82,-130.93 120.86,-101.79 149,-81 150.83,-79.65 152.72,-78.32 154.66,-77.02"/>
<polygon fill="midnightblue" stroke="midnightblue" points="156.79,-79.82 163.37,-71.52 153.05,-73.9 156.79,-79.82"/>
<path fill="none" stroke="midnightblue" d="M71.43,-177.29C87.9,-153.94 117.13,-115.86 149,-90 150.53,-88.76 152.12,-87.54 153.75,-86.35"/>
<polygon fill="midnightblue" stroke="midnightblue" points="155.86,-89.16 162.21,-80.67 151.96,-83.35 155.86,-89.16"/>
</g>
<!-- Node3&#45;&gt;Node3 -->
<g id="edge3" class="edge">
<title>Node3&#45;&gt;Node3</title>
<path fill="none" stroke="midnightblue" d="M178.3,-296.86C175.33,-306.54 184.4,-315 205.5,-315 218.69,-315 227.18,-311.7 230.96,-306.86"/>
<polygon fill="midnightblue" stroke="midnightblue" points="234.43,-307.32 232.7,-296.86 227.54,-306.12 234.43,-307.32"/>
</g>
<!-- Node4&#45;&gt;Node4 -->
<g id="edge5" class="edge">
<title>Node4&#45;&gt;Node4</title>
<path fill="none" stroke="midnightblue" d="M178.3,-218.86C175.33,-228.54 184.4,-237 205.5,-237 218.69,-237 227.18,-233.7 230.96,-228.86"/>
<polygon fill="midnightblue" stroke="midnightblue" points="234.43,-229.32 232.7,-218.86 227.54,-228.12 234.43,-229.32"/>
</g>
<!-- Node5&#45;&gt;Node5 -->
<g id="edge7" class="edge">
<title>Node5&#45;&gt;Node5</title>
<path fill="none" stroke="midnightblue" d="M178.3,-140.86C175.33,-150.54 184.4,-159 205.5,-159 218.69,-159 227.18,-155.7 230.96,-150.86"/>
<polygon fill="midnightblue" stroke="midnightblue" points="234.43,-151.32 232.7,-140.86 227.54,-150.12 234.43,-151.32"/>
</g>
<!-- Node7 -->
<g id="node7" class="node">
<title>Node7</title>
<g id="a_node7"><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="298,-60.5 298,-101.5 411,-101.5 411,-60.5 298,-60.5"/>
<text text-anchor="start" x="306" y="-89.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="306" y="-78.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="354.5" y="-67.5" font-family="Helvetica,sans-Serif" font-size="10.00">::Tree::dfs_lca</text>
<polygon fill="white" stroke="black" points="298,-78.5 298,-119.5 411,-119.5 411,-78.5 298,-78.5"/>
<text text-anchor="start" x="306" y="-107.5" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::heavy</text>
<text text-anchor="start" x="306" y="-96.5" font-family="Helvetica,sans-Serif" font-size="10.00">_light_decomposition</text>
<text text-anchor="middle" x="354.5" y="-85.5" font-family="Helvetica,sans-Serif" font-size="10.00">::Tree::dfs_lca</text>
</a>
</g>
</g>
<!-- Node6&#45;&gt;Node7 -->
<g id="edge6" class="edge">
<g id="edge9" class="edge">
<title>Node6&#45;&gt;Node7</title>
<path fill="none" stroke="midnightblue" d="M262.07,-62.34C270.49,-64.06 279.24,-65.84 287.84,-67.6"/>
<polygon fill="midnightblue" stroke="midnightblue" points="287.35,-71.07 297.85,-69.64 288.75,-64.21 287.35,-71.07"/>
<path fill="none" stroke="midnightblue" d="M262.07,-74.74C270.58,-77 279.43,-79.35 288.12,-81.65"/>
<polygon fill="midnightblue" stroke="midnightblue" points="287.28,-85.05 297.85,-84.23 289.08,-78.29 287.28,-85.05"/>
</g>
<!-- Node8 -->
<g id="node8" class="node">
@@ -134,10 +152,22 @@
</g>
</g>
<!-- Node6&#45;&gt;Node8 -->
<g id="edge7" class="edge">
<g id="edge11" class="edge">
<title>Node6&#45;&gt;Node8</title>
<path fill="none" stroke="midnightblue" d="M262.07,-39.66C270.49,-37.94 279.24,-36.16 287.84,-34.4"/>
<polygon fill="midnightblue" stroke="midnightblue" points="288.75,-37.79 297.85,-32.36 287.35,-30.93 288.75,-37.79"/>
<path fill="none" stroke="midnightblue" d="M262.07,-45.26C270.58,-43 279.43,-40.65 288.12,-38.35"/>
<polygon fill="midnightblue" stroke="midnightblue" points="289.08,-41.71 297.85,-35.77 287.28,-34.95 289.08,-41.71"/>
</g>
<!-- Node7&#45;&gt;Node7 -->
<g id="edge10" class="edge">
<title>Node7&#45;&gt;Node7</title>
<path fill="none" stroke="midnightblue" d="M327.3,-119.86C324.33,-129.54 333.4,-138 354.5,-138 367.69,-138 376.18,-134.7 379.96,-129.86"/>
<polygon fill="midnightblue" stroke="midnightblue" points="383.43,-130.32 381.7,-119.86 376.54,-129.12 383.43,-130.32"/>
</g>
<!-- Node8&#45;&gt;Node8 -->
<g id="edge12" class="edge">
<title>Node8&#45;&gt;Node8</title>
<path fill="none" stroke="midnightblue" d="M327.3,-41.86C324.33,-51.54 333.4,-60 354.5,-60 367.69,-60 376.18,-56.7 379.96,-51.86"/>
<polygon fill="midnightblue" stroke="midnightblue" points="383.43,-52.32 381.7,-41.86 376.54,-51.12 383.43,-52.32"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,3 @@
<map id="range_queries::heavy_light_decomposition::HLD::dfs_hc" name="range_queries::heavy_light_decomposition::HLD::dfs_hc">
<area shape="rect" id="node1" title="Utility function to assign heavy child to each node (&#45;1 for a leaf node)" alt="" coords="5,29,156,85"/>
</map>

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::HLD::dfs_hc 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::HLD::dfs_hc</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 assign heavy child to each node (&#45;1 for a leaf node)">
<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">::HLD::dfs_hc</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