Documentation for c6af943508
@@ -1,7 +1,9 @@
|
||||
<map id="math/fibonacci.cpp" name="math/fibonacci.cpp">
|
||||
<area shape="rect" id="Node000001" title="n-th Fibonacci number." alt="" coords="17,5,148,31"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="5,79,70,105"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="78,33,55,67,51,64,73,30"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="94,79,165,105"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="93,30,116,64,111,67,88,33"/>
|
||||
<area shape="rect" id="Node000001" title="n-th Fibonacci number." alt="" coords="56,5,188,31"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="5,79,66,105"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="109,34,63,71,60,67,106,29"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="90,79,154,105"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="125,31,125,63,120,63,120,31"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="178,79,250,105"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="139,29,189,67,185,72,136,34"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
49f66312ca146ee843623ef817e14b8f
|
||||
d3a10169b6b4b9690a711d2055b7a434
|
||||
@@ -4,8 +4,8 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: math/fibonacci.cpp Pages: 1 -->
|
||||
<svg width="128pt" height="83pt"
|
||||
viewBox="0.00 0.00 127.88 82.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="191pt" height="83pt"
|
||||
viewBox="0.00 0.00 191.38 82.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">
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="n-th Fibonacci number.">
|
||||
<polygon fill="#999999" stroke="#666666" points="107.38,-74.5 8.87,-74.5 8.87,-55.25 107.38,-55.25 107.38,-74.5"/>
|
||||
<text text-anchor="middle" x="58.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">math/fibonacci.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="136.88,-74.5 38.37,-74.5 38.37,-55.25 136.88,-55.25 136.88,-74.5"/>
|
||||
<text text-anchor="middle" x="87.62" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">math/fibonacci.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -32,8 +32,8 @@
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="48.25,-19.25 0,-19.25 0,0 48.25,0 48.25,-19.25"/>
|
||||
<text text-anchor="middle" x="24.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="45.25,-19.25 0,-19.25 0,0 45.25,0 45.25,-19.25"/>
|
||||
<text text-anchor="middle" x="22.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -41,8 +41,8 @@
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M52.51,-55.08C48.01,-48.03 41.54,-37.9 35.91,-29.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="39.01,-27.43 30.68,-20.88 33.11,-31.2 39.01,-27.43"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M76.6,-54.84C67.2,-47.15 53.48,-35.9 42.22,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="44.61,-24.11 34.66,-20.48 40.18,-29.53 44.61,-24.11"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -50,8 +50,8 @@
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="119.88,-19.25 66.38,-19.25 66.38,0 119.88,0 119.88,-19.25"/>
|
||||
<text text-anchor="middle" x="93.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="111.75,-19.25 63.5,-19.25 63.5,0 111.75,0 111.75,-19.25"/>
|
||||
<text text-anchor="middle" x="87.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -59,8 +59,26 @@
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M63.9,-55.08C68.54,-48.03 75.2,-37.9 80.99,-29.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="83.82,-31.15 86.39,-20.87 77.97,-27.31 83.82,-31.15"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M87.62,-55.08C87.62,-48.57 87.62,-39.42 87.62,-31.12"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="91.13,-31.12 87.63,-21.12 84.13,-31.12 91.13,-31.12"/>
|
||||
</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="183.38,-19.25 129.88,-19.25 129.88,0 183.38,0 183.38,-19.25"/>
|
||||
<text text-anchor="middle" x="156.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M99.33,-54.84C109.4,-47.07 124.17,-35.67 136.19,-26.4"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="138.12,-29.33 143.89,-20.45 133.84,-23.79 138.12,-29.33"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.8 KiB |
@@ -4,16 +4,16 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: math/fibonacci.cpp Pages: 1 -->
|
||||
<svg width="128pt" height="83pt"
|
||||
viewBox="0.00 0.00 127.88 82.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="191pt" height="83pt"
|
||||
viewBox="0.00 0.00 191.38 82.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 78.5)">
|
||||
<title>math/fibonacci.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="n-th Fibonacci number.">
|
||||
<polygon fill="#999999" stroke="#666666" points="107.38,-74.5 8.87,-74.5 8.87,-55.25 107.38,-55.25 107.38,-74.5"/>
|
||||
<text text-anchor="middle" x="58.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">math/fibonacci.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="136.88,-74.5 38.37,-74.5 38.37,-55.25 136.88,-55.25 136.88,-74.5"/>
|
||||
<text text-anchor="middle" x="87.62" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">math/fibonacci.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -21,8 +21,8 @@
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="48.25,-19.25 0,-19.25 0,0 48.25,0 48.25,-19.25"/>
|
||||
<text text-anchor="middle" x="24.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="45.25,-19.25 0,-19.25 0,0 45.25,0 45.25,-19.25"/>
|
||||
<text text-anchor="middle" x="22.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -30,8 +30,8 @@
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M52.51,-55.08C48.01,-48.03 41.54,-37.9 35.91,-29.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="39.01,-27.43 30.68,-20.88 33.11,-31.2 39.01,-27.43"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M76.6,-54.84C67.2,-47.15 53.48,-35.9 42.22,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="44.61,-24.11 34.66,-20.48 40.18,-29.53 44.61,-24.11"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -39,8 +39,8 @@
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="119.88,-19.25 66.38,-19.25 66.38,0 119.88,0 119.88,-19.25"/>
|
||||
<text text-anchor="middle" x="93.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="111.75,-19.25 63.5,-19.25 63.5,0 111.75,0 111.75,-19.25"/>
|
||||
<text text-anchor="middle" x="87.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -48,8 +48,26 @@
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M63.9,-55.08C68.54,-48.03 75.2,-37.9 80.99,-29.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="83.82,-31.15 86.39,-20.87 77.97,-27.31 83.82,-31.15"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M87.62,-55.08C87.62,-48.57 87.62,-39.42 87.62,-31.12"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="91.13,-31.12 87.63,-21.12 84.13,-31.12 91.13,-31.12"/>
|
||||
</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="183.38,-19.25 129.88,-19.25 129.88,0 183.38,0 183.38,-19.25"/>
|
||||
<text text-anchor="middle" x="156.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M99.33,-54.84C109.4,-47.07 124.17,-35.67 136.19,-26.4"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="138.12,-29.33 143.89,-20.45 133.84,-23.79 138.12,-29.33"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 3.1 KiB |
@@ -372,7 +372,7 @@ Here is the call graph for this function:</div>
|
||||
<div class="ttc" id="aatof_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/byte/atof.html">std::atof</a></div><div class="ttdeci">T atof(T... args)</div></div>
|
||||
<div class="ttc" id="aatoi_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/byte/atoi.html">std::atoi</a></div><div class="ttdeci">T atoi(T... args)</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="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:47</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="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="agenerate__parentheses_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> generate_parentheses.cpp:82</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>
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
<map id="sorting/dnf_sort.cpp" name="sorting/dnf_sort.cpp">
|
||||
<area shape="rect" id="Node000001" title="Implementation of the DNF sort implementation." alt="" coords="113,5,249,31"/>
|
||||
<area shape="rect" id="Node000001" title="Implementation of the DNF sort implementation." alt="" coords="154,5,291,31"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="5,79,80,105"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="159,34,81,74,79,69,156,29"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="193,34,88,75,86,70,191,29"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="104,79,168,105"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="176,33,154,67,149,64,171,30"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="192,79,264,105"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="191,30,214,64,209,67,187,33"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="287,79,344,105"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="205,29,281,69,278,74,203,34"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="209,34,164,71,160,67,206,29"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="192,79,253,105"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="225,31,225,63,220,63,220,31"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="276,79,348,105"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="239,29,287,67,283,71,236,34"/>
|
||||
<area shape="rect" id="Node000006" title=" " alt="" coords="371,79,428,105"/>
|
||||
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="254,29,358,71,356,76,252,34"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
02b6272d7e0497aeb2fb1ce3309cc25d
|
||||
dd905360671719642a1b392d60b27e78
|
||||
@@ -4,8 +4,8 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: sorting/dnf_sort.cpp Pages: 1 -->
|
||||
<svg width="262pt" height="83pt"
|
||||
viewBox="0.00 0.00 262.38 82.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="325pt" height="83pt"
|
||||
viewBox="0.00 0.00 325.38 82.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">
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Implementation of the DNF sort implementation.">
|
||||
<polygon fill="#999999" stroke="#666666" points="183,-74.5 80.75,-74.5 80.75,-55.25 183,-55.25 183,-74.5"/>
|
||||
<text text-anchor="middle" x="131.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">sorting/dnf_sort.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="214,-74.5 111.75,-74.5 111.75,-55.25 214,-55.25 214,-74.5"/>
|
||||
<text text-anchor="middle" x="162.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">sorting/dnf_sort.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -41,8 +41,8 @@
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M114.23,-54.84C98.25,-46.66 74.42,-34.46 55.84,-24.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="57.45,-21.83 46.95,-20.39 54.26,-28.07 57.45,-21.83"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M139.97,-54.84C118.45,-46.35 85.96,-33.54 61.5,-23.89"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="62.88,-20.67 52.3,-20.26 60.31,-27.18 62.88,-20.67"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -59,8 +59,8 @@
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M126.26,-55.08C121.76,-48.03 115.29,-37.9 109.66,-29.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="112.76,-27.43 104.43,-20.88 106.86,-31.2 112.76,-27.43"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M151.85,-54.84C142.45,-47.15 128.73,-35.9 117.47,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="119.86,-24.11 109.91,-20.48 115.43,-29.53 119.86,-24.11"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -68,8 +68,8 @@
|
||||
<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>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="185.5,-19.25 140.25,-19.25 140.25,0 185.5,0 185.5,-19.25"/>
|
||||
<text text-anchor="middle" x="162.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -77,8 +77,8 @@
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M137.65,-55.08C142.29,-48.03 148.95,-37.9 154.74,-29.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="157.57,-31.15 160.14,-20.87 151.72,-27.31 157.57,-31.15"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M162.88,-55.08C162.88,-48.57 162.88,-39.42 162.88,-31.12"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="166.38,-31.12 162.88,-21.12 159.38,-31.12 166.38,-31.12"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -86,8 +86,8 @@
|
||||
<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>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="256.62,-19.25 203.12,-19.25 203.12,0 256.62,0 256.62,-19.25"/>
|
||||
<text text-anchor="middle" x="229.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -95,8 +95,26 @@
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M149.01,-54.84C164.53,-46.66 187.68,-34.46 205.72,-24.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="207.11,-28.17 214.32,-20.41 203.84,-21.98 207.11,-28.17"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M174.24,-54.84C183.92,-47.15 198.07,-35.9 209.68,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="211.84,-29.43 217.49,-20.47 207.49,-23.95 211.84,-29.43"/>
|
||||
</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="317.38,-19.25 274.38,-19.25 274.38,0 317.38,0 317.38,-19.25"/>
|
||||
<text text-anchor="middle" x="295.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node6 -->
|
||||
<g id="edge5_Node000001_Node000006" class="edge">
|
||||
<title>Node1->Node6</title>
|
||||
<g id="a_edge5_Node000001_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M185.44,-54.84C206.9,-46.25 239.42,-33.23 263.62,-23.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="264.7,-26.88 272.68,-19.91 262.1,-20.38 264.7,-26.88"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 5.3 KiB |
@@ -4,16 +4,16 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: sorting/dnf_sort.cpp Pages: 1 -->
|
||||
<svg width="262pt" height="83pt"
|
||||
viewBox="0.00 0.00 262.38 82.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="325pt" height="83pt"
|
||||
viewBox="0.00 0.00 325.38 82.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 78.5)">
|
||||
<title>sorting/dnf_sort.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Implementation of the DNF sort implementation.">
|
||||
<polygon fill="#999999" stroke="#666666" points="183,-74.5 80.75,-74.5 80.75,-55.25 183,-55.25 183,-74.5"/>
|
||||
<text text-anchor="middle" x="131.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">sorting/dnf_sort.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="214,-74.5 111.75,-74.5 111.75,-55.25 214,-55.25 214,-74.5"/>
|
||||
<text text-anchor="middle" x="162.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">sorting/dnf_sort.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -30,8 +30,8 @@
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M114.23,-54.84C98.25,-46.66 74.42,-34.46 55.84,-24.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="57.45,-21.83 46.95,-20.39 54.26,-28.07 57.45,-21.83"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M139.97,-54.84C118.45,-46.35 85.96,-33.54 61.5,-23.89"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="62.88,-20.67 52.3,-20.26 60.31,-27.18 62.88,-20.67"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -48,8 +48,8 @@
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M126.26,-55.08C121.76,-48.03 115.29,-37.9 109.66,-29.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="112.76,-27.43 104.43,-20.88 106.86,-31.2 112.76,-27.43"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M151.85,-54.84C142.45,-47.15 128.73,-35.9 117.47,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="119.86,-24.11 109.91,-20.48 115.43,-29.53 119.86,-24.11"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -57,8 +57,8 @@
|
||||
<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>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="185.5,-19.25 140.25,-19.25 140.25,0 185.5,0 185.5,-19.25"/>
|
||||
<text text-anchor="middle" x="162.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -66,8 +66,8 @@
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M137.65,-55.08C142.29,-48.03 148.95,-37.9 154.74,-29.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="157.57,-31.15 160.14,-20.87 151.72,-27.31 157.57,-31.15"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M162.88,-55.08C162.88,-48.57 162.88,-39.42 162.88,-31.12"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="166.38,-31.12 162.88,-21.12 159.38,-31.12 166.38,-31.12"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -75,8 +75,8 @@
|
||||
<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>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="256.62,-19.25 203.12,-19.25 203.12,0 256.62,0 256.62,-19.25"/>
|
||||
<text text-anchor="middle" x="229.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -84,8 +84,26 @@
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M149.01,-54.84C164.53,-46.66 187.68,-34.46 205.72,-24.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="207.11,-28.17 214.32,-20.41 203.84,-21.98 207.11,-28.17"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M174.24,-54.84C183.92,-47.15 198.07,-35.9 209.68,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="211.84,-29.43 217.49,-20.47 207.49,-23.95 211.84,-29.43"/>
|
||||
</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="317.38,-19.25 274.38,-19.25 274.38,0 317.38,0 317.38,-19.25"/>
|
||||
<text text-anchor="middle" x="295.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node6 -->
|
||||
<g id="edge5_Node000001_Node000006" class="edge">
|
||||
<title>Node1->Node6</title>
|
||||
<g id="a_edge5_Node000001_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M185.44,-54.84C206.9,-46.25 239.42,-33.23 263.62,-23.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="264.7,-26.88 272.68,-19.91 262.1,-20.38 264.7,-26.88"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 4.5 KiB |
@@ -114,12 +114,13 @@ $(function(){initNavTree('df/d28/dsu__union__rank_8cpp.html','../../'); initResi
|
||||
<p><a href="https://en.wikipedia.org/wiki/Disjoint-set-data_structure" target="_blank">DSU (Disjoint sets)</a>
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <cassert></code><br />
|
||||
<code>#include <cstdint></code><br />
|
||||
<code>#include <iostream></code><br />
|
||||
<code>#include <vector></code><br />
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for dsu_union_rank.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d7/dda/dsu__union__rank_8cpp__incl.svg" width="252" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d7/dda/dsu__union__rank_8cpp__incl.svg" width="336" 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="nested-classes" name="nested-classes"></a>
|
||||
@@ -163,14 +164,14 @@ element). Disjoint sets uses cases : for finding connected components in a graph
|
||||
|
||||
<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"> 182</span> {</div>
|
||||
<div class="line"><span class="lineno"> 183</span> <a class="code hl_function" href="#ae7880ce913f3058a35ff106d5be9e243">test1</a>(); <span class="comment">// run 1st test case</span></div>
|
||||
<div class="line"><span class="lineno"> 184</span> <a class="code hl_function" href="#a45d94ead4cf4e1ff9f87c38bc99f59ae">test2</a>(); <span class="comment">// run 2nd test case</span></div>
|
||||
<div class="line"><span class="lineno"> 185</span> </div>
|
||||
<div class="line"><span class="lineno"> 186</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 187</span>}</div>
|
||||
<div class="ttc" id="adsu__union__rank_8cpp_html_a45d94ead4cf4e1ff9f87c38bc99f59ae"><div class="ttname"><a href="#a45d94ead4cf4e1ff9f87c38bc99f59ae">test2</a></div><div class="ttdeci">static void test2()</div><div class="ttdoc">Self-implementations, 2nd test.</div><div class="ttdef"><b>Definition</b> dsu_union_rank.cpp:157</div></div>
|
||||
<div class="ttc" id="adsu__union__rank_8cpp_html_ae7880ce913f3058a35ff106d5be9e243"><div class="ttname"><a href="#ae7880ce913f3058a35ff106d5be9e243">test1</a></div><div class="ttdeci">static void test1()</div><div class="ttdoc">Self-implementations, 1st test.</div><div class="ttdef"><b>Definition</b> dsu_union_rank.cpp:133</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 183</span> {</div>
|
||||
<div class="line"><span class="lineno"> 184</span> <a class="code hl_function" href="#ae7880ce913f3058a35ff106d5be9e243">test1</a>(); <span class="comment">// run 1st test case</span></div>
|
||||
<div class="line"><span class="lineno"> 185</span> <a class="code hl_function" href="#a45d94ead4cf4e1ff9f87c38bc99f59ae">test2</a>(); <span class="comment">// run 2nd test case</span></div>
|
||||
<div class="line"><span class="lineno"> 186</span> </div>
|
||||
<div class="line"><span class="lineno"> 187</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 188</span>}</div>
|
||||
<div class="ttc" id="adsu__union__rank_8cpp_html_a45d94ead4cf4e1ff9f87c38bc99f59ae"><div class="ttname"><a href="#a45d94ead4cf4e1ff9f87c38bc99f59ae">test2</a></div><div class="ttdeci">static void test2()</div><div class="ttdoc">Self-implementations, 2nd test.</div><div class="ttdef"><b>Definition</b> dsu_union_rank.cpp:158</div></div>
|
||||
<div class="ttc" id="adsu__union__rank_8cpp_html_ae7880ce913f3058a35ff106d5be9e243"><div class="ttname"><a href="#ae7880ce913f3058a35ff106d5be9e243">test1</a></div><div class="ttdeci">static void test1()</div><div class="ttdoc">Self-implementations, 1st test.</div><div class="ttdef"><b>Definition</b> dsu_union_rank.cpp:134</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -207,28 +208,28 @@ Here is the call graph for this function:</div>
|
||||
<p>< number of elements</p>
|
||||
<p>< object of class disjoint sets</p>
|
||||
<p>< performs union operation on 1 and 2</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 133</span> {</div>
|
||||
<div class="line"><span class="lineno"> 134</span> <span class="comment">/* checks the parents in the resultant structures */</span></div>
|
||||
<div class="line"><span class="lineno"> 135</span> uint64_t n = 10; <span class="comment">///< number of elements</span></div>
|
||||
<div class="line"><span class="lineno"> 136</span> <a class="code hl_class" href="../../dd/d1f/classdsu.html">dsu</a> d(n + 1); <span class="comment">///< object of class disjoint sets</span></div>
|
||||
<div class="line"><span class="lineno"> 137</span> d.unionSet(2, 1); <span class="comment">///< performs union operation on 1 and 2</span></div>
|
||||
<div class="line"><span class="lineno"> 138</span> d.unionSet(1, 4);</div>
|
||||
<div class="line"><span class="lineno"> 139</span> d.unionSet(8, 1);</div>
|
||||
<div class="line"><span class="lineno"> 140</span> d.unionSet(3, 5);</div>
|
||||
<div class="line"><span class="lineno"> 141</span> d.unionSet(5, 6);</div>
|
||||
<div class="line"><span class="lineno"> 142</span> d.unionSet(5, 7);</div>
|
||||
<div class="line"><span class="lineno"> 143</span> d.unionSet(9, 10);</div>
|
||||
<div class="line"><span class="lineno"> 144</span> d.unionSet(2, 10);</div>
|
||||
<div class="line"><span class="lineno"> 145</span> <span class="comment">// keeping track of the changes using parent pointers</span></div>
|
||||
<div class="line"><span class="lineno"> 146</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<uint64_t></a> ans = {7, 5};</div>
|
||||
<div class="line"><span class="lineno"> 147</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < ans.size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 148</span> assert(d.getParents(7).at(i) ==</div>
|
||||
<div class="line"><span class="lineno"> 149</span> ans[i]); <span class="comment">// makes sure algorithm works fine</span></div>
|
||||
<div class="line"><span class="lineno"> 150</span> }</div>
|
||||
<div class="line"><span class="lineno"> 151</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">cout</a> << <span class="stringliteral">"1st test passed!"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 152</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 134</span> {</div>
|
||||
<div class="line"><span class="lineno"> 135</span> <span class="comment">/* checks the parents in the resultant structures */</span></div>
|
||||
<div class="line"><span class="lineno"> 136</span> uint64_t n = 10; <span class="comment">///< number of elements</span></div>
|
||||
<div class="line"><span class="lineno"> 137</span> <a class="code hl_class" href="../../dd/d1f/classdsu.html">dsu</a> d(n + 1); <span class="comment">///< object of class disjoint sets</span></div>
|
||||
<div class="line"><span class="lineno"> 138</span> d.unionSet(2, 1); <span class="comment">///< performs union operation on 1 and 2</span></div>
|
||||
<div class="line"><span class="lineno"> 139</span> d.unionSet(1, 4);</div>
|
||||
<div class="line"><span class="lineno"> 140</span> d.unionSet(8, 1);</div>
|
||||
<div class="line"><span class="lineno"> 141</span> d.unionSet(3, 5);</div>
|
||||
<div class="line"><span class="lineno"> 142</span> d.unionSet(5, 6);</div>
|
||||
<div class="line"><span class="lineno"> 143</span> d.unionSet(5, 7);</div>
|
||||
<div class="line"><span class="lineno"> 144</span> d.unionSet(9, 10);</div>
|
||||
<div class="line"><span class="lineno"> 145</span> d.unionSet(2, 10);</div>
|
||||
<div class="line"><span class="lineno"> 146</span> <span class="comment">// keeping track of the changes using parent pointers</span></div>
|
||||
<div class="line"><span class="lineno"> 147</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<uint64_t></a> ans = {7, 5};</div>
|
||||
<div class="line"><span class="lineno"> 148</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < ans.size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 149</span> assert(d.getParents(7).at(i) ==</div>
|
||||
<div class="line"><span class="lineno"> 150</span> ans[i]); <span class="comment">// makes sure algorithm works fine</span></div>
|
||||
<div class="line"><span class="lineno"> 151</span> }</div>
|
||||
<div class="line"><span class="lineno"> 152</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">cout</a> << <span class="stringliteral">"1st test passed!"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 153</span>}</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="aclassdsu_html"><div class="ttname"><a href="../../dd/d1f/classdsu.html">dsu</a></div><div class="ttdoc">Disjoint sets union data structure, class based representation.</div><div class="ttdef"><b>Definition</b> dsu_path_compression.cpp:33</div></div>
|
||||
<div class="ttc" id="aclassdsu_html"><div class="ttname"><a href="../../dd/d1f/classdsu.html">dsu</a></div><div class="ttdoc">Disjoint sets union data structure, class based representation.</div><div class="ttdef"><b>Definition</b> dsu_path_compression.cpp:34</div></div>
|
||||
<div class="ttc" id="amatrix__exponentiation_8cpp_html_a600eaf353befc174637855795f12d258"><div class="ttname"><a href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a></div><div class="ttdeci">#define endl</div><div class="ttdef"><b>Definition</b> matrix_exponentiation.cpp:36</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">
|
||||
@@ -269,27 +270,27 @@ Here is the call graph for this function:</div>
|
||||
<p>performs union operation on 1 and 2</p>
|
||||
<p>keeping track of the changes using parent pointers</p>
|
||||
<p>makes sure algorithm works fine</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 157</span> {</div>
|
||||
<div class="line"><span class="lineno"> 158</span> <span class="comment">// checks the parents in the resultant structures</span></div>
|
||||
<div class="line"><span class="lineno"> 159</span> uint64_t n = 10; <span class="comment">///< number of elements</span></div>
|
||||
<div class="line"><span class="lineno"> 160</span> <a class="code hl_class" href="../../dd/d1f/classdsu.html">dsu</a> d(n + 1); <span class="comment">///< object of class disjoint sets</span></div>
|
||||
<div class="line"><span class="lineno"> 161</span> d.unionSet(2, 1); <span class="comment">/// performs union operation on 1 and 2</span></div>
|
||||
<div class="line"><span class="lineno"> 162</span> d.unionSet(1, 4);</div>
|
||||
<div class="line"><span class="lineno"> 163</span> d.unionSet(8, 1);</div>
|
||||
<div class="line"><span class="lineno"> 164</span> d.unionSet(3, 5);</div>
|
||||
<div class="line"><span class="lineno"> 165</span> d.unionSet(5, 6);</div>
|
||||
<div class="line"><span class="lineno"> 166</span> d.unionSet(5, 7);</div>
|
||||
<div class="line"><span class="lineno"> 167</span> d.unionSet(9, 10);</div>
|
||||
<div class="line"><span class="lineno"> 168</span> d.unionSet(2, 10);</div>
|
||||
<div class="line"><span class="lineno"> 169</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 170</span><span class="comment"> /// keeping track of the changes using parent pointers</span></div>
|
||||
<div class="line"><span class="lineno"> 171</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<uint64_t></a> ans = {2, 1, 10};</div>
|
||||
<div class="line"><span class="lineno"> 172</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < ans.size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 173</span> assert(d.getParents(2).at(i) ==</div>
|
||||
<div class="line"><span class="lineno"> 174</span> ans[i]); <span class="comment">/// makes sure algorithm works fine</span></div>
|
||||
<div class="line"><span class="lineno"> 175</span> }</div>
|
||||
<div class="line"><span class="lineno"> 176</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">cout</a> << <span class="stringliteral">"2nd test passed!"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 177</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 158</span> {</div>
|
||||
<div class="line"><span class="lineno"> 159</span> <span class="comment">// checks the parents in the resultant structures</span></div>
|
||||
<div class="line"><span class="lineno"> 160</span> uint64_t n = 10; <span class="comment">///< number of elements</span></div>
|
||||
<div class="line"><span class="lineno"> 161</span> <a class="code hl_class" href="../../dd/d1f/classdsu.html">dsu</a> d(n + 1); <span class="comment">///< object of class disjoint sets</span></div>
|
||||
<div class="line"><span class="lineno"> 162</span> d.unionSet(2, 1); <span class="comment">/// performs union operation on 1 and 2</span></div>
|
||||
<div class="line"><span class="lineno"> 163</span> d.unionSet(1, 4);</div>
|
||||
<div class="line"><span class="lineno"> 164</span> d.unionSet(8, 1);</div>
|
||||
<div class="line"><span class="lineno"> 165</span> d.unionSet(3, 5);</div>
|
||||
<div class="line"><span class="lineno"> 166</span> d.unionSet(5, 6);</div>
|
||||
<div class="line"><span class="lineno"> 167</span> d.unionSet(5, 7);</div>
|
||||
<div class="line"><span class="lineno"> 168</span> d.unionSet(9, 10);</div>
|
||||
<div class="line"><span class="lineno"> 169</span> d.unionSet(2, 10);</div>
|
||||
<div class="line"><span class="lineno"> 170</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 171</span><span class="comment"> /// keeping track of the changes using parent pointers</span></div>
|
||||
<div class="line"><span class="lineno"> 172</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<uint64_t></a> ans = {2, 1, 10};</div>
|
||||
<div class="line"><span class="lineno"> 173</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < ans.size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 174</span> assert(d.getParents(2).at(i) ==</div>
|
||||
<div class="line"><span class="lineno"> 175</span> ans[i]); <span class="comment">/// makes sure algorithm works fine</span></div>
|
||||
<div class="line"><span class="lineno"> 176</span> }</div>
|
||||
<div class="line"><span class="lineno"> 177</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">cout</a> << <span class="stringliteral">"2nd test passed!"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 178</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
|
||||
@@ -121,7 +121,7 @@ $(function(){initNavTree('df/d2c/elliptic__curve__key__exchange_8cpp.html','../.
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for elliptic_curve_key_exchange.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d2/d83/elliptic__curve__key__exchange_8cpp__incl.svg" width="470" height="272"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d2/d83/elliptic__curve__key__exchange_8cpp__incl.svg" width="547" height="272"><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="nested-classes" name="nested-classes"></a>
|
||||
@@ -345,7 +345,7 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><span class="lineno"> 221</span> assert((a ^ b) == <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"12321421424217440294"</span>));</div>
|
||||
<div class="line"><span class="lineno"> 222</span> assert((a << 64) == <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"227290107637132170748078080907806769152"</span>));</div>
|
||||
<div class="line"><span class="lineno"> 223</span>}</div>
|
||||
<div class="ttc" id="aclassuint128__t_html"><div class="ttname"><a href="../../db/d9a/classuint128__t.html">uint128_t</a></div><div class="ttdoc">class for 128-bit unsigned integer</div><div class="ttdef"><b>Definition</b> uint128_t.hpp:59</div></div>
|
||||
<div class="ttc" id="aclassuint128__t_html"><div class="ttname"><a href="../../db/d9a/classuint128__t.html">uint128_t</a></div><div class="ttdoc">class for 128-bit unsigned integer</div><div class="ttdef"><b>Definition</b> uint128_t.hpp:60</div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<map id="search/exponential_search.cpp" name="search/exponential_search.cpp">
|
||||
<area shape="rect" id="Node000001" title="Exponential search algorithm" alt="" coords="102,5,232,46"/>
|
||||
<area shape="rect" id="Node000001" title="Exponential search algorithm" alt="" coords="99,5,229,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="134,49,71,88,69,83,131,44"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="94,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="175,94,246,120"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="180,45,199,79,194,82,175,48"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="270,94,330,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="156,48,139,81,134,79,152,45"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="175,94,236,120"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="177,45,194,79,190,81,172,48"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="259,94,320,120"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="197,44,259,83,256,88,194,49"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
5164a3da2fcbda485abfd47e9570ca44
|
||||
7299af949721aa4acb03e7e972926ea1
|
||||
@@ -4,8 +4,8 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: search/exponential_search.cpp Pages: 1 -->
|
||||
<svg width="252pt" height="94pt"
|
||||
viewBox="0.00 0.00 251.75 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="244pt" height="94pt"
|
||||
viewBox="0.00 0.00 243.75 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="Exponential search algorithm">
|
||||
<polygon fill="#999999" stroke="#666666" points="170,-85.75 72.25,-85.75 72.25,-55.25 170,-55.25 170,-85.75"/>
|
||||
<text text-anchor="start" x="80.25" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">search/exponential</text>
|
||||
<text text-anchor="middle" x="121.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_search.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="168,-85.75 70.25,-85.75 70.25,-55.25 168,-55.25 168,-85.75"/>
|
||||
<text text-anchor="start" x="78.25" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">search/exponential</text>
|
||||
<text text-anchor="middle" x="119.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_search.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -42,8 +42,8 @@
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->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="M95.64,-54.95C81.32,-46.07 63.04,-34.74 48.54,-25.76"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="50.4,-22.79 40.06,-20.5 46.71,-28.74 50.4,-22.79"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -60,8 +60,8 @@
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->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="M111.46,-54.95C107.47,-47.36 102.53,-37.99 98.23,-29.82"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="101.37,-28.26 93.61,-21.04 95.17,-31.52 101.37,-28.26"/>
|
||||
</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="180.88,-19.25 127.38,-19.25 127.38,0 180.88,0 180.88,-19.25"/>
|
||||
<text text-anchor="middle" x="154.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="172.75,-19.25 127.5,-19.25 127.5,0 172.75,0 172.75,-19.25"/>
|
||||
<text text-anchor="middle" x="150.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->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M129.28,-54.95C133.58,-47.28 138.91,-37.77 143.52,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="146.46,-31.46 148.3,-21.02 140.36,-28.03 146.46,-31.46"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M126.79,-54.95C130.78,-47.36 135.72,-37.99 140.02,-29.82"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="143.08,-31.52 144.64,-21.04 136.88,-28.26 143.08,-31.52"/>
|
||||
</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="243.75,-19.25 198.5,-19.25 198.5,0 243.75,0 243.75,-19.25"/>
|
||||
<text text-anchor="middle" x="221.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstring</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="235.75,-19.25 190.5,-19.25 190.5,0 235.75,0 235.75,-19.25"/>
|
||||
<text text-anchor="middle" x="213.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstring</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -96,8 +96,8 @@
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->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="M142.36,-54.95C156.54,-46.07 174.62,-34.74 188.96,-25.76"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="190.73,-28.78 197.35,-20.5 187.02,-22.85 190.73,-28.78"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
@@ -4,17 +4,17 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: search/exponential_search.cpp Pages: 1 -->
|
||||
<svg width="252pt" height="94pt"
|
||||
viewBox="0.00 0.00 251.75 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="244pt" height="94pt"
|
||||
viewBox="0.00 0.00 243.75 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>search/exponential_search.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Exponential search algorithm">
|
||||
<polygon fill="#999999" stroke="#666666" points="170,-85.75 72.25,-85.75 72.25,-55.25 170,-55.25 170,-85.75"/>
|
||||
<text text-anchor="start" x="80.25" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">search/exponential</text>
|
||||
<text text-anchor="middle" x="121.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_search.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="168,-85.75 70.25,-85.75 70.25,-55.25 168,-55.25 168,-85.75"/>
|
||||
<text text-anchor="start" x="78.25" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">search/exponential</text>
|
||||
<text text-anchor="middle" x="119.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_search.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -31,8 +31,8 @@
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->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="M95.64,-54.95C81.32,-46.07 63.04,-34.74 48.54,-25.76"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="50.4,-22.79 40.06,-20.5 46.71,-28.74 50.4,-22.79"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -49,8 +49,8 @@
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->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="M111.46,-54.95C107.47,-47.36 102.53,-37.99 98.23,-29.82"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="101.37,-28.26 93.61,-21.04 95.17,-31.52 101.37,-28.26"/>
|
||||
</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="180.88,-19.25 127.38,-19.25 127.38,0 180.88,0 180.88,-19.25"/>
|
||||
<text text-anchor="middle" x="154.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="172.75,-19.25 127.5,-19.25 127.5,0 172.75,0 172.75,-19.25"/>
|
||||
<text text-anchor="middle" x="150.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->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M129.28,-54.95C133.58,-47.28 138.91,-37.77 143.52,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="146.46,-31.46 148.3,-21.02 140.36,-28.03 146.46,-31.46"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M126.79,-54.95C130.78,-47.36 135.72,-37.99 140.02,-29.82"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="143.08,-31.52 144.64,-21.04 136.88,-28.26 143.08,-31.52"/>
|
||||
</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="243.75,-19.25 198.5,-19.25 198.5,0 243.75,0 243.75,-19.25"/>
|
||||
<text text-anchor="middle" x="221.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstring</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="235.75,-19.25 190.5,-19.25 190.5,0 235.75,0 235.75,-19.25"/>
|
||||
<text text-anchor="middle" x="213.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstring</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -85,8 +85,8 @@
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->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="M142.36,-54.95C156.54,-46.07 174.62,-34.74 188.96,-25.76"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="190.73,-28.78 197.35,-20.5 187.02,-22.85 190.73,-28.78"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
@@ -115,6 +115,7 @@ $(function(){initNavTree('df/d47/fcfs__scheduling_8cpp.html','../../'); initResi
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <algorithm></code><br />
|
||||
<code>#include <cassert></code><br />
|
||||
<code>#include <cstdint></code><br />
|
||||
<code>#include <cstdlib></code><br />
|
||||
<code>#include <ctime></code><br />
|
||||
<code>#include <iomanip></code><br />
|
||||
@@ -183,35 +184,35 @@ template<typename S , typename T , typename E > </div>
|
||||
</dd>
|
||||
</dl>
|
||||
<p>Sorts the input vector according to arrival time. Processes whose arrival times are same get sorted according to process ID For each process, completion time, turnaround time and completion time are calculated, inserted in a tuple, which is added to the vector result. </p><dl class="section return"><dt>Returns</dt><dd>A vector of tuples consisting of process ID, arrival time, burst time, completion time, turnaround time and waiting time for each process. </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 226</span> {</div>
|
||||
<div class="line"><span class="lineno"> 227</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/sort.html">sort</a>(input.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/begin.html">begin</a>(), input.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/end.html">end</a>(), <a class="code hl_function" href="#a18920aa331faf4476b251c8cdb2c2bec">sortcol<S, T, E></a>);</div>
|
||||
<div class="line"><span class="lineno"> 228</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<tuple<S, T, E, double, double, double></a>> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>(input.<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"> 229</span> <span class="keywordtype">double</span> timeElapsed = 0;</div>
|
||||
<div class="line"><span class="lineno"> 230</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i{}; i < input.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 231</span> T arrival = get<1>(input[i]);</div>
|
||||
<div class="line"><span class="lineno"> 232</span> E burst = get<2>(input[i]);</div>
|
||||
<div class="line"><span class="lineno"> 233</span> </div>
|
||||
<div class="line"><span class="lineno"> 234</span> <span class="keywordflow">if</span> (arrival > timeElapsed) {</div>
|
||||
<div class="line"><span class="lineno"> 235</span> timeElapsed += arrival - timeElapsed;</div>
|
||||
<div class="line"><span class="lineno"> 236</span> }</div>
|
||||
<div class="line"><span class="lineno"> 237</span> timeElapsed += burst;</div>
|
||||
<div class="line"><span class="lineno"> 238</span> <span class="keywordtype">double</span> completion = timeElapsed;</div>
|
||||
<div class="line"><span class="lineno"> 239</span> <span class="keywordtype">double</span> turnaround = completion - arrival;</div>
|
||||
<div class="line"><span class="lineno"> 240</span> <span class="keywordtype">double</span> waiting = turnaround - burst;</div>
|
||||
<div class="line"><span class="lineno"> 241</span> </div>
|
||||
<div class="line"><span class="lineno"> 242</span> get<0>(result[i]) = get<0>(input[i]);</div>
|
||||
<div class="line"><span class="lineno"> 243</span> get<1>(result[i]) = arrival;</div>
|
||||
<div class="line"><span class="lineno"> 244</span> get<2>(result[i]) = burst;</div>
|
||||
<div class="line"><span class="lineno"> 245</span> get<3>(result[i]) = completion;</div>
|
||||
<div class="line"><span class="lineno"> 246</span> get<4>(result[i]) = turnaround;</div>
|
||||
<div class="line"><span class="lineno"> 247</span> get<5>(result[i]) = waiting;</div>
|
||||
<div class="line"><span class="lineno"> 248</span> }</div>
|
||||
<div class="line"><span class="lineno"> 249</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
|
||||
<div class="line"><span class="lineno"> 250</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 227</span> {</div>
|
||||
<div class="line"><span class="lineno"> 228</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/sort.html">sort</a>(input.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/begin.html">begin</a>(), input.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/end.html">end</a>(), <a class="code hl_function" href="#a18920aa331faf4476b251c8cdb2c2bec">sortcol<S, T, E></a>);</div>
|
||||
<div class="line"><span class="lineno"> 229</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<tuple<S, T, E, double, double, double></a>> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>(input.<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"> 230</span> <span class="keywordtype">double</span> timeElapsed = 0;</div>
|
||||
<div class="line"><span class="lineno"> 231</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i{}; i < input.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 232</span> T arrival = get<1>(input[i]);</div>
|
||||
<div class="line"><span class="lineno"> 233</span> E burst = get<2>(input[i]);</div>
|
||||
<div class="line"><span class="lineno"> 234</span> </div>
|
||||
<div class="line"><span class="lineno"> 235</span> <span class="keywordflow">if</span> (arrival > timeElapsed) {</div>
|
||||
<div class="line"><span class="lineno"> 236</span> timeElapsed += arrival - timeElapsed;</div>
|
||||
<div class="line"><span class="lineno"> 237</span> }</div>
|
||||
<div class="line"><span class="lineno"> 238</span> timeElapsed += burst;</div>
|
||||
<div class="line"><span class="lineno"> 239</span> <span class="keywordtype">double</span> completion = timeElapsed;</div>
|
||||
<div class="line"><span class="lineno"> 240</span> <span class="keywordtype">double</span> turnaround = completion - arrival;</div>
|
||||
<div class="line"><span class="lineno"> 241</span> <span class="keywordtype">double</span> waiting = turnaround - burst;</div>
|
||||
<div class="line"><span class="lineno"> 242</span> </div>
|
||||
<div class="line"><span class="lineno"> 243</span> get<0>(result[i]) = get<0>(input[i]);</div>
|
||||
<div class="line"><span class="lineno"> 244</span> get<1>(result[i]) = arrival;</div>
|
||||
<div class="line"><span class="lineno"> 245</span> get<2>(result[i]) = burst;</div>
|
||||
<div class="line"><span class="lineno"> 246</span> get<3>(result[i]) = completion;</div>
|
||||
<div class="line"><span class="lineno"> 247</span> get<4>(result[i]) = turnaround;</div>
|
||||
<div class="line"><span class="lineno"> 248</span> get<5>(result[i]) = waiting;</div>
|
||||
<div class="line"><span class="lineno"> 249</span> }</div>
|
||||
<div class="line"><span class="lineno"> 250</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
|
||||
<div class="line"><span class="lineno"> 251</span>}</div>
|
||||
<div class="ttc" id="abegin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/begin.html">std::vector::begin</a></div><div class="ttdeci">T begin(T... args)</div></div>
|
||||
<div class="ttc" id="aend_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/end.html">std::vector::end</a></div><div class="ttdeci">T end(T... args)</div></div>
|
||||
<div class="ttc" id="afcfs__scheduling_8cpp_html_a18920aa331faf4476b251c8cdb2c2bec"><div class="ttname"><a href="#a18920aa331faf4476b251c8cdb2c2bec">sortcol</a></div><div class="ttdeci">bool sortcol(tuple< S, T, E > &t1, tuple< S, T, E > &t2)</div><div class="ttdoc">Comparator function for sorting a vector.</div><div class="ttdef"><b>Definition</b> fcfs_scheduling.cpp:45</div></div>
|
||||
<div class="ttc" id="afibonacci__sum_8cpp_html_aadb40ac4c74a7efc0680b83eeee138aa"><div class="ttname"><a href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">math::fibonacci_sum::result</a></div><div class="ttdeci">uint64_t result(uint64_t n)</div><div class="ttdef"><b>Definition</b> fibonacci_sum.cpp:76</div></div>
|
||||
<div class="ttc" id="afcfs__scheduling_8cpp_html_a18920aa331faf4476b251c8cdb2c2bec"><div class="ttname"><a href="#a18920aa331faf4476b251c8cdb2c2bec">sortcol</a></div><div class="ttdeci">bool sortcol(tuple< S, T, E > &t1, tuple< S, T, E > &t2)</div><div class="ttdoc">Comparator function for sorting a vector.</div><div class="ttdef"><b>Definition</b> fcfs_scheduling.cpp:46</div></div>
|
||||
<div class="ttc" id="afibonacci__sum_8cpp_html_aadb40ac4c74a7efc0680b83eeee138aa"><div class="ttname"><a href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">math::fibonacci_sum::result</a></div><div class="ttdeci">uint64_t result(uint64_t n)</div><div class="ttdef"><b>Definition</b> fibonacci_sum.cpp:77</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="asort_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/sort.html">std::sort</a></div><div class="ttdeci">T sort(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>
|
||||
@@ -240,11 +241,11 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Entry point of the program. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 287</span> {</div>
|
||||
<div class="line"><span class="lineno"> 288</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 289</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 290</span>}</div>
|
||||
<div class="ttc" id="afcfs__scheduling_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> fcfs_scheduling.cpp:256</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 288</span> {</div>
|
||||
<div class="line"><span class="lineno"> 289</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 290</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 291</span>}</div>
|
||||
<div class="ttc" id="afcfs__scheduling_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> fcfs_scheduling.cpp:257</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -293,14 +294,14 @@ template<typename S , typename T , typename E > </div>
|
||||
<dl class="section return"><dt>Returns</dt><dd>true if t1 and t2 are in the CORRECT order </dd>
|
||||
<dd>
|
||||
false if t1 and t2 are in the INCORRECT order </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 45</span> {</div>
|
||||
<div class="line"><span class="lineno"> 46</span> <span class="keywordflow">if</span> (get<1>(t1) < get<1>(t2)) {</div>
|
||||
<div class="line"><span class="lineno"> 47</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 48</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (get<1>(t1) == get<1>(t2) && get<0>(t1) < get<0>(t2)) {</div>
|
||||
<div class="line"><span class="lineno"> 49</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 50</span> }</div>
|
||||
<div class="line"><span class="lineno"> 51</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 52</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 46</span> {</div>
|
||||
<div class="line"><span class="lineno"> 47</span> <span class="keywordflow">if</span> (get<1>(t1) < get<1>(t2)) {</div>
|
||||
<div class="line"><span class="lineno"> 48</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 49</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (get<1>(t1) == get<1>(t2) && get<0>(t1) < get<0>(t2)) {</div>
|
||||
<div class="line"><span class="lineno"> 50</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 51</span> }</div>
|
||||
<div class="line"><span class="lineno"> 52</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 53</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -329,37 +330,37 @@ false if t1 and t2 are in the INCORRECT order </dd></dl>
|
||||
|
||||
<p>Self-test implementations. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 256</span> {</div>
|
||||
<div class="line"><span class="lineno"> 257</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i{}; i < 1000; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 258</span> srand(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">time</a>(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><span class="lineno"> 259</span> uint32_t n = 1 + rand() % 1000;</div>
|
||||
<div class="line"><span class="lineno"> 260</span> <a class="code hl_class" href="../../dd/dca/class_f_c_f_s.html">FCFS<uint32_t, uint32_t, uint32_t></a> readyQueue;</div>
|
||||
<div class="line"><span class="lineno"> 261</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<tuple<uint32_t, uint32_t, uint32_t></a>> input(n);</div>
|
||||
<div class="line"><span class="lineno"> 262</span> </div>
|
||||
<div class="line"><span class="lineno"> 263</span> <span class="keywordflow">for</span> (uint32_t i{}; i < n; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 264</span> get<0>(input[i]) = i;</div>
|
||||
<div class="line"><span class="lineno"> 265</span> srand(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">time</a>(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><span class="lineno"> 266</span> get<1>(input[i]) = 1 + rand() % 10000;</div>
|
||||
<div class="line"><span class="lineno"> 267</span> srand(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">time</a>(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><span class="lineno"> 268</span> get<2>(input[i]) = 1 + rand() % 10000;</div>
|
||||
<div class="line"><span class="lineno"> 269</span> }</div>
|
||||
<div class="line"><span class="lineno"> 270</span> </div>
|
||||
<div class="line"><span class="lineno"> 271</span> <span class="keywordflow">for</span> (uint32_t i{}; i < n; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 272</span> readyQueue.<a class="code hl_function" href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69">addProcess</a>(get<0>(input[i]), get<1>(input[i]),</div>
|
||||
<div class="line"><span class="lineno"> 273</span> get<2>(input[i]));</div>
|
||||
<div class="line"><span class="lineno"> 274</span> }</div>
|
||||
<div class="line"><span class="lineno"> 275</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<tuple<uint32_t, uint32_t, uint32_t, double, double, double></a>></div>
|
||||
<div class="line"><span class="lineno"> 276</span> res = <a class="code hl_function" href="#a8f2b90cb64d63a7080965e66a05ccf86">get_final_status<uint32_t, uint32_t, uint32_t></a>(input);</div>
|
||||
<div class="line"><span class="lineno"> 277</span> assert(res == readyQueue.<a class="code hl_function" href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91">scheduleForFcfs</a>());</div>
|
||||
<div class="line"><span class="lineno"> 278</span> <span class="comment">// readyQueue.printResult();</span></div>
|
||||
<div class="line"><span class="lineno"> 279</span> }</div>
|
||||
<div class="line"><span class="lineno"> 280</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">cout</a> << <span class="stringliteral">"All the tests have successfully passed!"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 281</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 257</span> {</div>
|
||||
<div class="line"><span class="lineno"> 258</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i{}; i < 1000; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 259</span> srand(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">time</a>(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><span class="lineno"> 260</span> uint32_t n = 1 + rand() % 1000;</div>
|
||||
<div class="line"><span class="lineno"> 261</span> <a class="code hl_class" href="../../dd/dca/class_f_c_f_s.html">FCFS<uint32_t, uint32_t, uint32_t></a> readyQueue;</div>
|
||||
<div class="line"><span class="lineno"> 262</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<tuple<uint32_t, uint32_t, uint32_t></a>> input(n);</div>
|
||||
<div class="line"><span class="lineno"> 263</span> </div>
|
||||
<div class="line"><span class="lineno"> 264</span> <span class="keywordflow">for</span> (uint32_t i{}; i < n; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 265</span> get<0>(input[i]) = i;</div>
|
||||
<div class="line"><span class="lineno"> 266</span> srand(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">time</a>(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><span class="lineno"> 267</span> get<1>(input[i]) = 1 + rand() % 10000;</div>
|
||||
<div class="line"><span class="lineno"> 268</span> srand(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">time</a>(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><span class="lineno"> 269</span> get<2>(input[i]) = 1 + rand() % 10000;</div>
|
||||
<div class="line"><span class="lineno"> 270</span> }</div>
|
||||
<div class="line"><span class="lineno"> 271</span> </div>
|
||||
<div class="line"><span class="lineno"> 272</span> <span class="keywordflow">for</span> (uint32_t i{}; i < n; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 273</span> readyQueue.<a class="code hl_function" href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69">addProcess</a>(get<0>(input[i]), get<1>(input[i]),</div>
|
||||
<div class="line"><span class="lineno"> 274</span> get<2>(input[i]));</div>
|
||||
<div class="line"><span class="lineno"> 275</span> }</div>
|
||||
<div class="line"><span class="lineno"> 276</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<tuple<uint32_t, uint32_t, uint32_t, double, double, double></a>></div>
|
||||
<div class="line"><span class="lineno"> 277</span> res = <a class="code hl_function" href="#a8f2b90cb64d63a7080965e66a05ccf86">get_final_status<uint32_t, uint32_t, uint32_t></a>(input);</div>
|
||||
<div class="line"><span class="lineno"> 278</span> assert(res == readyQueue.<a class="code hl_function" href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91">scheduleForFcfs</a>());</div>
|
||||
<div class="line"><span class="lineno"> 279</span> <span class="comment">// readyQueue.printResult();</span></div>
|
||||
<div class="line"><span class="lineno"> 280</span> }</div>
|
||||
<div class="line"><span class="lineno"> 281</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">cout</a> << <span class="stringliteral">"All the tests have successfully passed!"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 282</span>}</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="aclass_f_c_f_s_html"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html">FCFS</a></div><div class="ttdoc">Class which implements the FCFS scheduling algorithm.</div><div class="ttdef"><b>Definition</b> fcfs_scheduling.cpp:97</div></div>
|
||||
<div class="ttc" id="aclass_f_c_f_s_html_a8fbfe4d85f7576b4a7aade07d29fbd69"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69">FCFS::addProcess</a></div><div class="ttdeci">void addProcess(S id, T arrival, E burst)</div><div class="ttdoc">Adds the process to the ready queue if it isn't already there.</div><div class="ttdef"><b>Definition</b> fcfs_scheduling.cpp:129</div></div>
|
||||
<div class="ttc" id="aclass_f_c_f_s_html_aa25dbe30ba9930b5a7c1a6d11758bd91"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91">FCFS::scheduleForFcfs</a></div><div class="ttdeci">vector< tuple< S, T, E, double, double, double > > scheduleForFcfs()</div><div class="ttdoc">Algorithm for scheduling CPU processes according to the First Come First Serve(FCFS) scheduling algor...</div><div class="ttdef"><b>Definition</b> fcfs_scheduling.cpp:154</div></div>
|
||||
<div class="ttc" id="afcfs__scheduling_8cpp_html_a8f2b90cb64d63a7080965e66a05ccf86"><div class="ttname"><a href="#a8f2b90cb64d63a7080965e66a05ccf86">get_final_status</a></div><div class="ttdeci">vector< tuple< S, T, E, double, double, double > > get_final_status(vector< tuple< uint32_t, uint32_t, uint32_t > > input)</div><div class="ttdoc">Function to be used for testing purposes. This function guarantees the correct solution for FCFS sche...</div><div class="ttdef"><b>Definition</b> fcfs_scheduling.cpp:225</div></div>
|
||||
<div class="ttc" id="aclass_f_c_f_s_html"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html">FCFS</a></div><div class="ttdoc">Class which implements the FCFS scheduling algorithm.</div><div class="ttdef"><b>Definition</b> fcfs_scheduling.cpp:98</div></div>
|
||||
<div class="ttc" id="aclass_f_c_f_s_html_a8fbfe4d85f7576b4a7aade07d29fbd69"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69">FCFS::addProcess</a></div><div class="ttdeci">void addProcess(S id, T arrival, E burst)</div><div class="ttdoc">Adds the process to the ready queue if it isn't already there.</div><div class="ttdef"><b>Definition</b> fcfs_scheduling.cpp:130</div></div>
|
||||
<div class="ttc" id="aclass_f_c_f_s_html_aa25dbe30ba9930b5a7c1a6d11758bd91"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91">FCFS::scheduleForFcfs</a></div><div class="ttdeci">vector< tuple< S, T, E, double, double, double > > scheduleForFcfs()</div><div class="ttdoc">Algorithm for scheduling CPU processes according to the First Come First Serve(FCFS) scheduling algor...</div><div class="ttdef"><b>Definition</b> fcfs_scheduling.cpp:155</div></div>
|
||||
<div class="ttc" id="afcfs__scheduling_8cpp_html_a8f2b90cb64d63a7080965e66a05ccf86"><div class="ttname"><a href="#a8f2b90cb64d63a7080965e66a05ccf86">get_final_status</a></div><div class="ttdeci">vector< tuple< S, T, E, double, double, double > > get_final_status(vector< tuple< uint32_t, uint32_t, uint32_t > > input)</div><div class="ttdoc">Function to be used for testing purposes. This function guarantees the correct solution for FCFS sche...</div><div class="ttdef"><b>Definition</b> fcfs_scheduling.cpp:226</div></div>
|
||||
<div class="ttc" id="amatrix__exponentiation_8cpp_html_a600eaf353befc174637855795f12d258"><div class="ttname"><a href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a></div><div class="ttdeci">#define endl</div><div class="ttdef"><b>Definition</b> matrix_exponentiation.cpp:36</div></div>
|
||||
<div class="ttc" id="atime_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/chrono/c/time.html">std::time</a></div><div class="ttdeci">T time(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
|
||||
@@ -126,7 +126,7 @@ Include dependency graph for vector_cross_product.cpp:</div>
|
||||
<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  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d47/namespacemath.html">math</a></td></tr>
|
||||
<tr class="memdesc:dd/d47/namespacemath"><td class="mdescLeft"> </td><td class="mdescRight">for IO operations <br /></td></tr>
|
||||
<tr class="memdesc:dd/d47/namespacemath"><td class="mdescLeft"> </td><td class="mdescRight">for assert <br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d91/namespacevector__cross.html">vector_cross</a></td></tr>
|
||||
<tr class="memdesc:d4/d91/namespacevector__cross"><td class="mdescLeft"> </td><td class="mdescRight">Functions for Vector Cross Product algorithms. <br /></td></tr>
|
||||
|
||||
@@ -382,7 +382,7 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><span class="lineno"> 186</span> }</div>
|
||||
<div class="line"><span class="lineno"> 187</span> <span class="keywordflow">return</span> Q;</div>
|
||||
<div class="line"><span class="lineno"> 188</span>}</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:47</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="anamespaceciphers_1_1elliptic__curve__key__exchange_html_acc5fe9c2032fb7582c38a20d1fa69bcf"><div class="ttname"><a href="#acc5fe9c2032fb7582c38a20d1fa69bcf">ciphers::elliptic_curve_key_exchange::addition</a></div><div class="ttdeci">Point addition(Point a, Point b, const uint256_t &curve_a_coeff, uint256_t mod)</div><div class="ttdoc">Addition of points.</div><div class="ttdef"><b>Definition</b> elliptic_curve_key_exchange.cpp:110</div></div>
|
||||
<div class="ttc" id="astructciphers_1_1elliptic__curve__key__exchange_1_1_point_html"><div class="ttname"><a href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">ciphers::elliptic_curve_key_exchange::Point</a></div><div class="ttdoc">Definition of struct Point.</div><div class="ttdef"><b>Definition</b> elliptic_curve_key_exchange.cpp:46</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
|
||||
@@ -114,17 +114,18 @@ $(function(){initNavTree('df/d72/modular__division_8cpp.html','../../'); initRes
|
||||
<p>An algorithm to divide two numbers under modulo p <a href="https://www.geeksforgeeks.org/modular-division" target="_blank">Modular Division</a>
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <cassert></code><br />
|
||||
<code>#include <cstdint></code><br />
|
||||
<code>#include <iostream></code><br />
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for modular_division.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d0/dcc/modular__division_8cpp__incl.svg" width="187" height="111"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d0/dcc/modular__division_8cpp__incl.svg" width="255" height="111"><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  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d47/namespacemath.html">math</a></td></tr>
|
||||
<tr class="memdesc:dd/d47/namespacemath"><td class="mdescLeft"> </td><td class="mdescRight">for IO operations <br /></td></tr>
|
||||
<tr class="memdesc:dd/d47/namespacemath"><td class="mdescLeft"> </td><td class="mdescRight">for assert <br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d64/namespacemodular__division.html">modular_division</a></td></tr>
|
||||
<tr class="memdesc:d1/d64/namespacemodular__division"><td class="mdescLeft"> </td><td class="mdescRight">Functions for <a href="https://www.geeksforgeeks.org/modular-division" target="_blank">Modular Division</a> implementation. <br /></td></tr>
|
||||
@@ -177,11 +178,11 @@ Functions</h2></td></tr>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 112</span> {</div>
|
||||
<div class="line"><span class="lineno"> 113</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// execute the tests</span></div>
|
||||
<div class="line"><span class="lineno"> 114</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 115</span>}</div>
|
||||
<div class="ttc" id="amodular__division_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdef"><b>Definition</b> modular_division.cpp:88</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 113</span> {</div>
|
||||
<div class="line"><span class="lineno"> 114</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// execute the tests</span></div>
|
||||
<div class="line"><span class="lineno"> 115</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 116</span>}</div>
|
||||
<div class="ttc" id="amodular__division_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdef"><b>Definition</b> modular_division.cpp:89</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -226,13 +227,13 @@ Here is the call graph for this function:</div>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a/b modulo c </dd></dl>
|
||||
<p>Calculate the inverse of b</p>
|
||||
<p>Calculate the final result</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 74</span> {</div>
|
||||
<div class="line"><span class="lineno"> 75</span> uint64_t inverse = <a class="code hl_function" href="../../df/def/power__for__huge__numbers_8cpp.html#ae249a2af508aa94266023ce8aa81426f">power</a>(b, p - 2, p) % p; <span class="comment">/// Calculate the inverse of b</span></div>
|
||||
<div class="line"><span class="lineno"> 76</span> uint64_t <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> =</div>
|
||||
<div class="line"><span class="lineno"> 77</span> ((a % p) * (inverse % p)) % p; <span class="comment">/// Calculate the final result</span></div>
|
||||
<div class="line"><span class="lineno"> 78</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
|
||||
<div class="line"><span class="lineno"> 79</span>}</div>
|
||||
<div class="ttc" id="afibonacci__sum_8cpp_html_aadb40ac4c74a7efc0680b83eeee138aa"><div class="ttname"><a href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">math::fibonacci_sum::result</a></div><div class="ttdeci">uint64_t result(uint64_t n)</div><div class="ttdef"><b>Definition</b> fibonacci_sum.cpp:76</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 75</span> {</div>
|
||||
<div class="line"><span class="lineno"> 76</span> uint64_t inverse = <a class="code hl_function" href="../../df/def/power__for__huge__numbers_8cpp.html#ae249a2af508aa94266023ce8aa81426f">power</a>(b, p - 2, p) % p; <span class="comment">/// Calculate the inverse of b</span></div>
|
||||
<div class="line"><span class="lineno"> 77</span> uint64_t <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> =</div>
|
||||
<div class="line"><span class="lineno"> 78</span> ((a % p) * (inverse % p)) % p; <span class="comment">/// Calculate the final result</span></div>
|
||||
<div class="line"><span class="lineno"> 79</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
|
||||
<div class="line"><span class="lineno"> 80</span>}</div>
|
||||
<div class="ttc" id="afibonacci__sum_8cpp_html_aadb40ac4c74a7efc0680b83eeee138aa"><div class="ttname"><a href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">math::fibonacci_sum::result</a></div><div class="ttdeci">uint64_t result(uint64_t n)</div><div class="ttdef"><b>Definition</b> fibonacci_sum.cpp:77</div></div>
|
||||
<div class="ttc" id="apower__for__huge__numbers_8cpp_html_ae249a2af508aa94266023ce8aa81426f"><div class="ttname"><a href="../../df/def/power__for__huge__numbers_8cpp.html#ae249a2af508aa94266023ce8aa81426f">power</a></div><div class="ttdeci">void power(int x, int n)</div><div class="ttdef"><b>Definition</b> power_for_huge_numbers.cpp:56</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -282,23 +283,23 @@ Here is the call graph for this function:</div>
|
||||
<p>If b is odd, multiply a with answer</p>
|
||||
<p>b must be even now</p>
|
||||
<p>b = b/2</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 49</span> {</div>
|
||||
<div class="line"><span class="lineno"> 50</span> uint64_t ans = 1; <span class="comment">/// Initialize the answer to be returned</span></div>
|
||||
<div class="line"><span class="lineno"> 51</span> a = a % c; <span class="comment">/// Update a if it is more than or equal to c</span></div>
|
||||
<div class="line"><span class="lineno"> 52</span> <span class="keywordflow">if</span> (a == 0) {</div>
|
||||
<div class="line"><span class="lineno"> 53</span> <span class="keywordflow">return</span> 0; <span class="comment">/// In case a is divisible by c;</span></div>
|
||||
<div class="line"><span class="lineno"> 54</span> }</div>
|
||||
<div class="line"><span class="lineno"> 55</span> <span class="keywordflow">while</span> (b > 0) {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 56</span><span class="comment"> /// If b is odd, multiply a with answer</span></div>
|
||||
<div class="line"><span class="lineno"> 57</span><span class="comment"></span> <span class="keywordflow">if</span> (b & 1) {</div>
|
||||
<div class="line"><span class="lineno"> 58</span> ans = ((ans % c) * (a % c)) % c;</div>
|
||||
<div class="line"><span class="lineno"> 59</span> }<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 60</span><span class="comment"> /// b must be even now</span></div>
|
||||
<div class="line"><span class="lineno"> 61</span><span class="comment"></span> b = b >> 1; <span class="comment">/// b = b/2</span></div>
|
||||
<div class="line"><span class="lineno"> 62</span> a = ((a % c) * (a % c)) % c;</div>
|
||||
<div class="line"><span class="lineno"> 63</span> }</div>
|
||||
<div class="line"><span class="lineno"> 64</span> <span class="keywordflow">return</span> ans;</div>
|
||||
<div class="line"><span class="lineno"> 65</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 50</span> {</div>
|
||||
<div class="line"><span class="lineno"> 51</span> uint64_t ans = 1; <span class="comment">/// Initialize the answer to be returned</span></div>
|
||||
<div class="line"><span class="lineno"> 52</span> a = a % c; <span class="comment">/// Update a if it is more than or equal to c</span></div>
|
||||
<div class="line"><span class="lineno"> 53</span> <span class="keywordflow">if</span> (a == 0) {</div>
|
||||
<div class="line"><span class="lineno"> 54</span> <span class="keywordflow">return</span> 0; <span class="comment">/// In case a is divisible by c;</span></div>
|
||||
<div class="line"><span class="lineno"> 55</span> }</div>
|
||||
<div class="line"><span class="lineno"> 56</span> <span class="keywordflow">while</span> (b > 0) {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 57</span><span class="comment"> /// If b is odd, multiply a with answer</span></div>
|
||||
<div class="line"><span class="lineno"> 58</span><span class="comment"></span> <span class="keywordflow">if</span> (b & 1) {</div>
|
||||
<div class="line"><span class="lineno"> 59</span> ans = ((ans % c) * (a % c)) % c;</div>
|
||||
<div class="line"><span class="lineno"> 60</span> }<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 61</span><span class="comment"> /// b must be even now</span></div>
|
||||
<div class="line"><span class="lineno"> 62</span><span class="comment"></span> b = b >> 1; <span class="comment">/// b = b/2</span></div>
|
||||
<div class="line"><span class="lineno"> 63</span> a = ((a % c) * (a % c)) % c;</div>
|
||||
<div class="line"><span class="lineno"> 64</span> }</div>
|
||||
<div class="line"><span class="lineno"> 65</span> <span class="keywordflow">return</span> ans;</div>
|
||||
<div class="line"><span class="lineno"> 66</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -325,26 +326,26 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Function for testing power function. test cases and assert statement. </p><dl class="section return"><dt>Returns</dt><dd><code>void</code> </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 88</span> {</div>
|
||||
<div class="line"><span class="lineno"> 89</span> uint64_t test_case_1 = <a class="code hl_function" href="#a905e368ae121beb7e7ea35349ddcdac7">math::modular_division::mod_division</a>(8, 2, 2);</div>
|
||||
<div class="line"><span class="lineno"> 90</span> assert(test_case_1 == 0);</div>
|
||||
<div class="line"><span class="lineno"> 91</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 1 Passed!"</span> << <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"> 92</span> uint64_t test_case_2 = <a class="code hl_function" href="#a905e368ae121beb7e7ea35349ddcdac7">math::modular_division::mod_division</a>(15, 3, 7);</div>
|
||||
<div class="line"><span class="lineno"> 93</span> assert(test_case_2 == 5);</div>
|
||||
<div class="line"><span class="lineno"> 94</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 2 Passed!"</span> << <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"> 95</span> uint64_t test_case_3 = <a class="code hl_function" href="#a905e368ae121beb7e7ea35349ddcdac7">math::modular_division::mod_division</a>(10, 5, 2);</div>
|
||||
<div class="line"><span class="lineno"> 96</span> assert(test_case_3 == 0);</div>
|
||||
<div class="line"><span class="lineno"> 97</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 3 Passed!"</span> << <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"> 98</span> uint64_t test_case_4 = <a class="code hl_function" href="#a905e368ae121beb7e7ea35349ddcdac7">math::modular_division::mod_division</a>(81, 3, 5);</div>
|
||||
<div class="line"><span class="lineno"> 99</span> assert(test_case_4 == 2);</div>
|
||||
<div class="line"><span class="lineno"> 100</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 4 Passed!"</span> << <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"> 101</span> uint64_t test_case_5 = <a class="code hl_function" href="#a905e368ae121beb7e7ea35349ddcdac7">math::modular_division::mod_division</a>(12848, 73, 29);</div>
|
||||
<div class="line"><span class="lineno"> 102</span> assert(test_case_5 == 2);</div>
|
||||
<div class="line"><span class="lineno"> 103</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 5 Passed!"</span> << <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"> 104</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 89</span> {</div>
|
||||
<div class="line"><span class="lineno"> 90</span> uint64_t test_case_1 = <a class="code hl_function" href="#a905e368ae121beb7e7ea35349ddcdac7">math::modular_division::mod_division</a>(8, 2, 2);</div>
|
||||
<div class="line"><span class="lineno"> 91</span> assert(test_case_1 == 0);</div>
|
||||
<div class="line"><span class="lineno"> 92</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 1 Passed!"</span> << <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"> 93</span> uint64_t test_case_2 = <a class="code hl_function" href="#a905e368ae121beb7e7ea35349ddcdac7">math::modular_division::mod_division</a>(15, 3, 7);</div>
|
||||
<div class="line"><span class="lineno"> 94</span> assert(test_case_2 == 5);</div>
|
||||
<div class="line"><span class="lineno"> 95</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 2 Passed!"</span> << <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"> 96</span> uint64_t test_case_3 = <a class="code hl_function" href="#a905e368ae121beb7e7ea35349ddcdac7">math::modular_division::mod_division</a>(10, 5, 2);</div>
|
||||
<div class="line"><span class="lineno"> 97</span> assert(test_case_3 == 0);</div>
|
||||
<div class="line"><span class="lineno"> 98</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 3 Passed!"</span> << <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"> 99</span> uint64_t test_case_4 = <a class="code hl_function" href="#a905e368ae121beb7e7ea35349ddcdac7">math::modular_division::mod_division</a>(81, 3, 5);</div>
|
||||
<div class="line"><span class="lineno"> 100</span> assert(test_case_4 == 2);</div>
|
||||
<div class="line"><span class="lineno"> 101</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 4 Passed!"</span> << <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"> 102</span> uint64_t test_case_5 = <a class="code hl_function" href="#a905e368ae121beb7e7ea35349ddcdac7">math::modular_division::mod_division</a>(12848, 73, 29);</div>
|
||||
<div class="line"><span class="lineno"> 103</span> assert(test_case_5 == 2);</div>
|
||||
<div class="line"><span class="lineno"> 104</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 5 Passed!"</span> << <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"> 105</span>}</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="amodular__division_8cpp_html_a905e368ae121beb7e7ea35349ddcdac7"><div class="ttname"><a href="#a905e368ae121beb7e7ea35349ddcdac7">math::modular_division::mod_division</a></div><div class="ttdeci">uint64_t mod_division(uint64_t a, uint64_t b, uint64_t p)</div><div class="ttdoc">This function calculates modular division.</div><div class="ttdef"><b>Definition</b> modular_division.cpp:74</div></div>
|
||||
<div class="ttc" id="amodular__division_8cpp_html_a905e368ae121beb7e7ea35349ddcdac7"><div class="ttname"><a href="#a905e368ae121beb7e7ea35349ddcdac7">math::modular_division::mod_division</a></div><div class="ttdeci">uint64_t mod_division(uint64_t a, uint64_t b, uint64_t p)</div><div class="ttdoc">This function calculates modular division.</div><div class="ttdef"><b>Definition</b> modular_division.cpp:75</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
<map id="data_structures/sparse_table.cpp" name="data_structures/sparse_table.cpp">
|
||||
<area shape="rect" id="Node000001" title="Implementation of Sparse Table for min() function." alt="" coords="35,5,189,46"/>
|
||||
<area shape="rect" id="Node000001" title="Implementation of Sparse Table for min() function." alt="" coords="77,5,232,46"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="5,94,56,120"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="94,48,56,85,52,81,90,44"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="125,49,64,88,61,83,122,44"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="80,94,144,120"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="114,46,114,78,109,78,109,46"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="168,94,240,120"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="136,44,180,82,176,86,133,48"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="146,48,128,81,123,79,142,45"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="168,94,229,120"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="168,45,187,79,182,82,163,48"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="252,94,324,120"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="189,44,256,83,253,88,186,49"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
00d383768b1d9cf81c88ba4c61810ef5
|
||||
5562a19c49f950b27a8fb95aed41a164
|
||||
@@ -4,8 +4,8 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: data_structures/sparse_table.cpp Pages: 1 -->
|
||||
<svg width="184pt" height="94pt"
|
||||
viewBox="0.00 0.00 183.62 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="247pt" height="94pt"
|
||||
viewBox="0.00 0.00 246.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 Sparse Table for min() function.">
|
||||
<polygon fill="#999999" stroke="#666666" points="137.75,-85.75 22,-85.75 22,-55.25 137.75,-55.25 137.75,-85.75"/>
|
||||
<text text-anchor="start" x="30" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">data_structures/sparse</text>
|
||||
<text text-anchor="middle" x="79.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_table.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="169.75,-85.75 54,-85.75 54,-55.25 169.75,-55.25 169.75,-85.75"/>
|
||||
<text text-anchor="start" x="62" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">data_structures/sparse</text>
|
||||
<text text-anchor="middle" x="111.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_table.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -42,8 +42,8 @@
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M64.8,-54.95C56.22,-46.67 45.44,-36.27 36.48,-27.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="38.99,-25.18 29.37,-20.75 34.13,-30.22 38.99,-25.18"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M88.89,-54.95C74.86,-46.07 56.97,-34.74 42.78,-25.76"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="44.81,-22.9 34.49,-20.51 41.07,-28.82 44.81,-22.9"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -60,8 +60,8 @@
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M79.88,-54.95C79.88,-47.71 79.88,-38.84 79.88,-30.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="83.38,-31.21 79.88,-21.21 76.38,-31.21 83.38,-31.21"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M103.96,-54.95C99.84,-47.36 94.75,-37.99 90.31,-29.82"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="93.38,-28.15 85.53,-21.03 87.23,-31.49 93.38,-28.15"/>
|
||||
</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="175.62,-19.25 122.12,-19.25 122.12,0 175.62,0 175.62,-19.25"/>
|
||||
<text text-anchor="middle" x="148.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="167.5,-19.25 122.25,-19.25 122.25,0 167.5,0 167.5,-19.25"/>
|
||||
<text text-anchor="middle" x="144.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -78,8 +78,26 @@
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M96.93,-54.95C106.83,-46.5 119.33,-35.83 129.59,-27.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="131.75,-29.84 137.09,-20.68 127.21,-24.51 131.75,-29.84"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M120.03,-54.95C124.33,-47.28 129.66,-37.77 134.27,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="137.21,-31.46 139.05,-21.02 131.11,-28.03 137.21,-31.46"/>
|
||||
</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="238.62,-19.25 185.12,-19.25 185.12,0 238.62,0 238.62,-19.25"/>
|
||||
<text text-anchor="middle" x="211.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node5 -->
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M136.85,-54.8C152.08,-45.83 171.48,-34.41 186.74,-25.42"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="188.39,-28.51 195.23,-20.42 184.84,-22.48 188.39,-28.51"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.7 KiB |
@@ -4,17 +4,17 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: data_structures/sparse_table.cpp Pages: 1 -->
|
||||
<svg width="184pt" height="94pt"
|
||||
viewBox="0.00 0.00 183.62 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="247pt" height="94pt"
|
||||
viewBox="0.00 0.00 246.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>data_structures/sparse_table.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Implementation of Sparse Table for min() function.">
|
||||
<polygon fill="#999999" stroke="#666666" points="137.75,-85.75 22,-85.75 22,-55.25 137.75,-55.25 137.75,-85.75"/>
|
||||
<text text-anchor="start" x="30" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">data_structures/sparse</text>
|
||||
<text text-anchor="middle" x="79.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_table.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="169.75,-85.75 54,-85.75 54,-55.25 169.75,-55.25 169.75,-85.75"/>
|
||||
<text text-anchor="start" x="62" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">data_structures/sparse</text>
|
||||
<text text-anchor="middle" x="111.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_table.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -31,8 +31,8 @@
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M64.8,-54.95C56.22,-46.67 45.44,-36.27 36.48,-27.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="38.99,-25.18 29.37,-20.75 34.13,-30.22 38.99,-25.18"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M88.89,-54.95C74.86,-46.07 56.97,-34.74 42.78,-25.76"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="44.81,-22.9 34.49,-20.51 41.07,-28.82 44.81,-22.9"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -49,8 +49,8 @@
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M79.88,-54.95C79.88,-47.71 79.88,-38.84 79.88,-30.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="83.38,-31.21 79.88,-21.21 76.38,-31.21 83.38,-31.21"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M103.96,-54.95C99.84,-47.36 94.75,-37.99 90.31,-29.82"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="93.38,-28.15 85.53,-21.03 87.23,-31.49 93.38,-28.15"/>
|
||||
</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="175.62,-19.25 122.12,-19.25 122.12,0 175.62,0 175.62,-19.25"/>
|
||||
<text text-anchor="middle" x="148.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="167.5,-19.25 122.25,-19.25 122.25,0 167.5,0 167.5,-19.25"/>
|
||||
<text text-anchor="middle" x="144.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -67,8 +67,26 @@
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M96.93,-54.95C106.83,-46.5 119.33,-35.83 129.59,-27.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="131.75,-29.84 137.09,-20.68 127.21,-24.51 131.75,-29.84"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M120.03,-54.95C124.33,-47.28 129.66,-37.77 134.27,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="137.21,-31.46 139.05,-21.02 131.11,-28.03 137.21,-31.46"/>
|
||||
</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="238.62,-19.25 185.12,-19.25 185.12,0 238.62,0 238.62,-19.25"/>
|
||||
<text text-anchor="middle" x="211.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node5 -->
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M136.85,-54.8C152.08,-45.83 171.48,-34.41 186.74,-25.42"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="188.39,-28.51 195.23,-20.42 184.84,-22.48 188.39,-28.51"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.9 KiB |
@@ -1,9 +1,11 @@
|
||||
<map id="backtracking/wildcard_matching.cpp" name="backtracking/wildcard_matching.cpp">
|
||||
<area shape="rect" id="Node000001" title="Implementation of the Wildcard Matching problem." alt="" coords="56,5,203,46"/>
|
||||
<area shape="rect" id="Node000001" title="Implementation of the Wildcard Matching problem." alt="" coords="94,5,242,46"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="5,94,70,120"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="108,48,65,86,61,82,105,44"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="94,94,165,120"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="132,46,132,78,127,78,127,46"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="189,94,246,120"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="153,44,194,81,191,85,149,48"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="137,49,72,88,69,83,134,44"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="94,94,154,120"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="160,48,141,82,136,79,155,45"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="178,94,249,120"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="182,45,201,79,197,82,177,48"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="273,94,330,120"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="203,44,269,83,267,88,200,49"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6c24a000481f42557122fedd78d366b0
|
||||
b6ade645e1a2cfe92a96eed9e656da54
|
||||
@@ -4,8 +4,8 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: backtracking/wildcard_matching.cpp Pages: 1 -->
|
||||
<svg width="189pt" height="94pt"
|
||||
viewBox="0.00 0.00 188.62 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="252pt" height="94pt"
|
||||
viewBox="0.00 0.00 251.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 the Wildcard Matching problem.">
|
||||
<polygon fill="#999999" stroke="#666666" points="148.38,-85.75 37.88,-85.75 37.88,-55.25 148.38,-55.25 148.38,-85.75"/>
|
||||
<text text-anchor="start" x="45.88" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">backtracking/wildcard</text>
|
||||
<text text-anchor="middle" x="93.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_matching.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="177.38,-85.75 66.88,-85.75 66.88,-55.25 177.38,-55.25 177.38,-85.75"/>
|
||||
<text text-anchor="start" x="74.88" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">backtracking/wildcard</text>
|
||||
<text text-anchor="middle" x="122.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_matching.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -42,8 +42,8 @@
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M76.07,-54.95C66.17,-46.5 53.67,-35.83 43.41,-27.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="45.79,-24.51 35.91,-20.68 41.25,-29.84 45.79,-24.51"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M97.65,-54.8C82.72,-45.83 63.71,-34.41 48.76,-25.42"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="50.83,-22.58 40.45,-20.43 47.22,-28.58 50.83,-22.58"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -51,8 +51,8 @@
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="119.88,-19.25 66.38,-19.25 66.38,0 119.88,0 119.88,-19.25"/>
|
||||
<text text-anchor="middle" x="93.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="111.75,-19.25 66.5,-19.25 66.5,0 111.75,0 111.75,-19.25"/>
|
||||
<text text-anchor="middle" x="89.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -60,8 +60,8 @@
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M93.12,-54.95C93.12,-47.71 93.12,-38.84 93.12,-30.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="96.63,-31.21 93.13,-21.21 89.63,-31.21 96.63,-31.21"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M113.97,-54.95C109.67,-47.28 104.34,-37.77 99.73,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="102.89,-28.03 94.95,-21.02 96.79,-31.46 102.89,-28.03"/>
|
||||
</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="180.62,-19.25 137.62,-19.25 137.62,0 180.62,0 180.62,-19.25"/>
|
||||
<text text-anchor="middle" x="159.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="182.88,-19.25 129.38,-19.25 129.38,0 182.88,0 182.88,-19.25"/>
|
||||
<text text-anchor="middle" x="156.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -78,8 +78,26 @@
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M109.44,-54.95C118.81,-46.59 130.62,-36.05 140.38,-27.35"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="142.69,-29.98 147.82,-20.71 138.03,-24.75 142.69,-29.98"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M130.53,-54.95C134.96,-47.28 140.45,-37.77 145.2,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="148.16,-31.42 150.13,-21.01 142.09,-27.92 148.16,-31.42"/>
|
||||
</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="243.62,-19.25 200.62,-19.25 200.62,0 243.62,0 243.62,-19.25"/>
|
||||
<text text-anchor="middle" x="222.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node5 -->
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M147.1,-54.8C162.33,-45.83 181.73,-34.41 196.99,-25.42"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="198.64,-28.51 205.48,-20.42 195.09,-22.48 198.64,-28.51"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.7 KiB |
@@ -4,17 +4,17 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: backtracking/wildcard_matching.cpp Pages: 1 -->
|
||||
<svg width="189pt" height="94pt"
|
||||
viewBox="0.00 0.00 188.62 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="252pt" height="94pt"
|
||||
viewBox="0.00 0.00 251.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>backtracking/wildcard_matching.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Implementation of the Wildcard Matching problem.">
|
||||
<polygon fill="#999999" stroke="#666666" points="148.38,-85.75 37.88,-85.75 37.88,-55.25 148.38,-55.25 148.38,-85.75"/>
|
||||
<text text-anchor="start" x="45.88" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">backtracking/wildcard</text>
|
||||
<text text-anchor="middle" x="93.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_matching.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="177.38,-85.75 66.88,-85.75 66.88,-55.25 177.38,-55.25 177.38,-85.75"/>
|
||||
<text text-anchor="start" x="74.88" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">backtracking/wildcard</text>
|
||||
<text text-anchor="middle" x="122.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_matching.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -31,8 +31,8 @@
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M76.07,-54.95C66.17,-46.5 53.67,-35.83 43.41,-27.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="45.79,-24.51 35.91,-20.68 41.25,-29.84 45.79,-24.51"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M97.65,-54.8C82.72,-45.83 63.71,-34.41 48.76,-25.42"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="50.83,-22.58 40.45,-20.43 47.22,-28.58 50.83,-22.58"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -40,8 +40,8 @@
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="119.88,-19.25 66.38,-19.25 66.38,0 119.88,0 119.88,-19.25"/>
|
||||
<text text-anchor="middle" x="93.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="111.75,-19.25 66.5,-19.25 66.5,0 111.75,0 111.75,-19.25"/>
|
||||
<text text-anchor="middle" x="89.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -49,8 +49,8 @@
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M93.12,-54.95C93.12,-47.71 93.12,-38.84 93.12,-30.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="96.63,-31.21 93.13,-21.21 89.63,-31.21 96.63,-31.21"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M113.97,-54.95C109.67,-47.28 104.34,-37.77 99.73,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="102.89,-28.03 94.95,-21.02 96.79,-31.46 102.89,-28.03"/>
|
||||
</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="180.62,-19.25 137.62,-19.25 137.62,0 180.62,0 180.62,-19.25"/>
|
||||
<text text-anchor="middle" x="159.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="182.88,-19.25 129.38,-19.25 129.38,0 182.88,0 182.88,-19.25"/>
|
||||
<text text-anchor="middle" x="156.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -67,8 +67,26 @@
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M109.44,-54.95C118.81,-46.59 130.62,-36.05 140.38,-27.35"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="142.69,-29.98 147.82,-20.71 138.03,-24.75 142.69,-29.98"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M130.53,-54.95C134.96,-47.28 140.45,-37.77 145.2,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="148.16,-31.42 150.13,-21.01 142.09,-27.92 148.16,-31.42"/>
|
||||
</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="243.62,-19.25 200.62,-19.25 200.62,0 243.62,0 243.62,-19.25"/>
|
||||
<text text-anchor="middle" x="222.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node5 -->
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M147.1,-54.8C162.33,-45.83 181.73,-34.41 196.99,-25.42"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="198.64,-28.51 205.48,-20.42 195.09,-22.48 198.64,-28.51"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 4.0 KiB |
@@ -114,13 +114,14 @@ $(function(){initNavTree('df/d94/subarray__sum_8cpp.html','../../'); initResizab
|
||||
<p><a href="https://en.wikipedia.org/wiki/Subset_sum_problem" target="_blank">Subset-sum</a> (only continuous subsets) problem
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <cassert></code><br />
|
||||
<code>#include <cstdint></code><br />
|
||||
<code>#include <iostream></code><br />
|
||||
<code>#include <unordered_map></code><br />
|
||||
<code>#include <vector></code><br />
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for subarray_sum.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d1/d90/subarray__sum_8cpp__incl.svg" width="387" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d1/d90/subarray__sum_8cpp__incl.svg" width="471" 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>
|
||||
@@ -166,11 +167,11 @@ Functions</h2></td></tr>
|
||||
|
||||
<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"> 114</span> {</div>
|
||||
<div class="line"><span class="lineno"> 115</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 116</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 117</span>}</div>
|
||||
<div class="ttc" id="asubarray__sum_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> subarray_sum.cpp:67</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 115</span> {</div>
|
||||
<div class="line"><span class="lineno"> 116</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 117</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 118</span>}</div>
|
||||
<div class="ttc" id="asubarray__sum_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> subarray_sum.cpp:68</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -207,28 +208,28 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>count of the number of subsets with required sum </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 38</span> {</div>
|
||||
<div class="line"><span class="lineno"> 39</span> int64_t nelement = in_arr.<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> int64_t count_of_subset = 0;</div>
|
||||
<div class="line"><span class="lineno"> 41</span> int64_t current_sum = 0;</div>
|
||||
<div class="line"><span class="lineno"> 42</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/unordered_map.html">std::unordered_map<int64_t, int64_t></a></div>
|
||||
<div class="line"><span class="lineno"> 43</span> sumarray; <span class="comment">// to store the subarrays count</span></div>
|
||||
<div class="line"><span class="lineno"> 44</span> <span class="comment">// frequency having some sum value</span></div>
|
||||
<div class="line"><span class="lineno"> 45</span> </div>
|
||||
<div class="line"><span class="lineno"> 46</span> <span class="keywordflow">for</span> (int64_t i = 0; i < nelement; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 47</span> current_sum += in_arr[i];</div>
|
||||
<div class="line"><span class="lineno"> 48</span> </div>
|
||||
<div class="line"><span class="lineno"> 49</span> <span class="keywordflow">if</span> (current_sum == sum) {</div>
|
||||
<div class="line"><span class="lineno"> 50</span> count_of_subset++;</div>
|
||||
<div class="line"><span class="lineno"> 51</span> }</div>
|
||||
<div class="line"><span class="lineno"> 52</span> <span class="comment">// If in case current_sum is greater than the required sum</span></div>
|
||||
<div class="line"><span class="lineno"> 53</span> <span class="keywordflow">if</span> (sumarray.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/unordered_map/find.html">find</a>(current_sum - sum) != sumarray.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/unordered_map/end.html">end</a>()) {</div>
|
||||
<div class="line"><span class="lineno"> 54</span> count_of_subset += (sumarray[current_sum - <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a>]);</div>
|
||||
<div class="line"><span class="lineno"> 55</span> }</div>
|
||||
<div class="line"><span class="lineno"> 56</span> sumarray[current_sum]++;</div>
|
||||
<div class="line"><span class="lineno"> 57</span> }</div>
|
||||
<div class="line"><span class="lineno"> 58</span> <span class="keywordflow">return</span> count_of_subset;</div>
|
||||
<div class="line"><span class="lineno"> 59</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 39</span> {</div>
|
||||
<div class="line"><span class="lineno"> 40</span> int64_t nelement = in_arr.<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"> 41</span> int64_t count_of_subset = 0;</div>
|
||||
<div class="line"><span class="lineno"> 42</span> int64_t current_sum = 0;</div>
|
||||
<div class="line"><span class="lineno"> 43</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/unordered_map.html">std::unordered_map<int64_t, int64_t></a></div>
|
||||
<div class="line"><span class="lineno"> 44</span> sumarray; <span class="comment">// to store the subarrays count</span></div>
|
||||
<div class="line"><span class="lineno"> 45</span> <span class="comment">// frequency having some sum value</span></div>
|
||||
<div class="line"><span class="lineno"> 46</span> </div>
|
||||
<div class="line"><span class="lineno"> 47</span> <span class="keywordflow">for</span> (int64_t i = 0; i < nelement; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 48</span> current_sum += in_arr[i];</div>
|
||||
<div class="line"><span class="lineno"> 49</span> </div>
|
||||
<div class="line"><span class="lineno"> 50</span> <span class="keywordflow">if</span> (current_sum == sum) {</div>
|
||||
<div class="line"><span class="lineno"> 51</span> count_of_subset++;</div>
|
||||
<div class="line"><span class="lineno"> 52</span> }</div>
|
||||
<div class="line"><span class="lineno"> 53</span> <span class="comment">// If in case current_sum is greater than the required sum</span></div>
|
||||
<div class="line"><span class="lineno"> 54</span> <span class="keywordflow">if</span> (sumarray.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/unordered_map/find.html">find</a>(current_sum - sum) != sumarray.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/unordered_map/end.html">end</a>()) {</div>
|
||||
<div class="line"><span class="lineno"> 55</span> count_of_subset += (sumarray[current_sum - <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a>]);</div>
|
||||
<div class="line"><span class="lineno"> 56</span> }</div>
|
||||
<div class="line"><span class="lineno"> 57</span> sumarray[current_sum]++;</div>
|
||||
<div class="line"><span class="lineno"> 58</span> }</div>
|
||||
<div class="line"><span class="lineno"> 59</span> <span class="keywordflow">return</span> count_of_subset;</div>
|
||||
<div class="line"><span class="lineno"> 60</span>}</div>
|
||||
<div class="ttc" id="aend_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/unordered_map/end.html">std::unordered_map::end</a></div><div class="ttdeci">T end(T... args)</div></div>
|
||||
<div class="ttc" id="afind_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/unordered_map/find.html">std::unordered_map::find</a></div><div class="ttdeci">T find(T... args)</div></div>
|
||||
<div class="ttc" id="anamespacemachine__learning_html_a6f1c98c016ad34ff3d9f39372161bd35"><div class="ttname"><a href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">machine_learning::sum</a></div><div class="ttdeci">T sum(const std::vector< std::valarray< T > > &A)</div><div class="ttdef"><b>Definition</b> vector_ops.hpp:232</div></div>
|
||||
@@ -267,48 +268,48 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Self-test implementations. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 67</span> {</div>
|
||||
<div class="line"><span class="lineno"> 68</span> <span class="comment">// 1st test</span></div>
|
||||
<div class="line"><span class="lineno"> 69</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"1st test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 70</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> array1 = {-7, -3, -2, 5, 8}; <span class="comment">// input array</span></div>
|
||||
<div class="line"><span class="lineno"> 71</span> assert(</div>
|
||||
<div class="line"><span class="lineno"> 72</span> backtracking::subarray_sum::subarray_sum(0, array1) ==</div>
|
||||
<div class="line"><span class="lineno"> 73</span> 1); <span class="comment">// first argument in subarray_sum function is the required sum and</span></div>
|
||||
<div class="line"><span class="lineno"> 74</span> <span class="comment">// second is the input array, answer is the subarray {(-3,-2,5)}</span></div>
|
||||
<div class="line"><span class="lineno"> 75</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <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"> 76</span> </div>
|
||||
<div class="line"><span class="lineno"> 77</span> <span class="comment">// 2nd test</span></div>
|
||||
<div class="line"><span class="lineno"> 78</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"2nd test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 79</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> array2 = {1, 2, 3, 3};</div>
|
||||
<div class="line"><span class="lineno"> 80</span> assert(backtracking::subarray_sum::subarray_sum(6, array2) ==</div>
|
||||
<div class="line"><span class="lineno"> 81</span> 2); <span class="comment">// here we are expecting 2 subsets which sum up to 6 i.e.</span></div>
|
||||
<div class="line"><span class="lineno"> 82</span> <span class="comment">// {(1,2,3),(3,3)}</span></div>
|
||||
<div class="line"><span class="lineno"> 83</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <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"> 84</span> </div>
|
||||
<div class="line"><span class="lineno"> 85</span> <span class="comment">// 3rd test</span></div>
|
||||
<div class="line"><span class="lineno"> 86</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"3rd test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 87</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> array3 = {1, 1, 1, 1};</div>
|
||||
<div class="line"><span class="lineno"> 88</span> assert(backtracking::subarray_sum::subarray_sum(1, array3) ==</div>
|
||||
<div class="line"><span class="lineno"> 89</span> 4); <span class="comment">// here we are expecting 4 subsets which sum up to 1 i.e.</span></div>
|
||||
<div class="line"><span class="lineno"> 90</span> <span class="comment">// {(1),(1),(1),(1)}</span></div>
|
||||
<div class="line"><span class="lineno"> 91</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <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"> 92</span> </div>
|
||||
<div class="line"><span class="lineno"> 93</span> <span class="comment">// 4rd test</span></div>
|
||||
<div class="line"><span class="lineno"> 94</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"4th test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 95</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> array4 = {3, 3, 3, 3};</div>
|
||||
<div class="line"><span class="lineno"> 96</span> assert(backtracking::subarray_sum::subarray_sum(6, array4) ==</div>
|
||||
<div class="line"><span class="lineno"> 97</span> 3); <span class="comment">// here we are expecting 3 subsets which sum up to 6 i.e.</span></div>
|
||||
<div class="line"><span class="lineno"> 98</span> <span class="comment">// {(3,3),(3,3),(3,3)}</span></div>
|
||||
<div class="line"><span class="lineno"> 99</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <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"> 100</span> </div>
|
||||
<div class="line"><span class="lineno"> 101</span> <span class="comment">// 5th test</span></div>
|
||||
<div class="line"><span class="lineno"> 102</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"5th test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 103</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> array5 = {};</div>
|
||||
<div class="line"><span class="lineno"> 104</span> assert(backtracking::subarray_sum::subarray_sum(6, array5) ==</div>
|
||||
<div class="line"><span class="lineno"> 105</span> 0); <span class="comment">// here we are expecting 0 subsets which sum up to 6 i.e. we</span></div>
|
||||
<div class="line"><span class="lineno"> 106</span> <span class="comment">// cannot select anything from an empty array</span></div>
|
||||
<div class="line"><span class="lineno"> 107</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <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"> 108</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 68</span> {</div>
|
||||
<div class="line"><span class="lineno"> 69</span> <span class="comment">// 1st test</span></div>
|
||||
<div class="line"><span class="lineno"> 70</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"1st test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 71</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> array1 = {-7, -3, -2, 5, 8}; <span class="comment">// input array</span></div>
|
||||
<div class="line"><span class="lineno"> 72</span> assert(</div>
|
||||
<div class="line"><span class="lineno"> 73</span> backtracking::subarray_sum::subarray_sum(0, array1) ==</div>
|
||||
<div class="line"><span class="lineno"> 74</span> 1); <span class="comment">// first argument in subarray_sum function is the required sum and</span></div>
|
||||
<div class="line"><span class="lineno"> 75</span> <span class="comment">// second is the input array, answer is the subarray {(-3,-2,5)}</span></div>
|
||||
<div class="line"><span class="lineno"> 76</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <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"> 77</span> </div>
|
||||
<div class="line"><span class="lineno"> 78</span> <span class="comment">// 2nd test</span></div>
|
||||
<div class="line"><span class="lineno"> 79</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"2nd test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 80</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> array2 = {1, 2, 3, 3};</div>
|
||||
<div class="line"><span class="lineno"> 81</span> assert(backtracking::subarray_sum::subarray_sum(6, array2) ==</div>
|
||||
<div class="line"><span class="lineno"> 82</span> 2); <span class="comment">// here we are expecting 2 subsets which sum up to 6 i.e.</span></div>
|
||||
<div class="line"><span class="lineno"> 83</span> <span class="comment">// {(1,2,3),(3,3)}</span></div>
|
||||
<div class="line"><span class="lineno"> 84</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <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"> 85</span> </div>
|
||||
<div class="line"><span class="lineno"> 86</span> <span class="comment">// 3rd test</span></div>
|
||||
<div class="line"><span class="lineno"> 87</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"3rd test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 88</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> array3 = {1, 1, 1, 1};</div>
|
||||
<div class="line"><span class="lineno"> 89</span> assert(backtracking::subarray_sum::subarray_sum(1, array3) ==</div>
|
||||
<div class="line"><span class="lineno"> 90</span> 4); <span class="comment">// here we are expecting 4 subsets which sum up to 1 i.e.</span></div>
|
||||
<div class="line"><span class="lineno"> 91</span> <span class="comment">// {(1),(1),(1),(1)}</span></div>
|
||||
<div class="line"><span class="lineno"> 92</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <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"> 93</span> </div>
|
||||
<div class="line"><span class="lineno"> 94</span> <span class="comment">// 4rd test</span></div>
|
||||
<div class="line"><span class="lineno"> 95</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"4th test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 96</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> array4 = {3, 3, 3, 3};</div>
|
||||
<div class="line"><span class="lineno"> 97</span> assert(backtracking::subarray_sum::subarray_sum(6, array4) ==</div>
|
||||
<div class="line"><span class="lineno"> 98</span> 3); <span class="comment">// here we are expecting 3 subsets which sum up to 6 i.e.</span></div>
|
||||
<div class="line"><span class="lineno"> 99</span> <span class="comment">// {(3,3),(3,3),(3,3)}</span></div>
|
||||
<div class="line"><span class="lineno"> 100</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <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"> 101</span> </div>
|
||||
<div class="line"><span class="lineno"> 102</span> <span class="comment">// 5th test</span></div>
|
||||
<div class="line"><span class="lineno"> 103</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"5th test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 104</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> array5 = {};</div>
|
||||
<div class="line"><span class="lineno"> 105</span> assert(backtracking::subarray_sum::subarray_sum(6, array5) ==</div>
|
||||
<div class="line"><span class="lineno"> 106</span> 0); <span class="comment">// here we are expecting 0 subsets which sum up to 6 i.e. we</span></div>
|
||||
<div class="line"><span class="lineno"> 107</span> <span class="comment">// cannot select anything from an empty array</span></div>
|
||||
<div class="line"><span class="lineno"> 108</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <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"> 109</span>}</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="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
<map id="bit_manipulation/travelling_salesman_using_bit_manipulation.cpp" name="bit_manipulation/travelling_salesman_using_bit_manipulation.cpp">
|
||||
<area shape="rect" id="Node000001" title="Implementation to [Travelling Salesman problem using bit-masking] (https://www.geeksforgeeks...." alt="" coords="104,5,352,46"/>
|
||||
<area shape="rect" id="Node000001" title="Implementation to [Travelling Salesman problem using bit-masking] (https://www.geeksforgeeks...." alt="" coords="142,5,391,46"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="5,94,80,120"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="183,49,86,90,84,85,181,44"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="211,49,92,91,90,86,210,44"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="104,94,168,120"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="207,48,163,86,160,82,203,44"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="192,94,264,120"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="230,46,230,78,225,78,225,46"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="287,94,339,120"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="251,44,291,81,287,85,247,48"/>
|
||||
<area shape="rect" id="Node000006" title=" " alt="" coords="363,94,420,120"/>
|
||||
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="270,44,354,85,352,89,268,49"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="235,49,170,88,167,83,232,44"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="192,94,253,120"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="258,48,239,82,234,79,253,45"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="276,94,348,120"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="280,45,300,79,295,82,275,48"/>
|
||||
<area shape="rect" id="Node000006" title=" " alt="" coords="371,94,423,120"/>
|
||||
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="301,44,366,83,363,88,298,49"/>
|
||||
<area shape="rect" id="Node000007" title=" " alt="" coords="447,94,504,120"/>
|
||||
<area shape="poly" id="edge6_Node000001_Node000007" title=" " alt="" coords="320,44,433,87,432,92,318,49"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
8028e3347ea4753fa7b762d749e3ee0c
|
||||
01b6ac7b920517c5bf3f4d5a3e1f6751
|
||||
@@ -4,8 +4,8 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: bit_manipulation/travelling_salesman_using_bit_manipulation.cpp Pages: 1 -->
|
||||
<svg width="319pt" height="94pt"
|
||||
viewBox="0.00 0.00 319.38 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="382pt" height="94pt"
|
||||
viewBox="0.00 0.00 382.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">
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Implementation to [Travelling Salesman problem using bit-masking] (https://www.geeksforgeeks....">
|
||||
<polygon fill="#999999" stroke="#666666" points="260,-85.75 73.75,-85.75 73.75,-55.25 260,-55.25 260,-85.75"/>
|
||||
<text text-anchor="start" x="81.75" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">bit_manipulation/travelling</text>
|
||||
<text text-anchor="middle" x="166.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_salesman_using_bit_manipulation.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="289,-85.75 102.75,-85.75 102.75,-55.25 289,-55.25 289,-85.75"/>
|
||||
<text text-anchor="start" x="110.75" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">bit_manipulation/travelling</text>
|
||||
<text text-anchor="middle" x="195.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_salesman_using_bit_manipulation.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -42,8 +42,8 @@
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M132.16,-54.8C109.87,-45.35 81.15,-33.19 59.5,-24.02"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.16,-20.92 50.59,-20.24 58.43,-27.37 61.16,-20.92"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M153.91,-54.8C126.36,-45.14 90.68,-32.63 64.32,-23.4"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="65.66,-20.16 55.07,-20.15 63.35,-26.76 65.66,-20.16"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -60,8 +60,8 @@
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M149.82,-54.95C139.92,-46.5 127.42,-35.83 117.16,-27.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="119.54,-24.51 109.66,-20.68 115,-29.84 119.54,-24.51"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M171.4,-54.8C156.47,-45.83 137.46,-34.41 122.51,-25.42"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="124.58,-22.58 114.2,-20.43 120.97,-28.58 124.58,-22.58"/>
|
||||
</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="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>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="185.5,-19.25 140.25,-19.25 140.25,0 185.5,0 185.5,-19.25"/>
|
||||
<text text-anchor="middle" x="162.88" 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->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M166.88,-54.95C166.88,-47.71 166.88,-38.84 166.88,-30.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="170.38,-31.21 166.88,-21.21 163.38,-31.21 170.38,-31.21"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M187.72,-54.95C183.42,-47.28 178.09,-37.77 173.48,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="176.64,-28.03 168.7,-21.02 170.54,-31.46 176.64,-28.03"/>
|
||||
</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="250.5,-19.25 211.25,-19.25 211.25,0 250.5,0 250.5,-19.25"/>
|
||||
<text text-anchor="middle" x="230.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">limits</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="256.62,-19.25 203.12,-19.25 203.12,0 256.62,0 256.62,-19.25"/>
|
||||
<text text-anchor="middle" x="229.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -96,8 +96,8 @@
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M182.7,-54.95C191.78,-46.59 203.24,-36.05 212.69,-27.35"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="214.9,-30.07 219.89,-20.73 210.17,-24.92 214.9,-30.07"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M204.28,-54.95C208.71,-47.28 214.2,-37.77 218.95,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="221.91,-31.42 223.88,-21.01 215.84,-27.92 221.91,-31.42"/>
|
||||
</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="311.38,-19.25 268.38,-19.25 268.38,0 311.38,0 311.38,-19.25"/>
|
||||
<text text-anchor="middle" x="289.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="313.5,-19.25 274.25,-19.25 274.25,0 313.5,0 313.5,-19.25"/>
|
||||
<text text-anchor="middle" x="293.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">limits</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -114,8 +114,26 @@
|
||||
<g id="edge5_Node000001_Node000006" class="edge">
|
||||
<title>Node1->Node6</title>
|
||||
<g id="a_edge5_Node000001_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M197.6,-54.8C216.96,-45.53 241.8,-33.63 260.84,-24.52"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="262.14,-27.78 269.65,-20.31 259.12,-21.47 262.14,-27.78"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M220.35,-54.8C235.28,-45.83 254.29,-34.41 269.24,-25.42"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="270.78,-28.58 277.55,-20.43 267.17,-22.58 270.78,-28.58"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="Node000007" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_Node000007"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="374.38,-19.25 331.38,-19.25 331.38,0 374.38,0 374.38,-19.25"/>
|
||||
<text text-anchor="middle" x="352.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node7 -->
|
||||
<g id="edge6_Node000001_Node000007" class="edge">
|
||||
<title>Node1->Node7</title>
|
||||
<g id="a_edge6_Node000001_Node000007"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M235.09,-54.8C261.39,-44.93 295.63,-32.09 320.41,-22.8"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="321.51,-26.12 329.65,-19.34 319.05,-19.57 321.51,-26.12"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 6.3 KiB |
@@ -4,17 +4,17 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: bit_manipulation/travelling_salesman_using_bit_manipulation.cpp Pages: 1 -->
|
||||
<svg width="319pt" height="94pt"
|
||||
viewBox="0.00 0.00 319.38 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="382pt" height="94pt"
|
||||
viewBox="0.00 0.00 382.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>bit_manipulation/travelling_salesman_using_bit_manipulation.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Implementation to [Travelling Salesman problem using bit-masking] (https://www.geeksforgeeks....">
|
||||
<polygon fill="#999999" stroke="#666666" points="260,-85.75 73.75,-85.75 73.75,-55.25 260,-55.25 260,-85.75"/>
|
||||
<text text-anchor="start" x="81.75" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">bit_manipulation/travelling</text>
|
||||
<text text-anchor="middle" x="166.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_salesman_using_bit_manipulation.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="289,-85.75 102.75,-85.75 102.75,-55.25 289,-55.25 289,-85.75"/>
|
||||
<text text-anchor="start" x="110.75" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">bit_manipulation/travelling</text>
|
||||
<text text-anchor="middle" x="195.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_salesman_using_bit_manipulation.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -31,8 +31,8 @@
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M132.16,-54.8C109.87,-45.35 81.15,-33.19 59.5,-24.02"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.16,-20.92 50.59,-20.24 58.43,-27.37 61.16,-20.92"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M153.91,-54.8C126.36,-45.14 90.68,-32.63 64.32,-23.4"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="65.66,-20.16 55.07,-20.15 63.35,-26.76 65.66,-20.16"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -49,8 +49,8 @@
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M149.82,-54.95C139.92,-46.5 127.42,-35.83 117.16,-27.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="119.54,-24.51 109.66,-20.68 115,-29.84 119.54,-24.51"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M171.4,-54.8C156.47,-45.83 137.46,-34.41 122.51,-25.42"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="124.58,-22.58 114.2,-20.43 120.97,-28.58 124.58,-22.58"/>
|
||||
</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="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>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="185.5,-19.25 140.25,-19.25 140.25,0 185.5,0 185.5,-19.25"/>
|
||||
<text text-anchor="middle" x="162.88" 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->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M166.88,-54.95C166.88,-47.71 166.88,-38.84 166.88,-30.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="170.38,-31.21 166.88,-21.21 163.38,-31.21 170.38,-31.21"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M187.72,-54.95C183.42,-47.28 178.09,-37.77 173.48,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="176.64,-28.03 168.7,-21.02 170.54,-31.46 176.64,-28.03"/>
|
||||
</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="250.5,-19.25 211.25,-19.25 211.25,0 250.5,0 250.5,-19.25"/>
|
||||
<text text-anchor="middle" x="230.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">limits</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="256.62,-19.25 203.12,-19.25 203.12,0 256.62,0 256.62,-19.25"/>
|
||||
<text text-anchor="middle" x="229.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -85,8 +85,8 @@
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M182.7,-54.95C191.78,-46.59 203.24,-36.05 212.69,-27.35"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="214.9,-30.07 219.89,-20.73 210.17,-24.92 214.9,-30.07"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M204.28,-54.95C208.71,-47.28 214.2,-37.77 218.95,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="221.91,-31.42 223.88,-21.01 215.84,-27.92 221.91,-31.42"/>
|
||||
</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="311.38,-19.25 268.38,-19.25 268.38,0 311.38,0 311.38,-19.25"/>
|
||||
<text text-anchor="middle" x="289.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="313.5,-19.25 274.25,-19.25 274.25,0 313.5,0 313.5,-19.25"/>
|
||||
<text text-anchor="middle" x="293.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">limits</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -103,8 +103,26 @@
|
||||
<g id="edge5_Node000001_Node000006" class="edge">
|
||||
<title>Node1->Node6</title>
|
||||
<g id="a_edge5_Node000001_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M197.6,-54.8C216.96,-45.53 241.8,-33.63 260.84,-24.52"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="262.14,-27.78 269.65,-20.31 259.12,-21.47 262.14,-27.78"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M220.35,-54.8C235.28,-45.83 254.29,-34.41 269.24,-25.42"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="270.78,-28.58 277.55,-20.43 267.17,-22.58 270.78,-28.58"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="Node000007" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_Node000007"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="374.38,-19.25 331.38,-19.25 331.38,0 374.38,0 374.38,-19.25"/>
|
||||
<text text-anchor="middle" x="352.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node7 -->
|
||||
<g id="edge6_Node000001_Node000007" class="edge">
|
||||
<title>Node1->Node7</title>
|
||||
<g id="a_edge6_Node000001_Node000007"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M235.09,-54.8C261.39,-44.93 295.63,-32.09 320.41,-22.8"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="321.51,-26.12 329.65,-19.34 319.05,-19.57 321.51,-26.12"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 5.5 KiB |
@@ -121,9 +121,9 @@ Namespaces</h2></td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p>String algorithms. </p>
|
||||
<p>for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a> STL</p>
|
||||
<p>for assert</p>
|
||||
<p>Algorithms with strings.</p>
|
||||
<p>for assert for IO operations for string</p>
|
||||
<p>for IO operations for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a> STL for string</p>
|
||||
<p>Algorithms with strings </p>
|
||||
</div></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
|
||||
@@ -306,7 +306,7 @@ $(function(){initNavTree('df/dcd/_2_users_2runner_2work_2_c-_plus-_plus_2_c-_plu
|
||||
<div class="ttc" id="agenerate__parentheses_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> generate_parentheses.cpp:82</div></div>
|
||||
<div class="ttc" id="agenerate__parentheses_8cpp_html_gae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">Main function.</div><div class="ttdef"><b>Definition</b> generate_parentheses.cpp:110</div></div>
|
||||
<div class="ttc" id="ainvalid_argument_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/error/invalid_argument.html">std::invalid_argument</a></div></div>
|
||||
<div class="ttc" id="anamespacemath_html"><div class="ttname"><a href="../../dd/d47/namespacemath.html">math</a></div><div class="ttdoc">for IO operations</div></div>
|
||||
<div class="ttc" id="anamespacemath_html"><div class="ttname"><a href="../../dd/d47/namespacemath.html">math</a></div><div class="ttdoc">for assert</div></div>
|
||||
<div class="ttc" id="anamespacemath_html_aacb1411ef2029e81f249c21e17c96fdb"><div class="ttname"><a href="../../dd/d47/namespacemath.html#aacb1411ef2029e81f249c21e17c96fdb">math::quadraticEquation</a></div><div class="ttdeci">std::array< std::complex< long double >, 2 > quadraticEquation(long double a, long double b, long double c)</div><div class="ttdoc">Quadratic equation calculator.</div><div class="ttdef"><b>Definition</b> quadratic_equations_complex_numbers.cpp:53</div></div>
|
||||
<div class="ttc" id="apow_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a></div><div class="ttdeci">T pow(T... args)</div></div>
|
||||
<div class="ttc" id="aquadratic__equations__complex__numbers_8cpp_html_af7a6d4e3dc85a6288c8f1f7094830c5a"><div class="ttname"><a href="../../da/d18/quadratic__equations__complex__numbers_8cpp.html#af7a6d4e3dc85a6288c8f1f7094830c5a">assertArray</a></div><div class="ttdeci">void assertArray(std::array< std::complex< long double >, 2 > input, std::array< std::complex< long double >, 2 > expected, size_t precision=10)</div><div class="ttdoc">Asserts an array of complex numbers.</div><div class="ttdef"><b>Definition</b> quadratic_equations_complex_numbers.cpp:100</div></div>
|
||||
|
||||
@@ -164,6 +164,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p><a class="el" href="../../dc/d61/classgraph_1_1_graph.html">Graph</a> Algorithms. </p>
|
||||
<p>for assert</p>
|
||||
<p>Check whether a given graph is bipartite or not.</p>
|
||||
<p>for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></p>
|
||||
<p><a class="el" href="../../dc/d61/classgraph_1_1_graph.html">Graph</a> algorithms.</p>
|
||||
@@ -172,7 +173,8 @@ Functions</h2></td></tr>
|
||||
<p>A bipartite graph is the one whose nodes can be divided into two disjoint sets in such a way that the nodes in a set are not connected to each other at all, i.e. no intra-set connections. The only connections that exist are that of inter-set, i.e. the nodes from one set are connected to a subset of nodes in the other set. In this implementation, using a graph in the form of adjacency list, check whether the given graph is a bipartite or not.</p>
|
||||
<p>References used: <a href="https://www.geeksforgeeks.org/bipartite-graph/" target="_blank">GeeksForGeeks</a> </p><dl class="section author"><dt>Author</dt><dd><a href="https://github.com/tushar2407" target="_blank">tushar2407</a> for assert for IO operations for queue data structure for vector data structure</dd></dl>
|
||||
<p>Graphical algorithms</p>
|
||||
<p>for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a> for assert for IO operations for limits of integral types for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a> </p>
|
||||
<p>for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a> for IO operations for limits of integral types for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></p>
|
||||
<p><a class="el" href="../../dc/d61/classgraph_1_1_graph.html">Graph</a> Algorithms </p>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="a9125ceb66bfbec3093bba64c2c1e99e2" name="a9125ceb66bfbec3093bba64c2c1e99e2"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a9125ceb66bfbec3093bba64c2c1e99e2">◆ </a></span>addEdge() <span class="overload">[1/3]</span></h2>
|
||||
@@ -354,38 +356,38 @@ Here is the call graph for this function:</div>
|
||||
<p>insert the neighbouring node into the queue</p>
|
||||
<p>if both the current node and its neighbour has the same state then it is not a bipartite graph</p>
|
||||
<p>return true when all the connected nodes of the current nodes are travelled and satisify all the above conditions</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 37</span> {</div>
|
||||
<div class="line"><span class="lineno"> 38</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue.html">std::queue<int64_t></a> q; <span class="comment">///< stores the neighbouring node indexes in squence</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 39</span><span class="comment"> /// of being reached</span></div>
|
||||
<div class="line"><span class="lineno"> 40</span><span class="comment"></span> q.push(index); <span class="comment">/// insert the current node into the queue</span></div>
|
||||
<div class="line"><span class="lineno"> 41</span> (*visited)[index] = 1; <span class="comment">/// mark the current node as travelled</span></div>
|
||||
<div class="line"><span class="lineno"> 42</span> <span class="keywordflow">while</span> (q.size()) {</div>
|
||||
<div class="line"><span class="lineno"> 43</span> int64_t u = q.front();</div>
|
||||
<div class="line"><span class="lineno"> 44</span> q.pop();</div>
|
||||
<div class="line"><span class="lineno"> 45</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>[u].size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 46</span> int64_t v =</div>
|
||||
<div class="line"><span class="lineno"> 47</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>[u][i]; <span class="comment">///< stores the neighbour of the current node</span></div>
|
||||
<div class="line"><span class="lineno"> 48</span> <span class="keywordflow">if</span> (!(*visited)[v]) <span class="comment">/// check whether the neighbour node is</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 49</span><span class="comment"> /// travelled already or not</span></div>
|
||||
<div class="line"><span class="lineno"> 50</span><span class="comment"></span> {</div>
|
||||
<div class="line"><span class="lineno"> 51</span> (*visited)[v] =</div>
|
||||
<div class="line"><span class="lineno"> 52</span> ((*visited)[u] == 1)</div>
|
||||
<div class="line"><span class="lineno"> 53</span> ? -1</div>
|
||||
<div class="line"><span class="lineno"> 54</span> : 1; <span class="comment">/// colour the neighbouring node with</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 55</span><span class="comment"> /// different colour than the current node</span></div>
|
||||
<div class="line"><span class="lineno"> 56</span><span class="comment"></span> q.push(v); <span class="comment">/// insert the neighbouring node into the queue</span></div>
|
||||
<div class="line"><span class="lineno"> 57</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((*visited)[v] ==</div>
|
||||
<div class="line"><span class="lineno"> 58</span> (*visited)[u]) <span class="comment">/// if both the current node and its</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 59</span><span class="comment"> /// neighbour has the same state then it</span></div>
|
||||
<div class="line"><span class="lineno"> 60</span><span class="comment"> /// is not a bipartite graph</span></div>
|
||||
<div class="line"><span class="lineno"> 61</span><span class="comment"></span> {</div>
|
||||
<div class="line"><span class="lineno"> 62</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 63</span> }</div>
|
||||
<div class="line"><span class="lineno"> 64</span> }</div>
|
||||
<div class="line"><span class="lineno"> 65</span> }</div>
|
||||
<div class="line"><span class="lineno"> 66</span> <span class="keywordflow">return</span> <span class="keyword">true</span>; <span class="comment">/// return true when all the connected nodes of the current</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 67</span><span class="comment"> /// nodes are travelled and satisify all the above conditions</span></div>
|
||||
<div class="line"><span class="lineno"> 68</span><span class="comment"></span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 38</span> {</div>
|
||||
<div class="line"><span class="lineno"> 39</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue.html">std::queue<int64_t></a> q; <span class="comment">///< stores the neighbouring node indexes in squence</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 40</span><span class="comment"> /// of being reached</span></div>
|
||||
<div class="line"><span class="lineno"> 41</span><span class="comment"></span> q.push(index); <span class="comment">/// insert the current node into the queue</span></div>
|
||||
<div class="line"><span class="lineno"> 42</span> (*visited)[index] = 1; <span class="comment">/// mark the current node as travelled</span></div>
|
||||
<div class="line"><span class="lineno"> 43</span> <span class="keywordflow">while</span> (q.size()) {</div>
|
||||
<div class="line"><span class="lineno"> 44</span> int64_t u = q.front();</div>
|
||||
<div class="line"><span class="lineno"> 45</span> q.pop();</div>
|
||||
<div class="line"><span class="lineno"> 46</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>[u].size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 47</span> int64_t v =</div>
|
||||
<div class="line"><span class="lineno"> 48</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>[u][i]; <span class="comment">///< stores the neighbour of the current node</span></div>
|
||||
<div class="line"><span class="lineno"> 49</span> <span class="keywordflow">if</span> (!(*visited)[v]) <span class="comment">/// check whether the neighbour node is</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 50</span><span class="comment"> /// travelled already or not</span></div>
|
||||
<div class="line"><span class="lineno"> 51</span><span class="comment"></span> {</div>
|
||||
<div class="line"><span class="lineno"> 52</span> (*visited)[v] =</div>
|
||||
<div class="line"><span class="lineno"> 53</span> ((*visited)[u] == 1)</div>
|
||||
<div class="line"><span class="lineno"> 54</span> ? -1</div>
|
||||
<div class="line"><span class="lineno"> 55</span> : 1; <span class="comment">/// colour the neighbouring node with</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 56</span><span class="comment"> /// different colour than the current node</span></div>
|
||||
<div class="line"><span class="lineno"> 57</span><span class="comment"></span> q.push(v); <span class="comment">/// insert the neighbouring node into the queue</span></div>
|
||||
<div class="line"><span class="lineno"> 58</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((*visited)[v] ==</div>
|
||||
<div class="line"><span class="lineno"> 59</span> (*visited)[u]) <span class="comment">/// if both the current node and its</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 60</span><span class="comment"> /// neighbour has the same state then it</span></div>
|
||||
<div class="line"><span class="lineno"> 61</span><span class="comment"> /// is not a bipartite graph</span></div>
|
||||
<div class="line"><span class="lineno"> 62</span><span class="comment"></span> {</div>
|
||||
<div class="line"><span class="lineno"> 63</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 64</span> }</div>
|
||||
<div class="line"><span class="lineno"> 65</span> }</div>
|
||||
<div class="line"><span class="lineno"> 66</span> }</div>
|
||||
<div class="line"><span class="lineno"> 67</span> <span class="keywordflow">return</span> <span class="keyword">true</span>; <span class="comment">/// return true when all the connected nodes of the current</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 68</span><span class="comment"> /// nodes are travelled and satisify all the above conditions</span></div>
|
||||
<div class="line"><span class="lineno"> 69</span><span class="comment"></span>}</div>
|
||||
<div class="ttc" id="anamespacegraph_html"><div class="ttname"><a href="../../df/dce/namespacegraph.html">graph</a></div><div class="ttdoc">Graph Algorithms.</div></div>
|
||||
<div class="ttc" id="aqueue_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/queue.html">std::queue</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
@@ -706,25 +708,25 @@ Here is the call graph for this function:</div>
|
||||
<dl class="section return"><dt>Returns</dt><dd>booleans </dd></dl>
|
||||
<p>< stores boolean values which signify whether that node had been visited or not</p>
|
||||
<p>if the current node is not visited then check whether the sub-graph of that node is a bipartite or not</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 75</span> {</div>
|
||||
<div class="line"><span class="lineno"> 76</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> visited(</div>
|
||||
<div class="line"><span class="lineno"> 77</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.size()); <span class="comment">///< stores boolean values</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 78</span><span class="comment"> /// which signify whether that node had been visited or</span></div>
|
||||
<div class="line"><span class="lineno"> 79</span><span class="comment"> /// not</span></div>
|
||||
<div class="line"><span class="lineno"> 80</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 81</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 82</span> <span class="keywordflow">if</span> (!visited[i]) <span class="comment">/// if the current node is not visited then check</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 83</span><span class="comment"> /// whether the sub-graph of that node is a bipartite</span></div>
|
||||
<div class="line"><span class="lineno"> 84</span><span class="comment"> /// or not</span></div>
|
||||
<div class="line"><span class="lineno"> 85</span><span class="comment"></span> {</div>
|
||||
<div class="line"><span class="lineno"> 86</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="#a8e1b547cd407c0774e63f0dc95cda9e7">checkBipartite</a>(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>, i, &visited)) {</div>
|
||||
<div class="line"><span class="lineno"> 87</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 88</span> }</div>
|
||||
<div class="line"><span class="lineno"> 89</span> }</div>
|
||||
<div class="line"><span class="lineno"> 90</span> }</div>
|
||||
<div class="line"><span class="lineno"> 91</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 92</span>}</div>
|
||||
<div class="ttc" id="anamespacegraph_html_a8e1b547cd407c0774e63f0dc95cda9e7"><div class="ttname"><a href="#a8e1b547cd407c0774e63f0dc95cda9e7">graph::checkBipartite</a></div><div class="ttdeci">bool checkBipartite(const std::vector< std::vector< int64_t > > &graph, int64_t index, std::vector< int64_t > *visited)</div><div class="ttdoc">function to check whether the passed graph is bipartite or not</div><div class="ttdef"><b>Definition</b> is_graph_bipartite2.cpp:36</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 76</span> {</div>
|
||||
<div class="line"><span class="lineno"> 77</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> visited(</div>
|
||||
<div class="line"><span class="lineno"> 78</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.size()); <span class="comment">///< stores boolean values</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 79</span><span class="comment"> /// which signify whether that node had been visited or</span></div>
|
||||
<div class="line"><span class="lineno"> 80</span><span class="comment"> /// not</span></div>
|
||||
<div class="line"><span class="lineno"> 81</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 82</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 83</span> <span class="keywordflow">if</span> (!visited[i]) <span class="comment">/// if the current node is not visited then check</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 84</span><span class="comment"> /// whether the sub-graph of that node is a bipartite</span></div>
|
||||
<div class="line"><span class="lineno"> 85</span><span class="comment"> /// or not</span></div>
|
||||
<div class="line"><span class="lineno"> 86</span><span class="comment"></span> {</div>
|
||||
<div class="line"><span class="lineno"> 87</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="#a8e1b547cd407c0774e63f0dc95cda9e7">checkBipartite</a>(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>, i, &visited)) {</div>
|
||||
<div class="line"><span class="lineno"> 88</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 89</span> }</div>
|
||||
<div class="line"><span class="lineno"> 90</span> }</div>
|
||||
<div class="line"><span class="lineno"> 91</span> }</div>
|
||||
<div class="line"><span class="lineno"> 92</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 93</span>}</div>
|
||||
<div class="ttc" id="anamespacegraph_html_a8e1b547cd407c0774e63f0dc95cda9e7"><div class="ttname"><a href="#a8e1b547cd407c0774e63f0dc95cda9e7">graph::checkBipartite</a></div><div class="ttdeci">bool checkBipartite(const std::vector< std::vector< int64_t > > &graph, int64_t index, std::vector< int64_t > *visited)</div><div class="ttdoc">function to check whether the passed graph is bipartite or not</div><div class="ttdef"><b>Definition</b> is_graph_bipartite2.cpp:37</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -766,36 +768,36 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 41</span> {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 42</span><span class="comment"> //// vtx stores the vertexs of the graph</span></div>
|
||||
<div class="line"><span class="lineno"> 43</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint32_t></a> vtx;</div>
|
||||
<div class="line"><span class="lineno"> 44</span> <span class="keywordflow">for</span> (uint32_t i = 0; i < V; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 45</span> <span class="keywordflow">if</span> (i != src) {</div>
|
||||
<div class="line"><span class="lineno"> 46</span> vtx.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(i);</div>
|
||||
<div class="line"><span class="lineno"> 47</span> }</div>
|
||||
<div class="line"><span class="lineno"> 48</span> }</div>
|
||||
<div class="line"><span class="lineno"> 49</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 50</span><span class="comment"> //// store minimum weight Hamiltonian Cycle.</span></div>
|
||||
<div class="line"><span class="lineno"> 51</span><span class="comment"></span> int32_t min_path = 2147483647;</div>
|
||||
<div class="line"><span class="lineno"> 52</span> <span class="keywordflow">do</span> {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 53</span><span class="comment"> //// store current Path weight(cost)</span></div>
|
||||
<div class="line"><span class="lineno"> 54</span><span class="comment"></span> int32_t curr_weight = 0;</div>
|
||||
<div class="line"><span class="lineno"> 55</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 56</span><span class="comment"> //// compute current path weight</span></div>
|
||||
<div class="line"><span class="lineno"> 57</span><span class="comment"></span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a> = src;</div>
|
||||
<div class="line"><span class="lineno"> 58</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i : vtx) {</div>
|
||||
<div class="line"><span class="lineno"> 59</span> curr_weight += (*cities)[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>][i];</div>
|
||||
<div class="line"><span class="lineno"> 60</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a> = i;</div>
|
||||
<div class="line"><span class="lineno"> 61</span> }</div>
|
||||
<div class="line"><span class="lineno"> 62</span> curr_weight += (*cities)[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>][src];</div>
|
||||
<div class="line"><span class="lineno"> 63</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 64</span><span class="comment"> //// update minimum</span></div>
|
||||
<div class="line"><span class="lineno"> 65</span><span class="comment"></span> min_path = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a>(min_path, curr_weight);</div>
|
||||
<div class="line"><span class="lineno"> 66</span> </div>
|
||||
<div class="line"><span class="lineno"> 67</span> } <span class="keywordflow">while</span> (<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/next_permutation.html">next_permutation</a>(vtx.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/begin.html">begin</a>(), vtx.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/end.html">end</a>()));</div>
|
||||
<div class="line"><span class="lineno"> 68</span> </div>
|
||||
<div class="line"><span class="lineno"> 69</span> <span class="keywordflow">return</span> min_path;</div>
|
||||
<div class="line"><span class="lineno"> 70</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 42</span> {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 43</span><span class="comment"> //// vtx stores the vertexs of the graph</span></div>
|
||||
<div class="line"><span class="lineno"> 44</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint32_t></a> vtx;</div>
|
||||
<div class="line"><span class="lineno"> 45</span> <span class="keywordflow">for</span> (uint32_t i = 0; i < V; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 46</span> <span class="keywordflow">if</span> (i != src) {</div>
|
||||
<div class="line"><span class="lineno"> 47</span> vtx.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(i);</div>
|
||||
<div class="line"><span class="lineno"> 48</span> }</div>
|
||||
<div class="line"><span class="lineno"> 49</span> }</div>
|
||||
<div class="line"><span class="lineno"> 50</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 51</span><span class="comment"> //// store minimum weight Hamiltonian Cycle.</span></div>
|
||||
<div class="line"><span class="lineno"> 52</span><span class="comment"></span> int32_t min_path = 2147483647;</div>
|
||||
<div class="line"><span class="lineno"> 53</span> <span class="keywordflow">do</span> {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 54</span><span class="comment"> //// store current Path weight(cost)</span></div>
|
||||
<div class="line"><span class="lineno"> 55</span><span class="comment"></span> int32_t curr_weight = 0;</div>
|
||||
<div class="line"><span class="lineno"> 56</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 57</span><span class="comment"> //// compute current path weight</span></div>
|
||||
<div class="line"><span class="lineno"> 58</span><span class="comment"></span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a> = src;</div>
|
||||
<div class="line"><span class="lineno"> 59</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i : vtx) {</div>
|
||||
<div class="line"><span class="lineno"> 60</span> curr_weight += (*cities)[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>][i];</div>
|
||||
<div class="line"><span class="lineno"> 61</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a> = i;</div>
|
||||
<div class="line"><span class="lineno"> 62</span> }</div>
|
||||
<div class="line"><span class="lineno"> 63</span> curr_weight += (*cities)[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>][src];</div>
|
||||
<div class="line"><span class="lineno"> 64</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 65</span><span class="comment"> //// update minimum</span></div>
|
||||
<div class="line"><span class="lineno"> 66</span><span class="comment"></span> min_path = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a>(min_path, curr_weight);</div>
|
||||
<div class="line"><span class="lineno"> 67</span> </div>
|
||||
<div class="line"><span class="lineno"> 68</span> } <span class="keywordflow">while</span> (<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/next_permutation.html">next_permutation</a>(vtx.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/begin.html">begin</a>(), vtx.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/end.html">end</a>()));</div>
|
||||
<div class="line"><span class="lineno"> 69</span> </div>
|
||||
<div class="line"><span class="lineno"> 70</span> <span class="keywordflow">return</span> min_path;</div>
|
||||
<div class="line"><span class="lineno"> 71</span>}</div>
|
||||
<div class="ttc" id="abegin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/begin.html">std::vector::begin</a></div><div class="ttdeci">T begin(T... args)</div></div>
|
||||
<div class="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="aend_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/end.html">std::vector::end</a></div><div class="ttdeci">T end(T... args)</div></div>
|
||||
|
||||