Documentation for 0d766b0f8a

This commit is contained in:
realstealthninja
2024-11-04 12:32:06 +00:00
parent fb1d00ead7
commit 4fb6e622e9
280 changed files with 2978 additions and 4001 deletions

View File

@@ -206,7 +206,7 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 72</span> </div>
<div class="line"><span class="lineno"> 73</span> <span class="comment">// Create the data table</span></div>
<div class="line"><span class="lineno"> 74</span> <span class="keywordtype">double</span> temp = NAN;</div>
<div class="line"><span class="lineno"> 75</span> <span class="keywordflow">for</span> (<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> i = 0; i &lt;= <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
<div class="line"><span class="lineno"> 75</span> <span class="keywordflow">for</span> (<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> i = 0; i &lt;= <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
<div class="line"><span class="lineno"> 76</span> temp = func(xi);</div>
<div class="line"><span class="lineno"> 77</span> data_table.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map/insert.html">insert</a>(</div>
<div class="line"><span class="lineno"> 78</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair&lt;std::int32_t, double&gt;</a>(i, temp)); <span class="comment">// add i and f(xi)</span></div>
@@ -216,7 +216,7 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 82</span> <span class="comment">// Evaluate the integral.</span></div>
<div class="line"><span class="lineno"> 83</span> <span class="comment">// Remember: f(x0) + 4*f(x1) + 2*f(x2) + ... + 2*f(xN-2) + 4*f(xN-1) + f(xN)</span></div>
<div class="line"><span class="lineno"> 84</span> <span class="keywordtype">double</span> evaluate_integral = 0;</div>
<div class="line"><span class="lineno"> 85</span> <span class="keywordflow">for</span> (<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> i = 0; i &lt;= <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
<div class="line"><span class="lineno"> 85</span> <span class="keywordflow">for</span> (<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> i = 0; i &lt;= <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
<div class="line"><span class="lineno"> 86</span> <span class="keywordflow">if</span> (i == 0 || i == N) {</div>
<div class="line"><span class="lineno"> 87</span> evaluate_integral += data_table.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map/at.html">at</a>(i);</div>
<div class="line"><span class="lineno"> 88</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (i % 2 == 1) {</div>
@@ -238,13 +238,13 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 104</span> <span class="keywordflow">return</span> evaluate_integral;</div>
<div class="line"><span class="lineno"> 105</span>}</div>
<div class="ttc" id="aat_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/map/at.html">std::map::at</a></div><div class="ttdeci">T at(T... args)</div></div>
<div class="ttc" id="adata__structures_2sparse__table_8cpp_html_a10f3ffb3f6f7e1b83d556b9c8de89a5d"><div class="ttname"><a href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">data_structures::sparse_table::N</a></div><div class="ttdeci">constexpr uint32_t N</div><div class="ttdoc">A struct to represent sparse table for min() as their invariant function, for the given array A....</div><div class="ttdef"><b>Definition</b> sparse_table.cpp:48</div></div>
<div class="ttc" id="ahash__search_8cpp_html_a566eaf0ffafd50bc61e644561fd27001"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a></div><div class="ttdeci">int h(int key)</div><div class="ttdef"><b>Definition</b> hash_search.cpp:45</div></div>
<div class="ttc" id="ainsert_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/map/insert.html">std::map::insert</a></div><div class="ttdeci">T insert(T... args)</div></div>
<div class="ttc" id="ainteger_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a></div></div>
<div class="ttc" id="aisnan_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/isnan.html">std::isnan</a></div><div class="ttdeci">T isnan(T... args)</div></div>
<div class="ttc" id="amap_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/map.html">std::map</a></div></div>
<div class="ttc" id="apair_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a></div></div>
<div class="ttc" id="asparse__table_8cpp_html_a10f3ffb3f6f7e1b83d556b9c8de89a5d"><div class="ttname"><a href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">data_structures::sparse_table::N</a></div><div class="ttdeci">constexpr uint32_t N</div><div class="ttdoc">A struct to represent sparse table for min() as their invariant function, for the given array A....</div><div class="ttdef"><b>Definition</b> sparse_table.cpp:48</div></div>
</div><!-- fragment -->
</div>
</div>
@@ -391,7 +391,7 @@ Here is the call graph for this function:</div>
<p>Starting and ending point of the integration in the real axis</p>
<p>Step, calculated by a, b and N</p>
<div class="fragment"><div class="line"><span class="lineno"> 170</span> {</div>
<div class="line"><span class="lineno"> 171</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 16; <span class="comment">/// Number of intervals to divide the integration</span><span class="comment"></span></div>
<div class="line"><span class="lineno"> 171</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 16; <span class="comment">/// Number of intervals to divide the integration</span><span class="comment"></span></div>
<div class="line"><span class="lineno"> 172</span><span class="comment"> /// interval. MUST BE EVEN</span></div>
<div class="line"><span class="lineno"> 173</span><span class="comment"></span> <span class="keywordtype">double</span> a = 1, b = 3; <span class="comment">/// Starting and ending point of the integration in</span><span class="comment"></span></div>
<div class="line"><span class="lineno"> 174</span><span class="comment"> /// the real axis</span></div>
@@ -404,7 +404,7 @@ Here is the call graph for this function:</div>
<div class="line"><span class="lineno"> 181</span> <span class="comment">// Get user input (by the command line parameters or the console after</span></div>
<div class="line"><span class="lineno"> 182</span> <span class="comment">// displaying messages)</span></div>
<div class="line"><span class="lineno"> 183</span> <span class="keywordflow">if</span> (argc == 4) {</div>
<div class="line"><span class="lineno"> 184</span> <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/atoi.html">std::atoi</a>(argv[1]);</div>
<div class="line"><span class="lineno"> 184</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/atoi.html">std::atoi</a>(argv[1]);</div>
<div class="line"><span class="lineno"> 185</span> a = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/atof.html">std::atof</a>(argv[2]);</div>
<div class="line"><span class="lineno"> 186</span> b = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/atof.html">std::atof</a>(argv[3]);</div>
<div class="line"><span class="lineno"> 187</span> <span class="comment">// Check if a&lt;b else abort</span></div>
@@ -413,10 +413,10 @@ Here is the call graph for this function:</div>
<div class="line"><span class="lineno"> 190</span> <span class="keywordflow">if</span> (N &lt; 16 || a != 1 || b != 3) {</div>
<div class="line"><span class="lineno"> 191</span> used_argv_parameters = <span class="keyword">true</span>;</div>
<div class="line"><span class="lineno"> 192</span> }</div>
<div class="line"><span class="lineno"> 193</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;You selected N=&quot;</span> &lt;&lt; <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> &lt;&lt; <span class="stringliteral">&quot;, a=&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, b=&quot;</span> &lt;&lt; b</div>
<div class="line"><span class="lineno"> 193</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;You selected N=&quot;</span> &lt;&lt; <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> &lt;&lt; <span class="stringliteral">&quot;, a=&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, b=&quot;</span> &lt;&lt; b</div>
<div class="line"><span class="lineno"> 194</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 195</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 196</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Default N=&quot;</span> &lt;&lt; <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> &lt;&lt; <span class="stringliteral">&quot;, a=&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, b=&quot;</span> &lt;&lt; b</div>
<div class="line"><span class="lineno"> 196</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Default N=&quot;</span> &lt;&lt; <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> &lt;&lt; <span class="stringliteral">&quot;, a=&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, b=&quot;</span> &lt;&lt; b</div>
<div class="line"><span class="lineno"> 197</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 198</span> }</div>
<div class="line"><span class="lineno"> 199</span> </div>

View File

@@ -1,11 +0,0 @@
<map id="range_queries/sparse_table.cpp" name="range_queries/sparse_table.cpp">
<area shape="rect" id="Node000001" title="Implementation of Sparse Table data structure." alt="" coords="108,5,254,46"/>
<area shape="rect" id="Node000002" title=" " alt="" coords="5,94,80,120"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="148,49,78,88,75,84,145,44"/>
<area shape="rect" id="Node000003" title=" " alt="" coords="104,94,168,120"/>
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="172,48,153,82,148,79,168,45"/>
<area shape="rect" id="Node000004" title=" " alt="" coords="192,94,264,120"/>
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="195,45,215,79,211,82,190,48"/>
<area shape="rect" id="Node000005" title=" " alt="" coords="287,94,344,120"/>
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="216,44,283,83,281,88,213,49"/>
</map>

View File

@@ -1 +0,0 @@
b9a90ade7cac95ede7df6277c6c92ab1

View File

@@ -1,120 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: range_queries/sparse_table.cpp Pages: 1 -->
<svg width="262pt" height="94pt"
viewBox="0.00 0.00 262.38 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<style type="text/css"><![CDATA[
.node, .edge {opacity: 0.7;}
.node.selected, .edge.selected {opacity: 1;}
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 89.75)">
<title>range_queries/sparse_table.cpp</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Implementation of Sparse Table data structure.">
<polygon fill="#999999" stroke="#666666" points="186.38,-85.75 77.38,-85.75 77.38,-55.25 186.38,-55.25 186.38,-85.75"/>
<text text-anchor="start" x="85.38" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries/sparse</text>
<text text-anchor="middle" x="131.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_table.cpp</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="55.75,-19.25 0,-19.25 0,0 55.75,0 55.75,-19.25"/>
<text text-anchor="middle" x="27.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">algorithm</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M105.9,-54.8C89.91,-45.74 69.49,-34.19 53.56,-25.16"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="55.57,-22.28 45.14,-20.4 52.12,-28.37 55.57,-22.28"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="122,-19.25 73.75,-19.25 73.75,0 122,0 122,-19.25"/>
<text text-anchor="middle" x="97.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge2_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M123.47,-54.95C119.04,-47.28 113.55,-37.77 108.8,-29.54"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="111.91,-27.92 103.87,-21.01 105.84,-31.42 111.91,-27.92"/>
</a>
</g>
</g>
<!-- Node4 -->
<g id="Node000004" class="node">
<title>Node4</title>
<g id="a_Node000004"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="193.62,-19.25 140.12,-19.25 140.12,0 193.62,0 193.62,-19.25"/>
<text text-anchor="middle" x="166.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node4 -->
<g id="edge3_Node000001_Node000004" class="edge">
<title>Node1&#45;&gt;Node4</title>
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M140.53,-54.95C145.09,-47.28 150.74,-37.77 155.63,-29.54"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="158.6,-31.39 160.71,-21 152.59,-27.81 158.6,-31.39"/>
</a>
</g>
</g>
<!-- Node5 -->
<g id="Node000005" class="node">
<title>Node5</title>
<g id="a_Node000005"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="254.38,-19.25 211.38,-19.25 211.38,0 254.38,0 254.38,-19.25"/>
<text text-anchor="middle" x="232.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node5 -->
<g id="edge4_Node000001_Node000005" class="edge">
<title>Node1&#45;&gt;Node5</title>
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M157.1,-54.8C172.48,-45.83 192.08,-34.41 207.49,-25.42"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="209.2,-28.48 216.08,-20.42 205.68,-22.43 209.2,-28.48"/>
</a>
</g>
</g>
</g>
</svg>
</svg>
<style type='text/css'>
<![CDATA[
[data-mouse-over-selected='false'] { opacity: 0.7; }
[data-mouse-over-selected='true'] { opacity: 1.0; }
]]>
</style>
<script type="application/ecmascript"><![CDATA[
document.addEventListener('DOMContentLoaded', (event) => {
highlightEdges();
highlightAdjacentNodes();
});
]]></script>
</svg>

Before

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -1,94 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: range_queries/sparse_table.cpp Pages: 1 -->
<svg width="262pt" height="94pt"
viewBox="0.00 0.00 262.38 93.75" 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 89.75)">
<title>range_queries/sparse_table.cpp</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Implementation of Sparse Table data structure.">
<polygon fill="#999999" stroke="#666666" points="186.38,-85.75 77.38,-85.75 77.38,-55.25 186.38,-55.25 186.38,-85.75"/>
<text text-anchor="start" x="85.38" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries/sparse</text>
<text text-anchor="middle" x="131.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_table.cpp</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="55.75,-19.25 0,-19.25 0,0 55.75,0 55.75,-19.25"/>
<text text-anchor="middle" x="27.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">algorithm</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M105.9,-54.8C89.91,-45.74 69.49,-34.19 53.56,-25.16"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="55.57,-22.28 45.14,-20.4 52.12,-28.37 55.57,-22.28"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="122,-19.25 73.75,-19.25 73.75,0 122,0 122,-19.25"/>
<text text-anchor="middle" x="97.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge2_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M123.47,-54.95C119.04,-47.28 113.55,-37.77 108.8,-29.54"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="111.91,-27.92 103.87,-21.01 105.84,-31.42 111.91,-27.92"/>
</a>
</g>
</g>
<!-- Node4 -->
<g id="Node000004" class="node">
<title>Node4</title>
<g id="a_Node000004"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="193.62,-19.25 140.12,-19.25 140.12,0 193.62,0 193.62,-19.25"/>
<text text-anchor="middle" x="166.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node4 -->
<g id="edge3_Node000001_Node000004" class="edge">
<title>Node1&#45;&gt;Node4</title>
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M140.53,-54.95C145.09,-47.28 150.74,-37.77 155.63,-29.54"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="158.6,-31.39 160.71,-21 152.59,-27.81 158.6,-31.39"/>
</a>
</g>
</g>
<!-- Node5 -->
<g id="Node000005" class="node">
<title>Node5</title>
<g id="a_Node000005"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="254.38,-19.25 211.38,-19.25 211.38,0 254.38,0 254.38,-19.25"/>
<text text-anchor="middle" x="232.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node5 -->
<g id="edge4_Node000001_Node000005" class="edge">
<title>Node1&#45;&gt;Node5</title>
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M157.1,-54.8C172.48,-45.83 192.08,-34.41 207.49,-25.42"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="209.2,-28.48 216.08,-20.42 205.68,-22.43 209.2,-28.48"/>
</a>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -250,7 +250,7 @@ Here is the call graph for this function:</div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
<div class="ttc" id="afill_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/array/fill.html">std::array::fill</a></div><div class="ttdeci">T fill(T... args)</div></div>
<div class="ttc" id="asegtree_8cpp_html_abd3e818681fb2e29cf08f4f60f82c8e0"><div class="ttname"><a href="../../d2/d45/segtree_8cpp.html#abd3e818681fb2e29cf08f4f60f82c8e0">update</a></div><div class="ttdeci">void update(std::vector&lt; int64_t &gt; *segtree, std::vector&lt; int64_t &gt; *lazy, int64_t start, int64_t end, int64_t delta, uint64_t low, uint64_t high, uint64_t pos)</div><div class="ttdoc">Updates a range of the segment tree.</div><div class="ttdef"><b>Definition</b> segtree.cpp:102</div></div>
<div class="ttc" id="asegtree_8cpp_html_abd3e818681fb2e29cf08f4f60f82c8e0"><div class="ttname"><a href="../../d2/d45/segtree_8cpp.html#abd3e818681fb2e29cf08f4f60f82c8e0">update</a></div><div class="ttdeci">void update(std::vector&lt; int64_t &gt; *segtree, std::vector&lt; int64_t &gt; *lazy, int64_t start, int64_t end, int64_t delta, uint64_t low, uint64_t high, uint64_t pos)</div><div class="ttdoc">Updates a range of the segment tree.</div><div class="ttdef"><b>Definition</b> segtree.cpp:103</div></div>
<div class="ttc" id="ashared_ptr_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr</a></div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>

View File

@@ -1,352 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: range_queries/sparse_table.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/x-mathjax-config">
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>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<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>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @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:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('../../',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('d4/d96/range__queries_2sparse__table_8cpp.html','../../'); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#namespaces">Namespaces</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">sparse_table.cpp File Reference</div></div>
</div><!--header-->
<div class="contents">
<p>Implementation of <a href="https://en.wikipedia.org/wiki/Range_minimum_query" target="_blank">Sparse Table</a> data structure.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;algorithm&gt;</code><br />
<code>#include &lt;cassert&gt;</code><br />
<code>#include &lt;iostream&gt;</code><br />
<code>#include &lt;vector&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for sparse_table.cpp:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/d31/range__queries_2sparse__table_8cpp__incl.svg" width="350" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d69/namespacerange__queries.html">range_queries</a></td></tr>
<tr class="memdesc:dd/d69/namespacerange__queries"><td class="mdescLeft">&#160;</td><td class="mdescRight">for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a> <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d55/namespacesparse__table.html">sparse_table</a></td></tr>
<tr class="memdesc:d9/d55/namespacesparse__table"><td class="mdescLeft">&#160;</td><td class="mdescRight">Functions for Implementation of <a href="https://brilliant.org/wiki/sparse-table/" target="_blank">Sparse Table</a> <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a40810d8c0fe3f8cf432ab128b1ae0300" id="r_a40810d8c0fe3f8cf432ab128b1ae0300"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a40810d8c0fe3f8cf432ab128b1ae0300"><td class="memTemplItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a40810d8c0fe3f8cf432ab128b1ae0300">range_queries::sparse_table::computeLogs</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;A)</td></tr>
<tr class="separator:a40810d8c0fe3f8cf432ab128b1ae0300"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a803a2451e87021d14ae06f148383e6bc" id="r_a803a2451e87021d14ae06f148383e6bc"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a803a2451e87021d14ae06f148383e6bc"><td class="memTemplItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a803a2451e87021d14ae06f148383e6bc">range_queries::sparse_table::buildTable</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;A, const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;logs)</td></tr>
<tr class="separator:a803a2451e87021d14ae06f148383e6bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a932816c3de9e5ad122b180de60978e8f" id="r_a932816c3de9e5ad122b180de60978e8f"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a932816c3de9e5ad122b180de60978e8f"><td class="memTemplItemLeft" align="right" valign="top">int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a932816c3de9e5ad122b180de60978e8f">range_queries::sparse_table::getMinimum</a> (int beg, int end, const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;logs, const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &gt; &amp;table)</td></tr>
<tr class="separator:a932816c3de9e5ad122b180de60978e8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4" id="r_ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Implementation of <a href="https://en.wikipedia.org/wiki/Range_minimum_query" target="_blank">Sparse Table</a> data structure. </p>
<p>Sparse Table is a data structure, that allows answering range queries. It can answer most range queries in O(logn), but its true power is answering range minimum queries or equivalent range maximum queries). For those queries it can compute the answer in O(1) time.</p>
<ul>
<li>Running Time Complexity <br />
</li>
<li>Build : O(NlogN) <br />
</li>
<li>Range Query : O(1) <br />
</li>
</ul>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a803a2451e87021d14ae06f148383e6bc" name="a803a2451e87021d14ae06f148383e6bc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a803a2451e87021d14ae06f148383e6bc">&#9670;&#160;</a></span>buildTable()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &gt; range_queries::sparse_table::buildTable </td>
<td>(</td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>A</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>logs</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>This functions builds the primary data structure sparse table </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">n</td><td>value of the size of the input array </td></tr>
<tr><td class="paramname">A</td><td>array of the input integers </td></tr>
<tr><td class="paramname">logs</td><td>array of the log table </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>created sparse table data structure </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 57</span> {</div>
<div class="line"><span class="lineno"> 58</span> <span class="keywordtype">int</span> n = A.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>();</div>
<div class="line"><span class="lineno"> 59</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;std::vector&lt;T&gt;</a> &gt; table(20, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;T&gt;</a>(n + 5, 0));</div>
<div class="line"><span class="lineno"> 60</span> <span class="keywordtype">int</span> curLen = 0;</div>
<div class="line"><span class="lineno"> 61</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt;= logs[n]; i++) {</div>
<div class="line"><span class="lineno"> 62</span> curLen = 1 &lt;&lt; i;</div>
<div class="line"><span class="lineno"> 63</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j + curLen &lt; n; j++) {</div>
<div class="line"><span class="lineno"> 64</span> <span class="keywordflow">if</span> (curLen == 1) {</div>
<div class="line"><span class="lineno"> 65</span> table[i][j] = A[j];</div>
<div class="line"><span class="lineno"> 66</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 67</span> table[i][j] =</div>
<div class="line"><span class="lineno"> 68</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a>(table[i - 1][j], table[i - 1][j + curLen / 2]);</div>
<div class="line"><span class="lineno"> 69</span> }</div>
<div class="line"><span class="lineno"> 70</span> }</div>
<div class="line"><span class="lineno"> 71</span> }</div>
<div class="line"><span class="lineno"> 72</span> <span class="keywordflow">return</span> table;</div>
<div class="line"><span class="lineno"> 73</span>}</div>
<div class="ttc" id="amin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a></div><div class="ttdeci">T min(T... args)</div></div>
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/size.html">std::vector::size</a></div><div class="ttdeci">T size(T... args)</div></div>
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/d96/range__queries_2sparse__table_8cpp_a803a2451e87021d14ae06f148383e6bc_cgraph.svg" width="324" height="92"><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="a40810d8c0fe3f8cf432ab128b1ae0300" name="a40810d8c0fe3f8cf432ab128b1ae0300"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a40810d8c0fe3f8cf432ab128b1ae0300">&#9670;&#160;</a></span>computeLogs()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; range_queries::sparse_table::computeLogs </td>
<td>(</td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>A</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>This function precomputes intial log table for further use. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">n</td><td>value of the size of the input array </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>corresponding vector of the log table </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 38</span> {</div>
<div class="line"><span class="lineno"> 39</span> <span class="keywordtype">int</span> n = A.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>();</div>
<div class="line"><span class="lineno"> 40</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;T&gt;</a> logs(n);</div>
<div class="line"><span class="lineno"> 41</span> logs[1] = 0;</div>
<div class="line"><span class="lineno"> 42</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 2; i &lt; n; i++) {</div>
<div class="line"><span class="lineno"> 43</span> logs[i] = logs[i / 2] + 1;</div>
<div class="line"><span class="lineno"> 44</span> }</div>
<div class="line"><span class="lineno"> 45</span> <span class="keywordflow">return</span> logs;</div>
<div class="line"><span class="lineno"> 46</span>}</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/d96/range__queries_2sparse__table_8cpp_a40810d8c0fe3f8cf432ab128b1ae0300_cgraph.svg" width="324" height="76"><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="a932816c3de9e5ad122b180de60978e8f" name="a932816c3de9e5ad122b180de60978e8f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a932816c3de9e5ad122b180de60978e8f">&#9670;&#160;</a></span>getMinimum()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="memname">
<tr>
<td class="memname">int range_queries::sparse_table::getMinimum </td>
<td>(</td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>beg</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>end</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>logs</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>table</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>This function is the query function to get the range minimum value </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">beg</td><td>beginning index of the query range </td></tr>
<tr><td class="paramname">end</td><td>ending index of the query range </td></tr>
<tr><td class="paramname">logs</td><td>array of the log table </td></tr>
<tr><td class="paramname">table</td><td>sparse table data structure for the input array </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>minimum value for the [beg, end] range for the input array </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 85</span> {</div>
<div class="line"><span class="lineno"> 86</span> <span class="keywordtype">int</span> p = logs[<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">end</a> - beg + 1];</div>
<div class="line"><span class="lineno"> 87</span> <span class="keywordtype">int</span> pLen = 1 &lt;&lt; p;</div>
<div class="line"><span class="lineno"> 88</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a>(table[p][beg], table[p][end - pLen + 1]);</div>
<div class="line"><span class="lineno"> 89</span>}</div>
<div class="ttc" id="aend_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/iterator/end.html">std::end</a></div><div class="ttdeci">T end(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/d96/range__queries_2sparse__table_8cpp_a932816c3de9e5ad122b180de60978e8f_cgraph.svg" width="276" height="76"><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="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">&#9670;&#160;</a></span>main()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int main </td>
<td>(</td>
<td class="paramtype">void</td> <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Main function </p>
<div class="fragment"><div class="line"><span class="lineno"> 96</span> {</div>
<div class="line"><span class="lineno"> 97</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;int&gt;</a> A{1, 2, 0, 3, 9};</div>
<div class="line"><span class="lineno"> 98</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;int&gt;</a> logs = <a class="code hl_function" href="#a40810d8c0fe3f8cf432ab128b1ae0300">range_queries::sparse_table::computeLogs</a>(A);</div>
<div class="line"><span class="lineno"> 99</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;std::vector&lt;int&gt;</a> &gt; table =</div>
<div class="line"><span class="lineno"> 100</span> <a class="code hl_function" href="#a803a2451e87021d14ae06f148383e6bc">range_queries::sparse_table::buildTable</a>(A, logs);</div>
<div class="line"><span class="lineno"> 101</span> assert(range_queries::sparse_table::getMinimum(0, 0, logs, table) == 1);</div>
<div class="line"><span class="lineno"> 102</span> assert(range_queries::sparse_table::getMinimum(0, 4, logs, table) == 0);</div>
<div class="line"><span class="lineno"> 103</span> assert(range_queries::sparse_table::getMinimum(2, 4, logs, table) == 0);</div>
<div class="line"><span class="lineno"> 104</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 105</span>}</div>
<div class="ttc" id="arange__queries_2sparse__table_8cpp_html_a40810d8c0fe3f8cf432ab128b1ae0300"><div class="ttname"><a href="#a40810d8c0fe3f8cf432ab128b1ae0300">range_queries::sparse_table::computeLogs</a></div><div class="ttdeci">std::vector&lt; T &gt; computeLogs(const std::vector&lt; T &gt; &amp;A)</div><div class="ttdef"><b>Definition</b> sparse_table.cpp:38</div></div>
<div class="ttc" id="arange__queries_2sparse__table_8cpp_html_a803a2451e87021d14ae06f148383e6bc"><div class="ttname"><a href="#a803a2451e87021d14ae06f148383e6bc">range_queries::sparse_table::buildTable</a></div><div class="ttdeci">std::vector&lt; std::vector&lt; T &gt; &gt; buildTable(const std::vector&lt; T &gt; &amp;A, const std::vector&lt; T &gt; &amp;logs)</div><div class="ttdef"><b>Definition</b> sparse_table.cpp:56</div></div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_074119ce3a874b57120c49a0cc4bb5ad.html">range_queries</a></li><li class="navelem"><a class="el" href="../../d4/d96/range__queries_2sparse__table_8cpp.html">sparse_table.cpp</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.12.0 </li>
</ul>
</div>
</body>
</html>

View File

@@ -1,7 +0,0 @@
var range__queries_2sparse__table_8cpp =
[
[ "buildTable", "d4/d96/range__queries_2sparse__table_8cpp.html#a803a2451e87021d14ae06f148383e6bc", null ],
[ "computeLogs", "d4/d96/range__queries_2sparse__table_8cpp.html#a40810d8c0fe3f8cf432ab128b1ae0300", null ],
[ "getMinimum", "d4/d96/range__queries_2sparse__table_8cpp.html#a932816c3de9e5ad122b180de60978e8f", null ],
[ "main", "d4/d96/range__queries_2sparse__table_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ]
];

View File

@@ -1,6 +0,0 @@
<map id="range_queries::sparse_table::computeLogs" name="range_queries::sparse_table::computeLogs">
<area shape="rect" id="Node000001" title=" " alt="" coords="5,29,155,70"/>
<area shape="poly" id="edge1_Node000001_Node000001" title=" " alt="" coords="45,29,44,19,49,10,62,5,80,3,100,5,112,11,109,16,98,10,80,8,63,10,53,14,49,20,51,28"/>
<area shape="rect" id="Node000002" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size.html#" title=" " alt="" coords="203,37,318,62"/>
<area shape="poly" id="edge2_Node000001_Node000002" title=" " alt="" coords="155,47,187,47,187,52,155,52"/>
</map>

View File

@@ -1 +0,0 @@
9dd109d2dbbdfbf9fca953d193387d01

View File

@@ -1,49 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: range_queries::sparse_table::computeLogs Pages: 1 -->
<svg width="243pt" height="57pt"
viewBox="0.00 0.00 242.50 56.50" 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 52.5)">
<title>range_queries::sparse_table::computeLogs</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title=" ">
<polygon fill="#999999" stroke="#666666" points="112,-30.5 0,-30.5 0,0 112,0 112,-30.5"/>
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::sparse</text>
<text text-anchor="middle" x="56" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">_table::computeLogs</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge1_Node000001_Node000001" class="edge">
<title>Node1&#45;&gt;Node1</title>
<g id="a_edge1_Node000001_Node000001"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M32.03,-30.99C27.14,-40.06 35.13,-48.5 56,-48.5 67.41,-48.5 74.97,-45.97 78.68,-42.2"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="82.13,-42.82 79.79,-32.49 75.18,-42.03 82.13,-42.82"/>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="234.5,-24.88 148,-24.88 148,-5.63 234.5,-5.63 234.5,-24.88"/>
<text text-anchor="middle" x="191.25" y="-11.38" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge2_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge2_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M112.35,-15.25C120.33,-15.25 128.52,-15.25 136.47,-15.25"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="136.36,-18.75 146.36,-15.25 136.36,-11.75 136.36,-18.75"/>
</a>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -1,8 +0,0 @@
<map id="range_queries::sparse_table::buildTable" name="range_queries::sparse_table::buildTable">
<area shape="rect" id="Node000001" title=" " alt="" coords="5,29,155,70"/>
<area shape="poly" id="edge1_Node000001_Node000001" title=" " alt="" coords="45,29,44,19,49,10,62,5,80,3,100,5,112,11,109,16,98,10,80,8,63,10,53,14,49,20,51,28"/>
<area shape="rect" id="Node000002" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/min.html#" title=" " alt="" coords="226,12,294,37"/>
<area shape="poly" id="edge2_Node000001_Node000002" title=" " alt="" coords="155,37,211,29,211,34,156,42"/>
<area shape="rect" id="Node000003" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size.html#" title=" " alt="" coords="203,61,318,86"/>
<area shape="poly" id="edge3_Node000001_Node000003" title=" " alt="" coords="155,57,188,61,187,67,155,62"/>
</map>

View File

@@ -1 +0,0 @@
98658f295d1efd86f8f71770745dd0ae

View File

@@ -1,93 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: range_queries::sparse_table::buildTable Pages: 1 -->
<svg width="243pt" height="69pt"
viewBox="0.00 0.00 242.50 68.88" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<style type="text/css"><![CDATA[
.node, .edge {opacity: 0.7;}
.node.selected, .edge.selected {opacity: 1;}
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 64.88)">
<title>range_queries::sparse_table::buildTable</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title=" ">
<polygon fill="#999999" stroke="#666666" points="112,-42.88 0,-42.88 0,-12.37 112,-12.37 112,-42.88"/>
<text text-anchor="start" x="8" y="-29.38" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::sparse</text>
<text text-anchor="middle" x="56" y="-18.12" font-family="Helvetica,sans-Serif" font-size="10.00">_table::buildTable</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge1_Node000001_Node000001" class="edge">
<title>Node1&#45;&gt;Node1</title>
<g id="a_edge1_Node000001_Node000001"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M32.03,-43.36C27.14,-52.43 35.13,-60.88 56,-60.88 67.41,-60.88 74.97,-58.35 78.68,-54.58"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="82.13,-55.2 79.79,-44.86 75.18,-54.4 82.13,-55.2"/>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/min.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="216.88,-56.25 165.62,-56.25 165.62,-37 216.88,-37 216.88,-56.25"/>
<text text-anchor="middle" x="191.25" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::min</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge2_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge2_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M112.35,-35.52C126.48,-37.53 141.3,-39.64 154.17,-41.48"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="153.49,-44.92 163.88,-42.86 154.47,-37.99 153.49,-44.92"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="234.5,-19.25 148,-19.25 148,0 234.5,0 234.5,-19.25"/>
<text text-anchor="middle" x="191.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge3_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge3_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M112.35,-20.15C120.33,-19.07 128.52,-17.96 136.47,-16.89"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="136.93,-20.36 146.37,-15.55 135.99,-13.42 136.93,-20.36"/>
</a>
</g>
</g>
</g>
</svg>
</svg>
<style type='text/css'>
<![CDATA[
[data-mouse-over-selected='false'] { opacity: 0.7; }
[data-mouse-over-selected='true'] { opacity: 1.0; }
]]>
</style>
<script type="application/ecmascript"><![CDATA[
document.addEventListener('DOMContentLoaded', (event) => {
highlightEdges();
highlightAdjacentNodes();
});
]]></script>
</svg>

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -1,67 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: range_queries::sparse_table::buildTable Pages: 1 -->
<svg width="243pt" height="69pt"
viewBox="0.00 0.00 242.50 68.88" 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.88)">
<title>range_queries::sparse_table::buildTable</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title=" ">
<polygon fill="#999999" stroke="#666666" points="112,-42.88 0,-42.88 0,-12.37 112,-12.37 112,-42.88"/>
<text text-anchor="start" x="8" y="-29.38" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::sparse</text>
<text text-anchor="middle" x="56" y="-18.12" font-family="Helvetica,sans-Serif" font-size="10.00">_table::buildTable</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge1_Node000001_Node000001" class="edge">
<title>Node1&#45;&gt;Node1</title>
<g id="a_edge1_Node000001_Node000001"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M32.03,-43.36C27.14,-52.43 35.13,-60.88 56,-60.88 67.41,-60.88 74.97,-58.35 78.68,-54.58"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="82.13,-55.2 79.79,-44.86 75.18,-54.4 82.13,-55.2"/>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/min.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="216.88,-56.25 165.62,-56.25 165.62,-37 216.88,-37 216.88,-56.25"/>
<text text-anchor="middle" x="191.25" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::min</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge2_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge2_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M112.35,-35.52C126.48,-37.53 141.3,-39.64 154.17,-41.48"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="153.49,-44.92 163.88,-42.86 154.47,-37.99 153.49,-44.92"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="234.5,-19.25 148,-19.25 148,0 234.5,0 234.5,-19.25"/>
<text text-anchor="middle" x="191.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge3_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge3_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M112.35,-20.15C120.33,-19.07 128.52,-17.96 136.47,-16.89"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="136.93,-20.36 146.37,-15.55 135.99,-13.42 136.93,-20.36"/>
</a>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -1,6 +0,0 @@
<map id="range_queries::sparse_table::getMinimum" name="range_queries::sparse_table::getMinimum">
<area shape="rect" id="Node000001" title=" " alt="" coords="5,29,155,70"/>
<area shape="poly" id="edge1_Node000001_Node000001" title=" " alt="" coords="50,29,48,19,53,11,64,5,80,3,97,5,108,11,105,16,96,10,80,8,65,10,57,14,53,20,55,28"/>
<area shape="rect" id="Node000002" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/min.html#" title=" " alt="" coords="203,37,271,62"/>
<area shape="poly" id="edge2_Node000001_Node000002" title=" " alt="" coords="155,47,187,47,187,52,155,52"/>
</map>

View File

@@ -1 +0,0 @@
8d764f1bef624da5e58af0c896f208d5

View File

@@ -1,75 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: range_queries::sparse_table::getMinimum Pages: 1 -->
<svg width="207pt" height="57pt"
viewBox="0.00 0.00 207.25 56.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<style type="text/css"><![CDATA[
.node, .edge {opacity: 0.7;}
.node.selected, .edge.selected {opacity: 1;}
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 52.5)">
<title>range_queries::sparse_table::getMinimum</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title=" ">
<polygon fill="#999999" stroke="#666666" points="112,-30.5 0,-30.5 0,0 112,0 112,-30.5"/>
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::sparse</text>
<text text-anchor="middle" x="56" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">_table::getMinimum</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge1_Node000001_Node000001" class="edge">
<title>Node1&#45;&gt;Node1</title>
<g id="a_edge1_Node000001_Node000001"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M35.16,-30.99C30.9,-40.06 37.85,-48.5 56,-48.5 65.93,-48.5 72.5,-45.97 75.73,-42.2"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="79.18,-42.79 76.69,-32.49 72.22,-42.1 79.18,-42.79"/>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/min.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="199.25,-24.88 148,-24.88 148,-5.63 199.25,-5.63 199.25,-24.88"/>
<text text-anchor="middle" x="173.62" y="-11.38" font-family="Helvetica,sans-Serif" font-size="10.00">std::min</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge2_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge2_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M112.44,-15.25C120.51,-15.25 128.63,-15.25 136.19,-15.25"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="135.99,-18.75 145.99,-15.25 135.99,-11.75 135.99,-18.75"/>
</a>
</g>
</g>
</g>
</svg>
</svg>
<style type='text/css'>
<![CDATA[
[data-mouse-over-selected='false'] { opacity: 0.7; }
[data-mouse-over-selected='true'] { opacity: 1.0; }
]]>
</style>
<script type="application/ecmascript"><![CDATA[
document.addEventListener('DOMContentLoaded', (event) => {
highlightEdges();
highlightAdjacentNodes();
});
]]></script>
</svg>

Before

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -1,49 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: range_queries::sparse_table::getMinimum Pages: 1 -->
<svg width="207pt" height="57pt"
viewBox="0.00 0.00 207.25 56.50" 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 52.5)">
<title>range_queries::sparse_table::getMinimum</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title=" ">
<polygon fill="#999999" stroke="#666666" points="112,-30.5 0,-30.5 0,0 112,0 112,-30.5"/>
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::sparse</text>
<text text-anchor="middle" x="56" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">_table::getMinimum</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge1_Node000001_Node000001" class="edge">
<title>Node1&#45;&gt;Node1</title>
<g id="a_edge1_Node000001_Node000001"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M35.16,-30.99C30.9,-40.06 37.85,-48.5 56,-48.5 65.93,-48.5 72.5,-45.97 75.73,-42.2"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="79.18,-42.79 76.69,-32.49 72.22,-42.1 79.18,-42.79"/>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/min.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="199.25,-24.88 148,-24.88 148,-5.63 199.25,-5.63 199.25,-24.88"/>
<text text-anchor="middle" x="173.62" y="-11.38" font-family="Helvetica,sans-Serif" font-size="10.00">std::min</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge2_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge2_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M112.44,-15.25C120.51,-15.25 128.63,-15.25 136.19,-15.25"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="135.99,-18.75 145.99,-15.25 135.99,-11.75 135.99,-18.75"/>
</a>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.2 KiB

252
d4/da0/kadane_8cpp.html Normal file
View File

@@ -0,0 +1,252 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: dynamic_programming/kadane.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/x-mathjax-config">
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>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<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>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @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:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('../../',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('d4/da0/kadane_8cpp.html','../../'); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#namespaces">Namespaces</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">kadane.cpp File Reference</div></div>
</div><!--header-->
<div class="contents">
<p>Implementation of <a href="https://en.wikipedia.org/wiki/Kadane%27s_algorithm" target="_blank">Kadane Algorithm</a>
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;array&gt;</code><br />
<code>#include &lt;climits&gt;</code><br />
<code>#include &lt;iostream&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for kadane.cpp:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d7/d53/kadane_8cpp__incl.svg" width="240" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d24/namespacedynamic__programming.html">dynamic_programming</a></td></tr>
<tr class="memdesc:dd/d24/namespacedynamic__programming"><td class="mdescLeft">&#160;</td><td class="mdescRight">Dynamic Programming algorithms. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/d74/namespacekadane.html">kadane</a></td></tr>
<tr class="memdesc:d6/d74/namespacekadane"><td class="mdescLeft">&#160;</td><td class="mdescRight">Functions for <a href="https://en.wikipedia.org/wiki/Kadane%27s_algorithm" target="_blank">Kadane</a> algorithm. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:af3029007a422a914a85c0b0122f1c7b4" id="r_af3029007a422a914a85c0b0122f1c7b4"><td class="memTemplParams" colspan="2">template&lt;size_t N&gt; </td></tr>
<tr class="memitem:af3029007a422a914a85c0b0122f1c7b4"><td class="memTemplItemLeft" align="right" valign="top">int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#af3029007a422a914a85c0b0122f1c7b4">dynamic_programming::kadane::maxSubArray</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; int, N &gt; &amp;n)</td></tr>
<tr class="memdesc:af3029007a422a914a85c0b0122f1c7b4"><td class="mdescLeft">&#160;</td><td class="mdescRight">maxSubArray function is used to calculate the maximum sum subarray and returns the value of maximum sum which is stored in the variable max_sum <br /></td></tr>
<tr class="separator:af3029007a422a914a85c0b0122f1c7b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4" id="r_ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function. <br /></td></tr>
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Implementation of <a href="https://en.wikipedia.org/wiki/Kadane%27s_algorithm" target="_blank">Kadane Algorithm</a> </p>
<p>Kadane algorithm is used to find the maximum sum subarray in an array and maximum sum subarray problem is the task of finding a contiguous subarray with the largest sum</p>
<h3><a class="anchor" id="autotoc_md72"></a>
Algorithm</h3>
<p>The simple idea of the algorithm is to search for all positive contiguous segments of the array and keep track of maximum sum contiguous segment among all positive segments(curr_sum is used for this) Each time we get a positive sum we compare it with max_sum and update max_sum if it is greater than curr_sum</p>
<dl class="section author"><dt>Author</dt><dd><a href="https://github.com/ayush523" target="_blank">Ayush Singh</a> </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">&#9670;&#160;</a></span>main()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int main </td>
<td>(</td>
<td class="paramtype">void</td> <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Main function. </p>
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 60</span> {</div>
<div class="line"><span class="lineno"> 61</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 5;</div>
<div class="line"><span class="lineno"> 62</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array&lt;int, N&gt;</a> n{}; <span class="comment">// declaring array</span></div>
<div class="line"><span class="lineno"> 63</span> <span class="comment">// taking values of elements from user</span></div>
<div class="line"><span class="lineno"> 64</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n.size(); i++) {</div>
<div class="line"><span class="lineno"> 65</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Enter value of n[&quot;</span> &lt;&lt; i &lt;&lt; <span class="stringliteral">&quot;]&quot;</span></div>
<div class="line"><span class="lineno"> 66</span> &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 67</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; n[i];</div>
<div class="line"><span class="lineno"> 68</span> }</div>
<div class="line"><span class="lineno"> 69</span> <span class="keywordtype">int</span> max_sum = dynamic_programming::kadane::maxSubArray&lt;N&gt;(</div>
<div class="line"><span class="lineno"> 70</span> n); <span class="comment">// calling maxSubArray function</span></div>
<div class="line"><span class="lineno"> 71</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Maximum subarray sum is &quot;</span> &lt;&lt; max_sum; <span class="comment">// Printing the answer</span></div>
<div class="line"><span class="lineno"> 72</span> </div>
<div class="line"><span class="lineno"> 73</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 74</span>}</div>
<div class="ttc" id="aarray_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a></div></div>
<div class="ttc" id="abasic_istream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a></div></div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
<div class="ttc" id="asparse__table_8cpp_html_a10f3ffb3f6f7e1b83d556b9c8de89a5d"><div class="ttname"><a href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">data_structures::sparse_table::N</a></div><div class="ttdeci">constexpr uint32_t N</div><div class="ttdoc">A struct to represent sparse table for min() as their invariant function, for the given array A....</div><div class="ttdef"><b>Definition</b> sparse_table.cpp:48</div></div>
</div><!-- fragment -->
</div>
</div>
<a id="af3029007a422a914a85c0b0122f1c7b4" name="af3029007a422a914a85c0b0122f1c7b4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af3029007a422a914a85c0b0122f1c7b4">&#9670;&#160;</a></span>maxSubArray()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t N&gt; </div>
<table class="memname">
<tr>
<td class="memname">int dynamic_programming::kadane::maxSubArray </td>
<td>(</td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; int, N &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>n</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>maxSubArray function is used to calculate the maximum sum subarray and returns the value of maximum sum which is stored in the variable max_sum </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">N</td><td>number of array size </td></tr>
</table>
</dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">n</td><td>array where numbers are saved </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the value of maximum subarray sum </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 42</span> {</div>
<div class="line"><span class="lineno"> 43</span> <span class="keywordtype">int</span> curr_sum =</div>
<div class="line"><span class="lineno"> 44</span> 0; <span class="comment">// declaring a variable named as curr_sum and initialized it to 0</span></div>
<div class="line"><span class="lineno"> 45</span> <span class="keywordtype">int</span> max_sum = INT_MIN; <span class="comment">// Initialized max_sum to INT_MIN</span></div>
<div class="line"><span class="lineno"> 46</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i : n) { <span class="comment">// for loop to iterate over the elements of the array</span></div>
<div class="line"><span class="lineno"> 47</span> curr_sum += n[i];</div>
<div class="line"><span class="lineno"> 48</span> max_sum = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/max.html">std::max</a>(max_sum, curr_sum); <span class="comment">// getting the maximum value</span></div>
<div class="line"><span class="lineno"> 49</span> curr_sum = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/max.html">std::max</a>(curr_sum, 0); <span class="comment">// updating the value of curr_sum</span></div>
<div class="line"><span class="lineno"> 50</span> }</div>
<div class="line"><span class="lineno"> 51</span> <span class="keywordflow">return</span> max_sum; <span class="comment">// returning the value of max_sum</span></div>
<div class="line"><span class="lineno"> 52</span>}</div>
<div class="ttc" id="amax_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/max.html">std::max</a></div><div class="ttdeci">T max(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/da0/kadane_8cpp_af3029007a422a914a85c0b0122f1c7b4_cgraph.svg" width="290" height="76"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_8a20dd5bfd5341a725342bf72b6b686f.html">dynamic_programming</a></li><li class="navelem"><a class="el" href="../../d4/da0/kadane_8cpp.html">kadane.cpp</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.12.0 </li>
</ul>
</div>
</body>
</html>

5
d4/da0/kadane_8cpp.js Normal file
View File

@@ -0,0 +1,5 @@
var kadane_8cpp =
[
[ "main", "d4/da0/kadane_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
[ "maxSubArray", "d4/da0/kadane_8cpp.html#af3029007a422a914a85c0b0122f1c7b4", null ]
];

View File

@@ -0,0 +1,6 @@
<map id="dynamic_programming::kadane::maxSubArray" name="dynamic_programming::kadane::maxSubArray">
<area shape="rect" id="Node000001" title="maxSubArray function is used to calculate the maximum sum subarray and returns the value of maximum s..." alt="" coords="5,29,164,70"/>
<area shape="poly" id="edge2_Node000001_Node000001" title=" " alt="" coords="53,29,51,19,57,11,68,5,85,3,103,5,113,11,111,16,101,10,84,8,69,10,60,14,57,20,58,28"/>
<area shape="rect" id="Node000002" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/max.html#" title=" " alt="" coords="212,37,284,62"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="164,47,196,47,196,52,164,52"/>
</map>

View File

@@ -0,0 +1 @@
48c388afe0d3daac622c444b3cdcdb4f

View File

@@ -3,9 +3,9 @@
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: range_queries::sparse_table::computeLogs Pages: 1 -->
<svg width="243pt" height="57pt"
viewBox="0.00 0.00 242.50 56.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Title: dynamic_programming::kadane::maxSubArray Pages: 1 -->
<svg width="217pt" height="57pt"
viewBox="0.00 0.00 217.00 56.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
@@ -18,41 +18,41 @@
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 52.5)">
<title>range_queries::sparse_table::computeLogs</title>
<title>dynamic_programming::kadane::maxSubArray</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title=" ">
<polygon fill="#999999" stroke="#666666" points="112,-30.5 0,-30.5 0,0 112,0 112,-30.5"/>
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">range_queries::sparse</text>
<text text-anchor="middle" x="56" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">_table::computeLogs</text>
<g id="a_Node000001"><a xlink:title="maxSubArray function is used to calculate the maximum sum subarray and returns the value of maximum s...">
<polygon fill="#999999" stroke="#666666" points="118.75,-30.5 0,-30.5 0,0 118.75,0 118.75,-30.5"/>
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">dynamic_programming</text>
<text text-anchor="middle" x="59.38" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">::kadane::maxSubArray</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge1_Node000001_Node000001" class="edge">
<g id="edge2_Node000001_Node000001" class="edge">
<title>Node1&#45;&gt;Node1</title>
<g id="a_edge1_Node000001_Node000001"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M32.03,-30.99C27.14,-40.06 35.13,-48.5 56,-48.5 67.41,-48.5 74.97,-45.97 78.68,-42.2"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="82.13,-42.82 79.79,-32.49 75.18,-42.03 82.13,-42.82"/>
<g id="a_edge2_Node000001_Node000001"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.67,-30.99C33.24,-40.06 40.47,-48.5 59.38,-48.5 69.71,-48.5 76.56,-45.97 79.92,-42.2"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="83.38,-42.8 80.93,-32.49 76.41,-42.08 83.38,-42.8"/>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="234.5,-24.88 148,-24.88 148,-5.63 234.5,-5.63 234.5,-24.88"/>
<text text-anchor="middle" x="191.25" y="-11.38" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/max.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="209,-24.88 154.75,-24.88 154.75,-5.63 209,-5.63 209,-24.88"/>
<text text-anchor="middle" x="181.88" y="-11.38" font-family="Helvetica,sans-Serif" font-size="10.00">std::max</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge2_Node000001_Node000002" class="edge">
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge2_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M112.35,-15.25C120.33,-15.25 128.52,-15.25 136.47,-15.25"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="136.36,-18.75 146.36,-15.25 136.36,-11.75 136.36,-18.75"/>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M119.21,-15.25C127.29,-15.25 135.4,-15.25 142.96,-15.25"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="142.8,-18.75 152.8,-15.25 142.8,-11.75 142.8,-18.75"/>
</a>
</g>
</g>

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -0,0 +1,49 @@
<?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 12.1.2 (20240928.0832)
-->
<!-- Title: dynamic_programming::kadane::maxSubArray Pages: 1 -->
<svg width="217pt" height="57pt"
viewBox="0.00 0.00 217.00 56.50" 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 52.5)">
<title>dynamic_programming::kadane::maxSubArray</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="maxSubArray function is used to calculate the maximum sum subarray and returns the value of maximum s...">
<polygon fill="#999999" stroke="#666666" points="118.75,-30.5 0,-30.5 0,0 118.75,0 118.75,-30.5"/>
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">dynamic_programming</text>
<text text-anchor="middle" x="59.38" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">::kadane::maxSubArray</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge2_Node000001_Node000001" class="edge">
<title>Node1&#45;&gt;Node1</title>
<g id="a_edge2_Node000001_Node000001"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.67,-30.99C33.24,-40.06 40.47,-48.5 59.38,-48.5 69.71,-48.5 76.56,-45.97 79.92,-42.2"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="83.38,-42.8 80.93,-32.49 76.41,-42.08 83.38,-42.8"/>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/max.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="209,-24.88 154.75,-24.88 154.75,-5.63 209,-5.63 209,-24.88"/>
<text text-anchor="middle" x="181.88" y="-11.38" font-family="Helvetica,sans-Serif" font-size="10.00">std::max</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M119.21,-15.25C127.29,-15.25 135.4,-15.25 142.96,-15.25"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="142.8,-18.75 152.8,-15.25 142.8,-11.75 142.8,-18.75"/>
</a>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -1,11 +1,13 @@
<map id="dynamic_programming/house_robber.cpp" name="dynamic_programming/house_robber.cpp">
<area shape="rect" id="Node000001" title="Implementation of House Robber Problem algorithm." alt="" coords="91,5,243,46"/>
<area shape="rect" id="Node000001" title="Implementation of House Robber Problem algorithm." alt="" coords="131,5,283,46"/>
<area shape="rect" id="Node000002" title=" " alt="" coords="5,94,70,120"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="136,49,72,88,69,83,133,44"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="166,49,78,90,76,85,163,44"/>
<area shape="rect" id="Node000003" title=" " alt="" coords="93,94,152,120"/>
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="158,48,139,82,135,79,154,45"/>
<area shape="rect" id="Node000004" title=" " alt="" coords="176,94,248,120"/>
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="180,45,200,79,195,82,176,48"/>
<area shape="rect" id="Node000005" title=" " alt="" coords="272,94,329,120"/>
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="201,44,268,83,265,88,199,49"/>
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="188,48,149,85,145,81,184,44"/>
<area shape="rect" id="Node000004" title=" " alt="" coords="177,94,237,120"/>
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="210,46,210,78,204,78,204,46"/>
<area shape="rect" id="Node000005" title=" " alt="" coords="260,94,332,120"/>
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="231,44,273,82,269,86,227,48"/>
<area shape="rect" id="Node000006" title=" " alt="" coords="356,94,413,120"/>
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="252,44,344,85,342,90,250,49"/>
</map>

View File

@@ -1 +1 @@
58370627a53ec42f06fe817c7591cb43
179733e96c0e668d3df1b8df8ea8ec06

View File

@@ -4,8 +4,8 @@
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: dynamic_programming/house_robber.cpp Pages: 1 -->
<svg width="251pt" height="94pt"
viewBox="0.00 0.00 250.62 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg width="314pt" height="94pt"
viewBox="0.00 0.00 313.62 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
@@ -23,9 +23,9 @@
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Implementation of House Robber Problem algorithm.">
<polygon fill="#999999" stroke="#666666" points="178.25,-85.75 64,-85.75 64,-55.25 178.25,-55.25 178.25,-85.75"/>
<text text-anchor="start" x="72" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">dynamic_programming</text>
<text text-anchor="middle" x="121.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">/house_robber.cpp</text>
<polygon fill="#999999" stroke="#666666" points="208.25,-85.75 94,-85.75 94,-55.25 208.25,-55.25 208.25,-85.75"/>
<text text-anchor="start" x="102" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">dynamic_programming</text>
<text text-anchor="middle" x="151.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">/house_robber.cpp</text>
</a>
</g>
</g>
@@ -42,8 +42,8 @@
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M97.15,-54.95C82.38,-45.98 63.49,-34.52 48.63,-25.5"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="50.74,-22.68 40.37,-20.49 47.11,-28.67 50.74,-22.68"/>
<path fill="none" stroke="#63b8ff" d="M119.41,-54.8C99.32,-45.48 73.52,-33.52 53.83,-24.4"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="55.52,-21.32 44.97,-20.29 52.58,-27.67 55.52,-21.32"/>
</a>
</g>
</g>
@@ -60,8 +60,8 @@
<g id="edge2_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M112.97,-54.95C108.67,-47.28 103.34,-37.77 98.73,-29.54"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="101.89,-28.03 93.95,-21.02 95.79,-31.46 101.89,-28.03"/>
<path fill="none" stroke="#63b8ff" d="M135.55,-54.95C126.61,-46.59 115.33,-36.05 106.02,-27.35"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="108.64,-25.01 98.94,-20.73 103.86,-30.12 108.64,-25.01"/>
</a>
</g>
</g>
@@ -69,8 +69,8 @@
<g id="Node000004" class="node">
<title>Node4</title>
<g id="a_Node000004"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="181.88,-19.25 128.38,-19.25 128.38,0 181.88,0 181.88,-19.25"/>
<text text-anchor="middle" x="155.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
<polygon fill="#e0e0e0" stroke="#999999" points="173.75,-19.25 128.5,-19.25 128.5,0 173.75,0 173.75,-19.25"/>
<text text-anchor="middle" x="151.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
</a>
</g>
</g>
@@ -78,8 +78,8 @@
<g id="edge3_Node000001_Node000004" class="edge">
<title>Node1&#45;&gt;Node4</title>
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M129.53,-54.95C133.96,-47.28 139.45,-37.77 144.2,-29.54"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="147.16,-31.42 149.13,-21.01 141.09,-27.92 147.16,-31.42"/>
<path fill="none" stroke="#63b8ff" d="M151.12,-54.95C151.12,-47.71 151.12,-38.84 151.12,-30.94"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="154.63,-31.21 151.13,-21.21 147.63,-31.21 154.63,-31.21"/>
</a>
</g>
</g>
@@ -87,8 +87,8 @@
<g id="Node000005" class="node">
<title>Node5</title>
<g id="a_Node000005"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="242.62,-19.25 199.62,-19.25 199.62,0 242.62,0 242.62,-19.25"/>
<text text-anchor="middle" x="221.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
<polygon fill="#e0e0e0" stroke="#999999" points="244.88,-19.25 191.38,-19.25 191.38,0 244.88,0 244.88,-19.25"/>
<text text-anchor="middle" x="218.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
</a>
</g>
</g>
@@ -96,8 +96,26 @@
<g id="edge4_Node000001_Node000005" class="edge">
<title>Node1&#45;&gt;Node5</title>
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M146.1,-54.8C161.33,-45.83 180.73,-34.41 195.99,-25.42"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="197.64,-28.51 204.48,-20.42 194.09,-22.48 197.64,-28.51"/>
<path fill="none" stroke="#63b8ff" d="M167.69,-54.95C177.3,-46.5 189.44,-35.83 199.4,-27.08"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="201.46,-29.93 206.66,-20.7 196.84,-24.67 201.46,-29.93"/>
</a>
</g>
</g>
<!-- Node6 -->
<g id="Node000006" class="node">
<title>Node6</title>
<g id="a_Node000006"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="305.62,-19.25 262.62,-19.25 262.62,0 305.62,0 305.62,-19.25"/>
<text text-anchor="middle" x="284.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node6 -->
<g id="edge5_Node000001_Node000006" class="edge">
<title>Node1&#45;&gt;Node6</title>
<g id="a_edge5_Node000001_Node000006"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M184.34,-54.8C205.47,-45.44 232.65,-33.41 253.3,-24.27"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="254.62,-27.51 262.34,-20.27 251.78,-21.11 254.62,-27.51"/>
</a>
</g>
</g>

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@@ -4,17 +4,17 @@
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: dynamic_programming/house_robber.cpp Pages: 1 -->
<svg width="251pt" height="94pt"
viewBox="0.00 0.00 250.62 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg width="314pt" height="94pt"
viewBox="0.00 0.00 313.62 93.75" 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 89.75)">
<title>dynamic_programming/house_robber.cpp</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Implementation of House Robber Problem algorithm.">
<polygon fill="#999999" stroke="#666666" points="178.25,-85.75 64,-85.75 64,-55.25 178.25,-55.25 178.25,-85.75"/>
<text text-anchor="start" x="72" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">dynamic_programming</text>
<text text-anchor="middle" x="121.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">/house_robber.cpp</text>
<polygon fill="#999999" stroke="#666666" points="208.25,-85.75 94,-85.75 94,-55.25 208.25,-55.25 208.25,-85.75"/>
<text text-anchor="start" x="102" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">dynamic_programming</text>
<text text-anchor="middle" x="151.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">/house_robber.cpp</text>
</a>
</g>
</g>
@@ -31,8 +31,8 @@
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M97.15,-54.95C82.38,-45.98 63.49,-34.52 48.63,-25.5"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="50.74,-22.68 40.37,-20.49 47.11,-28.67 50.74,-22.68"/>
<path fill="none" stroke="#63b8ff" d="M119.41,-54.8C99.32,-45.48 73.52,-33.52 53.83,-24.4"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="55.52,-21.32 44.97,-20.29 52.58,-27.67 55.52,-21.32"/>
</a>
</g>
</g>
@@ -49,8 +49,8 @@
<g id="edge2_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M112.97,-54.95C108.67,-47.28 103.34,-37.77 98.73,-29.54"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="101.89,-28.03 93.95,-21.02 95.79,-31.46 101.89,-28.03"/>
<path fill="none" stroke="#63b8ff" d="M135.55,-54.95C126.61,-46.59 115.33,-36.05 106.02,-27.35"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="108.64,-25.01 98.94,-20.73 103.86,-30.12 108.64,-25.01"/>
</a>
</g>
</g>
@@ -58,8 +58,8 @@
<g id="Node000004" class="node">
<title>Node4</title>
<g id="a_Node000004"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="181.88,-19.25 128.38,-19.25 128.38,0 181.88,0 181.88,-19.25"/>
<text text-anchor="middle" x="155.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
<polygon fill="#e0e0e0" stroke="#999999" points="173.75,-19.25 128.5,-19.25 128.5,0 173.75,0 173.75,-19.25"/>
<text text-anchor="middle" x="151.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
</a>
</g>
</g>
@@ -67,8 +67,8 @@
<g id="edge3_Node000001_Node000004" class="edge">
<title>Node1&#45;&gt;Node4</title>
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M129.53,-54.95C133.96,-47.28 139.45,-37.77 144.2,-29.54"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="147.16,-31.42 149.13,-21.01 141.09,-27.92 147.16,-31.42"/>
<path fill="none" stroke="#63b8ff" d="M151.12,-54.95C151.12,-47.71 151.12,-38.84 151.12,-30.94"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="154.63,-31.21 151.13,-21.21 147.63,-31.21 154.63,-31.21"/>
</a>
</g>
</g>
@@ -76,8 +76,8 @@
<g id="Node000005" class="node">
<title>Node5</title>
<g id="a_Node000005"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="242.62,-19.25 199.62,-19.25 199.62,0 242.62,0 242.62,-19.25"/>
<text text-anchor="middle" x="221.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
<polygon fill="#e0e0e0" stroke="#999999" points="244.88,-19.25 191.38,-19.25 191.38,0 244.88,0 244.88,-19.25"/>
<text text-anchor="middle" x="218.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
</a>
</g>
</g>
@@ -85,8 +85,26 @@
<g id="edge4_Node000001_Node000005" class="edge">
<title>Node1&#45;&gt;Node5</title>
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M146.1,-54.8C161.33,-45.83 180.73,-34.41 195.99,-25.42"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="197.64,-28.51 204.48,-20.42 194.09,-22.48 197.64,-28.51"/>
<path fill="none" stroke="#63b8ff" d="M167.69,-54.95C177.3,-46.5 189.44,-35.83 199.4,-27.08"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="201.46,-29.93 206.66,-20.7 196.84,-24.67 201.46,-29.93"/>
</a>
</g>
</g>
<!-- Node6 -->
<g id="Node000006" class="node">
<title>Node6</title>
<g id="a_Node000006"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="305.62,-19.25 262.62,-19.25 262.62,0 305.62,0 305.62,-19.25"/>
<text text-anchor="middle" x="284.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node6 -->
<g id="edge5_Node000001_Node000006" class="edge">
<title>Node1&#45;&gt;Node6</title>
<g id="a_edge5_Node000001_Node000006"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M184.34,-54.8C205.47,-45.44 232.65,-33.41 253.3,-24.27"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="254.62,-27.51 262.34,-20.27 251.78,-21.11 254.62,-27.51"/>
</a>
</g>
</g>

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -303,7 +303,7 @@ Here is the call graph for this function:</div>
<li><code>w12.csv</code>: trained SOM map </li>
</ul>
<div class="fragment"><div class="line"><span class="lineno"> 369</span> {</div>
<div class="line"><span class="lineno"> 370</span> <span class="keywordtype">int</span> j = 0, <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 300;</div>
<div class="line"><span class="lineno"> 370</span> <span class="keywordtype">int</span> j = 0, <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 300;</div>
<div class="line"><span class="lineno"> 371</span> <span class="keywordtype">int</span> features = 2;</div>
<div class="line"><span class="lineno"> 372</span> <span class="keywordtype">int</span> num_out = 30;</div>
<div class="line"><span class="lineno"> 373</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;std::valarray&lt;double&gt;</a>&gt; X(N);</div>
@@ -335,11 +335,11 @@ Here is the call graph for this function:</div>
<div class="line"><span class="lineno"> 399</span> save_u_matrix(<span class="stringliteral">&quot;w12.csv&quot;</span>, W); <span class="comment">// save the resultant weights</span></div>
<div class="line"><span class="lineno"> 400</span>}</div>
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a1b74d828b33760094906797042b89442"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">numerical_methods::simpson_method::k</a></div><div class="ttdeci">double k(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition</b> composite_simpson_rule.cpp:117</div></div>
<div class="ttc" id="adata__structures_2sparse__table_8cpp_html_a10f3ffb3f6f7e1b83d556b9c8de89a5d"><div class="ttname"><a href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">data_structures::sparse_table::N</a></div><div class="ttdeci">constexpr uint32_t N</div><div class="ttdoc">A struct to represent sparse table for min() as their invariant function, for the given array A....</div><div class="ttdef"><b>Definition</b> sparse_table.cpp:48</div></div>
<div class="ttc" id="agroup__machine__learning_html_gabc90175770bf0d5853c466e14993a08c"><div class="ttname"><a href="../../d9/d66/group__machine__learning.html#gabc90175770bf0d5853c466e14993a08c">save_2d_data</a></div><div class="ttdeci">int save_2d_data(const char *fname, const std::vector&lt; std::valarray&lt; double &gt; &gt; &amp;X)</div><div class="ttdef"><b>Definition</b> kohonen_som_topology.cpp:65</div></div>
<div class="ttc" id="agroup__machine__learning_html_gaf5ce14f026d6d231bef29161bac2b485"><div class="ttname"><a href="../../d9/d66/group__machine__learning.html#gaf5ce14f026d6d231bef29161bac2b485">_random</a></div><div class="ttdeci">double _random(double a, double b)</div><div class="ttdef"><b>Definition</b> kohonen_som_topology.cpp:53</div></div>
<div class="ttc" id="akohonen__som__topology_8cpp_html_a48efb079040c7aaa3a4917a0e486cba9"><div class="ttname"><a href="#a48efb079040c7aaa3a4917a0e486cba9">test_2d_classes</a></div><div class="ttdeci">void test_2d_classes(std::vector&lt; std::valarray&lt; double &gt; &gt; *data)</div><div class="ttdef"><b>Definition</b> kohonen_som_topology.cpp:330</div></div>
<div class="ttc" id="amax_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/max.html">std::max</a></div><div class="ttdeci">T max(T... args)</div></div>
<div class="ttc" id="asparse__table_8cpp_html_a10f3ffb3f6f7e1b83d556b9c8de89a5d"><div class="ttname"><a href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">data_structures::sparse_table::N</a></div><div class="ttdeci">constexpr uint32_t N</div><div class="ttdoc">A struct to represent sparse table for min() as their invariant function, for the given array A....</div><div class="ttdef"><b>Definition</b> sparse_table.cpp:48</div></div>
<div class="ttc" id="avalarray_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/valarray.html">std::valarray</a></div></div>
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
</div><!-- fragment --><div class="dynheader">
@@ -370,7 +370,7 @@ Here is the call graph for this function:</div>
<li><code>w22.csv</code>: trained SOM map </li>
</ul>
<div class="fragment"><div class="line"><span class="lineno"> 451</span> {</div>
<div class="line"><span class="lineno"> 452</span> <span class="keywordtype">int</span> j = 0, <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 300;</div>
<div class="line"><span class="lineno"> 452</span> <span class="keywordtype">int</span> j = 0, <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 300;</div>
<div class="line"><span class="lineno"> 453</span> <span class="keywordtype">int</span> features = 3;</div>
<div class="line"><span class="lineno"> 454</span> <span class="keywordtype">int</span> num_out = 30;</div>
<div class="line"><span class="lineno"> 455</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;std::valarray&lt;double&gt;</a>&gt; X(N);</div>
@@ -430,7 +430,7 @@ Here is the call graph for this function:</div>
<li><code>w32.csv</code>: trained SOM map </li>
</ul>
<div class="fragment"><div class="line"><span class="lineno"> 537</span> {</div>
<div class="line"><span class="lineno"> 538</span> <span class="keywordtype">int</span> j = 0, <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 500;</div>
<div class="line"><span class="lineno"> 538</span> <span class="keywordtype">int</span> j = 0, <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 500;</div>
<div class="line"><span class="lineno"> 539</span> <span class="keywordtype">int</span> features = 3;</div>
<div class="line"><span class="lineno"> 540</span> <span class="keywordtype">int</span> num_out = 30;</div>
<div class="line"><span class="lineno"> 541</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;std::valarray&lt;double&gt;</a>&gt; X(N);</div>
@@ -497,7 +497,7 @@ Here is the call graph for this function:</div>
</dd>
</dl>
<div class="fragment"><div class="line"><span class="lineno"> 330</span> {</div>
<div class="line"><span class="lineno"> 331</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>-&gt;size();</div>
<div class="line"><span class="lineno"> 331</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>-&gt;size();</div>
<div class="line"><span class="lineno"> 332</span> <span class="keyword">const</span> <span class="keywordtype">double</span> R = 0.3; <span class="comment">// radius of cluster</span></div>
<div class="line"><span class="lineno"> 333</span> <span class="keywordtype">int</span> i = 0;</div>
<div class="line"><span class="lineno"> 334</span> <span class="keyword">const</span> <span class="keywordtype">int</span> num_classes = 4;</div>
@@ -512,7 +512,7 @@ Here is the call graph for this function:</div>
<div class="line"><span class="lineno"> 343</span><span class="preprocessor">#ifdef _OPENMP</span></div>
<div class="line"><span class="lineno"> 344</span><span class="preprocessor">#pragma omp for</span></div>
<div class="line"><span class="lineno"> 345</span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="lineno"> 346</span> <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
<div class="line"><span class="lineno"> 346</span> <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
<div class="line"><span class="lineno"> 347</span> <span class="comment">// select a random class for the point</span></div>
<div class="line"><span class="lineno"> 348</span> <span class="keywordtype">int</span> cls = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/rand.html">std::rand</a>() % num_classes;</div>
<div class="line"><span class="lineno"> 349</span> </div>
@@ -564,7 +564,7 @@ Here is the call graph for this function:</div>
</dd>
</dl>
<div class="fragment"><div class="line"><span class="lineno"> 411</span> {</div>
<div class="line"><span class="lineno"> 412</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>-&gt;size();</div>
<div class="line"><span class="lineno"> 412</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>-&gt;size();</div>
<div class="line"><span class="lineno"> 413</span> <span class="keyword">const</span> <span class="keywordtype">double</span> R = 0.3; <span class="comment">// radius of cluster</span></div>
<div class="line"><span class="lineno"> 414</span> <span class="keywordtype">int</span> i = 0;</div>
<div class="line"><span class="lineno"> 415</span> <span class="keyword">const</span> <span class="keywordtype">int</span> num_classes = 4;</div>
@@ -579,7 +579,7 @@ Here is the call graph for this function:</div>
<div class="line"><span class="lineno"> 424</span><span class="preprocessor">#ifdef _OPENMP</span></div>
<div class="line"><span class="lineno"> 425</span><span class="preprocessor">#pragma omp for</span></div>
<div class="line"><span class="lineno"> 426</span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="lineno"> 427</span> <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
<div class="line"><span class="lineno"> 427</span> <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
<div class="line"><span class="lineno"> 428</span> <span class="comment">// select a random class for the point</span></div>
<div class="line"><span class="lineno"> 429</span> <span class="keywordtype">int</span> cls = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/rand.html">std::rand</a>() % num_classes;</div>
<div class="line"><span class="lineno"> 430</span> </div>
@@ -629,7 +629,7 @@ Here is the call graph for this function:</div>
</dd>
</dl>
<div class="fragment"><div class="line"><span class="lineno"> 493</span> {</div>
<div class="line"><span class="lineno"> 494</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>-&gt;size();</div>
<div class="line"><span class="lineno"> 494</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>-&gt;size();</div>
<div class="line"><span class="lineno"> 495</span> <span class="keyword">const</span> <span class="keywordtype">double</span> R = 0.2; <span class="comment">// radius of cluster</span></div>
<div class="line"><span class="lineno"> 496</span> <span class="keywordtype">int</span> i = 0;</div>
<div class="line"><span class="lineno"> 497</span> <span class="keyword">const</span> <span class="keywordtype">int</span> num_classes = 8;</div>
@@ -648,7 +648,7 @@ Here is the call graph for this function:</div>
<div class="line"><span class="lineno"> 510</span><span class="preprocessor">#ifdef _OPENMP</span></div>
<div class="line"><span class="lineno"> 511</span><span class="preprocessor">#pragma omp for</span></div>
<div class="line"><span class="lineno"> 512</span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="lineno"> 513</span> <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
<div class="line"><span class="lineno"> 513</span> <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
<div class="line"><span class="lineno"> 514</span> <span class="comment">// select a random class for the point</span></div>
<div class="line"><span class="lineno"> 515</span> <span class="keywordtype">int</span> cls = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/rand.html">std::rand</a>() % num_classes;</div>
<div class="line"><span class="lineno"> 516</span> </div>

View File

@@ -1,15 +1,17 @@
<map id="operations_on_datastructures/trie_multiple_search.cpp" name="operations_on_datastructures/trie_multiple_search.cpp">
<area shape="rect" id="Node000001" title="Trie datastructure with search variants" alt="" coords="168,5,360,46"/>
<area shape="rect" id="Node000001" title="Trie datastructure with search variants" alt="" coords="210,5,403,46"/>
<area shape="rect" id="Node000002" title=" " alt="" coords="5,94,80,120"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="209,49,91,91,90,86,208,44"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="241,49,96,92,94,87,240,44"/>
<area shape="rect" id="Node000003" title=" " alt="" coords="104,94,168,120"/>
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="234,49,170,88,167,83,231,44"/>
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="265,49,177,90,175,85,263,44"/>
<area shape="rect" id="Node000004" title=" " alt="" coords="192,94,253,120"/>
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="256,48,238,81,234,79,251,45"/>
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="288,48,248,85,245,81,284,44"/>
<area shape="rect" id="Node000005" title=" " alt="" coords="276,94,337,120"/>
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="277,45,295,79,290,81,272,48"/>
<area shape="rect" id="Node000006" title=" " alt="" coords="360,94,432,120"/>
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="298,44,364,83,361,88,295,49"/>
<area shape="rect" id="Node000007" title=" " alt="" coords="456,94,512,120"/>
<area shape="poly" id="edge6_Node000001_Node000007" title=" " alt="" coords="320,44,442,88,440,93,318,49"/>
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="309,46,309,78,304,78,304,46"/>
<area shape="rect" id="Node000006" title=" " alt="" coords="360,94,421,120"/>
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="329,44,368,81,365,85,325,48"/>
<area shape="rect" id="Node000007" title=" " alt="" coords="444,94,516,120"/>
<area shape="poly" id="edge6_Node000001_Node000007" title=" " alt="" coords="351,44,440,85,438,90,349,49"/>
<area shape="rect" id="Node000008" title=" " alt="" coords="540,94,596,120"/>
<area shape="poly" id="edge7_Node000001_Node000008" title=" " alt="" coords="373,44,526,90,524,95,371,49"/>
</map>

View File

@@ -1 +1 @@
7faf370a84d664eb2e7390db0276959b
bd655c6b8b4d8e7bd95e834de8c7ad00

View File

@@ -4,8 +4,8 @@
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: operations_on_datastructures/trie_multiple_search.cpp Pages: 1 -->
<svg width="388pt" height="94pt"
viewBox="0.00 0.00 388.00 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg width="451pt" height="94pt"
viewBox="0.00 0.00 451.00 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
@@ -23,9 +23,9 @@
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Trie datastructure with search variants">
<polygon fill="#999999" stroke="#666666" points="266,-85.75 121.75,-85.75 121.75,-55.25 266,-55.25 266,-85.75"/>
<text text-anchor="start" x="129.75" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">operations_on_datastructures</text>
<text text-anchor="middle" x="193.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">/trie_multiple_search.cpp</text>
<polygon fill="#999999" stroke="#666666" points="298,-85.75 153.75,-85.75 153.75,-55.25 298,-55.25 298,-85.75"/>
<text text-anchor="start" x="161.75" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">operations_on_datastructures</text>
<text text-anchor="middle" x="225.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">/trie_multiple_search.cpp</text>
</a>
</g>
</g>
@@ -42,8 +42,8 @@
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M152.41,-54.8C125.19,-45.14 89.93,-32.63 63.88,-23.4"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="65.35,-20.2 54.76,-20.16 63.01,-26.8 65.35,-20.2"/>
<path fill="none" stroke="#63b8ff" d="M176.42,-54.8C142.65,-44.75 98.53,-31.63 67.16,-22.31"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="68.26,-18.98 57.68,-19.49 66.27,-25.69 68.26,-18.98"/>
</a>
</g>
</g>
@@ -60,8 +60,8 @@
<g id="edge2_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M170.14,-54.95C155.53,-45.98 136.84,-34.52 122.12,-25.5"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="124.32,-22.74 113.96,-20.49 120.66,-28.7 124.32,-22.74"/>
<path fill="none" stroke="#63b8ff" d="M193.91,-54.8C173.66,-45.48 147.66,-33.52 127.82,-24.4"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="129.43,-21.29 118.88,-20.29 126.5,-27.65 129.43,-21.29"/>
</a>
</g>
</g>
@@ -78,8 +78,8 @@
<g id="edge3_Node000001_Node000004" class="edge">
<title>Node1&#45;&gt;Node4</title>
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M186.21,-54.95C182.22,-47.36 177.28,-37.99 172.98,-29.82"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="176.12,-28.26 168.36,-21.04 169.92,-31.52 176.12,-28.26"/>
<path fill="none" stroke="#63b8ff" d="M210.3,-54.95C201.36,-46.59 190.08,-36.05 180.77,-27.35"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="183.39,-25.01 173.69,-20.73 178.61,-30.12 183.39,-25.01"/>
</a>
</g>
</g>
@@ -88,7 +88,7 @@
<title>Node5</title>
<g id="a_Node000005"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="248.5,-19.25 203.25,-19.25 203.25,0 248.5,0 248.5,-19.25"/>
<text text-anchor="middle" x="225.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstring</text>
<text text-anchor="middle" x="225.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
</a>
</g>
</g>
@@ -96,8 +96,8 @@
<g id="edge4_Node000001_Node000005" class="edge">
<title>Node1&#45;&gt;Node5</title>
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M201.79,-54.95C205.91,-47.36 211,-37.99 215.44,-29.82"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="218.52,-31.49 220.22,-21.03 212.37,-28.15 218.52,-31.49"/>
<path fill="none" stroke="#63b8ff" d="M225.88,-54.95C225.88,-47.71 225.88,-38.84 225.88,-30.94"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="229.38,-31.21 225.88,-21.21 222.38,-31.21 229.38,-31.21"/>
</a>
</g>
</g>
@@ -105,8 +105,8 @@
<g id="Node000006" class="node">
<title>Node6</title>
<g id="a_Node000006"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="319.62,-19.25 266.12,-19.25 266.12,0 319.62,0 319.62,-19.25"/>
<text text-anchor="middle" x="292.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
<polygon fill="#e0e0e0" stroke="#999999" points="311.5,-19.25 266.25,-19.25 266.25,0 311.5,0 311.5,-19.25"/>
<text text-anchor="middle" x="288.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstring</text>
</a>
</g>
</g>
@@ -114,8 +114,8 @@
<g id="edge5_Node000001_Node000006" class="edge">
<title>Node1&#45;&gt;Node6</title>
<g id="a_edge5_Node000001_Node000006"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M218.6,-54.8C233.68,-45.83 252.89,-34.41 267.99,-25.42"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="269.59,-28.55 276.39,-20.43 266.01,-22.53 269.59,-28.55"/>
<path fill="none" stroke="#63b8ff" d="M241.45,-54.95C250.39,-46.59 261.67,-36.05 270.98,-27.35"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="273.14,-30.12 278.06,-20.73 268.36,-25.01 273.14,-30.12"/>
</a>
</g>
</g>
@@ -123,8 +123,8 @@
<g id="Node000007" class="node">
<title>Node7</title>
<g id="a_Node000007"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="380,-19.25 337.75,-19.25 337.75,0 380,0 380,-19.25"/>
<text text-anchor="middle" x="358.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">queue</text>
<polygon fill="#e0e0e0" stroke="#999999" points="382.62,-19.25 329.12,-19.25 329.12,0 382.62,0 382.62,-19.25"/>
<text text-anchor="middle" x="355.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
</a>
</g>
</g>
@@ -132,8 +132,26 @@
<g id="edge6_Node000001_Node000007" class="edge">
<title>Node1&#45;&gt;Node7</title>
<g id="a_edge6_Node000001_Node000007"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M235.09,-54.8C263.36,-44.71 300.34,-31.51 326.5,-22.18"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="327.67,-25.48 335.91,-18.82 325.32,-18.88 327.67,-25.48"/>
<path fill="none" stroke="#63b8ff" d="M258.34,-54.8C278.9,-45.48 305.31,-33.52 325.46,-24.4"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="326.89,-27.59 334.56,-20.28 324.01,-21.22 326.89,-27.59"/>
</a>
</g>
</g>
<!-- Node8 -->
<g id="Node000008" class="node">
<title>Node8</title>
<g id="a_Node000008"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="443,-19.25 400.75,-19.25 400.75,0 443,0 443,-19.25"/>
<text text-anchor="middle" x="421.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">queue</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node8 -->
<g id="edge7_Node000001_Node000008" class="edge">
<title>Node1&#45;&gt;Node8</title>
<g id="a_edge7_Node000001_Node000008"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M274.83,-54.8C310.78,-44 358.59,-29.63 389.79,-20.26"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="390.46,-23.72 399.03,-17.49 388.45,-17.01 390.46,-23.72"/>
</a>
</g>
</g>

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@@ -4,17 +4,17 @@
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: operations_on_datastructures/trie_multiple_search.cpp Pages: 1 -->
<svg width="388pt" height="94pt"
viewBox="0.00 0.00 388.00 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg width="451pt" height="94pt"
viewBox="0.00 0.00 451.00 93.75" 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 89.75)">
<title>operations_on_datastructures/trie_multiple_search.cpp</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Trie datastructure with search variants">
<polygon fill="#999999" stroke="#666666" points="266,-85.75 121.75,-85.75 121.75,-55.25 266,-55.25 266,-85.75"/>
<text text-anchor="start" x="129.75" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">operations_on_datastructures</text>
<text text-anchor="middle" x="193.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">/trie_multiple_search.cpp</text>
<polygon fill="#999999" stroke="#666666" points="298,-85.75 153.75,-85.75 153.75,-55.25 298,-55.25 298,-85.75"/>
<text text-anchor="start" x="161.75" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">operations_on_datastructures</text>
<text text-anchor="middle" x="225.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">/trie_multiple_search.cpp</text>
</a>
</g>
</g>
@@ -31,8 +31,8 @@
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M152.41,-54.8C125.19,-45.14 89.93,-32.63 63.88,-23.4"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="65.35,-20.2 54.76,-20.16 63.01,-26.8 65.35,-20.2"/>
<path fill="none" stroke="#63b8ff" d="M176.42,-54.8C142.65,-44.75 98.53,-31.63 67.16,-22.31"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="68.26,-18.98 57.68,-19.49 66.27,-25.69 68.26,-18.98"/>
</a>
</g>
</g>
@@ -49,8 +49,8 @@
<g id="edge2_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M170.14,-54.95C155.53,-45.98 136.84,-34.52 122.12,-25.5"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="124.32,-22.74 113.96,-20.49 120.66,-28.7 124.32,-22.74"/>
<path fill="none" stroke="#63b8ff" d="M193.91,-54.8C173.66,-45.48 147.66,-33.52 127.82,-24.4"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="129.43,-21.29 118.88,-20.29 126.5,-27.65 129.43,-21.29"/>
</a>
</g>
</g>
@@ -67,8 +67,8 @@
<g id="edge3_Node000001_Node000004" class="edge">
<title>Node1&#45;&gt;Node4</title>
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M186.21,-54.95C182.22,-47.36 177.28,-37.99 172.98,-29.82"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="176.12,-28.26 168.36,-21.04 169.92,-31.52 176.12,-28.26"/>
<path fill="none" stroke="#63b8ff" d="M210.3,-54.95C201.36,-46.59 190.08,-36.05 180.77,-27.35"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="183.39,-25.01 173.69,-20.73 178.61,-30.12 183.39,-25.01"/>
</a>
</g>
</g>
@@ -77,7 +77,7 @@
<title>Node5</title>
<g id="a_Node000005"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="248.5,-19.25 203.25,-19.25 203.25,0 248.5,0 248.5,-19.25"/>
<text text-anchor="middle" x="225.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstring</text>
<text text-anchor="middle" x="225.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
</a>
</g>
</g>
@@ -85,8 +85,8 @@
<g id="edge4_Node000001_Node000005" class="edge">
<title>Node1&#45;&gt;Node5</title>
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M201.79,-54.95C205.91,-47.36 211,-37.99 215.44,-29.82"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="218.52,-31.49 220.22,-21.03 212.37,-28.15 218.52,-31.49"/>
<path fill="none" stroke="#63b8ff" d="M225.88,-54.95C225.88,-47.71 225.88,-38.84 225.88,-30.94"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="229.38,-31.21 225.88,-21.21 222.38,-31.21 229.38,-31.21"/>
</a>
</g>
</g>
@@ -94,8 +94,8 @@
<g id="Node000006" class="node">
<title>Node6</title>
<g id="a_Node000006"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="319.62,-19.25 266.12,-19.25 266.12,0 319.62,0 319.62,-19.25"/>
<text text-anchor="middle" x="292.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
<polygon fill="#e0e0e0" stroke="#999999" points="311.5,-19.25 266.25,-19.25 266.25,0 311.5,0 311.5,-19.25"/>
<text text-anchor="middle" x="288.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstring</text>
</a>
</g>
</g>
@@ -103,8 +103,8 @@
<g id="edge5_Node000001_Node000006" class="edge">
<title>Node1&#45;&gt;Node6</title>
<g id="a_edge5_Node000001_Node000006"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M218.6,-54.8C233.68,-45.83 252.89,-34.41 267.99,-25.42"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="269.59,-28.55 276.39,-20.43 266.01,-22.53 269.59,-28.55"/>
<path fill="none" stroke="#63b8ff" d="M241.45,-54.95C250.39,-46.59 261.67,-36.05 270.98,-27.35"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="273.14,-30.12 278.06,-20.73 268.36,-25.01 273.14,-30.12"/>
</a>
</g>
</g>
@@ -112,8 +112,8 @@
<g id="Node000007" class="node">
<title>Node7</title>
<g id="a_Node000007"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="380,-19.25 337.75,-19.25 337.75,0 380,0 380,-19.25"/>
<text text-anchor="middle" x="358.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">queue</text>
<polygon fill="#e0e0e0" stroke="#999999" points="382.62,-19.25 329.12,-19.25 329.12,0 382.62,0 382.62,-19.25"/>
<text text-anchor="middle" x="355.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
</a>
</g>
</g>
@@ -121,8 +121,26 @@
<g id="edge6_Node000001_Node000007" class="edge">
<title>Node1&#45;&gt;Node7</title>
<g id="a_edge6_Node000001_Node000007"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M235.09,-54.8C263.36,-44.71 300.34,-31.51 326.5,-22.18"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="327.67,-25.48 335.91,-18.82 325.32,-18.88 327.67,-25.48"/>
<path fill="none" stroke="#63b8ff" d="M258.34,-54.8C278.9,-45.48 305.31,-33.52 325.46,-24.4"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="326.89,-27.59 334.56,-20.28 324.01,-21.22 326.89,-27.59"/>
</a>
</g>
</g>
<!-- Node8 -->
<g id="Node000008" class="node">
<title>Node8</title>
<g id="a_Node000008"><a xlink:title=" ">
<polygon fill="#e0e0e0" stroke="#999999" points="443,-19.25 400.75,-19.25 400.75,0 443,0 443,-19.25"/>
<text text-anchor="middle" x="421.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">queue</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node8 -->
<g id="edge7_Node000001_Node000008" class="edge">
<title>Node1&#45;&gt;Node8</title>
<g id="a_edge7_Node000001_Node000008"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M274.83,-54.8C310.78,-44 358.59,-29.63 389.79,-20.26"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="390.46,-23.72 399.03,-17.49 388.45,-17.01 390.46,-23.72"/>
</a>
</g>
</g>

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB