Documentation for c6af943508
@@ -1,26 +1,28 @@
|
||||
<map id="ciphers/hill_cipher.cpp" name="ciphers/hill_cipher.cpp">
|
||||
<area shape="rect" id="Node000001" title="Implementation of Hill cipher algorithm." alt="" coords="296,5,446,31"/>
|
||||
<area shape="rect" id="Node000001" title="Implementation of Hill cipher algorithm." alt="" coords="338,5,487,31"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="5,86,70,112"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="296,34,195,53,84,82,79,83,77,78,82,76,193,48,295,28"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="338,31,217,50,84,82,78,83,77,78,82,76,216,45,337,26"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="94,86,152,112"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="320,34,246,54,164,82,161,82,159,77,162,76,244,49,319,29"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="346,34,258,54,164,82,161,82,159,77,162,76,257,49,344,29"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="175,86,236,112"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="347,34,246,82,243,77,344,29"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="260,86,314,112"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="360,33,312,78,309,74,356,29"/>
|
||||
<area shape="rect" id="Node000006" title=" " alt="" coords="338,86,404,112"/>
|
||||
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="374,31,374,71,368,71,368,31"/>
|
||||
<area shape="rect" id="Node000007" title=" " alt="" coords="427,86,493,112"/>
|
||||
<area shape="poly" id="edge6_Node000001_Node000007" title=" " alt="" coords="386,29,437,74,433,78,383,33"/>
|
||||
<area shape="rect" id="Node000008" title=" " alt="" coords="542,168,613,193"/>
|
||||
<area shape="poly" id="edge7_Node000001_Node000008" title=" " alt="" coords="414,29,461,48,507,77,542,114,567,153,562,156,538,118,504,81,458,53,412,34"/>
|
||||
<area shape="rect" id="Node000009" title=" " alt="" coords="568,86,622,112"/>
|
||||
<area shape="poly" id="edge8_Node000001_Node000009" title=" " alt="" coords="411,29,550,76,554,78,552,83,549,82,409,34"/>
|
||||
<area shape="rect" id="Node000010" href="$d1/dbe/lu__decomposition_8h.html" title="Functions associated with LU Decomposition of a square matrix." alt="" coords="646,79,792,120"/>
|
||||
<area shape="poly" id="edge9_Node000001_Node000010" title=" " alt="" coords="425,29,631,75,630,81,424,34"/>
|
||||
<area shape="poly" id="edge10_Node000010_Node000008" title=" " alt="" coords="685,123,614,162,611,157,682,118"/>
|
||||
<area shape="rect" id="Node000011" title=" " alt="" coords="641,168,708,193"/>
|
||||
<area shape="poly" id="edge11_Node000010_Node000011" title=" " alt="" coords="710,121,691,155,687,153,706,119"/>
|
||||
<area shape="rect" id="Node000012" title=" " alt="" coords="733,168,790,193"/>
|
||||
<area shape="poly" id="edge12_Node000010_Node000012" title=" " alt="" coords="732,119,750,152,745,155,727,121"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="377,34,248,81,245,82,243,78,246,77,375,29"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="259,86,320,112"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="395,34,322,80,319,76,392,29"/>
|
||||
<area shape="rect" id="Node000006" title=" " alt="" coords="344,86,398,112"/>
|
||||
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="408,33,387,74,382,71,404,30"/>
|
||||
<area shape="rect" id="Node000007" title=" " alt="" coords="422,86,488,112"/>
|
||||
<area shape="poly" id="edge6_Node000001_Node000007" title=" " alt="" coords="421,30,443,72,439,74,416,33"/>
|
||||
<area shape="rect" id="Node000008" title=" " alt="" coords="511,86,577,112"/>
|
||||
<area shape="poly" id="edge7_Node000001_Node000008" title=" " alt="" coords="434,29,512,76,509,80,431,34"/>
|
||||
<area shape="rect" id="Node000009" title=" " alt="" coords="626,168,697,193"/>
|
||||
<area shape="poly" id="edge8_Node000001_Node000009" title=" " alt="" coords="480,29,536,47,565,60,591,77,610,94,627,114,652,153,647,156,623,117,607,98,588,81,562,65,534,52,478,34"/>
|
||||
<area shape="rect" id="Node000010" title=" " alt="" coords="652,86,706,112"/>
|
||||
<area shape="poly" id="edge9_Node000001_Node000010" title=" " alt="" coords="466,29,546,50,634,76,638,78,637,83,633,82,544,55,464,34"/>
|
||||
<area shape="rect" id="Node000011" href="$d1/dbe/lu__decomposition_8h.html" title="Functions associated with LU Decomposition of a square matrix." alt="" coords="730,79,876,120"/>
|
||||
<area shape="poly" id="edge10_Node000001_Node000011" title=" " alt="" coords="478,29,715,76,714,81,477,34"/>
|
||||
<area shape="poly" id="edge11_Node000011_Node000009" title=" " alt="" coords="769,123,698,162,695,157,766,118"/>
|
||||
<area shape="rect" id="Node000012" title=" " alt="" coords="725,168,792,193"/>
|
||||
<area shape="poly" id="edge12_Node000011_Node000012" title=" " alt="" coords="794,121,775,155,771,153,790,119"/>
|
||||
<area shape="rect" id="Node000013" title=" " alt="" coords="817,168,874,193"/>
|
||||
<area shape="poly" id="edge13_Node000011_Node000013" title=" " alt="" coords="816,119,834,152,829,155,811,121"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
770c77c44a8202fdf083ac3e26375873
|
||||
5f39a4538d52363e8eade1e12188ed5e
|
||||
@@ -47,7 +47,7 @@
|
||||
</g>
|
||||
</defs>
|
||||
<script type="application/ecmascript">
|
||||
var viewWidth = 598;
|
||||
var viewWidth = 661;
|
||||
var viewHeight = 149;
|
||||
var sectionId = 'dynsection-0';
|
||||
</script>
|
||||
@@ -59,8 +59,8 @@ var sectionId = 'dynsection-0';
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Implementation of Hill cipher algorithm.">
|
||||
<polygon fill="#999999" stroke="#666666" points="330.12,-141 218.12,-141 218.12,-121.75 330.12,-121.75 330.12,-141"/>
|
||||
<text text-anchor="middle" x="274.12" y="-127.5" font-family="Helvetica,sans-Serif" font-size="10.00">ciphers/hill_cipher.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="361.12,-141 249.12,-141 249.12,-121.75 361.12,-121.75 361.12,-141"/>
|
||||
<text text-anchor="middle" x="305.12" y="-127.5" font-family="Helvetica,sans-Serif" font-size="10.00">ciphers/hill_cipher.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -77,8 +77,8 @@ var sectionId = 'dynsection-0';
|
||||
<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="M217.88,-121.82C173.84,-114.39 111.35,-102.23 58.12,-85.75 56.96,-85.39 55.79,-85.01 54.6,-84.6"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="56.03,-81.4 45.44,-81.13 53.55,-87.94 56.03,-81.4"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M248.89,-123.77C198.29,-117 122.26,-104.74 58.12,-85.75 56.78,-85.35 55.41,-84.92 54.04,-84.45"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="55.64,-81.32 45.05,-81.07 53.18,-87.87 55.64,-81.32"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -95,8 +95,8 @@ var sectionId = 'dynsection-0';
|
||||
<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="M235.73,-121.27C203.8,-113.26 157.39,-100.58 118.12,-85.75 117.5,-85.51 116.87,-85.27 116.24,-85.02"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="117.96,-81.95 107.39,-81.18 115.17,-88.37 117.96,-81.95"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M254.7,-121.32C216.59,-113.76 163.3,-101.67 118.12,-85.75 117.48,-85.52 116.83,-85.29 116.18,-85.04"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="117.6,-81.84 107.03,-81.16 114.87,-88.29 117.6,-81.84"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -105,7 +105,7 @@ var sectionId = 'dynsection-0';
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="172.75,-80.12 127.5,-80.12 127.5,-60.88 172.75,-60.88 172.75,-80.12"/>
|
||||
<text text-anchor="middle" x="150.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">cstring</text>
|
||||
<text text-anchor="middle" x="150.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -113,8 +113,8 @@ var sectionId = 'dynsection-0';
|
||||
<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="M255.02,-121.3C234.85,-111.73 202.79,-96.5 179.41,-85.41"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="180.95,-82.26 170.41,-81.13 177.95,-88.58 180.95,-82.26"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M277.78,-121.29C252.48,-112.7 213.95,-99.17 181.12,-85.75 180.51,-85.5 179.89,-85.24 179.26,-84.98"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="180.98,-81.91 170.42,-81.11 178.17,-88.32 180.98,-81.91"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -122,8 +122,8 @@ var sectionId = 'dynsection-0';
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="231.12,-80.12 191.12,-80.12 191.12,-60.88 231.12,-60.88 231.12,-80.12"/>
|
||||
<text text-anchor="middle" x="211.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">ctime</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="235.75,-80.12 190.5,-80.12 190.5,-60.88 235.75,-60.88 235.75,-80.12"/>
|
||||
<text text-anchor="middle" x="213.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">cstring</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -131,8 +131,8 @@ var sectionId = 'dynsection-0';
|
||||
<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="M264.56,-121.43C255.12,-112.62 240.47,-98.93 228.9,-88.11"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="231.59,-85.83 221.89,-81.56 226.81,-90.94 231.59,-85.83"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M291.15,-121.43C276.7,-112.18 253.87,-97.57 236.63,-86.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="238.81,-83.78 228.5,-81.34 235.04,-89.68 238.81,-83.78"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -140,8 +140,8 @@ var sectionId = 'dynsection-0';
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="298.62,-80.12 249.62,-80.12 249.62,-60.88 298.62,-60.88 298.62,-80.12"/>
|
||||
<text text-anchor="middle" x="274.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">fstream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="294.12,-80.12 254.12,-80.12 254.12,-60.88 294.12,-60.88 294.12,-80.12"/>
|
||||
<text text-anchor="middle" x="274.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">ctime</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -149,8 +149,8 @@ var sectionId = 'dynsection-0';
|
||||
<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="M274.12,-121.43C274.12,-113.65 274.12,-102.08 274.12,-92.03"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="277.63,-92.04 274.13,-82.04 270.63,-92.04 277.63,-92.04"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M300.42,-121.43C296.14,-113.31 289.68,-101.04 284.24,-90.7"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="287.34,-89.08 279.58,-81.87 281.14,-92.34 287.34,-89.08"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -158,8 +158,8 @@ var sectionId = 'dynsection-0';
|
||||
<g id="Node000007" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_Node000007"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="366,-80.12 316.25,-80.12 316.25,-60.88 366,-60.88 366,-80.12"/>
|
||||
<text text-anchor="middle" x="341.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">iomanip</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="361.62,-80.12 312.62,-80.12 312.62,-60.88 361.62,-60.88 361.62,-80.12"/>
|
||||
<text text-anchor="middle" x="337.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">fstream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -167,8 +167,8 @@ var sectionId = 'dynsection-0';
|
||||
<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="M284.3,-121.43C294.34,-112.62 309.91,-98.93 322.22,-88.11"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="324.51,-90.76 329.72,-81.53 319.89,-85.5 324.51,-90.76"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M309.99,-121.43C314.45,-113.22 321.21,-100.78 326.87,-90.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="329.8,-92.31 331.5,-81.86 323.65,-88.97 329.8,-92.31"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -176,8 +176,8 @@ var sectionId = 'dynsection-0';
|
||||
<g id="Node000008" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_Node000008"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="455.88,-19.25 402.38,-19.25 402.38,0 455.88,0 455.88,-19.25"/>
|
||||
<text text-anchor="middle" x="429.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="429,-80.12 379.25,-80.12 379.25,-60.88 429,-60.88 429,-80.12"/>
|
||||
<text text-anchor="middle" x="404.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">iomanip</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -185,8 +185,8 @@ var sectionId = 'dynsection-0';
|
||||
<g id="edge7_Node000001_Node000008" class="edge">
|
||||
<title>Node1->Node8</title>
|
||||
<g id="a_edge7_Node000001_Node000008"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M305.63,-121.3C326.84,-114.09 354.58,-102.42 375.12,-85.75 394.36,-70.14 410.02,-46.07 419.43,-29.4"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="422.28,-31.48 423.96,-21.01 416.13,-28.15 422.28,-31.48"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M320.16,-121.43C335.79,-112.14 360.51,-97.44 379.09,-86.39"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="380.84,-89.42 387.65,-81.3 377.26,-83.4 380.84,-89.42"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -194,8 +194,8 @@ var sectionId = 'dynsection-0';
|
||||
<g id="Node000009" class="node">
|
||||
<title>Node9</title>
|
||||
<g id="a_Node000009"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="462.12,-80.12 422.12,-80.12 422.12,-60.88 462.12,-60.88 462.12,-80.12"/>
|
||||
<text text-anchor="middle" x="442.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">string</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="518.88,-19.25 465.38,-19.25 465.38,0 518.88,0 518.88,-19.25"/>
|
||||
<text text-anchor="middle" x="492.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -203,18 +203,17 @@ var sectionId = 'dynsection-0';
|
||||
<g id="edge8_Node000001_Node000009" class="edge">
|
||||
<title>Node1->Node9</title>
|
||||
<g id="a_edge8_Node000001_Node000009"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M303.63,-121.26C330.93,-112.65 372.54,-99.11 408.12,-85.75 409.09,-85.39 410.08,-85.01 411.07,-84.63"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="412.35,-87.88 420.32,-80.91 409.74,-81.39 412.35,-87.88"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M355.36,-121.32C381.86,-114.71 413.82,-103.68 438.12,-85.75 458.27,-70.89 473.9,-46.28 483.05,-29.29"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="485.97,-31.26 487.42,-20.76 479.74,-28.07 485.97,-31.26"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node10 -->
|
||||
<g id="Node000010" class="node">
|
||||
<title>Node10</title>
|
||||
<g id="a_Node000010"><a xlink:href="../../d1/dbe/lu__decomposition_8h.html" target="_top" xlink:title="Functions associated with LU Decomposition of a square matrix.">
|
||||
<polygon fill="white" stroke="#666666" points="590,-85.75 480.25,-85.75 480.25,-55.25 590,-55.25 590,-85.75"/>
|
||||
<text text-anchor="start" x="488.25" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">../numerical_methods</text>
|
||||
<text text-anchor="middle" x="535.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">/lu_decomposition.h</text>
|
||||
<g id="a_Node000010"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="525.12,-80.12 485.12,-80.12 485.12,-60.88 525.12,-60.88 525.12,-80.12"/>
|
||||
<text text-anchor="middle" x="505.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">string</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -222,35 +221,36 @@ var sectionId = 'dynsection-0';
|
||||
<g id="edge9_Node000001_Node000010" class="edge">
|
||||
<title>Node1->Node10</title>
|
||||
<g id="a_edge9_Node000001_Node000010"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M314.33,-121.3C355.46,-112.03 420.05,-97.46 468.76,-86.47"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="469.38,-89.92 478.36,-84.3 467.84,-83.09 469.38,-89.92"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node10->Node8 -->
|
||||
<g id="edge10_Node000010_Node000008" class="edge">
|
||||
<title>Node10->Node8</title>
|
||||
<g id="a_edge10_Node000010_Node000008"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M508.65,-54.8C492.35,-45.74 471.55,-34.19 455.3,-25.16"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="457.15,-22.18 446.7,-20.39 453.75,-28.3 457.15,-22.18"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M344.82,-121.29C378.73,-113.16 428.63,-100.29 471.12,-85.75 472.11,-85.41 473.1,-85.06 474.1,-84.7"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="475.34,-87.98 483.39,-81.09 472.8,-81.45 475.34,-87.98"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node11 -->
|
||||
<g id="Node000011" class="node">
|
||||
<title>Node11</title>
|
||||
<g id="a_Node000011"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="527.38,-19.25 476.88,-19.25 476.88,0 527.38,0 527.38,-19.25"/>
|
||||
<text text-anchor="middle" x="502.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">valarray</text>
|
||||
<g id="a_Node000011"><a xlink:href="../../d1/dbe/lu__decomposition_8h.html" target="_top" xlink:title="Functions associated with LU Decomposition of a square matrix.">
|
||||
<polygon fill="white" stroke="#666666" points="653,-85.75 543.25,-85.75 543.25,-55.25 653,-55.25 653,-85.75"/>
|
||||
<text text-anchor="start" x="551.25" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">../numerical_methods</text>
|
||||
<text text-anchor="middle" x="598.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">/lu_decomposition.h</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node10->Node11 -->
|
||||
<g id="edge11_Node000010_Node000011" class="edge">
|
||||
<title>Node10->Node11</title>
|
||||
<g id="a_edge11_Node000010_Node000011"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M526.97,-54.95C522.67,-47.28 517.34,-37.77 512.73,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="515.89,-28.03 507.95,-21.02 509.79,-31.46 515.89,-28.03"/>
|
||||
<!-- Node1->Node11 -->
|
||||
<g id="edge10_Node000001_Node000011" class="edge">
|
||||
<title>Node1->Node11</title>
|
||||
<g id="a_edge10_Node000001_Node000011"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M353.89,-121.26C397.86,-112.96 464.57,-100.14 531.76,-86.21"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="532.43,-89.65 541.51,-84.18 531,-82.79 532.43,-89.65"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node11->Node9 -->
|
||||
<g id="edge11_Node000011_Node000009" class="edge">
|
||||
<title>Node11->Node9</title>
|
||||
<g id="a_edge11_Node000011_Node000009"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M571.65,-54.8C555.35,-45.74 534.55,-34.19 518.3,-25.16"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="520.15,-22.18 509.7,-20.39 516.75,-28.3 520.15,-22.18"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -258,17 +258,35 @@ var sectionId = 'dynsection-0';
|
||||
<g id="Node000012" class="node">
|
||||
<title>Node12</title>
|
||||
<g id="a_Node000012"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="588.62,-19.25 545.62,-19.25 545.62,0 588.62,0 588.62,-19.25"/>
|
||||
<text text-anchor="middle" x="567.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="590.38,-19.25 539.88,-19.25 539.88,0 590.38,0 590.38,-19.25"/>
|
||||
<text text-anchor="middle" x="565.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">valarray</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node10->Node12 -->
|
||||
<g id="edge12_Node000010_Node000012" class="edge">
|
||||
<title>Node10->Node12</title>
|
||||
<g id="a_edge12_Node000010_Node000012"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M543.04,-54.95C547.16,-47.36 552.25,-37.99 556.69,-29.82"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="559.77,-31.49 561.47,-21.03 553.62,-28.15 559.77,-31.49"/>
|
||||
<!-- Node11->Node12 -->
|
||||
<g id="edge12_Node000011_Node000012" class="edge">
|
||||
<title>Node11->Node12</title>
|
||||
<g id="a_edge12_Node000011_Node000012"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M589.97,-54.95C585.67,-47.28 580.34,-37.77 575.73,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="578.89,-28.03 570.95,-21.02 572.79,-31.46 578.89,-28.03"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node13 -->
|
||||
<g id="Node000013" class="node">
|
||||
<title>Node13</title>
|
||||
<g id="a_Node000013"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="651.62,-19.25 608.62,-19.25 608.62,0 651.62,0 651.62,-19.25"/>
|
||||
<text text-anchor="middle" x="630.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node11->Node13 -->
|
||||
<g id="edge13_Node000011_Node000013" class="edge">
|
||||
<title>Node11->Node13</title>
|
||||
<g id="a_edge13_Node000011_Node000013"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M606.04,-54.95C610.16,-47.36 615.25,-37.99 619.69,-29.82"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="622.77,-31.49 624.47,-21.03 616.62,-28.15 622.77,-31.49"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
@@ -4,16 +4,16 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: ciphers/hill_cipher.cpp Pages: 1 -->
|
||||
<svg width="598pt" height="149pt"
|
||||
viewBox="0.00 0.00 598.00 149.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="661pt" height="149pt"
|
||||
viewBox="0.00 0.00 661.00 149.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 145)">
|
||||
<title>ciphers/hill_cipher.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Implementation of Hill cipher algorithm.">
|
||||
<polygon fill="#999999" stroke="#666666" points="330.12,-141 218.12,-141 218.12,-121.75 330.12,-121.75 330.12,-141"/>
|
||||
<text text-anchor="middle" x="274.12" y="-127.5" font-family="Helvetica,sans-Serif" font-size="10.00">ciphers/hill_cipher.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="361.12,-141 249.12,-141 249.12,-121.75 361.12,-121.75 361.12,-141"/>
|
||||
<text text-anchor="middle" x="305.12" y="-127.5" font-family="Helvetica,sans-Serif" font-size="10.00">ciphers/hill_cipher.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="M217.88,-121.82C173.84,-114.39 111.35,-102.23 58.12,-85.75 56.96,-85.39 55.79,-85.01 54.6,-84.6"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="56.03,-81.4 45.44,-81.13 53.55,-87.94 56.03,-81.4"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M248.89,-123.77C198.29,-117 122.26,-104.74 58.12,-85.75 56.78,-85.35 55.41,-84.92 54.04,-84.45"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="55.64,-81.32 45.05,-81.07 53.18,-87.87 55.64,-81.32"/>
|
||||
</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="M235.73,-121.27C203.8,-113.26 157.39,-100.58 118.12,-85.75 117.5,-85.51 116.87,-85.27 116.24,-85.02"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="117.96,-81.95 107.39,-81.18 115.17,-88.37 117.96,-81.95"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M254.7,-121.32C216.59,-113.76 163.3,-101.67 118.12,-85.75 117.48,-85.52 116.83,-85.29 116.18,-85.04"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="117.6,-81.84 107.03,-81.16 114.87,-88.29 117.6,-81.84"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -58,7 +58,7 @@
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="172.75,-80.12 127.5,-80.12 127.5,-60.88 172.75,-60.88 172.75,-80.12"/>
|
||||
<text text-anchor="middle" x="150.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">cstring</text>
|
||||
<text text-anchor="middle" x="150.12" y="-66.62" 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="M255.02,-121.3C234.85,-111.73 202.79,-96.5 179.41,-85.41"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="180.95,-82.26 170.41,-81.13 177.95,-88.58 180.95,-82.26"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M277.78,-121.29C252.48,-112.7 213.95,-99.17 181.12,-85.75 180.51,-85.5 179.89,-85.24 179.26,-84.98"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="180.98,-81.91 170.42,-81.11 178.17,-88.32 180.98,-81.91"/>
|
||||
</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="231.12,-80.12 191.12,-80.12 191.12,-60.88 231.12,-60.88 231.12,-80.12"/>
|
||||
<text text-anchor="middle" x="211.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">ctime</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="235.75,-80.12 190.5,-80.12 190.5,-60.88 235.75,-60.88 235.75,-80.12"/>
|
||||
<text text-anchor="middle" x="213.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">cstring</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -84,8 +84,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="M264.56,-121.43C255.12,-112.62 240.47,-98.93 228.9,-88.11"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="231.59,-85.83 221.89,-81.56 226.81,-90.94 231.59,-85.83"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M291.15,-121.43C276.7,-112.18 253.87,-97.57 236.63,-86.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="238.81,-83.78 228.5,-81.34 235.04,-89.68 238.81,-83.78"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -93,8 +93,8 @@
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="298.62,-80.12 249.62,-80.12 249.62,-60.88 298.62,-60.88 298.62,-80.12"/>
|
||||
<text text-anchor="middle" x="274.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">fstream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="294.12,-80.12 254.12,-80.12 254.12,-60.88 294.12,-60.88 294.12,-80.12"/>
|
||||
<text text-anchor="middle" x="274.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">ctime</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -102,8 +102,8 @@
|
||||
<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="M274.12,-121.43C274.12,-113.65 274.12,-102.08 274.12,-92.03"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="277.63,-92.04 274.13,-82.04 270.63,-92.04 277.63,-92.04"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M300.42,-121.43C296.14,-113.31 289.68,-101.04 284.24,-90.7"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="287.34,-89.08 279.58,-81.87 281.14,-92.34 287.34,-89.08"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -111,8 +111,8 @@
|
||||
<g id="Node000007" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_Node000007"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="366,-80.12 316.25,-80.12 316.25,-60.88 366,-60.88 366,-80.12"/>
|
||||
<text text-anchor="middle" x="341.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">iomanip</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="361.62,-80.12 312.62,-80.12 312.62,-60.88 361.62,-60.88 361.62,-80.12"/>
|
||||
<text text-anchor="middle" x="337.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">fstream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -120,8 +120,8 @@
|
||||
<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="M284.3,-121.43C294.34,-112.62 309.91,-98.93 322.22,-88.11"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="324.51,-90.76 329.72,-81.53 319.89,-85.5 324.51,-90.76"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M309.99,-121.43C314.45,-113.22 321.21,-100.78 326.87,-90.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="329.8,-92.31 331.5,-81.86 323.65,-88.97 329.8,-92.31"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -129,8 +129,8 @@
|
||||
<g id="Node000008" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_Node000008"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="455.88,-19.25 402.38,-19.25 402.38,0 455.88,0 455.88,-19.25"/>
|
||||
<text text-anchor="middle" x="429.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="429,-80.12 379.25,-80.12 379.25,-60.88 429,-60.88 429,-80.12"/>
|
||||
<text text-anchor="middle" x="404.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">iomanip</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -138,8 +138,8 @@
|
||||
<g id="edge7_Node000001_Node000008" class="edge">
|
||||
<title>Node1->Node8</title>
|
||||
<g id="a_edge7_Node000001_Node000008"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M305.63,-121.3C326.84,-114.09 354.58,-102.42 375.12,-85.75 394.36,-70.14 410.02,-46.07 419.43,-29.4"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="422.28,-31.48 423.96,-21.01 416.13,-28.15 422.28,-31.48"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M320.16,-121.43C335.79,-112.14 360.51,-97.44 379.09,-86.39"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="380.84,-89.42 387.65,-81.3 377.26,-83.4 380.84,-89.42"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -147,8 +147,8 @@
|
||||
<g id="Node000009" class="node">
|
||||
<title>Node9</title>
|
||||
<g id="a_Node000009"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="462.12,-80.12 422.12,-80.12 422.12,-60.88 462.12,-60.88 462.12,-80.12"/>
|
||||
<text text-anchor="middle" x="442.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">string</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="518.88,-19.25 465.38,-19.25 465.38,0 518.88,0 518.88,-19.25"/>
|
||||
<text text-anchor="middle" x="492.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -156,18 +156,17 @@
|
||||
<g id="edge8_Node000001_Node000009" class="edge">
|
||||
<title>Node1->Node9</title>
|
||||
<g id="a_edge8_Node000001_Node000009"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M303.63,-121.26C330.93,-112.65 372.54,-99.11 408.12,-85.75 409.09,-85.39 410.08,-85.01 411.07,-84.63"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="412.35,-87.88 420.32,-80.91 409.74,-81.39 412.35,-87.88"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M355.36,-121.32C381.86,-114.71 413.82,-103.68 438.12,-85.75 458.27,-70.89 473.9,-46.28 483.05,-29.29"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="485.97,-31.26 487.42,-20.76 479.74,-28.07 485.97,-31.26"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node10 -->
|
||||
<g id="Node000010" class="node">
|
||||
<title>Node10</title>
|
||||
<g id="a_Node000010"><a xlink:href="../../d1/dbe/lu__decomposition_8h.html" target="_top" xlink:title="Functions associated with LU Decomposition of a square matrix.">
|
||||
<polygon fill="white" stroke="#666666" points="590,-85.75 480.25,-85.75 480.25,-55.25 590,-55.25 590,-85.75"/>
|
||||
<text text-anchor="start" x="488.25" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">../numerical_methods</text>
|
||||
<text text-anchor="middle" x="535.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">/lu_decomposition.h</text>
|
||||
<g id="a_Node000010"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="525.12,-80.12 485.12,-80.12 485.12,-60.88 525.12,-60.88 525.12,-80.12"/>
|
||||
<text text-anchor="middle" x="505.12" y="-66.62" font-family="Helvetica,sans-Serif" font-size="10.00">string</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -175,35 +174,36 @@
|
||||
<g id="edge9_Node000001_Node000010" class="edge">
|
||||
<title>Node1->Node10</title>
|
||||
<g id="a_edge9_Node000001_Node000010"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M314.33,-121.3C355.46,-112.03 420.05,-97.46 468.76,-86.47"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="469.38,-89.92 478.36,-84.3 467.84,-83.09 469.38,-89.92"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node10->Node8 -->
|
||||
<g id="edge10_Node000010_Node000008" class="edge">
|
||||
<title>Node10->Node8</title>
|
||||
<g id="a_edge10_Node000010_Node000008"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M508.65,-54.8C492.35,-45.74 471.55,-34.19 455.3,-25.16"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="457.15,-22.18 446.7,-20.39 453.75,-28.3 457.15,-22.18"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M344.82,-121.29C378.73,-113.16 428.63,-100.29 471.12,-85.75 472.11,-85.41 473.1,-85.06 474.1,-84.7"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="475.34,-87.98 483.39,-81.09 472.8,-81.45 475.34,-87.98"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node11 -->
|
||||
<g id="Node000011" class="node">
|
||||
<title>Node11</title>
|
||||
<g id="a_Node000011"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="527.38,-19.25 476.88,-19.25 476.88,0 527.38,0 527.38,-19.25"/>
|
||||
<text text-anchor="middle" x="502.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">valarray</text>
|
||||
<g id="a_Node000011"><a xlink:href="../../d1/dbe/lu__decomposition_8h.html" target="_top" xlink:title="Functions associated with LU Decomposition of a square matrix.">
|
||||
<polygon fill="white" stroke="#666666" points="653,-85.75 543.25,-85.75 543.25,-55.25 653,-55.25 653,-85.75"/>
|
||||
<text text-anchor="start" x="551.25" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">../numerical_methods</text>
|
||||
<text text-anchor="middle" x="598.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">/lu_decomposition.h</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node10->Node11 -->
|
||||
<g id="edge11_Node000010_Node000011" class="edge">
|
||||
<title>Node10->Node11</title>
|
||||
<g id="a_edge11_Node000010_Node000011"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M526.97,-54.95C522.67,-47.28 517.34,-37.77 512.73,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="515.89,-28.03 507.95,-21.02 509.79,-31.46 515.89,-28.03"/>
|
||||
<!-- Node1->Node11 -->
|
||||
<g id="edge10_Node000001_Node000011" class="edge">
|
||||
<title>Node1->Node11</title>
|
||||
<g id="a_edge10_Node000001_Node000011"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M353.89,-121.26C397.86,-112.96 464.57,-100.14 531.76,-86.21"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="532.43,-89.65 541.51,-84.18 531,-82.79 532.43,-89.65"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node11->Node9 -->
|
||||
<g id="edge11_Node000011_Node000009" class="edge">
|
||||
<title>Node11->Node9</title>
|
||||
<g id="a_edge11_Node000011_Node000009"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M571.65,-54.8C555.35,-45.74 534.55,-34.19 518.3,-25.16"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="520.15,-22.18 509.7,-20.39 516.75,-28.3 520.15,-22.18"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -211,17 +211,35 @@
|
||||
<g id="Node000012" class="node">
|
||||
<title>Node12</title>
|
||||
<g id="a_Node000012"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="588.62,-19.25 545.62,-19.25 545.62,0 588.62,0 588.62,-19.25"/>
|
||||
<text text-anchor="middle" x="567.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="590.38,-19.25 539.88,-19.25 539.88,0 590.38,0 590.38,-19.25"/>
|
||||
<text text-anchor="middle" x="565.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">valarray</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node10->Node12 -->
|
||||
<g id="edge12_Node000010_Node000012" class="edge">
|
||||
<title>Node10->Node12</title>
|
||||
<g id="a_edge12_Node000010_Node000012"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M543.04,-54.95C547.16,-47.36 552.25,-37.99 556.69,-29.82"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="559.77,-31.49 561.47,-21.03 553.62,-28.15 559.77,-31.49"/>
|
||||
<!-- Node11->Node12 -->
|
||||
<g id="edge12_Node000011_Node000012" class="edge">
|
||||
<title>Node11->Node12</title>
|
||||
<g id="a_edge12_Node000011_Node000012"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M589.97,-54.95C585.67,-47.28 580.34,-37.77 575.73,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="578.89,-28.03 570.95,-21.02 572.79,-31.46 578.89,-28.03"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node13 -->
|
||||
<g id="Node000013" class="node">
|
||||
<title>Node13</title>
|
||||
<g id="a_Node000013"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="651.62,-19.25 608.62,-19.25 608.62,0 651.62,0 651.62,-19.25"/>
|
||||
<text text-anchor="middle" x="630.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node11->Node13 -->
|
||||
<g id="edge13_Node000011_Node000013" class="edge">
|
||||
<title>Node11->Node13</title>
|
||||
<g id="a_edge13_Node000011_Node000013"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M606.04,-54.95C610.16,-47.36 615.25,-37.99 619.69,-29.82"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="622.77,-31.49 624.47,-21.03 616.62,-28.15 622.77,-31.49"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 11 KiB |
@@ -114,18 +114,19 @@ $(function(){initNavTree('d3/d22/saddleback__search_8cpp.html','../../'); initRe
|
||||
<p>Implementation of <a href="https://www.geeksforgeeks.org/saddleback-search-algorithm-in-a-2d-array" target="_blank">Saddleback Algorithm</a> for 2D arrays.
|
||||
<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 saddleback_search.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../de/d4c/saddleback__search_8cpp__incl.svg" width="252" 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="../../de/d4c/saddleback__search_8cpp__incl.svg" width="336" 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="../../d9/dca/namespacesearch.html">search</a></td></tr>
|
||||
<tr class="memdesc:d9/dca/namespacesearch"><td class="mdescLeft"> </td><td class="mdescRight">for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a> <br /></td></tr>
|
||||
<tr class="memdesc:d9/dca/namespacesearch"><td class="mdescLeft"> </td><td class="mdescRight">for std::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="../../d0/dda/namespacesaddleback.html">saddleback</a></td></tr>
|
||||
<tr class="memdesc:d0/dda/namespacesaddleback"><td class="mdescLeft"> </td><td class="mdescRight">Function for implementing <a href="https://www.geeksforgeeks.org/saddleback-search-algorithm-in-a-2d-array" target="_blank">Saddleback Algorithm</a>. <br /></td></tr>
|
||||
@@ -164,11 +165,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"> 103</span> {</div>
|
||||
<div class="line"><span class="lineno"> 104</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// execute the tests</span></div>
|
||||
<div class="line"><span class="lineno"> 105</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 106</span>}</div>
|
||||
<div class="ttc" id="asaddleback__search_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Test implementations.</div><div class="ttdef"><b>Definition</b> saddleback_search.cpp:70</div></div>
|
||||
<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="asaddleback__search_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Test implementations.</div><div class="ttdef"><b>Definition</b> saddleback_search.cpp:78</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -205,35 +206,37 @@ Here is the call graph for this function:</div>
|
||||
<dl class="section return"><dt>Returns</dt><dd>An <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a> of with row and column populated within it, if the element is present. </dd>
|
||||
<dd>
|
||||
An <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a> with (0, 0), if the element is not present. </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 34</span> {</div>
|
||||
<div class="line"><span class="lineno"> 35</span> uint32_t left_index = 0;</div>
|
||||
<div class="line"><span class="lineno"> 36</span> uint32_t right_index = <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>[0].<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() - 1; <span class="comment">// Start from top right corner</span></div>
|
||||
<div class="line"><span class="lineno"> 37</span> <span class="keywordflow">while</span> (left_index < <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>()) { <span class="comment">// Exit once the value of indexes get out of range.</span></div>
|
||||
<div class="line"><span class="lineno"> 38</span> <span class="keywordflow">if</span> (element ==</div>
|
||||
<div class="line"><span class="lineno"> 39</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>[left_index]</div>
|
||||
<div class="line"><span class="lineno"> 40</span> [right_index]) { <span class="comment">// If value on this position of matrix is</span></div>
|
||||
<div class="line"><span class="lineno"> 41</span> <span class="comment">// equal to element, return (row, column).</span></div>
|
||||
<div class="line"><span class="lineno"> 42</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(left_index+1, right_index+1);</div>
|
||||
<div class="line"><span class="lineno"> 43</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (element ></div>
|
||||
<div class="line"><span class="lineno"> 44</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>[left_index]</div>
|
||||
<div class="line"><span class="lineno"> 45</span> [right_index]) { <span class="comment">// Else if value on this position of</span></div>
|
||||
<div class="line"><span class="lineno"> 46</span> <span class="comment">// matrix is less than the element,</span></div>
|
||||
<div class="line"><span class="lineno"> 47</span> <span class="comment">// move left.</span></div>
|
||||
<div class="line"><span class="lineno"> 48</span> ++left_index;</div>
|
||||
<div class="line"><span class="lineno"> 49</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (element <</div>
|
||||
<div class="line"><span class="lineno"> 50</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>[left_index]</div>
|
||||
<div class="line"><span class="lineno"> 51</span> [right_index]) { <span class="comment">// Else if value on this position of</span></div>
|
||||
<div class="line"><span class="lineno"> 52</span> <span class="comment">// matrix is greater than the</span></div>
|
||||
<div class="line"><span class="lineno"> 53</span> <span class="comment">// element, move down.</span></div>
|
||||
<div class="line"><span class="lineno"> 54</span> <span class="keywordflow">if</span>(!right_index)</div>
|
||||
<div class="line"><span class="lineno"> 55</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><span class="lineno"> 56</span> <span class="keywordflow">else</span> --right_index;</div>
|
||||
<div class="line"><span class="lineno"> 57</span> }</div>
|
||||
<div class="line"><span class="lineno"> 58</span> }</div>
|
||||
<div class="line"><span class="lineno"> 59</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(</div>
|
||||
<div class="line"><span class="lineno"> 60</span> 0, 0); <span class="comment">// If the program reaches here, that means one of the index</span></div>
|
||||
<div class="line"><span class="lineno"> 61</span> <span class="comment">// went out of index, hence no element present.</span></div>
|
||||
<div class="line"><span class="lineno"> 62</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 40</span> {</div>
|
||||
<div class="line"><span class="lineno"> 41</span> uint32_t left_index = 0;</div>
|
||||
<div class="line"><span class="lineno"> 42</span> uint32_t right_index = <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>[0].<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() - 1; <span class="comment">// Start from top right corner</span></div>
|
||||
<div class="line"><span class="lineno"> 43</span> <span class="keywordflow">while</span> (left_index <</div>
|
||||
<div class="line"><span class="lineno"> 44</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>()) { <span class="comment">// Exit once the value of indexes get out of range.</span></div>
|
||||
<div class="line"><span class="lineno"> 45</span> <span class="keywordflow">if</span> (element ==</div>
|
||||
<div class="line"><span class="lineno"> 46</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>[left_index]</div>
|
||||
<div class="line"><span class="lineno"> 47</span> [right_index]) { <span class="comment">// If value on this position of matrix is</span></div>
|
||||
<div class="line"><span class="lineno"> 48</span> <span class="comment">// equal to element, return (row, column).</span></div>
|
||||
<div class="line"><span class="lineno"> 49</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(left_index + 1, right_index + 1);</div>
|
||||
<div class="line"><span class="lineno"> 50</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (element ></div>
|
||||
<div class="line"><span class="lineno"> 51</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>[left_index]</div>
|
||||
<div class="line"><span class="lineno"> 52</span> [right_index]) { <span class="comment">// Else if value on this position of</span></div>
|
||||
<div class="line"><span class="lineno"> 53</span> <span class="comment">// matrix is less than the element,</span></div>
|
||||
<div class="line"><span class="lineno"> 54</span> <span class="comment">// move left.</span></div>
|
||||
<div class="line"><span class="lineno"> 55</span> ++left_index;</div>
|
||||
<div class="line"><span class="lineno"> 56</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (element <</div>
|
||||
<div class="line"><span class="lineno"> 57</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>[left_index]</div>
|
||||
<div class="line"><span class="lineno"> 58</span> [right_index]) { <span class="comment">// Else if value on this position of</span></div>
|
||||
<div class="line"><span class="lineno"> 59</span> <span class="comment">// matrix is greater than the</span></div>
|
||||
<div class="line"><span class="lineno"> 60</span> <span class="comment">// element, move down.</span></div>
|
||||
<div class="line"><span class="lineno"> 61</span> <span class="keywordflow">if</span> (!right_index)</div>
|
||||
<div class="line"><span class="lineno"> 62</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><span class="lineno"> 63</span> <span class="keywordflow">else</span></div>
|
||||
<div class="line"><span class="lineno"> 64</span> --right_index;</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> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(</div>
|
||||
<div class="line"><span class="lineno"> 68</span> 0, 0); <span class="comment">// If the program reaches here, that means one of the index</span></div>
|
||||
<div class="line"><span class="lineno"> 69</span> <span class="comment">// went out of index, hence no element present.</span></div>
|
||||
<div class="line"><span class="lineno"> 70</span>}</div>
|
||||
<div class="ttc" id="amake_pair_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a></div><div class="ttdeci">T make_pair(T... args)</div></div>
|
||||
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/size.html">std::vector::size</a></div><div class="ttdeci">T size(T... args)</div></div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
|
||||
@@ -270,36 +273,37 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Test implementations. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 70</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<std::vector<int32_t></a>> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a> = {{1, 10, 100, 1000, 10000},</div>
|
||||
<div class="line"><span class="lineno"> 72</span> {2, 20, 200, 2000, 20000},</div>
|
||||
<div class="line"><span class="lineno"> 73</span> {3, 30, 300, 3000, 30000},</div>
|
||||
<div class="line"><span class="lineno"> 74</span> {4, 40, 400, 4000, 40000},</div>
|
||||
<div class="line"><span class="lineno"> 75</span> {5, 50, 500, 5000, 50000}};</div>
|
||||
<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/utility/pair.html">std::pair<uint32_t, uint32_t></a> not_found = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(0, 0);</div>
|
||||
<div class="line"><span class="lineno"> 78</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<uint32_t, uint32_t></a> test_answer;</div>
|
||||
<div class="line"><span class="lineno"> 79</span> <span class="comment">// Test 1</span></div>
|
||||
<div class="line"><span class="lineno"> 80</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<uint32_t, uint32_t></a> answer1 = <a class="code hl_function" href="#ad1e0ca34797d88490747c08eca70a2e6">search::saddleback::saddleback</a>(<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>, 123);</div>
|
||||
<div class="line"><span class="lineno"> 81</span> assert(not_found == answer1);</div>
|
||||
<div class="line"><span class="lineno"> 82</span> <span class="comment">// Test 2</span></div>
|
||||
<div class="line"><span class="lineno"> 83</span> answer1 = <a class="code hl_function" href="#ad1e0ca34797d88490747c08eca70a2e6">search::saddleback::saddleback</a>(<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>, 0);</div>
|
||||
<div class="line"><span class="lineno"> 84</span> assert(not_found == answer1);</div>
|
||||
<div class="line"><span class="lineno"> 85</span> <span class="comment">// Test 3</span></div>
|
||||
<div class="line"><span class="lineno"> 86</span> answer1 = <a class="code hl_function" href="#ad1e0ca34797d88490747c08eca70a2e6">search::saddleback::saddleback</a>(<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>, 1);</div>
|
||||
<div class="line"><span class="lineno"> 87</span> test_answer = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(1, 1);</div>
|
||||
<div class="line"><span class="lineno"> 88</span> assert(test_answer == answer1);</div>
|
||||
<div class="line"><span class="lineno"> 89</span> <span class="comment">// Test 4</span></div>
|
||||
<div class="line"><span class="lineno"> 90</span> answer1 = <a class="code hl_function" href="#ad1e0ca34797d88490747c08eca70a2e6">search::saddleback::saddleback</a>(<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>, 50000);</div>
|
||||
<div class="line"><span class="lineno"> 91</span> test_answer = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(5, 5);</div>
|
||||
<div class="line"><span class="lineno"> 92</span> assert(test_answer == answer1);</div>
|
||||
<div class="line"><span class="lineno"> 93</span> <span class="comment">// Test 5</span></div>
|
||||
<div class="line"><span class="lineno"> 94</span> answer1 = <a class="code hl_function" href="#ad1e0ca34797d88490747c08eca70a2e6">search::saddleback::saddleback</a>(<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>, 300);</div>
|
||||
<div class="line"><span class="lineno"> 95</span> test_answer = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(3, 3);</div>
|
||||
<div class="line"><span class="lineno"> 96</span> assert(test_answer == answer1);</div>
|
||||
<div class="line"><span class="lineno"> 97</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 78</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<std::vector<int32_t></a>> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a> = {{1, 10, 100, 1000, 10000},</div>
|
||||
<div class="line"><span class="lineno"> 80</span> {2, 20, 200, 2000, 20000},</div>
|
||||
<div class="line"><span class="lineno"> 81</span> {3, 30, 300, 3000, 30000},</div>
|
||||
<div class="line"><span class="lineno"> 82</span> {4, 40, 400, 4000, 40000},</div>
|
||||
<div class="line"><span class="lineno"> 83</span> {5, 50, 500, 5000, 50000}};</div>
|
||||
<div class="line"><span class="lineno"> 84</span> </div>
|
||||
<div class="line"><span class="lineno"> 85</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<uint32_t, uint32_t></a> not_found = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(0, 0);</div>
|
||||
<div class="line"><span class="lineno"> 86</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<uint32_t, uint32_t></a> test_answer;</div>
|
||||
<div class="line"><span class="lineno"> 87</span> <span class="comment">// Test 1</span></div>
|
||||
<div class="line"><span class="lineno"> 88</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<uint32_t, uint32_t></a> answer1 =</div>
|
||||
<div class="line"><span class="lineno"> 89</span> <a class="code hl_function" href="#ad1e0ca34797d88490747c08eca70a2e6">search::saddleback::saddleback</a>(<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>, 123);</div>
|
||||
<div class="line"><span class="lineno"> 90</span> assert(not_found == answer1);</div>
|
||||
<div class="line"><span class="lineno"> 91</span> <span class="comment">// Test 2</span></div>
|
||||
<div class="line"><span class="lineno"> 92</span> answer1 = <a class="code hl_function" href="#ad1e0ca34797d88490747c08eca70a2e6">search::saddleback::saddleback</a>(<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>, 0);</div>
|
||||
<div class="line"><span class="lineno"> 93</span> assert(not_found == answer1);</div>
|
||||
<div class="line"><span class="lineno"> 94</span> <span class="comment">// Test 3</span></div>
|
||||
<div class="line"><span class="lineno"> 95</span> answer1 = <a class="code hl_function" href="#ad1e0ca34797d88490747c08eca70a2e6">search::saddleback::saddleback</a>(<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>, 1);</div>
|
||||
<div class="line"><span class="lineno"> 96</span> test_answer = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(1, 1);</div>
|
||||
<div class="line"><span class="lineno"> 97</span> assert(test_answer == answer1);</div>
|
||||
<div class="line"><span class="lineno"> 98</span> <span class="comment">// Test 4</span></div>
|
||||
<div class="line"><span class="lineno"> 99</span> answer1 = <a class="code hl_function" href="#ad1e0ca34797d88490747c08eca70a2e6">search::saddleback::saddleback</a>(<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>, 50000);</div>
|
||||
<div class="line"><span class="lineno"> 100</span> test_answer = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(5, 5);</div>
|
||||
<div class="line"><span class="lineno"> 101</span> assert(test_answer == answer1);</div>
|
||||
<div class="line"><span class="lineno"> 102</span> <span class="comment">// Test 5</span></div>
|
||||
<div class="line"><span class="lineno"> 103</span> answer1 = <a class="code hl_function" href="#ad1e0ca34797d88490747c08eca70a2e6">search::saddleback::saddleback</a>(<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix</a>, 300);</div>
|
||||
<div class="line"><span class="lineno"> 104</span> test_answer = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(3, 3);</div>
|
||||
<div class="line"><span class="lineno"> 105</span> assert(test_answer == answer1);</div>
|
||||
<div class="line"><span class="lineno"> 106</span>}</div>
|
||||
<div class="ttc" id="apair_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a></div></div>
|
||||
<div class="ttc" id="asaddleback__search_8cpp_html_ad1e0ca34797d88490747c08eca70a2e6"><div class="ttname"><a href="#ad1e0ca34797d88490747c08eca70a2e6">search::saddleback::saddleback</a></div><div class="ttdeci">std::pair< uint32_t, uint32_t > saddleback(std::vector< std::vector< int32_t > > matrix, int32_t element)</div><div class="ttdef"><b>Definition</b> saddleback_search.cpp:33</div></div>
|
||||
<div class="ttc" id="asaddleback__search_8cpp_html_ad1e0ca34797d88490747c08eca70a2e6"><div class="ttname"><a href="#ad1e0ca34797d88490747c08eca70a2e6">search::saddleback::saddleback</a></div><div class="ttdeci">std::pair< uint32_t, uint32_t > saddleback(std::vector< std::vector< int32_t > > matrix, int32_t element)</div><div class="ttdef"><b>Definition</b> saddleback_search.cpp:39</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
|
||||
@@ -418,7 +418,7 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><span class="lineno"> 210</span> </div>
|
||||
<div class="line"><span class="lineno"> 211</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"> 212</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="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="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
<map id="sorting/wiggle_sort.cpp" name="sorting/wiggle_sort.cpp">
|
||||
<area shape="rect" id="Node000001" title="[Wiggle Sort Algorithm] (https://leetcode.com/problems/wiggle-sort-ii/) Implementation" alt="" coords="141,5,296,31"/>
|
||||
<area shape="rect" id="Node000001" title="[Wiggle Sort Algorithm] (https://leetcode.com/problems/wiggle-sort-ii/) Implementation" alt="" coords="185,5,340,31"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="5,79,80,105"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="190,34,87,75,85,70,188,29"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="226,34,95,76,93,71,224,29"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="104,79,168,105"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="206,34,163,71,159,67,203,30"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="192,79,245,105"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="221,31,221,63,216,63,216,31"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="270,79,341,105"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="235,29,281,67,277,71,232,34"/>
|
||||
<area shape="rect" id="Node000006" title=" " alt="" coords="364,79,422,105"/>
|
||||
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="249,29,351,70,349,75,247,34"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="242,34,172,73,169,69,240,29"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="192,79,253,105"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="258,33,239,67,234,64,254,30"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="277,79,330,105"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="272,30,292,64,287,67,267,33"/>
|
||||
<area shape="rect" id="Node000006" title=" " alt="" coords="355,79,426,105"/>
|
||||
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="286,29,357,69,354,73,283,34"/>
|
||||
<area shape="rect" id="Node000007" title=" " alt="" coords="450,79,507,105"/>
|
||||
<area shape="poly" id="edge6_Node000001_Node000007" title=" " alt="" coords="300,29,436,74,434,79,298,34"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
d77d9a15db4b2cc46df759ac220e1367
|
||||
4b656474ef6a70465ad4fb6a648ac076
|
||||
@@ -4,8 +4,8 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: sorting/wiggle_sort.cpp Pages: 1 -->
|
||||
<svg width="320pt" height="83pt"
|
||||
viewBox="0.00 0.00 320.38 82.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="384pt" height="83pt"
|
||||
viewBox="0.00 0.00 384.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="[Wiggle Sort Algorithm] (https://leetcode.com/problems/wiggle-sort-ii/) Implementation">
|
||||
<polygon fill="#999999" stroke="#666666" points="218.12,-74.5 101.62,-74.5 101.62,-55.25 218.12,-55.25 218.12,-74.5"/>
|
||||
<text text-anchor="middle" x="159.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">sorting/wiggle_sort.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="251.12,-74.5 134.62,-74.5 134.62,-55.25 251.12,-55.25 251.12,-74.5"/>
|
||||
<text text-anchor="middle" x="192.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">sorting/wiggle_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="M137.48,-54.84C116.43,-46.35 84.67,-33.54 60.75,-23.89"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="62.36,-20.76 51.78,-20.27 59.74,-27.26 62.36,-20.76"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M164.88,-54.84C137.86,-46.12 96.72,-32.84 66.57,-23.11"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="68.03,-19.91 57.44,-20.17 65.88,-26.57 68.03,-19.91"/>
|
||||
</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="M149.36,-54.84C140.49,-47.22 127.56,-36.12 116.89,-26.95"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="119.25,-24.37 109.39,-20.51 114.69,-29.68 119.25,-24.37"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M176.76,-54.84C162.29,-46.73 140.8,-34.68 123.89,-25.21"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="125.82,-22.28 115.39,-20.44 122.4,-28.39 125.82,-22.28"/>
|
||||
</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="179.88,-19.25 139.88,-19.25 139.88,0 179.88,0 179.88,-19.25"/>
|
||||
<text text-anchor="middle" x="159.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">ctime</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="M159.88,-55.08C159.88,-48.57 159.88,-39.42 159.88,-31.12"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="163.38,-31.12 159.88,-21.12 156.38,-31.12 163.38,-31.12"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M187.92,-55.08C183.99,-48.11 178.36,-38.12 173.44,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="176.64,-27.92 168.68,-20.93 170.54,-31.36 176.64,-27.92"/>
|
||||
</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="251.62,-19.25 198.12,-19.25 198.12,0 251.62,0 251.62,-19.25"/>
|
||||
<text text-anchor="middle" x="224.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="243.88,-19.25 203.88,-19.25 203.88,0 243.88,0 243.88,-19.25"/>
|
||||
<text text-anchor="middle" x="223.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">ctime</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -95,8 +95,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="M170.9,-54.84C180.3,-47.15 194.02,-35.9 205.28,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="207.32,-29.53 212.84,-20.48 202.89,-24.11 207.32,-29.53"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M197.99,-55.08C202.05,-48.11 207.87,-38.12 212.96,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="215.88,-31.32 217.88,-20.92 209.83,-27.8 215.88,-31.32"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -104,8 +104,8 @@
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="312.38,-19.25 269.38,-19.25 269.38,0 312.38,0 312.38,-19.25"/>
|
||||
<text text-anchor="middle" x="290.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="315.62,-19.25 262.12,-19.25 262.12,0 315.62,0 315.62,-19.25"/>
|
||||
<text text-anchor="middle" x="288.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -113,8 +113,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="M182.1,-54.84C203.02,-46.34 234.6,-33.5 258.36,-23.84"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="259.63,-27.1 267.58,-20.09 257,-20.62 259.63,-27.1"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M209.16,-54.84C223.78,-46.73 245.5,-34.68 262.58,-25.21"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="264.14,-28.35 271.19,-20.44 260.74,-22.23 264.14,-28.35"/>
|
||||
</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="376.38,-19.25 333.38,-19.25 333.38,0 376.38,0 376.38,-19.25"/>
|
||||
<text text-anchor="middle" x="354.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="M220.36,-54.84C248.53,-45.58 292.35,-31.18 322.26,-21.35"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="323.14,-24.74 331.55,-18.29 320.95,-18.09 323.14,-24.74"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 6.1 KiB |
@@ -4,16 +4,16 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: sorting/wiggle_sort.cpp Pages: 1 -->
|
||||
<svg width="320pt" height="83pt"
|
||||
viewBox="0.00 0.00 320.38 82.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="384pt" height="83pt"
|
||||
viewBox="0.00 0.00 384.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/wiggle_sort.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="[Wiggle Sort Algorithm] (https://leetcode.com/problems/wiggle-sort-ii/) Implementation">
|
||||
<polygon fill="#999999" stroke="#666666" points="218.12,-74.5 101.62,-74.5 101.62,-55.25 218.12,-55.25 218.12,-74.5"/>
|
||||
<text text-anchor="middle" x="159.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">sorting/wiggle_sort.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="251.12,-74.5 134.62,-74.5 134.62,-55.25 251.12,-55.25 251.12,-74.5"/>
|
||||
<text text-anchor="middle" x="192.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">sorting/wiggle_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="M137.48,-54.84C116.43,-46.35 84.67,-33.54 60.75,-23.89"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="62.36,-20.76 51.78,-20.27 59.74,-27.26 62.36,-20.76"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M164.88,-54.84C137.86,-46.12 96.72,-32.84 66.57,-23.11"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="68.03,-19.91 57.44,-20.17 65.88,-26.57 68.03,-19.91"/>
|
||||
</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="M149.36,-54.84C140.49,-47.22 127.56,-36.12 116.89,-26.95"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="119.25,-24.37 109.39,-20.51 114.69,-29.68 119.25,-24.37"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M176.76,-54.84C162.29,-46.73 140.8,-34.68 123.89,-25.21"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="125.82,-22.28 115.39,-20.44 122.4,-28.39 125.82,-22.28"/>
|
||||
</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="179.88,-19.25 139.88,-19.25 139.88,0 179.88,0 179.88,-19.25"/>
|
||||
<text text-anchor="middle" x="159.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">ctime</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="M159.88,-55.08C159.88,-48.57 159.88,-39.42 159.88,-31.12"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="163.38,-31.12 159.88,-21.12 156.38,-31.12 163.38,-31.12"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M187.92,-55.08C183.99,-48.11 178.36,-38.12 173.44,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="176.64,-27.92 168.68,-20.93 170.54,-31.36 176.64,-27.92"/>
|
||||
</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="251.62,-19.25 198.12,-19.25 198.12,0 251.62,0 251.62,-19.25"/>
|
||||
<text text-anchor="middle" x="224.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="243.88,-19.25 203.88,-19.25 203.88,0 243.88,0 243.88,-19.25"/>
|
||||
<text text-anchor="middle" x="223.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">ctime</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -84,8 +84,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="M170.9,-54.84C180.3,-47.15 194.02,-35.9 205.28,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="207.32,-29.53 212.84,-20.48 202.89,-24.11 207.32,-29.53"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M197.99,-55.08C202.05,-48.11 207.87,-38.12 212.96,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="215.88,-31.32 217.88,-20.92 209.83,-27.8 215.88,-31.32"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -93,8 +93,8 @@
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="312.38,-19.25 269.38,-19.25 269.38,0 312.38,0 312.38,-19.25"/>
|
||||
<text text-anchor="middle" x="290.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="315.62,-19.25 262.12,-19.25 262.12,0 315.62,0 315.62,-19.25"/>
|
||||
<text text-anchor="middle" x="288.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -102,8 +102,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="M182.1,-54.84C203.02,-46.34 234.6,-33.5 258.36,-23.84"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="259.63,-27.1 267.58,-20.09 257,-20.62 259.63,-27.1"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M209.16,-54.84C223.78,-46.73 245.5,-34.68 262.58,-25.21"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="264.14,-28.35 271.19,-20.44 260.74,-22.23 264.14,-28.35"/>
|
||||
</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="376.38,-19.25 333.38,-19.25 333.38,0 376.38,0 376.38,-19.25"/>
|
||||
<text text-anchor="middle" x="354.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="M220.36,-54.84C248.53,-45.58 292.35,-31.18 322.26,-21.35"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="323.14,-24.74 331.55,-18.29 320.95,-18.09 323.14,-24.74"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 5.3 KiB |
@@ -114,13 +114,14 @@ $(function(){initNavTree('d3/d39/manacher__algorithm_8cpp.html','../../'); initR
|
||||
<p>Implementation of <a href="https://en.wikipedia.org/wiki/Longest_palindromic_substring" target="_blank">Manacher's Algorithm</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 />
|
||||
<code>#include <cstring></code><br />
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for manacher_algorithm.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dd/d05/manacher__algorithm_8cpp__incl.svg" width="336" 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="../../dd/d05/manacher__algorithm_8cpp__incl.svg" width="420" 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>
|
||||
@@ -165,11 +166,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"> 171</span> {</div>
|
||||
<div class="line"><span class="lineno"> 172</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"> 173</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 174</span>}</div>
|
||||
<div class="ttc" id="amanacher__algorithm_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> manacher_algorithm.cpp:150</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 172</span> {</div>
|
||||
<div class="line"><span class="lineno"> 173</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"> 174</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 175</span>}</div>
|
||||
<div class="ttc" id="amanacher__algorithm_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> manacher_algorithm.cpp:151</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -201,108 +202,108 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>the largest palindromic substring </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 40</span> {</div>
|
||||
<div class="line"><span class="lineno"> 41</span> <span class="keywordflow">if</span> (prototype.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>() > 0) {</div>
|
||||
<div class="line"><span class="lineno"> 42</span> <span class="comment">// stuffing characters between the input string to handle cases with</span></div>
|
||||
<div class="line"><span class="lineno"> 43</span> <span class="comment">// even length palindrome</span></div>
|
||||
<div class="line"><span class="lineno"> 44</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> stuffed_string = <span class="stringliteral">""</span>;</div>
|
||||
<div class="line"><span class="lineno"> 45</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> str : prototype) {</div>
|
||||
<div class="line"><span class="lineno"> 46</span> stuffed_string += str;</div>
|
||||
<div class="line"><span class="lineno"> 47</span> stuffed_string += <span class="stringliteral">"#"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 48</span> }</div>
|
||||
<div class="line"><span class="lineno"> 49</span> stuffed_string = <span class="stringliteral">"@#"</span> + stuffed_string + <span class="stringliteral">"&"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 50</span> </div>
|
||||
<div class="line"><span class="lineno"> 51</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> palindrome_max_half_length(</div>
|
||||
<div class="line"><span class="lineno"> 52</span> stuffed_string.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>(),</div>
|
||||
<div class="line"><span class="lineno"> 53</span> 0); <span class="comment">// this array will consist of largest possible half length of</span></div>
|
||||
<div class="line"><span class="lineno"> 54</span> <span class="comment">// palindrome centered at index (say i with respect to the</span></div>
|
||||
<div class="line"><span class="lineno"> 55</span> <span class="comment">// stuffed string). This value will be lower bound of half</span></div>
|
||||
<div class="line"><span class="lineno"> 56</span> <span class="comment">// length since single character is a palindrome in itself.</span></div>
|
||||
<div class="line"><span class="lineno"> 57</span> </div>
|
||||
<div class="line"><span class="lineno"> 58</span> uint64_t bigger_center =</div>
|
||||
<div class="line"><span class="lineno"> 59</span> 0; <span class="comment">// this is the index of the center of palindromic</span></div>
|
||||
<div class="line"><span class="lineno"> 60</span> <span class="comment">// substring which would be considered as the larger</span></div>
|
||||
<div class="line"><span class="lineno"> 61</span> <span class="comment">// palindrome, having symmetric halves</span></div>
|
||||
<div class="line"><span class="lineno"> 62</span> </div>
|
||||
<div class="line"><span class="lineno"> 63</span> uint64_t <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">right</a> = 0; <span class="comment">// this is the maximum length of the palindrome</span></div>
|
||||
<div class="line"><span class="lineno"> 64</span> <span class="comment">// from 'bigger_center' to the rightmost end</span></div>
|
||||
<div class="line"><span class="lineno"> 65</span> </div>
|
||||
<div class="line"><span class="lineno"> 66</span> <span class="comment">// i is considered as center lying within one half of the palindrone</span></div>
|
||||
<div class="line"><span class="lineno"> 67</span> <span class="comment">// which is centered at 'bigger_center'</span></div>
|
||||
<div class="line"><span class="lineno"> 68</span> <span class="keywordflow">for</span> (uint64_t i = 1; i < stuffed_string.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>() - 1; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 69</span> <span class="keywordflow">if</span> (i < right) { <span class="comment">// when i is before right end, considering</span></div>
|
||||
<div class="line"><span class="lineno"> 70</span> <span class="comment">// 'bigger_center' as center of palindrome</span></div>
|
||||
<div class="line"><span class="lineno"> 71</span> uint64_t opposite_to_i =</div>
|
||||
<div class="line"><span class="lineno"> 72</span> 2 * bigger_center -</div>
|
||||
<div class="line"><span class="lineno"> 73</span> i; <span class="comment">// this is the opposite end of string, if</span></div>
|
||||
<div class="line"><span class="lineno"> 74</span> <span class="comment">// centered at center, and having one end as i</span></div>
|
||||
<div class="line"><span class="lineno"> 75</span> </div>
|
||||
<div class="line"><span class="lineno"> 76</span> <span class="comment">// finding the minimum possible half length among</span></div>
|
||||
<div class="line"><span class="lineno"> 77</span> <span class="comment">// the palindrome on having center at opposite end,</span></div>
|
||||
<div class="line"><span class="lineno"> 78</span> <span class="comment">// and the string between i and right end,</span></div>
|
||||
<div class="line"><span class="lineno"> 79</span> <span class="comment">// considering 'bigger_center' as center of palindrome</span></div>
|
||||
<div class="line"><span class="lineno"> 80</span> palindrome_max_half_length[i] = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a>(</div>
|
||||
<div class="line"><span class="lineno"> 81</span> palindrome_max_half_length[opposite_to_i], right - i);</div>
|
||||
<div class="line"><span class="lineno"> 82</span> }</div>
|
||||
<div class="line"><span class="lineno"> 83</span> </div>
|
||||
<div class="line"><span class="lineno"> 84</span> <span class="comment">// expanding the palindrome across the maximum stored length in the</span></div>
|
||||
<div class="line"><span class="lineno"> 85</span> <span class="comment">// array, centered at i</span></div>
|
||||
<div class="line"><span class="lineno"> 86</span> <span class="keywordflow">while</span> (stuffed_string[i + (palindrome_max_half_length[i] + 1)] ==</div>
|
||||
<div class="line"><span class="lineno"> 87</span> stuffed_string[i - (palindrome_max_half_length[i] + 1)]) {</div>
|
||||
<div class="line"><span class="lineno"> 88</span> palindrome_max_half_length[i]++;</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="comment">// if palindrome centered at i exceeds the rightmost end of</span></div>
|
||||
<div class="line"><span class="lineno"> 92</span> <span class="comment">// palindrome centered at 'bigger_center', then i will be made the</span></div>
|
||||
<div class="line"><span class="lineno"> 93</span> <span class="comment">// 'bigger_center' and right value will also be updated with respect</span></div>
|
||||
<div class="line"><span class="lineno"> 94</span> <span class="comment">// to center i</span></div>
|
||||
<div class="line"><span class="lineno"> 95</span> <span class="keywordflow">if</span> (i + palindrome_max_half_length[i] > right) {</div>
|
||||
<div class="line"><span class="lineno"> 96</span> bigger_center = i;</div>
|
||||
<div class="line"><span class="lineno"> 97</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">right</a> = i + palindrome_max_half_length[i];</div>
|
||||
<div class="line"><span class="lineno"> 98</span> }</div>
|
||||
<div class="line"><span class="lineno"> 99</span> }</div>
|
||||
<div class="line"><span class="lineno"> 100</span> </div>
|
||||
<div class="line"><span class="lineno"> 101</span> <span class="comment">// now extracting the first largest palindrome</span></div>
|
||||
<div class="line"><span class="lineno"> 102</span> uint64_t half_length = 0; <span class="comment">// half length of the largest palindrome</span></div>
|
||||
<div class="line"><span class="lineno"> 103</span> uint64_t center_index = 0; <span class="comment">// index of center of the largest palindrome</span></div>
|
||||
<div class="line"><span class="lineno"> 104</span> </div>
|
||||
<div class="line"><span class="lineno"> 105</span> <span class="keywordflow">for</span> (uint64_t i = 1; i < stuffed_string.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>() - 1; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 106</span> <span class="keywordflow">if</span> (palindrome_max_half_length[i] > half_length) {</div>
|
||||
<div class="line"><span class="lineno"> 107</span> half_length = palindrome_max_half_length[i];</div>
|
||||
<div class="line"><span class="lineno"> 108</span> center_index = i;</div>
|
||||
<div class="line"><span class="lineno"> 109</span> }</div>
|
||||
<div class="line"><span class="lineno"> 110</span> }</div>
|
||||
<div class="line"><span class="lineno"> 111</span> </div>
|
||||
<div class="line"><span class="lineno"> 112</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> palindromic_substring =</div>
|
||||
<div class="line"><span class="lineno"> 113</span> <span class="stringliteral">""</span>; <span class="comment">// contains the resulting largest palindrome</span></div>
|
||||
<div class="line"><span class="lineno"> 114</span> </div>
|
||||
<div class="line"><span class="lineno"> 115</span> <span class="keywordflow">if</span> (half_length > 0) {</div>
|
||||
<div class="line"><span class="lineno"> 116</span> <span class="comment">// extra information: when '#' is the center, then palindromic</span></div>
|
||||
<div class="line"><span class="lineno"> 117</span> <span class="comment">// substring will have even length, else palindromic substring will</span></div>
|
||||
<div class="line"><span class="lineno"> 118</span> <span class="comment">// have odd length</span></div>
|
||||
<div class="line"><span class="lineno"> 119</span> </div>
|
||||
<div class="line"><span class="lineno"> 120</span> uint64_t start =</div>
|
||||
<div class="line"><span class="lineno"> 121</span> center_index - half_length +</div>
|
||||
<div class="line"><span class="lineno"> 122</span> 1; <span class="comment">// index of first character of palindromic substring</span></div>
|
||||
<div class="line"><span class="lineno"> 123</span> uint64_t <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">end</a> =</div>
|
||||
<div class="line"><span class="lineno"> 124</span> center_index + half_length -</div>
|
||||
<div class="line"><span class="lineno"> 125</span> 1; <span class="comment">// index of last character of palindromic substring</span></div>
|
||||
<div class="line"><span class="lineno"> 126</span> <span class="keywordflow">for</span> (uint64_t index = start; index <= <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">end</a>; index += 2) {</div>
|
||||
<div class="line"><span class="lineno"> 127</span> palindromic_substring += stuffed_string[index];</div>
|
||||
<div class="line"><span class="lineno"> 128</span> }</div>
|
||||
<div class="line"><span class="lineno"> 129</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 130</span> <span class="comment">// if length = 0, then there does not exist any palindrome of length</span></div>
|
||||
<div class="line"><span class="lineno"> 131</span> <span class="comment">// > 1 so we can assign any character of length 1 from string as the</span></div>
|
||||
<div class="line"><span class="lineno"> 132</span> <span class="comment">// palindromic substring</span></div>
|
||||
<div class="line"><span class="lineno"> 133</span> palindromic_substring = prototype[0];</div>
|
||||
<div class="line"><span class="lineno"> 134</span> }</div>
|
||||
<div class="line"><span class="lineno"> 135</span> <span class="keywordflow">return</span> palindromic_substring;</div>
|
||||
<div class="line"><span class="lineno"> 136</span> </div>
|
||||
<div class="line"><span class="lineno"> 137</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 138</span> <span class="comment">// handling case when string is empty</span></div>
|
||||
<div class="line"><span class="lineno"> 139</span> <span class="keywordflow">return</span> <span class="stringliteral">""</span>;</div>
|
||||
<div class="line"><span class="lineno"> 140</span> }</div>
|
||||
<div class="line"><span class="lineno"> 141</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 41</span> {</div>
|
||||
<div class="line"><span class="lineno"> 42</span> <span class="keywordflow">if</span> (prototype.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>() > 0) {</div>
|
||||
<div class="line"><span class="lineno"> 43</span> <span class="comment">// stuffing characters between the input string to handle cases with</span></div>
|
||||
<div class="line"><span class="lineno"> 44</span> <span class="comment">// even length palindrome</span></div>
|
||||
<div class="line"><span class="lineno"> 45</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> stuffed_string = <span class="stringliteral">""</span>;</div>
|
||||
<div class="line"><span class="lineno"> 46</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> str : prototype) {</div>
|
||||
<div class="line"><span class="lineno"> 47</span> stuffed_string += str;</div>
|
||||
<div class="line"><span class="lineno"> 48</span> stuffed_string += <span class="stringliteral">"#"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 49</span> }</div>
|
||||
<div class="line"><span class="lineno"> 50</span> stuffed_string = <span class="stringliteral">"@#"</span> + stuffed_string + <span class="stringliteral">"&"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 51</span> </div>
|
||||
<div class="line"><span class="lineno"> 52</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> palindrome_max_half_length(</div>
|
||||
<div class="line"><span class="lineno"> 53</span> stuffed_string.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>(),</div>
|
||||
<div class="line"><span class="lineno"> 54</span> 0); <span class="comment">// this array will consist of largest possible half length of</span></div>
|
||||
<div class="line"><span class="lineno"> 55</span> <span class="comment">// palindrome centered at index (say i with respect to the</span></div>
|
||||
<div class="line"><span class="lineno"> 56</span> <span class="comment">// stuffed string). This value will be lower bound of half</span></div>
|
||||
<div class="line"><span class="lineno"> 57</span> <span class="comment">// length since single character is a palindrome in itself.</span></div>
|
||||
<div class="line"><span class="lineno"> 58</span> </div>
|
||||
<div class="line"><span class="lineno"> 59</span> uint64_t bigger_center =</div>
|
||||
<div class="line"><span class="lineno"> 60</span> 0; <span class="comment">// this is the index of the center of palindromic</span></div>
|
||||
<div class="line"><span class="lineno"> 61</span> <span class="comment">// substring which would be considered as the larger</span></div>
|
||||
<div class="line"><span class="lineno"> 62</span> <span class="comment">// palindrome, having symmetric halves</span></div>
|
||||
<div class="line"><span class="lineno"> 63</span> </div>
|
||||
<div class="line"><span class="lineno"> 64</span> uint64_t <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">right</a> = 0; <span class="comment">// this is the maximum length of the palindrome</span></div>
|
||||
<div class="line"><span class="lineno"> 65</span> <span class="comment">// from 'bigger_center' to the rightmost end</span></div>
|
||||
<div class="line"><span class="lineno"> 66</span> </div>
|
||||
<div class="line"><span class="lineno"> 67</span> <span class="comment">// i is considered as center lying within one half of the palindrone</span></div>
|
||||
<div class="line"><span class="lineno"> 68</span> <span class="comment">// which is centered at 'bigger_center'</span></div>
|
||||
<div class="line"><span class="lineno"> 69</span> <span class="keywordflow">for</span> (uint64_t i = 1; i < stuffed_string.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>() - 1; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 70</span> <span class="keywordflow">if</span> (i < right) { <span class="comment">// when i is before right end, considering</span></div>
|
||||
<div class="line"><span class="lineno"> 71</span> <span class="comment">// 'bigger_center' as center of palindrome</span></div>
|
||||
<div class="line"><span class="lineno"> 72</span> uint64_t opposite_to_i =</div>
|
||||
<div class="line"><span class="lineno"> 73</span> 2 * bigger_center -</div>
|
||||
<div class="line"><span class="lineno"> 74</span> i; <span class="comment">// this is the opposite end of string, if</span></div>
|
||||
<div class="line"><span class="lineno"> 75</span> <span class="comment">// centered at center, and having one end as i</span></div>
|
||||
<div class="line"><span class="lineno"> 76</span> </div>
|
||||
<div class="line"><span class="lineno"> 77</span> <span class="comment">// finding the minimum possible half length among</span></div>
|
||||
<div class="line"><span class="lineno"> 78</span> <span class="comment">// the palindrome on having center at opposite end,</span></div>
|
||||
<div class="line"><span class="lineno"> 79</span> <span class="comment">// and the string between i and right end,</span></div>
|
||||
<div class="line"><span class="lineno"> 80</span> <span class="comment">// considering 'bigger_center' as center of palindrome</span></div>
|
||||
<div class="line"><span class="lineno"> 81</span> palindrome_max_half_length[i] = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a>(</div>
|
||||
<div class="line"><span class="lineno"> 82</span> palindrome_max_half_length[opposite_to_i], right - i);</div>
|
||||
<div class="line"><span class="lineno"> 83</span> }</div>
|
||||
<div class="line"><span class="lineno"> 84</span> </div>
|
||||
<div class="line"><span class="lineno"> 85</span> <span class="comment">// expanding the palindrome across the maximum stored length in the</span></div>
|
||||
<div class="line"><span class="lineno"> 86</span> <span class="comment">// array, centered at i</span></div>
|
||||
<div class="line"><span class="lineno"> 87</span> <span class="keywordflow">while</span> (stuffed_string[i + (palindrome_max_half_length[i] + 1)] ==</div>
|
||||
<div class="line"><span class="lineno"> 88</span> stuffed_string[i - (palindrome_max_half_length[i] + 1)]) {</div>
|
||||
<div class="line"><span class="lineno"> 89</span> palindrome_max_half_length[i]++;</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="comment">// if palindrome centered at i exceeds the rightmost end of</span></div>
|
||||
<div class="line"><span class="lineno"> 93</span> <span class="comment">// palindrome centered at 'bigger_center', then i will be made the</span></div>
|
||||
<div class="line"><span class="lineno"> 94</span> <span class="comment">// 'bigger_center' and right value will also be updated with respect</span></div>
|
||||
<div class="line"><span class="lineno"> 95</span> <span class="comment">// to center i</span></div>
|
||||
<div class="line"><span class="lineno"> 96</span> <span class="keywordflow">if</span> (i + palindrome_max_half_length[i] > right) {</div>
|
||||
<div class="line"><span class="lineno"> 97</span> bigger_center = i;</div>
|
||||
<div class="line"><span class="lineno"> 98</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">right</a> = i + palindrome_max_half_length[i];</div>
|
||||
<div class="line"><span class="lineno"> 99</span> }</div>
|
||||
<div class="line"><span class="lineno"> 100</span> }</div>
|
||||
<div class="line"><span class="lineno"> 101</span> </div>
|
||||
<div class="line"><span class="lineno"> 102</span> <span class="comment">// now extracting the first largest palindrome</span></div>
|
||||
<div class="line"><span class="lineno"> 103</span> uint64_t half_length = 0; <span class="comment">// half length of the largest palindrome</span></div>
|
||||
<div class="line"><span class="lineno"> 104</span> uint64_t center_index = 0; <span class="comment">// index of center of the largest palindrome</span></div>
|
||||
<div class="line"><span class="lineno"> 105</span> </div>
|
||||
<div class="line"><span class="lineno"> 106</span> <span class="keywordflow">for</span> (uint64_t i = 1; i < stuffed_string.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>() - 1; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 107</span> <span class="keywordflow">if</span> (palindrome_max_half_length[i] > half_length) {</div>
|
||||
<div class="line"><span class="lineno"> 108</span> half_length = palindrome_max_half_length[i];</div>
|
||||
<div class="line"><span class="lineno"> 109</span> center_index = i;</div>
|
||||
<div class="line"><span class="lineno"> 110</span> }</div>
|
||||
<div class="line"><span class="lineno"> 111</span> }</div>
|
||||
<div class="line"><span class="lineno"> 112</span> </div>
|
||||
<div class="line"><span class="lineno"> 113</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> palindromic_substring =</div>
|
||||
<div class="line"><span class="lineno"> 114</span> <span class="stringliteral">""</span>; <span class="comment">// contains the resulting largest palindrome</span></div>
|
||||
<div class="line"><span class="lineno"> 115</span> </div>
|
||||
<div class="line"><span class="lineno"> 116</span> <span class="keywordflow">if</span> (half_length > 0) {</div>
|
||||
<div class="line"><span class="lineno"> 117</span> <span class="comment">// extra information: when '#' is the center, then palindromic</span></div>
|
||||
<div class="line"><span class="lineno"> 118</span> <span class="comment">// substring will have even length, else palindromic substring will</span></div>
|
||||
<div class="line"><span class="lineno"> 119</span> <span class="comment">// have odd length</span></div>
|
||||
<div class="line"><span class="lineno"> 120</span> </div>
|
||||
<div class="line"><span class="lineno"> 121</span> uint64_t start =</div>
|
||||
<div class="line"><span class="lineno"> 122</span> center_index - half_length +</div>
|
||||
<div class="line"><span class="lineno"> 123</span> 1; <span class="comment">// index of first character of palindromic substring</span></div>
|
||||
<div class="line"><span class="lineno"> 124</span> uint64_t <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">end</a> =</div>
|
||||
<div class="line"><span class="lineno"> 125</span> center_index + half_length -</div>
|
||||
<div class="line"><span class="lineno"> 126</span> 1; <span class="comment">// index of last character of palindromic substring</span></div>
|
||||
<div class="line"><span class="lineno"> 127</span> <span class="keywordflow">for</span> (uint64_t index = start; index <= <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">end</a>; index += 2) {</div>
|
||||
<div class="line"><span class="lineno"> 128</span> palindromic_substring += stuffed_string[index];</div>
|
||||
<div class="line"><span class="lineno"> 129</span> }</div>
|
||||
<div class="line"><span class="lineno"> 130</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 131</span> <span class="comment">// if length = 0, then there does not exist any palindrome of length</span></div>
|
||||
<div class="line"><span class="lineno"> 132</span> <span class="comment">// > 1 so we can assign any character of length 1 from string as the</span></div>
|
||||
<div class="line"><span class="lineno"> 133</span> <span class="comment">// palindromic substring</span></div>
|
||||
<div class="line"><span class="lineno"> 134</span> palindromic_substring = prototype[0];</div>
|
||||
<div class="line"><span class="lineno"> 135</span> }</div>
|
||||
<div class="line"><span class="lineno"> 136</span> <span class="keywordflow">return</span> palindromic_substring;</div>
|
||||
<div class="line"><span class="lineno"> 137</span> </div>
|
||||
<div class="line"><span class="lineno"> 138</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 139</span> <span class="comment">// handling case when string is empty</span></div>
|
||||
<div class="line"><span class="lineno"> 140</span> <span class="keywordflow">return</span> <span class="stringliteral">""</span>;</div>
|
||||
<div class="line"><span class="lineno"> 141</span> }</div>
|
||||
<div class="line"><span class="lineno"> 142</span>}</div>
|
||||
<div class="ttc" id="abasic_string_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a></div></div>
|
||||
<div class="ttc" id="aend_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/iterator/end.html">std::end</a></div><div class="ttdeci">T end(T... args)</div></div>
|
||||
<div class="ttc" id="aleft_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/left.html">std::right</a></div><div class="ttdeci">T right(T... args)</div></div>
|
||||
@@ -342,22 +343,22 @@ 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"> 150</span> {</div>
|
||||
<div class="line"><span class="lineno"> 151</span> assert(strings::manacher::manacher(<span class="stringliteral">""</span>) == <span class="stringliteral">""</span>);</div>
|
||||
<div class="line"><span class="lineno"> 152</span> assert(strings::manacher::manacher(<span class="stringliteral">"abababc"</span>) == <span class="stringliteral">"ababa"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 153</span> assert(strings::manacher::manacher(<span class="stringliteral">"cbaabd"</span>) == <span class="stringliteral">"baab"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 154</span> assert(strings::manacher::manacher(<span class="stringliteral">"DedzefDeD"</span>) == <span class="stringliteral">"DeD"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 155</span> assert(strings::manacher::manacher(<span class="stringliteral">"XZYYXXYZXX"</span>) == <span class="stringliteral">"YXXY"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 156</span> assert(strings::manacher::manacher(<span class="stringliteral">"1sm222m10abc"</span>) == <span class="stringliteral">"m222m"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 157</span> assert(strings::manacher::manacher(<span class="stringliteral">"798989591"</span>) == <span class="stringliteral">"98989"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 158</span> assert(strings::manacher::manacher(<span class="stringliteral">"xacdedcax"</span>) == <span class="stringliteral">"xacdedcax"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 159</span> assert(strings::manacher::manacher(<span class="stringliteral">"xaccax"</span>) == <span class="stringliteral">"xaccax"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 160</span> assert(strings::manacher::manacher(<span class="stringliteral">"a"</span>) == <span class="stringliteral">"a"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 161</span> assert(strings::manacher::manacher(<span class="stringliteral">"xy"</span>) == <span class="stringliteral">"x"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 162</span> assert(strings::manacher::manacher(<span class="stringliteral">"abced"</span>) == <span class="stringliteral">"a"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 163</span> </div>
|
||||
<div class="line"><span class="lineno"> 164</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">"All tests have 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"> 165</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 151</span> {</div>
|
||||
<div class="line"><span class="lineno"> 152</span> assert(strings::manacher::manacher(<span class="stringliteral">""</span>) == <span class="stringliteral">""</span>);</div>
|
||||
<div class="line"><span class="lineno"> 153</span> assert(strings::manacher::manacher(<span class="stringliteral">"abababc"</span>) == <span class="stringliteral">"ababa"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 154</span> assert(strings::manacher::manacher(<span class="stringliteral">"cbaabd"</span>) == <span class="stringliteral">"baab"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 155</span> assert(strings::manacher::manacher(<span class="stringliteral">"DedzefDeD"</span>) == <span class="stringliteral">"DeD"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 156</span> assert(strings::manacher::manacher(<span class="stringliteral">"XZYYXXYZXX"</span>) == <span class="stringliteral">"YXXY"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 157</span> assert(strings::manacher::manacher(<span class="stringliteral">"1sm222m10abc"</span>) == <span class="stringliteral">"m222m"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 158</span> assert(strings::manacher::manacher(<span class="stringliteral">"798989591"</span>) == <span class="stringliteral">"98989"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 159</span> assert(strings::manacher::manacher(<span class="stringliteral">"xacdedcax"</span>) == <span class="stringliteral">"xacdedcax"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 160</span> assert(strings::manacher::manacher(<span class="stringliteral">"xaccax"</span>) == <span class="stringliteral">"xaccax"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 161</span> assert(strings::manacher::manacher(<span class="stringliteral">"a"</span>) == <span class="stringliteral">"a"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 162</span> assert(strings::manacher::manacher(<span class="stringliteral">"xy"</span>) == <span class="stringliteral">"x"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 163</span> assert(strings::manacher::manacher(<span class="stringliteral">"abced"</span>) == <span class="stringliteral">"a"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 164</span> </div>
|
||||
<div class="line"><span class="lineno"> 165</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">"All tests have 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"> 166</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><!-- fragment --><div class="dynheader">
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
<map id="hashing/sha1.cpp" name="hashing/sha1.cpp">
|
||||
<area shape="rect" id="Node000001" title="Simple C++ implementation of the SHA-1 Hashing Algorithm" alt="" coords="236,5,359,31"/>
|
||||
<area shape="rect" id="Node000001" title="Simple C++ implementation of the SHA-1 Hashing Algorithm" alt="" coords="277,5,400,31"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="5,79,80,105"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="255,34,95,79,94,73,253,29"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="289,34,96,80,94,75,287,29"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="104,79,154,105"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="270,34,170,76,168,71,268,29"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="304,34,170,79,168,74,302,29"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="178,79,243,105"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="284,34,238,71,235,67,281,29"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="318,34,247,73,244,69,315,29"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="267,79,327,105"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="300,31,300,63,294,63,294,31"/>
|
||||
<area shape="rect" id="Node000006" title=" " alt="" coords="351,79,422,105"/>
|
||||
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="314,29,361,67,358,71,311,34"/>
|
||||
<area shape="rect" id="Node000007" title=" " alt="" coords="446,79,500,105"/>
|
||||
<area shape="poly" id="edge6_Node000001_Node000007" title=" " alt="" coords="328,29,433,72,431,76,326,34"/>
|
||||
<area shape="rect" id="Node000008" title=" " alt="" coords="524,79,582,105"/>
|
||||
<area shape="poly" id="edge7_Node000001_Node000008" title=" " alt="" coords="341,29,510,76,509,81,340,34"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="334,33,314,67,309,64,329,30"/>
|
||||
<area shape="rect" id="Node000006" title=" " alt="" coords="351,79,411,105"/>
|
||||
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="348,30,368,64,364,67,343,33"/>
|
||||
<area shape="rect" id="Node000007" title=" " alt="" coords="435,79,506,105"/>
|
||||
<area shape="poly" id="edge6_Node000001_Node000007" title=" " alt="" coords="362,29,436,69,434,74,360,34"/>
|
||||
<area shape="rect" id="Node000008" title=" " alt="" coords="530,79,584,105"/>
|
||||
<area shape="poly" id="edge7_Node000001_Node000008" title=" " alt="" coords="376,29,517,75,515,80,375,34"/>
|
||||
<area shape="rect" id="Node000009" title=" " alt="" coords="608,79,666,105"/>
|
||||
<area shape="poly" id="edge8_Node000001_Node000009" title=" " alt="" coords="394,29,594,76,592,81,393,34"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
413100f5e1fded24a8424dd9bc7a640b
|
||||
cb136bed87111bc762bd3c424fcef672
|
||||
@@ -4,10 +4,9 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: hashing/sha1.cpp Pages: 1 -->
|
||||
<svg width="440pt" height="83pt"
|
||||
viewBox="0.00 0.00 440.38 82.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!--zoomable 83 -->
|
||||
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" onload="init(evt)">
|
||||
|
||||
<style type="text/css"><![CDATA[
|
||||
.node, .edge {opacity: 0.7;}
|
||||
@@ -15,16 +14,53 @@
|
||||
.edge:hover path { stroke: red; }
|
||||
.edge:hover polygon { stroke: red; fill: red; }
|
||||
]]></style>
|
||||
|
||||
<defs>
|
||||
<circle id="rim" cx="0" cy="0" r="7"/>
|
||||
<circle id="rim2" cx="0" cy="0" r="3.5"/>
|
||||
<g id="zoomPlus">
|
||||
<use xlink:href="#rim" fill="#404040"><set attributeName="fill" to="#808080" begin="zoomplus.mouseover" end="zoomplus.mouseout"/></use>
|
||||
<path d="M-4,0h8M0,-4v8" fill="none" stroke="white" stroke-width="1.5" pointer-events="none"/>
|
||||
</g>
|
||||
<g id="zoomMin">
|
||||
<use xlink:href="#rim" fill="#404040"><set attributeName="fill" to="#808080" begin="zoomminus.mouseover" end="zoomminus.mouseout"/></use>
|
||||
<path d="M-4,0h8" fill="none" stroke="white" stroke-width="1.5" pointer-events="none"/>
|
||||
</g>
|
||||
<g id="arrowUp" transform="translate(30 24)">
|
||||
<use xlink:href="#rim"/>
|
||||
<path pointer-events="none" fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="arrowRight" transform="rotate(90) translate(36 -43)">
|
||||
<use xlink:href="#rim"/>
|
||||
<path pointer-events="none" fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="arrowDown" transform="rotate(180) translate(-30 -48)">
|
||||
<use xlink:href="#rim"/>
|
||||
<path pointer-events="none" fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="arrowLeft" transform="rotate(270) translate(-36 17)">
|
||||
<use xlink:href="#rim"/>
|
||||
<path pointer-events="none" fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="resetDef">
|
||||
<use xlink:href="#rim2" fill="#404040"><set attributeName="fill" to="#808080" begin="reset.mouseover" end="reset.mouseout"/></use>
|
||||
</g>
|
||||
</defs>
|
||||
<script type="application/ecmascript">
|
||||
var viewWidth = 503;
|
||||
var viewHeight = 83;
|
||||
var sectionId = 'dynsection-0';
|
||||
</script>
|
||||
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 78.5)">
|
||||
<g id="viewport">
|
||||
<title>hashing/sha1.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Simple C++ implementation of the SHA-1 Hashing Algorithm">
|
||||
<polygon fill="#999999" stroke="#666666" points="265.12,-74.5 172.62,-74.5 172.62,-55.25 265.12,-55.25 265.12,-74.5"/>
|
||||
<text text-anchor="middle" x="218.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">hashing/sha1.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="296.12,-74.5 203.62,-74.5 203.62,-55.25 296.12,-55.25 296.12,-74.5"/>
|
||||
<text text-anchor="middle" x="249.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">hashing/sha1.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -41,8 +77,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="M186.47,-54.84C153.44,-45.63 102.16,-31.34 66.91,-21.51"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="68.1,-18.21 57.53,-18.89 66.22,-24.95 68.1,-18.21"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M211.96,-54.78C171.64,-45.11 108.15,-29.88 67.27,-20.07"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="68.13,-16.68 57.59,-17.75 66.5,-23.49 68.13,-16.68"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -59,8 +95,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="M197.5,-54.84C176.87,-46.12 145.44,-32.84 122.42,-23.11"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="123.84,-19.91 113.27,-19.24 121.12,-26.36 123.84,-19.91"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M223.24,-54.84C195.44,-45.41 151.92,-30.65 122.91,-20.81"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="124.22,-17.56 113.63,-17.66 121.97,-24.19 124.22,-17.56"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -77,8 +113,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="M207.85,-54.84C198.45,-47.15 184.73,-35.9 173.47,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="175.86,-24.11 165.91,-20.48 171.43,-29.53 175.86,-24.11"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M233.59,-54.84C218.97,-46.73 197.25,-34.68 180.17,-25.21"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="182.01,-22.23 171.56,-20.44 178.61,-28.35 182.01,-22.23"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -87,7 +123,7 @@
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="241.5,-19.25 196.25,-19.25 196.25,0 241.5,0 241.5,-19.25"/>
|
||||
<text text-anchor="middle" x="218.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstring</text>
|
||||
<text text-anchor="middle" x="218.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -95,8 +131,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="M218.88,-55.08C218.88,-48.57 218.88,-39.42 218.88,-31.12"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="222.38,-31.12 218.88,-21.12 215.38,-31.12 222.38,-31.12"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M244.76,-55.08C240.7,-48.11 234.88,-38.12 229.79,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="232.92,-27.8 224.87,-20.92 226.87,-31.32 232.92,-27.8"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -104,8 +140,8 @@
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="312.62,-19.25 259.12,-19.25 259.12,0 312.62,0 312.62,-19.25"/>
|
||||
<text text-anchor="middle" x="285.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="304.5,-19.25 259.25,-19.25 259.25,0 304.5,0 304.5,-19.25"/>
|
||||
<text text-anchor="middle" x="281.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstring</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -113,8 +149,8 @@
|
||||
<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="M230.24,-54.84C239.92,-47.15 254.07,-35.9 265.68,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="267.84,-29.43 273.49,-20.47 263.49,-23.95 267.84,-29.43"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M255.16,-55.08C259.35,-48.11 265.35,-38.12 270.61,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="273.55,-31.28 275.7,-20.91 267.55,-27.68 273.55,-31.28"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -122,8 +158,8 @@
|
||||
<g id="Node000007" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_Node000007"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="370.88,-19.25 330.88,-19.25 330.88,0 370.88,0 370.88,-19.25"/>
|
||||
<text text-anchor="middle" x="350.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">string</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="375.62,-19.25 322.12,-19.25 322.12,0 375.62,0 375.62,-19.25"/>
|
||||
<text text-anchor="middle" x="348.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -131,8 +167,8 @@
|
||||
<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="M241.27,-54.84C262.95,-46.09 296.01,-32.76 320.15,-23.02"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="321.18,-26.38 329.14,-19.39 318.56,-19.89 321.18,-26.38"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M266.67,-54.84C281.89,-46.66 304.57,-34.46 322.26,-24.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="323.52,-28.24 330.67,-20.42 320.2,-22.07 323.52,-28.24"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -140,8 +176,8 @@
|
||||
<g id="Node000008" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_Node000008"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="432.38,-19.25 389.38,-19.25 389.38,0 432.38,0 432.38,-19.25"/>
|
||||
<text text-anchor="middle" x="410.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="433.88,-19.25 393.88,-19.25 393.88,0 433.88,0 433.88,-19.25"/>
|
||||
<text text-anchor="middle" x="413.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">string</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -149,13 +185,52 @@
|
||||
<g id="edge7_Node000001_Node000008" class="edge">
|
||||
<title>Node1->Node8</title>
|
||||
<g id="a_edge7_Node000001_Node000008"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M251.56,-54.82C281.87,-46.43 328.51,-33.51 378.21,-19.71"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="379.04,-23.11 387.74,-17.06 377.17,-16.37 379.04,-23.11"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M277.7,-54.84C306.87,-45.37 352.6,-30.52 382.9,-20.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="383.82,-24.06 392.25,-17.65 381.66,-17.4 383.82,-24.06"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node9 -->
|
||||
<g id="Node000009" class="node">
|
||||
<title>Node9</title>
|
||||
<g id="a_Node000009"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="495.38,-19.25 452.38,-19.25 452.38,0 495.38,0 495.38,-19.25"/>
|
||||
<text text-anchor="middle" x="473.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node9 -->
|
||||
<g id="edge8_Node000001_Node000009" class="edge">
|
||||
<title>Node1->Node9</title>
|
||||
<g id="a_edge8_Node000001_Node000009"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M291.42,-54.83C328.22,-46.69 383.66,-34.12 440.82,-19.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="441.6,-23.1 450.42,-17.24 439.87,-16.32 441.6,-23.1"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
<g id="navigator" transform="translate(0 0)" fill="#404254">
|
||||
<rect fill="#f2f5e9" fill-opacity="0.5" stroke="#606060" stroke-width=".5" x="0" y="0" width="60" height="60"/>
|
||||
<use id="zoomplus" xlink:href="#zoomPlus" x="17" y="9" onmousedown="handleZoom(evt,'in')"/>
|
||||
<use id="zoomminus" xlink:href="#zoomMin" x="42" y="9" onmousedown="handleZoom(evt,'out')"/>
|
||||
<use id="reset" xlink:href="#resetDef" x="30" y="36" onmousedown="handleReset()"/>
|
||||
<use id="arrowup" xlink:href="#arrowUp" x="0" y="0" onmousedown="handlePan(0,-1)"/>
|
||||
<use id="arrowright" xlink:href="#arrowRight" x="0" y="0" onmousedown="handlePan(1,0)"/>
|
||||
<use id="arrowdown" xlink:href="#arrowDown" x="0" y="0" onmousedown="handlePan(0,1)"/>
|
||||
<use id="arrowleft" xlink:href="#arrowLeft" x="0" y="0" onmousedown="handlePan(-1,0)"/>
|
||||
</g>
|
||||
<svg viewBox="0 0 15 15" width="100%" height="30px" preserveAspectRatio="xMaxYMin meet">
|
||||
<g id="arrow_out" transform="scale(0.3 0.3)">
|
||||
<a xlink:href="sha1_8cpp__incl_org.svg" target="_base">
|
||||
<rect id="button" ry="5" rx="5" y="6" x="6" height="38" width="38"
|
||||
fill="#f2f5e9" fill-opacity="0.5" stroke="#606060" stroke-width="1.0"/>
|
||||
<path id="arrow"
|
||||
d="M 11.500037,31.436501 C 11.940474,20.09759 22.043105,11.32322 32.158766,21.979434 L 37.068811,17.246167 C 37.068811,17.246167 37.088388,32 37.088388,32 L 22.160133,31.978069 C 22.160133,31.978069 26.997745,27.140456 26.997745,27.140456 C 18.528582,18.264221 13.291696,25.230495 11.500037,31.436501 z"
|
||||
style="fill:#404040;"/>
|
||||
</a>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
<style type='text/css'>
|
||||
|
||||
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 10 KiB |
@@ -4,16 +4,16 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: hashing/sha1.cpp Pages: 1 -->
|
||||
<svg width="440pt" height="83pt"
|
||||
viewBox="0.00 0.00 440.38 82.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="503pt" height="83pt"
|
||||
viewBox="0.00 0.00 503.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>hashing/sha1.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Simple C++ implementation of the SHA-1 Hashing Algorithm">
|
||||
<polygon fill="#999999" stroke="#666666" points="265.12,-74.5 172.62,-74.5 172.62,-55.25 265.12,-55.25 265.12,-74.5"/>
|
||||
<text text-anchor="middle" x="218.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">hashing/sha1.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="296.12,-74.5 203.62,-74.5 203.62,-55.25 296.12,-55.25 296.12,-74.5"/>
|
||||
<text text-anchor="middle" x="249.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">hashing/sha1.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="M186.47,-54.84C153.44,-45.63 102.16,-31.34 66.91,-21.51"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="68.1,-18.21 57.53,-18.89 66.22,-24.95 68.1,-18.21"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M211.96,-54.78C171.64,-45.11 108.15,-29.88 67.27,-20.07"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="68.13,-16.68 57.59,-17.75 66.5,-23.49 68.13,-16.68"/>
|
||||
</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="M197.5,-54.84C176.87,-46.12 145.44,-32.84 122.42,-23.11"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="123.84,-19.91 113.27,-19.24 121.12,-26.36 123.84,-19.91"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M223.24,-54.84C195.44,-45.41 151.92,-30.65 122.91,-20.81"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="124.22,-17.56 113.63,-17.66 121.97,-24.19 124.22,-17.56"/>
|
||||
</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="M207.85,-54.84C198.45,-47.15 184.73,-35.9 173.47,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="175.86,-24.11 165.91,-20.48 171.43,-29.53 175.86,-24.11"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M233.59,-54.84C218.97,-46.73 197.25,-34.68 180.17,-25.21"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="182.01,-22.23 171.56,-20.44 178.61,-28.35 182.01,-22.23"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -76,7 +76,7 @@
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="241.5,-19.25 196.25,-19.25 196.25,0 241.5,0 241.5,-19.25"/>
|
||||
<text text-anchor="middle" x="218.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstring</text>
|
||||
<text text-anchor="middle" x="218.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -84,8 +84,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="M218.88,-55.08C218.88,-48.57 218.88,-39.42 218.88,-31.12"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="222.38,-31.12 218.88,-21.12 215.38,-31.12 222.38,-31.12"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M244.76,-55.08C240.7,-48.11 234.88,-38.12 229.79,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="232.92,-27.8 224.87,-20.92 226.87,-31.32 232.92,-27.8"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -93,8 +93,8 @@
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="312.62,-19.25 259.12,-19.25 259.12,0 312.62,0 312.62,-19.25"/>
|
||||
<text text-anchor="middle" x="285.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="304.5,-19.25 259.25,-19.25 259.25,0 304.5,0 304.5,-19.25"/>
|
||||
<text text-anchor="middle" x="281.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstring</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -102,8 +102,8 @@
|
||||
<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="M230.24,-54.84C239.92,-47.15 254.07,-35.9 265.68,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="267.84,-29.43 273.49,-20.47 263.49,-23.95 267.84,-29.43"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M255.16,-55.08C259.35,-48.11 265.35,-38.12 270.61,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="273.55,-31.28 275.7,-20.91 267.55,-27.68 273.55,-31.28"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -111,8 +111,8 @@
|
||||
<g id="Node000007" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_Node000007"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="370.88,-19.25 330.88,-19.25 330.88,0 370.88,0 370.88,-19.25"/>
|
||||
<text text-anchor="middle" x="350.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">string</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="375.62,-19.25 322.12,-19.25 322.12,0 375.62,0 375.62,-19.25"/>
|
||||
<text text-anchor="middle" x="348.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -120,8 +120,8 @@
|
||||
<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="M241.27,-54.84C262.95,-46.09 296.01,-32.76 320.15,-23.02"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="321.18,-26.38 329.14,-19.39 318.56,-19.89 321.18,-26.38"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M266.67,-54.84C281.89,-46.66 304.57,-34.46 322.26,-24.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="323.52,-28.24 330.67,-20.42 320.2,-22.07 323.52,-28.24"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -129,8 +129,8 @@
|
||||
<g id="Node000008" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_Node000008"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="432.38,-19.25 389.38,-19.25 389.38,0 432.38,0 432.38,-19.25"/>
|
||||
<text text-anchor="middle" x="410.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="433.88,-19.25 393.88,-19.25 393.88,0 433.88,0 433.88,-19.25"/>
|
||||
<text text-anchor="middle" x="413.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">string</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -138,8 +138,26 @@
|
||||
<g id="edge7_Node000001_Node000008" class="edge">
|
||||
<title>Node1->Node8</title>
|
||||
<g id="a_edge7_Node000001_Node000008"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M251.56,-54.82C281.87,-46.43 328.51,-33.51 378.21,-19.71"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="379.04,-23.11 387.74,-17.06 377.17,-16.37 379.04,-23.11"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M277.7,-54.84C306.87,-45.37 352.6,-30.52 382.9,-20.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="383.82,-24.06 392.25,-17.65 381.66,-17.4 383.82,-24.06"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node9 -->
|
||||
<g id="Node000009" class="node">
|
||||
<title>Node9</title>
|
||||
<g id="a_Node000009"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="495.38,-19.25 452.38,-19.25 452.38,0 495.38,0 495.38,-19.25"/>
|
||||
<text text-anchor="middle" x="473.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node9 -->
|
||||
<g id="edge8_Node000001_Node000009" class="edge">
|
||||
<title>Node1->Node9</title>
|
||||
<g id="a_edge8_Node000001_Node000009"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M291.42,-54.83C328.22,-46.69 383.66,-34.12 440.82,-19.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="441.6,-23.1 450.42,-17.24 439.87,-16.32 441.6,-23.1"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.7 KiB |
@@ -1,9 +1,11 @@
|
||||
<map id="search/floyd_cycle_detection_algo.cpp" name="search/floyd_cycle_detection_algo.cpp">
|
||||
<area shape="rect" id="Node000001" title="Implementation of Floyd's Cycle Detection algorithm." alt="" coords="61,5,198,46"/>
|
||||
<area shape="rect" id="Node000001" title="Implementation of Floyd's Cycle Detection algorithm." alt="" coords="100,5,237,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 @@
|
||||
4a156a3d22c72c34e1d3b5466afb928d
|
||||
ccf4e419094c5bb9975a24daf203969f
|
||||
@@ -4,8 +4,8 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: search/floyd_cycle_detection_algo.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 Floyd's Cycle Detection algorithm.">
|
||||
<polygon fill="#999999" stroke="#666666" points="144.62,-85.75 41.62,-85.75 41.62,-55.25 144.62,-55.25 144.62,-85.75"/>
|
||||
<text text-anchor="start" x="49.62" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">search/floyd_cycle</text>
|
||||
<text text-anchor="middle" x="93.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_detection_algo.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="173.62,-85.75 70.62,-85.75 70.62,-55.25 173.62,-55.25 173.62,-85.75"/>
|
||||
<text text-anchor="start" x="78.62" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">search/floyd_cycle</text>
|
||||
<text text-anchor="middle" x="122.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_detection_algo.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: search/floyd_cycle_detection_algo.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>search/floyd_cycle_detection_algo.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Implementation of Floyd's Cycle Detection algorithm.">
|
||||
<polygon fill="#999999" stroke="#666666" points="144.62,-85.75 41.62,-85.75 41.62,-55.25 144.62,-55.25 144.62,-85.75"/>
|
||||
<text text-anchor="start" x="49.62" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">search/floyd_cycle</text>
|
||||
<text text-anchor="middle" x="93.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_detection_algo.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="173.62,-85.75 70.62,-85.75 70.62,-55.25 173.62,-55.25 173.62,-85.75"/>
|
||||
<text text-anchor="start" x="78.62" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">search/floyd_cycle</text>
|
||||
<text text-anchor="middle" x="122.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_detection_algo.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.3 KiB After Width: | Height: | Size: 4.0 KiB |
@@ -112,14 +112,15 @@ $(function(){initNavTree('d3/d80/z__function_8cpp.html','../../'); initResizable
|
||||
|
||||
<p>The <a href="https://cp-algorithms.com/string/z-function.html" target="_blank">Z function</a> for finding occurences of a pattern within a piece of text with time and space complexity O(n + m)
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <iostream></code><br />
|
||||
<div class="textblock"><code>#include <cstdint></code><br />
|
||||
<code>#include <iostream></code><br />
|
||||
<code>#include <cstring></code><br />
|
||||
<code>#include <cassert></code><br />
|
||||
<code>#include <vector></code><br />
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for z_function.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d0/df1/z__function_8cpp__incl.svg" width="336" 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/df1/z__function_8cpp__incl.svg" width="420" 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="func-members" name="func-members"></a>
|
||||
@@ -173,22 +174,22 @@ Functions</h2></td></tr>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a vector of starting indexes where pattern is found in the text </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 54</span> {</div>
|
||||
<div class="line"><span class="lineno"> 55</span> uint64_t text_length = text.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>(), pattern_length = pattern.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>();</div>
|
||||
<div class="line"><span class="lineno"> 56</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> z = <a class="code hl_function" href="#ac044c4794349a8cff6256b99950d5773">Z_function</a>(pattern + <span class="charliteral">'#'</span> + text);</div>
|
||||
<div class="line"><span class="lineno"> 57</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> matching_indexes;</div>
|
||||
<div class="line"><span class="lineno"> 58</span> </div>
|
||||
<div class="line"><span class="lineno"> 59</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < text_length; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 60</span> <span class="keywordflow">if</span> (z[i + pattern_length + 1] == pattern_length) {</div>
|
||||
<div class="line"><span class="lineno"> 61</span> matching_indexes.<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"> 62</span> }</div>
|
||||
<div class="line"><span class="lineno"> 63</span> }</div>
|
||||
<div class="line"><span class="lineno"> 64</span> <span class="keywordflow">return</span> matching_indexes;</div>
|
||||
<div class="line"><span class="lineno"> 65</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 55</span> {</div>
|
||||
<div class="line"><span class="lineno"> 56</span> uint64_t text_length = text.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>(), pattern_length = pattern.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>();</div>
|
||||
<div class="line"><span class="lineno"> 57</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> z = <a class="code hl_function" href="#ac044c4794349a8cff6256b99950d5773">Z_function</a>(pattern + <span class="charliteral">'#'</span> + text);</div>
|
||||
<div class="line"><span class="lineno"> 58</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> matching_indexes;</div>
|
||||
<div class="line"><span class="lineno"> 59</span> </div>
|
||||
<div class="line"><span class="lineno"> 60</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < text_length; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 61</span> <span class="keywordflow">if</span> (z[i + pattern_length + 1] == pattern_length) {</div>
|
||||
<div class="line"><span class="lineno"> 62</span> matching_indexes.<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"> 63</span> }</div>
|
||||
<div class="line"><span class="lineno"> 64</span> }</div>
|
||||
<div class="line"><span class="lineno"> 65</span> <span class="keywordflow">return</span> matching_indexes;</div>
|
||||
<div class="line"><span class="lineno"> 66</span>}</div>
|
||||
<div class="ttc" id="apush_back_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">std::vector::push_back</a></div><div class="ttdeci">T push_back(T... args)</div></div>
|
||||
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">std::string::size</a></div><div class="ttdeci">T size(T... args)</div></div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
|
||||
<div class="ttc" id="az__function_8cpp_html_ac044c4794349a8cff6256b99950d5773"><div class="ttname"><a href="#ac044c4794349a8cff6256b99950d5773">Z_function</a></div><div class="ttdeci">std::vector< uint64_t > Z_function(const std::string &pattern)</div><div class="ttdoc">for IO operations</div><div class="ttdef"><b>Definition</b> z_function.cpp:28</div></div>
|
||||
<div class="ttc" id="az__function_8cpp_html_ac044c4794349a8cff6256b99950d5773"><div class="ttname"><a href="#ac044c4794349a8cff6256b99950d5773">Z_function</a></div><div class="ttdeci">std::vector< uint64_t > Z_function(const std::string &pattern)</div><div class="ttdoc">for IO operations</div><div class="ttdef"><b>Definition</b> z_function.cpp:29</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -214,11 +215,11 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<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"> 93</span> {</div>
|
||||
<div class="line"><span class="lineno"> 94</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"> 95</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 96</span>}</div>
|
||||
<div class="ttc" id="az__function_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> z_function.cpp:71</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 94</span> {</div>
|
||||
<div class="line"><span class="lineno"> 95</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"> 96</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 97</span>}</div>
|
||||
<div class="ttc" id="az__function_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> z_function.cpp:72</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -252,25 +253,25 @@ 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"> 71</span> {</div>
|
||||
<div class="line"><span class="lineno"> 72</span> <span class="comment">// usual case</span></div>
|
||||
<div class="line"><span class="lineno"> 73</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> text1 = <span class="stringliteral">"alskfjaldsabc1abc1abcbksbcdnsdabcabc"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 74</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> pattern1 = <span class="stringliteral">"abc"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 75</span> </div>
|
||||
<div class="line"><span class="lineno"> 76</span> <span class="comment">// matching_indexes1 gets the indexes where pattern1 exists in text1</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<uint64_t></a> matching_indexes1 = <a class="code hl_function" href="#ac186ca3ac3a69b5e52543bb13fe46db8">find_pat_in_text</a>(pattern1, text1);</div>
|
||||
<div class="line"><span class="lineno"> 78</span> assert((matching_indexes1 == <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a>{10, 14, 18, 30, 33}));</div>
|
||||
<div class="line"><span class="lineno"> 79</span> </div>
|
||||
<div class="line"><span class="lineno"> 80</span> <span class="comment">// corner case</span></div>
|
||||
<div class="line"><span class="lineno"> 81</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> text2 = <span class="stringliteral">"greengrass"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 82</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> pattern2 = <span class="stringliteral">"abc"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 83</span> </div>
|
||||
<div class="line"><span class="lineno"> 84</span> <span class="comment">// matching_indexes2 gets the indexes where pattern2 exists in text2</span></div>
|
||||
<div class="line"><span class="lineno"> 85</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> matching_indexes2 = <a class="code hl_function" href="#ac186ca3ac3a69b5e52543bb13fe46db8">find_pat_in_text</a>(pattern2, text2);</div>
|
||||
<div class="line"><span class="lineno"> 86</span> assert((matching_indexes2 == <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a>{}));</div>
|
||||
<div class="line"><span class="lineno"> 87</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 72</span> {</div>
|
||||
<div class="line"><span class="lineno"> 73</span> <span class="comment">// usual case</span></div>
|
||||
<div class="line"><span class="lineno"> 74</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> text1 = <span class="stringliteral">"alskfjaldsabc1abc1abcbksbcdnsdabcabc"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 75</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> pattern1 = <span class="stringliteral">"abc"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 76</span> </div>
|
||||
<div class="line"><span class="lineno"> 77</span> <span class="comment">// matching_indexes1 gets the indexes where pattern1 exists in text1</span></div>
|
||||
<div class="line"><span class="lineno"> 78</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> matching_indexes1 = <a class="code hl_function" href="#ac186ca3ac3a69b5e52543bb13fe46db8">find_pat_in_text</a>(pattern1, text1);</div>
|
||||
<div class="line"><span class="lineno"> 79</span> assert((matching_indexes1 == <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a>{10, 14, 18, 30, 33}));</div>
|
||||
<div class="line"><span class="lineno"> 80</span> </div>
|
||||
<div class="line"><span class="lineno"> 81</span> <span class="comment">// corner case</span></div>
|
||||
<div class="line"><span class="lineno"> 82</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> text2 = <span class="stringliteral">"greengrass"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 83</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> pattern2 = <span class="stringliteral">"abc"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 84</span> </div>
|
||||
<div class="line"><span class="lineno"> 85</span> <span class="comment">// matching_indexes2 gets the indexes where pattern2 exists in text2</span></div>
|
||||
<div class="line"><span class="lineno"> 86</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> matching_indexes2 = <a class="code hl_function" href="#ac186ca3ac3a69b5e52543bb13fe46db8">find_pat_in_text</a>(pattern2, text2);</div>
|
||||
<div class="line"><span class="lineno"> 87</span> assert((matching_indexes2 == <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a>{}));</div>
|
||||
<div class="line"><span class="lineno"> 88</span>}</div>
|
||||
<div class="ttc" id="abasic_string_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a></div></div>
|
||||
<div class="ttc" id="az__function_8cpp_html_ac186ca3ac3a69b5e52543bb13fe46db8"><div class="ttname"><a href="#ac186ca3ac3a69b5e52543bb13fe46db8">find_pat_in_text</a></div><div class="ttdeci">std::vector< uint64_t > find_pat_in_text(const std::string &pattern, const std::string &text)</div><div class="ttdoc">Using Z_function to find a pattern in a text.</div><div class="ttdef"><b>Definition</b> z_function.cpp:53</div></div>
|
||||
<div class="ttc" id="az__function_8cpp_html_ac186ca3ac3a69b5e52543bb13fe46db8"><div class="ttname"><a href="#ac186ca3ac3a69b5e52543bb13fe46db8">find_pat_in_text</a></div><div class="ttdeci">std::vector< uint64_t > find_pat_in_text(const std::string &pattern, const std::string &text)</div><div class="ttdoc">Using Z_function to find a pattern in a text.</div><div class="ttdef"><b>Definition</b> z_function.cpp:54</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -303,24 +304,24 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>the Z-function output as a vector array </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 28</span> {</div>
|
||||
<div class="line"><span class="lineno"> 29</span> uint64_t pattern_length = pattern.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>();</div>
|
||||
<div class="line"><span class="lineno"> 30</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> z(pattern_length, 0);</div>
|
||||
<div class="line"><span class="lineno"> 31</span> </div>
|
||||
<div class="line"><span class="lineno"> 32</span> <span class="keywordflow">for</span> (uint64_t i = 1, l = 0, r = 0; i < pattern_length; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 33</span> <span class="keywordflow">if</span> (i <= r) {</div>
|
||||
<div class="line"><span class="lineno"> 34</span> z[i] = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a>(r - i + 1, z[i - l]);</div>
|
||||
<div class="line"><span class="lineno"> 35</span> }</div>
|
||||
<div class="line"><span class="lineno"> 36</span> <span class="keywordflow">while</span> (i + z[i] < pattern_length &&</div>
|
||||
<div class="line"><span class="lineno"> 37</span> pattern[z[i]] == pattern[i + z[i]]) {</div>
|
||||
<div class="line"><span class="lineno"> 38</span> z[i]++;</div>
|
||||
<div class="line"><span class="lineno"> 39</span> }</div>
|
||||
<div class="line"><span class="lineno"> 40</span> <span class="keywordflow">if</span> (i + z[i] - 1 > r) {</div>
|
||||
<div class="line"><span class="lineno"> 41</span> r = i + z[i] - 1;</div>
|
||||
<div class="line"><span class="lineno"> 42</span> }</div>
|
||||
<div class="line"><span class="lineno"> 43</span> }</div>
|
||||
<div class="line"><span class="lineno"> 44</span> <span class="keywordflow">return</span> z;</div>
|
||||
<div class="line"><span class="lineno"> 45</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 29</span> {</div>
|
||||
<div class="line"><span class="lineno"> 30</span> uint64_t pattern_length = pattern.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>();</div>
|
||||
<div class="line"><span class="lineno"> 31</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> z(pattern_length, 0);</div>
|
||||
<div class="line"><span class="lineno"> 32</span> </div>
|
||||
<div class="line"><span class="lineno"> 33</span> <span class="keywordflow">for</span> (uint64_t i = 1, l = 0, r = 0; i < pattern_length; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 34</span> <span class="keywordflow">if</span> (i <= r) {</div>
|
||||
<div class="line"><span class="lineno"> 35</span> z[i] = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a>(r - i + 1, z[i - l]);</div>
|
||||
<div class="line"><span class="lineno"> 36</span> }</div>
|
||||
<div class="line"><span class="lineno"> 37</span> <span class="keywordflow">while</span> (i + z[i] < pattern_length &&</div>
|
||||
<div class="line"><span class="lineno"> 38</span> pattern[z[i]] == pattern[i + z[i]]) {</div>
|
||||
<div class="line"><span class="lineno"> 39</span> z[i]++;</div>
|
||||
<div class="line"><span class="lineno"> 40</span> }</div>
|
||||
<div class="line"><span class="lineno"> 41</span> <span class="keywordflow">if</span> (i + z[i] - 1 > r) {</div>
|
||||
<div class="line"><span class="lineno"> 42</span> r = i + z[i] - 1;</div>
|
||||
<div class="line"><span class="lineno"> 43</span> }</div>
|
||||
<div class="line"><span class="lineno"> 44</span> }</div>
|
||||
<div class="line"><span class="lineno"> 45</span> <span class="keywordflow">return</span> z;</div>
|
||||
<div class="line"><span class="lineno"> 46</span>}</div>
|
||||
<div class="ttc" id="amin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a></div><div class="ttdeci">T min(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
|
||||
@@ -114,12 +114,13 @@ $(function(){initNavTree('d3/dae/dsu__path__compression_8cpp.html','../../'); in
|
||||
<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_path_compression.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../db/de3/dsu__path__compression_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="../../db/de3/dsu__path__compression_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>
|
||||
@@ -165,18 +166,18 @@ element). Disjoint sets uses cases : for finding connected components in a graph
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
<p>< number of items</p>
|
||||
<p>< object of class disjoint sets</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 205</span> {</div>
|
||||
<div class="line"><span class="lineno"> 206</span> uint64_t n = 10; <span class="comment">///< number of items</span></div>
|
||||
<div class="line"><span class="lineno"> 207</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"> 208</span> </div>
|
||||
<div class="line"><span class="lineno"> 209</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"> 210</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"> 211</span> </div>
|
||||
<div class="line"><span class="lineno"> 212</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 213</span>}</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="adsu__path__compression_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_path_compression.cpp:186</div></div>
|
||||
<div class="ttc" id="adsu__path__compression_8cpp_html_ae7880ce913f3058a35ff106d5be9e243"><div class="ttname"><a href="#ae7880ce913f3058a35ff106d5be9e243">test1</a></div><div class="ttdeci">static void test1()</div><div class="ttdoc">Self-test implementations, 1st test.</div><div class="ttdef"><b>Definition</b> dsu_path_compression.cpp:169</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 206</span> {</div>
|
||||
<div class="line"><span class="lineno"> 207</span> uint64_t n = 10; <span class="comment">///< number of items</span></div>
|
||||
<div class="line"><span class="lineno"> 208</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"> 209</span> </div>
|
||||
<div class="line"><span class="lineno"> 210</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"> 211</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"> 212</span> </div>
|
||||
<div class="line"><span class="lineno"> 213</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 214</span>}</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="adsu__path__compression_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_path_compression.cpp:187</div></div>
|
||||
<div class="ttc" id="adsu__path__compression_8cpp_html_ae7880ce913f3058a35ff106d5be9e243"><div class="ttname"><a href="#ae7880ce913f3058a35ff106d5be9e243">test1</a></div><div class="ttdeci">static void test1()</div><div class="ttdoc">Self-test implementations, 1st test.</div><div class="ttdef"><b>Definition</b> dsu_path_compression.cpp:170</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -212,19 +213,19 @@ Here is the call graph for this function:</div>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<p>< number of items</p>
|
||||
<p>< object of class disjoint sets</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 169</span> {</div>
|
||||
<div class="line"><span class="lineno"> 170</span> <span class="comment">// the minimum, maximum, and size of the set</span></div>
|
||||
<div class="line"><span class="lineno"> 171</span> uint64_t n = 10; <span class="comment">///< number of items</span></div>
|
||||
<div class="line"><span class="lineno"> 172</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"> 173</span> <span class="comment">// set 1</span></div>
|
||||
<div class="line"><span class="lineno"> 174</span> d.UnionSet(1, 2); <span class="comment">// performs union operation on 1 and 2</span></div>
|
||||
<div class="line"><span class="lineno"> 175</span> d.UnionSet(1, 4); <span class="comment">// performs union operation on 1 and 4</span></div>
|
||||
<div class="line"><span class="lineno"> 176</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<uint64_t></a> ans = {1, 4, 3};</div>
|
||||
<div class="line"><span class="lineno"> 177</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < ans.size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 178</span> assert(d.get(4).at(i) == ans[i]); <span class="comment">// makes sure algorithm works fine</span></div>
|
||||
<div class="line"><span class="lineno"> 179</span> }</div>
|
||||
<div class="line"><span class="lineno"> 180</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"> 181</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 170</span> {</div>
|
||||
<div class="line"><span class="lineno"> 171</span> <span class="comment">// the minimum, maximum, and size of the set</span></div>
|
||||
<div class="line"><span class="lineno"> 172</span> uint64_t n = 10; <span class="comment">///< number of items</span></div>
|
||||
<div class="line"><span class="lineno"> 173</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"> 174</span> <span class="comment">// set 1</span></div>
|
||||
<div class="line"><span class="lineno"> 175</span> d.UnionSet(1, 2); <span class="comment">// performs union operation on 1 and 2</span></div>
|
||||
<div class="line"><span class="lineno"> 176</span> d.UnionSet(1, 4); <span class="comment">// performs union operation on 1 and 4</span></div>
|
||||
<div class="line"><span class="lineno"> 177</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<uint64_t></a> ans = {1, 4, 3};</div>
|
||||
<div class="line"><span class="lineno"> 178</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < ans.size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 179</span> assert(d.get(4).at(i) == ans[i]); <span class="comment">// makes sure algorithm works fine</span></div>
|
||||
<div class="line"><span class="lineno"> 180</span> }</div>
|
||||
<div class="line"><span class="lineno"> 181</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"> 182</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="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>
|
||||
@@ -263,20 +264,20 @@ Here is the call graph for this function:</div>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<p>< number of items</p>
|
||||
<p>< object of class disjoint sets</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 186</span> {</div>
|
||||
<div class="line"><span class="lineno"> 187</span> <span class="comment">// the minimum, maximum, and size of the set</span></div>
|
||||
<div class="line"><span class="lineno"> 188</span> uint64_t n = 10; <span class="comment">///< number of items</span></div>
|
||||
<div class="line"><span class="lineno"> 189</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"> 190</span> <span class="comment">// set 1</span></div>
|
||||
<div class="line"><span class="lineno"> 191</span> d.UnionSet(3, 5);</div>
|
||||
<div class="line"><span class="lineno"> 192</span> d.UnionSet(5, 6);</div>
|
||||
<div class="line"><span class="lineno"> 193</span> d.UnionSet(5, 7);</div>
|
||||
<div class="line"><span class="lineno"> 194</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<uint64_t></a> ans = {3, 7, 4};</div>
|
||||
<div class="line"><span class="lineno"> 195</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < ans.size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 196</span> assert(d.get(3).at(i) == ans[i]); <span class="comment">// makes sure algorithm works fine</span></div>
|
||||
<div class="line"><span class="lineno"> 197</span> }</div>
|
||||
<div class="line"><span class="lineno"> 198</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"> 199</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 187</span> {</div>
|
||||
<div class="line"><span class="lineno"> 188</span> <span class="comment">// the minimum, maximum, and size of the set</span></div>
|
||||
<div class="line"><span class="lineno"> 189</span> uint64_t n = 10; <span class="comment">///< number of items</span></div>
|
||||
<div class="line"><span class="lineno"> 190</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"> 191</span> <span class="comment">// set 1</span></div>
|
||||
<div class="line"><span class="lineno"> 192</span> d.UnionSet(3, 5);</div>
|
||||
<div class="line"><span class="lineno"> 193</span> d.UnionSet(5, 6);</div>
|
||||
<div class="line"><span class="lineno"> 194</span> d.UnionSet(5, 7);</div>
|
||||
<div class="line"><span class="lineno"> 195</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<uint64_t></a> ans = {3, 7, 4};</div>
|
||||
<div class="line"><span class="lineno"> 196</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < ans.size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 197</span> assert(d.get(3).at(i) == ans[i]); <span class="comment">// makes sure algorithm works fine</span></div>
|
||||
<div class="line"><span class="lineno"> 198</span> }</div>
|
||||
<div class="line"><span class="lineno"> 199</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"> 200</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
|
||||
@@ -115,13 +115,14 @@ $(function(){initNavTree('d3/db3/lru__cache_8cpp.html','../../'); initResizable(
|
||||
<p>An implementation of <a href="https://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU)" target="_blank">LRU Cache</a>. Lru is a part of cache algorithms (also frequently called cache replacement algorithms or cache replacement policies).
|
||||
<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 <list></code><br />
|
||||
<code>#include <unordered_map></code><br />
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for lru_cache.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d1/d6d/lru__cache_8cpp__incl.svg" width="368" 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="../../d1/d6d/lru__cache_8cpp__incl.svg" width="452" 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="nested-classes" name="nested-classes"></a>
|
||||
@@ -219,10 +220,10 @@ template<typename T > </div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 148</span> {</div>
|
||||
<div class="line"><span class="lineno"> 149</span> <span class="comment">// It's just to avoid writing cout and endl</span></div>
|
||||
<div class="line"><span class="lineno"> 150</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">"[TESTS] : ---> "</span> << msg << <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"> 151</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 149</span> {</div>
|
||||
<div class="line"><span class="lineno"> 150</span> <span class="comment">// It's just to avoid writing cout and endl</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">std::cout</a> << <span class="stringliteral">"[TESTS] : ---> "</span> << msg << <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"> 152</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><!-- fragment --><div class="dynheader">
|
||||
@@ -250,26 +251,26 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<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"> 251</span> {</div>
|
||||
<div class="line"><span class="lineno"> 252</span> <a class="code hl_function" href="#a6a3be6d8871b1f5dc03688da8f3ee9e6">lru_tests::run_tests</a>();</div>
|
||||
<div class="line"><span class="lineno"> 253</span> </div>
|
||||
<div class="line"><span class="lineno"> 254</span> <span class="comment">// Usage</span></div>
|
||||
<div class="line"><span class="lineno"> 255</span> <a class="code hl_class" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a> cache(4);</div>
|
||||
<div class="line"><span class="lineno"> 256</span> cache.refer(1);</div>
|
||||
<div class="line"><span class="lineno"> 257</span> cache.refer(2);</div>
|
||||
<div class="line"><span class="lineno"> 258</span> cache.refer(3);</div>
|
||||
<div class="line"><span class="lineno"> 259</span> cache.refer(4);</div>
|
||||
<div class="line"><span class="lineno"> 260</span> cache.refer(5);</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 252</span> {</div>
|
||||
<div class="line"><span class="lineno"> 253</span> <a class="code hl_function" href="#a6a3be6d8871b1f5dc03688da8f3ee9e6">lru_tests::run_tests</a>();</div>
|
||||
<div class="line"><span class="lineno"> 254</span> </div>
|
||||
<div class="line"><span class="lineno"> 255</span> <span class="comment">// Usage</span></div>
|
||||
<div class="line"><span class="lineno"> 256</span> <a class="code hl_class" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a> cache(4);</div>
|
||||
<div class="line"><span class="lineno"> 257</span> cache.refer(1);</div>
|
||||
<div class="line"><span class="lineno"> 258</span> cache.refer(2);</div>
|
||||
<div class="line"><span class="lineno"> 259</span> cache.refer(3);</div>
|
||||
<div class="line"><span class="lineno"> 260</span> cache.refer(4);</div>
|
||||
<div class="line"><span class="lineno"> 261</span> cache.refer(5);</div>
|
||||
<div class="line"><span class="lineno"> 262</span> </div>
|
||||
<div class="line"><span class="lineno"> 263</span> cache.display();</div>
|
||||
<div class="line"><span class="lineno"> 264</span> </div>
|
||||
<div class="line"><span class="lineno"> 265</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">"Hits: "</span> << cache.getHits()</div>
|
||||
<div class="line"><span class="lineno"> 266</span> << <span class="stringliteral">" Miss: "</span> << cache.getPageFault() << <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"> 267</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 268</span>}</div>
|
||||
<div class="ttc" id="aclassothers_1_1lru__cache_1_1_l_r_u_cache_html"><div class="ttname"><a href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a></div><div class="ttdoc">LRU cache class.</div><div class="ttdef"><b>Definition</b> lru_cache.cpp:67</div></div>
|
||||
<div class="ttc" id="alru__cache_8cpp_html_a6a3be6d8871b1f5dc03688da8f3ee9e6"><div class="ttname"><a href="#a6a3be6d8871b1f5dc03688da8f3ee9e6">lru_tests::run_tests</a></div><div class="ttdeci">static void run_tests()</div><div class="ttdoc">A function to invoke all test cases.</div><div class="ttdef"><b>Definition</b> lru_cache.cpp:238</div></div>
|
||||
<div class="line"><span class="lineno"> 262</span> cache.refer(5);</div>
|
||||
<div class="line"><span class="lineno"> 263</span> </div>
|
||||
<div class="line"><span class="lineno"> 264</span> cache.display();</div>
|
||||
<div class="line"><span class="lineno"> 265</span> </div>
|
||||
<div class="line"><span class="lineno"> 266</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">"Hits: "</span> << cache.getHits()</div>
|
||||
<div class="line"><span class="lineno"> 267</span> << <span class="stringliteral">" Miss: "</span> << cache.getPageFault() << <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"> 268</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 269</span>}</div>
|
||||
<div class="ttc" id="aclassothers_1_1lru__cache_1_1_l_r_u_cache_html"><div class="ttname"><a href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a></div><div class="ttdoc">LRU cache class.</div><div class="ttdef"><b>Definition</b> lru_cache.cpp:68</div></div>
|
||||
<div class="ttc" id="alru__cache_8cpp_html_a6a3be6d8871b1f5dc03688da8f3ee9e6"><div class="ttname"><a href="#a6a3be6d8871b1f5dc03688da8f3ee9e6">lru_tests::run_tests</a></div><div class="ttdeci">static void run_tests()</div><div class="ttdoc">A function to invoke all test cases.</div><div class="ttdef"><b>Definition</b> lru_cache.cpp:239</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -303,13 +304,13 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>A function to invoke all test cases. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 238</span> {</div>
|
||||
<div class="line"><span class="lineno"> 239</span> <a class="code hl_function" href="../../d2/de9/heavy__light__decomposition_8cpp.html#a34b8683a2b429de5cce57e6d733ec817">test_1</a>();</div>
|
||||
<div class="line"><span class="lineno"> 240</span> <a class="code hl_function" href="../../d2/de9/heavy__light__decomposition_8cpp.html#a458410412185a5f09199deaff7157a8d">test_2</a>();</div>
|
||||
<div class="line"><span class="lineno"> 241</span> <a class="code hl_function" href="../../d2/de9/heavy__light__decomposition_8cpp.html#af31ec5409537703d9c8a47350386b32a">test_3</a>();</div>
|
||||
<div class="line"><span class="lineno"> 242</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">""</span>);</div>
|
||||
<div class="line"><span class="lineno"> 243</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"TESTS COMPLETED!"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 244</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 239</span> {</div>
|
||||
<div class="line"><span class="lineno"> 240</span> <a class="code hl_function" href="../../d2/de9/heavy__light__decomposition_8cpp.html#a34b8683a2b429de5cce57e6d733ec817">test_1</a>();</div>
|
||||
<div class="line"><span class="lineno"> 241</span> <a class="code hl_function" href="../../d2/de9/heavy__light__decomposition_8cpp.html#a458410412185a5f09199deaff7157a8d">test_2</a>();</div>
|
||||
<div class="line"><span class="lineno"> 242</span> <a class="code hl_function" href="../../d2/de9/heavy__light__decomposition_8cpp.html#af31ec5409537703d9c8a47350386b32a">test_3</a>();</div>
|
||||
<div class="line"><span class="lineno"> 243</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">""</span>);</div>
|
||||
<div class="line"><span class="lineno"> 244</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"TESTS COMPLETED!"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 245</span>}</div>
|
||||
<div class="ttc" id="aheavy__light__decomposition_8cpp_html_a34b8683a2b429de5cce57e6d733ec817"><div class="ttname"><a href="../../d2/de9/heavy__light__decomposition_8cpp.html#a34b8683a2b429de5cce57e6d733ec817">test_1</a></div><div class="ttdeci">static void test_1()</div><div class="ttdef"><b>Definition</b> heavy_light_decomposition.cpp:505</div></div>
|
||||
<div class="ttc" id="aheavy__light__decomposition_8cpp_html_a458410412185a5f09199deaff7157a8d"><div class="ttname"><a href="../../d2/de9/heavy__light__decomposition_8cpp.html#a458410412185a5f09199deaff7157a8d">test_2</a></div><div class="ttdeci">static void test_2()</div><div class="ttdef"><b>Definition</b> heavy_light_decomposition.cpp:549</div></div>
|
||||
<div class="ttc" id="aheavy__light__decomposition_8cpp_html_af31ec5409537703d9c8a47350386b32a"><div class="ttname"><a href="../../d2/de9/heavy__light__decomposition_8cpp.html#af31ec5409537703d9c8a47350386b32a">test_3</a></div><div class="ttdeci">static void test_3()</div><div class="ttdef"><b>Definition</b> heavy_light_decomposition.cpp:592</div></div>
|
||||
@@ -347,26 +348,26 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>A simple test case The assert statement will check expected hist and miss to resultant hits and miss. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 159</span> {</div>
|
||||
<div class="line"><span class="lineno"> 160</span> uint64_t expected_hits = 2;</div>
|
||||
<div class="line"><span class="lineno"> 161</span> uint64_t expected_pageFault = 4;</div>
|
||||
<div class="line"><span class="lineno"> 162</span> </div>
|
||||
<div class="line"><span class="lineno"> 163</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Running Test-1..."</span>);</div>
|
||||
<div class="line"><span class="lineno"> 164</span> </div>
|
||||
<div class="line"><span class="lineno"> 165</span> <a class="code hl_class" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a> cache(4);</div>
|
||||
<div class="line"><span class="lineno"> 166</span> cache.refer(1);</div>
|
||||
<div class="line"><span class="lineno"> 167</span> cache.refer(2);</div>
|
||||
<div class="line"><span class="lineno"> 168</span> cache.refer(5);</div>
|
||||
<div class="line"><span class="lineno"> 169</span> cache.refer(1);</div>
|
||||
<div class="line"><span class="lineno"> 170</span> cache.refer(4);</div>
|
||||
<div class="line"><span class="lineno"> 171</span> cache.refer(5);</div>
|
||||
<div class="line"><span class="lineno"> 172</span> </div>
|
||||
<div class="line"><span class="lineno"> 173</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Checking assert statement..."</span>);</div>
|
||||
<div class="line"><span class="lineno"> 174</span> assert(cache.getHits() == expected_hits &&</div>
|
||||
<div class="line"><span class="lineno"> 175</span> cache.getPageFault() == expected_pageFault);</div>
|
||||
<div class="line"><span class="lineno"> 176</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Assert successful!"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 177</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Test-1 complete!"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 178</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 160</span> {</div>
|
||||
<div class="line"><span class="lineno"> 161</span> uint64_t expected_hits = 2;</div>
|
||||
<div class="line"><span class="lineno"> 162</span> uint64_t expected_pageFault = 4;</div>
|
||||
<div class="line"><span class="lineno"> 163</span> </div>
|
||||
<div class="line"><span class="lineno"> 164</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Running Test-1..."</span>);</div>
|
||||
<div class="line"><span class="lineno"> 165</span> </div>
|
||||
<div class="line"><span class="lineno"> 166</span> <a class="code hl_class" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a> cache(4);</div>
|
||||
<div class="line"><span class="lineno"> 167</span> cache.refer(1);</div>
|
||||
<div class="line"><span class="lineno"> 168</span> cache.refer(2);</div>
|
||||
<div class="line"><span class="lineno"> 169</span> cache.refer(5);</div>
|
||||
<div class="line"><span class="lineno"> 170</span> cache.refer(1);</div>
|
||||
<div class="line"><span class="lineno"> 171</span> cache.refer(4);</div>
|
||||
<div class="line"><span class="lineno"> 172</span> cache.refer(5);</div>
|
||||
<div class="line"><span class="lineno"> 173</span> </div>
|
||||
<div class="line"><span class="lineno"> 174</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Checking assert statement..."</span>);</div>
|
||||
<div class="line"><span class="lineno"> 175</span> assert(cache.getHits() == expected_hits &&</div>
|
||||
<div class="line"><span class="lineno"> 176</span> cache.getPageFault() == expected_pageFault);</div>
|
||||
<div class="line"><span class="lineno"> 177</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Assert successful!"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 178</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Test-1 complete!"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 179</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -400,26 +401,26 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>A test case contains hits more than cache size The assert statement will check expected hist and miss to resultant hits and miss. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 186</span> {</div>
|
||||
<div class="line"><span class="lineno"> 187</span> uint64_t expected_hits = 4;</div>
|
||||
<div class="line"><span class="lineno"> 188</span> uint64_t expected_pageFault = 2;</div>
|
||||
<div class="line"><span class="lineno"> 189</span> </div>
|
||||
<div class="line"><span class="lineno"> 190</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Running Test-2..."</span>);</div>
|
||||
<div class="line"><span class="lineno"> 191</span> </div>
|
||||
<div class="line"><span class="lineno"> 192</span> <a class="code hl_class" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a> cache(4);</div>
|
||||
<div class="line"><span class="lineno"> 193</span> cache.refer(1);</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 187</span> {</div>
|
||||
<div class="line"><span class="lineno"> 188</span> uint64_t expected_hits = 4;</div>
|
||||
<div class="line"><span class="lineno"> 189</span> uint64_t expected_pageFault = 2;</div>
|
||||
<div class="line"><span class="lineno"> 190</span> </div>
|
||||
<div class="line"><span class="lineno"> 191</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Running Test-2..."</span>);</div>
|
||||
<div class="line"><span class="lineno"> 192</span> </div>
|
||||
<div class="line"><span class="lineno"> 193</span> <a class="code hl_class" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a> cache(4);</div>
|
||||
<div class="line"><span class="lineno"> 194</span> cache.refer(1);</div>
|
||||
<div class="line"><span class="lineno"> 195</span> cache.refer(1);</div>
|
||||
<div class="line"><span class="lineno"> 196</span> cache.refer(1);</div>
|
||||
<div class="line"><span class="lineno"> 197</span> cache.refer(1);</div>
|
||||
<div class="line"><span class="lineno"> 198</span> cache.refer(5);</div>
|
||||
<div class="line"><span class="lineno"> 199</span> </div>
|
||||
<div class="line"><span class="lineno"> 200</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Checking assert statement..."</span>);</div>
|
||||
<div class="line"><span class="lineno"> 201</span> assert(cache.getHits() == expected_hits &&</div>
|
||||
<div class="line"><span class="lineno"> 202</span> cache.getPageFault() == expected_pageFault);</div>
|
||||
<div class="line"><span class="lineno"> 203</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Assert successful!"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 204</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Test-2 complete!"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 205</span>}</div>
|
||||
<div class="line"><span class="lineno"> 198</span> cache.refer(1);</div>
|
||||
<div class="line"><span class="lineno"> 199</span> cache.refer(5);</div>
|
||||
<div class="line"><span class="lineno"> 200</span> </div>
|
||||
<div class="line"><span class="lineno"> 201</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Checking assert statement..."</span>);</div>
|
||||
<div class="line"><span class="lineno"> 202</span> assert(cache.getHits() == expected_hits &&</div>
|
||||
<div class="line"><span class="lineno"> 203</span> cache.getPageFault() == expected_pageFault);</div>
|
||||
<div class="line"><span class="lineno"> 204</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Assert successful!"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 205</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Test-2 complete!"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 206</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -453,26 +454,26 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>A simple test case The assert statement will check expected hist and miss to resultant hits and miss. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 213</span> {</div>
|
||||
<div class="line"><span class="lineno"> 214</span> uint64_t expected_hits = 1;</div>
|
||||
<div class="line"><span class="lineno"> 215</span> uint64_t expected_pageFault = 5;</div>
|
||||
<div class="line"><span class="lineno"> 216</span> </div>
|
||||
<div class="line"><span class="lineno"> 217</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Running Test-3..."</span>);</div>
|
||||
<div class="line"><span class="lineno"> 218</span> </div>
|
||||
<div class="line"><span class="lineno"> 219</span> <a class="code hl_class" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a> cache(4);</div>
|
||||
<div class="line"><span class="lineno"> 220</span> cache.refer(1);</div>
|
||||
<div class="line"><span class="lineno"> 221</span> cache.refer(2);</div>
|
||||
<div class="line"><span class="lineno"> 222</span> cache.refer(3);</div>
|
||||
<div class="line"><span class="lineno"> 223</span> cache.refer(4);</div>
|
||||
<div class="line"><span class="lineno"> 224</span> cache.refer(5);</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 214</span> {</div>
|
||||
<div class="line"><span class="lineno"> 215</span> uint64_t expected_hits = 1;</div>
|
||||
<div class="line"><span class="lineno"> 216</span> uint64_t expected_pageFault = 5;</div>
|
||||
<div class="line"><span class="lineno"> 217</span> </div>
|
||||
<div class="line"><span class="lineno"> 218</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Running Test-3..."</span>);</div>
|
||||
<div class="line"><span class="lineno"> 219</span> </div>
|
||||
<div class="line"><span class="lineno"> 220</span> <a class="code hl_class" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a> cache(4);</div>
|
||||
<div class="line"><span class="lineno"> 221</span> cache.refer(1);</div>
|
||||
<div class="line"><span class="lineno"> 222</span> cache.refer(2);</div>
|
||||
<div class="line"><span class="lineno"> 223</span> cache.refer(3);</div>
|
||||
<div class="line"><span class="lineno"> 224</span> cache.refer(4);</div>
|
||||
<div class="line"><span class="lineno"> 225</span> cache.refer(5);</div>
|
||||
<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/numeric/math/log.html">log</a>(<span class="stringliteral">"Checking assert statement..."</span>);</div>
|
||||
<div class="line"><span class="lineno"> 228</span> assert(cache.getHits() == expected_hits &&</div>
|
||||
<div class="line"><span class="lineno"> 229</span> cache.getPageFault() == expected_pageFault);</div>
|
||||
<div class="line"><span class="lineno"> 230</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Assert successful!"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 231</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Test-3 complete!"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 232</span>}</div>
|
||||
<div class="line"><span class="lineno"> 226</span> cache.refer(5);</div>
|
||||
<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/numeric/math/log.html">log</a>(<span class="stringliteral">"Checking assert statement..."</span>);</div>
|
||||
<div class="line"><span class="lineno"> 229</span> assert(cache.getHits() == expected_hits &&</div>
|
||||
<div class="line"><span class="lineno"> 230</span> cache.getPageFault() == expected_pageFault);</div>
|
||||
<div class="line"><span class="lineno"> 231</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Assert successful!"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 232</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">"Test-3 complete!"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 233</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
|
||||
@@ -160,7 +160,7 @@ Static Private Member Functions</h2></td></tr>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 160</span>: uint8_t { not_visited = 0, in_stack, visited };</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 161</span>: uint8_t { not_visited = 0, in_stack, visited };</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -196,56 +196,56 @@ Static Private Member Functions</h2></td></tr>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>true if a cycle is detected, else false. </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 249</span> {</div>
|
||||
<div class="line"><span class="lineno"> 250</span> <span class="keyword">auto</span> graphAjdList = <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.getAdjList();</div>
|
||||
<div class="line"><span class="lineno"> 251</span> <span class="keyword">auto</span> vertices = <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.getVertices();</div>
|
||||
<div class="line"><span class="lineno"> 252</span> </div>
|
||||
<div class="line"><span class="lineno"> 253</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<unsigned int></a> indegree(vertices, 0);</div>
|
||||
<div class="line"><span class="lineno"> 254</span> <span class="comment">// Calculate the indegree i.e. the number of incident edges to the node.</span></div>
|
||||
<div class="line"><span class="lineno"> 255</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span>& <a class="code hl_struct" href="../../d8/d10/structlist.html">list</a> : graphAjdList) {</div>
|
||||
<div class="line"><span class="lineno"> 256</span> <span class="keyword">auto</span> children = <a class="code hl_struct" href="../../d8/d10/structlist.html">list</a>.second;</div>
|
||||
<div class="line"><span class="lineno"> 257</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span>& child : children) {</div>
|
||||
<div class="line"><span class="lineno"> 258</span> indegree[child]++;</div>
|
||||
<div class="line"><span class="lineno"> 259</span> }</div>
|
||||
<div class="line"><span class="lineno"> 260</span> }</div>
|
||||
<div class="line"><span class="lineno"> 261</span> </div>
|
||||
<div class="line"><span class="lineno"> 262</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue.html">std::queue<unsigned int></a> can_be_solved;</div>
|
||||
<div class="line"><span class="lineno"> 263</span> <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = 0; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> < vertices; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>++) {</div>
|
||||
<div class="line"><span class="lineno"> 264</span> <span class="comment">// If a node doesn't have any input edges, then that node will</span></div>
|
||||
<div class="line"><span class="lineno"> 265</span> <span class="comment">// definately not result in a cycle and can be visited safely.</span></div>
|
||||
<div class="line"><span class="lineno"> 266</span> <span class="keywordflow">if</span> (!indegree[<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>]) {</div>
|
||||
<div class="line"><span class="lineno"> 267</span> can_be_solved.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/emplace.html">emplace</a>(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>);</div>
|
||||
<div class="line"><span class="lineno"> 268</span> }</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="comment">// Vertices that need to be traversed.</span></div>
|
||||
<div class="line"><span class="lineno"> 272</span> <span class="keyword">auto</span> remain = vertices;</div>
|
||||
<div class="line"><span class="lineno"> 273</span> <span class="comment">// While there are safe nodes that we can visit.</span></div>
|
||||
<div class="line"><span class="lineno"> 274</span> <span class="keywordflow">while</span> (!can_be_solved.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/empty.html">empty</a>()) {</div>
|
||||
<div class="line"><span class="lineno"> 275</span> <span class="keyword">auto</span> solved = can_be_solved.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/front.html">front</a>();</div>
|
||||
<div class="line"><span class="lineno"> 276</span> <span class="comment">// Visit the node.</span></div>
|
||||
<div class="line"><span class="lineno"> 277</span> can_be_solved.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/pop.html">pop</a>();</div>
|
||||
<div class="line"><span class="lineno"> 278</span> <span class="comment">// Decrease number of nodes that need to be traversed.</span></div>
|
||||
<div class="line"><span class="lineno"> 279</span> remain--;</div>
|
||||
<div class="line"><span class="lineno"> 280</span> </div>
|
||||
<div class="line"><span class="lineno"> 281</span> <span class="comment">// Visit all the children of the visited node.</span></div>
|
||||
<div class="line"><span class="lineno"> 282</span> <span class="keyword">auto</span> it = graphAjdList.find(solved);</div>
|
||||
<div class="line"><span class="lineno"> 283</span> <span class="keywordflow">if</span> (it != graphAjdList.end()) {</div>
|
||||
<div class="line"><span class="lineno"> 284</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> child : it->second) {</div>
|
||||
<div class="line"><span class="lineno"> 285</span> <span class="comment">// Check if we can visited the node safely.</span></div>
|
||||
<div class="line"><span class="lineno"> 286</span> <span class="keywordflow">if</span> (--indegree[child] == 0) {</div>
|
||||
<div class="line"><span class="lineno"> 287</span> <span class="comment">// if node can be visited safely, then add that node to</span></div>
|
||||
<div class="line"><span class="lineno"> 288</span> <span class="comment">// the visit queue.</span></div>
|
||||
<div class="line"><span class="lineno"> 289</span> can_be_solved.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/emplace.html">emplace</a>(child);</div>
|
||||
<div class="line"><span class="lineno"> 290</span> }</div>
|
||||
<div class="line"><span class="lineno"> 291</span> }</div>
|
||||
<div class="line"><span class="lineno"> 292</span> }</div>
|
||||
<div class="line"><span class="lineno"> 293</span> }</div>
|
||||
<div class="line"><span class="lineno"> 294</span> </div>
|
||||
<div class="line"><span class="lineno"> 295</span> <span class="comment">// If there are still nodes that we can't visit, then it means that</span></div>
|
||||
<div class="line"><span class="lineno"> 296</span> <span class="comment">// there is a cycle and return true, else return false.</span></div>
|
||||
<div class="line"><span class="lineno"> 297</span> <span class="keywordflow">return</span> !(remain == 0);</div>
|
||||
<div class="line"><span class="lineno"> 298</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 250</span> {</div>
|
||||
<div class="line"><span class="lineno"> 251</span> <span class="keyword">auto</span> graphAjdList = <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.getAdjList();</div>
|
||||
<div class="line"><span class="lineno"> 252</span> <span class="keyword">auto</span> vertices = <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.getVertices();</div>
|
||||
<div class="line"><span class="lineno"> 253</span> </div>
|
||||
<div class="line"><span class="lineno"> 254</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<unsigned int></a> indegree(vertices, 0);</div>
|
||||
<div class="line"><span class="lineno"> 255</span> <span class="comment">// Calculate the indegree i.e. the number of incident edges to the node.</span></div>
|
||||
<div class="line"><span class="lineno"> 256</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span>& <a class="code hl_struct" href="../../d8/d10/structlist.html">list</a> : graphAjdList) {</div>
|
||||
<div class="line"><span class="lineno"> 257</span> <span class="keyword">auto</span> children = <a class="code hl_struct" href="../../d8/d10/structlist.html">list</a>.second;</div>
|
||||
<div class="line"><span class="lineno"> 258</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span>& child : children) {</div>
|
||||
<div class="line"><span class="lineno"> 259</span> indegree[child]++;</div>
|
||||
<div class="line"><span class="lineno"> 260</span> }</div>
|
||||
<div class="line"><span class="lineno"> 261</span> }</div>
|
||||
<div class="line"><span class="lineno"> 262</span> </div>
|
||||
<div class="line"><span class="lineno"> 263</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue.html">std::queue<unsigned int></a> can_be_solved;</div>
|
||||
<div class="line"><span class="lineno"> 264</span> <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = 0; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> < vertices; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>++) {</div>
|
||||
<div class="line"><span class="lineno"> 265</span> <span class="comment">// If a node doesn't have any input edges, then that node will</span></div>
|
||||
<div class="line"><span class="lineno"> 266</span> <span class="comment">// definately not result in a cycle and can be visited safely.</span></div>
|
||||
<div class="line"><span class="lineno"> 267</span> <span class="keywordflow">if</span> (!indegree[<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>]) {</div>
|
||||
<div class="line"><span class="lineno"> 268</span> can_be_solved.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/emplace.html">emplace</a>(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>);</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> </div>
|
||||
<div class="line"><span class="lineno"> 272</span> <span class="comment">// Vertices that need to be traversed.</span></div>
|
||||
<div class="line"><span class="lineno"> 273</span> <span class="keyword">auto</span> remain = vertices;</div>
|
||||
<div class="line"><span class="lineno"> 274</span> <span class="comment">// While there are safe nodes that we can visit.</span></div>
|
||||
<div class="line"><span class="lineno"> 275</span> <span class="keywordflow">while</span> (!can_be_solved.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/empty.html">empty</a>()) {</div>
|
||||
<div class="line"><span class="lineno"> 276</span> <span class="keyword">auto</span> solved = can_be_solved.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/front.html">front</a>();</div>
|
||||
<div class="line"><span class="lineno"> 277</span> <span class="comment">// Visit the node.</span></div>
|
||||
<div class="line"><span class="lineno"> 278</span> can_be_solved.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/pop.html">pop</a>();</div>
|
||||
<div class="line"><span class="lineno"> 279</span> <span class="comment">// Decrease number of nodes that need to be traversed.</span></div>
|
||||
<div class="line"><span class="lineno"> 280</span> remain--;</div>
|
||||
<div class="line"><span class="lineno"> 281</span> </div>
|
||||
<div class="line"><span class="lineno"> 282</span> <span class="comment">// Visit all the children of the visited node.</span></div>
|
||||
<div class="line"><span class="lineno"> 283</span> <span class="keyword">auto</span> it = graphAjdList.find(solved);</div>
|
||||
<div class="line"><span class="lineno"> 284</span> <span class="keywordflow">if</span> (it != graphAjdList.end()) {</div>
|
||||
<div class="line"><span class="lineno"> 285</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> child : it->second) {</div>
|
||||
<div class="line"><span class="lineno"> 286</span> <span class="comment">// Check if we can visited the node safely.</span></div>
|
||||
<div class="line"><span class="lineno"> 287</span> <span class="keywordflow">if</span> (--indegree[child] == 0) {</div>
|
||||
<div class="line"><span class="lineno"> 288</span> <span class="comment">// if node can be visited safely, then add that node to</span></div>
|
||||
<div class="line"><span class="lineno"> 289</span> <span class="comment">// the visit queue.</span></div>
|
||||
<div class="line"><span class="lineno"> 290</span> can_be_solved.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/emplace.html">emplace</a>(child);</div>
|
||||
<div class="line"><span class="lineno"> 291</span> }</div>
|
||||
<div class="line"><span class="lineno"> 292</span> }</div>
|
||||
<div class="line"><span class="lineno"> 293</span> }</div>
|
||||
<div class="line"><span class="lineno"> 294</span> }</div>
|
||||
<div class="line"><span class="lineno"> 295</span> </div>
|
||||
<div class="line"><span class="lineno"> 296</span> <span class="comment">// If there are still nodes that we can't visit, then it means that</span></div>
|
||||
<div class="line"><span class="lineno"> 297</span> <span class="comment">// there is a cycle and return true, else return false.</span></div>
|
||||
<div class="line"><span class="lineno"> 298</span> <span class="keywordflow">return</span> !(remain == 0);</div>
|
||||
<div class="line"><span class="lineno"> 299</span> }</div>
|
||||
<div class="ttc" id="aemplace_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/queue/emplace.html">std::queue::emplace</a></div><div class="ttdeci">T emplace(T... args)</div></div>
|
||||
<div class="ttc" id="aempty_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/queue/empty.html">std::queue::empty</a></div><div class="ttdeci">T empty(T... args)</div></div>
|
||||
<div class="ttc" id="afront_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/queue/front.html">std::queue::front</a></div><div class="ttdeci">T front(T... args)</div></div>
|
||||
@@ -297,36 +297,36 @@ Here is the call graph for this function:</div>
|
||||
<p>State of the node.</p>
|
||||
<p>It is a vector of "nodeStates" which represents the state node is in. It can take only 3 values: "not_visited", "in_stack", and "visited".</p>
|
||||
<p>Initially, all nodes are in "not_visited" state.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 212</span> {</div>
|
||||
<div class="line"><span class="lineno"> 213</span> <span class="keyword">auto</span> vertices = <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.getVertices();</div>
|
||||
<div class="line"><span class="lineno"> 214</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 215</span><span class="comment"> /** State of the node.</span></div>
|
||||
<div class="line"><span class="lineno"> 216</span><span class="comment"> *</span></div>
|
||||
<div class="line"><span class="lineno"> 217</span><span class="comment"> * It is a vector of "nodeStates" which represents the state node is in.</span></div>
|
||||
<div class="line"><span class="lineno"> 218</span><span class="comment"> * It can take only 3 values: "not_visited", "in_stack", and "visited".</span></div>
|
||||
<div class="line"><span class="lineno"> 219</span><span class="comment"> *</span></div>
|
||||
<div class="line"><span class="lineno"> 220</span><span class="comment"> * Initially, all nodes are in "not_visited" state.</span></div>
|
||||
<div class="line"><span class="lineno"> 221</span><span class="comment"> */</span></div>
|
||||
<div class="line"><span class="lineno"> 222</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<nodeStates></a> state(vertices, not_visited);</div>
|
||||
<div class="line"><span class="lineno"> 223</span> </div>
|
||||
<div class="line"><span class="lineno"> 224</span> <span class="comment">// Start visiting each node.</span></div>
|
||||
<div class="line"><span class="lineno"> 225</span> <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = 0; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> < vertices; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>++) {</div>
|
||||
<div class="line"><span class="lineno"> 226</span> <span class="comment">// If a node is not visited, only then check for presence of cycle.</span></div>
|
||||
<div class="line"><span class="lineno"> 227</span> <span class="comment">// There is no need to check for presence of cycle for a visited</span></div>
|
||||
<div class="line"><span class="lineno"> 228</span> <span class="comment">// node as it has already been checked for presence of cycle.</span></div>
|
||||
<div class="line"><span class="lineno"> 229</span> <span class="keywordflow">if</span> (state[<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>] == not_visited) {</div>
|
||||
<div class="line"><span class="lineno"> 230</span> <span class="comment">// Check for cycle.</span></div>
|
||||
<div class="line"><span class="lineno"> 231</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="#a2f4485c08b45e7a21a2e86f9c3f01d8b">isCyclicDFSHelper</a>(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.getAdjList(), &state, <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>)) {</div>
|
||||
<div class="line"><span class="lineno"> 232</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 233</span> }</div>
|
||||
<div class="line"><span class="lineno"> 234</span> }</div>
|
||||
<div class="line"><span class="lineno"> 235</span> }</div>
|
||||
<div class="line"><span class="lineno"> 236</span> </div>
|
||||
<div class="line"><span class="lineno"> 237</span> <span class="comment">// All nodes have been safely traversed, that means there is no cycle in</span></div>
|
||||
<div class="line"><span class="lineno"> 238</span> <span class="comment">// the graph. Return false.</span></div>
|
||||
<div class="line"><span class="lineno"> 239</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 240</span> }</div>
|
||||
<div class="ttc" id="aclass_cycle_check_html_a2f4485c08b45e7a21a2e86f9c3f01d8b"><div class="ttname"><a href="#a2f4485c08b45e7a21a2e86f9c3f01d8b">CycleCheck::isCyclicDFSHelper</a></div><div class="ttdeci">static bool isCyclicDFSHelper(AdjList const &adjList, std::vector< nodeStates > *state, unsigned int node)</div><div class="ttdef"><b>Definition</b> cycle_check_directed_graph.cpp:170</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 213</span> {</div>
|
||||
<div class="line"><span class="lineno"> 214</span> <span class="keyword">auto</span> vertices = <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.getVertices();</div>
|
||||
<div class="line"><span class="lineno"> 215</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 216</span><span class="comment"> /** State of the node.</span></div>
|
||||
<div class="line"><span class="lineno"> 217</span><span class="comment"> *</span></div>
|
||||
<div class="line"><span class="lineno"> 218</span><span class="comment"> * It is a vector of "nodeStates" which represents the state node is in.</span></div>
|
||||
<div class="line"><span class="lineno"> 219</span><span class="comment"> * It can take only 3 values: "not_visited", "in_stack", and "visited".</span></div>
|
||||
<div class="line"><span class="lineno"> 220</span><span class="comment"> *</span></div>
|
||||
<div class="line"><span class="lineno"> 221</span><span class="comment"> * Initially, all nodes are in "not_visited" state.</span></div>
|
||||
<div class="line"><span class="lineno"> 222</span><span class="comment"> */</span></div>
|
||||
<div class="line"><span class="lineno"> 223</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<nodeStates></a> state(vertices, not_visited);</div>
|
||||
<div class="line"><span class="lineno"> 224</span> </div>
|
||||
<div class="line"><span class="lineno"> 225</span> <span class="comment">// Start visiting each node.</span></div>
|
||||
<div class="line"><span class="lineno"> 226</span> <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = 0; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> < vertices; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>++) {</div>
|
||||
<div class="line"><span class="lineno"> 227</span> <span class="comment">// If a node is not visited, only then check for presence of cycle.</span></div>
|
||||
<div class="line"><span class="lineno"> 228</span> <span class="comment">// There is no need to check for presence of cycle for a visited</span></div>
|
||||
<div class="line"><span class="lineno"> 229</span> <span class="comment">// node as it has already been checked for presence of cycle.</span></div>
|
||||
<div class="line"><span class="lineno"> 230</span> <span class="keywordflow">if</span> (state[<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>] == not_visited) {</div>
|
||||
<div class="line"><span class="lineno"> 231</span> <span class="comment">// Check for cycle.</span></div>
|
||||
<div class="line"><span class="lineno"> 232</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="#a2f4485c08b45e7a21a2e86f9c3f01d8b">isCyclicDFSHelper</a>(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.getAdjList(), &state, <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>)) {</div>
|
||||
<div class="line"><span class="lineno"> 233</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 234</span> }</div>
|
||||
<div class="line"><span class="lineno"> 235</span> }</div>
|
||||
<div class="line"><span class="lineno"> 236</span> }</div>
|
||||
<div class="line"><span class="lineno"> 237</span> </div>
|
||||
<div class="line"><span class="lineno"> 238</span> <span class="comment">// All nodes have been safely traversed, that means there is no cycle in</span></div>
|
||||
<div class="line"><span class="lineno"> 239</span> <span class="comment">// the graph. Return false.</span></div>
|
||||
<div class="line"><span class="lineno"> 240</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 241</span> }</div>
|
||||
<div class="ttc" id="aclass_cycle_check_html_a2f4485c08b45e7a21a2e86f9c3f01d8b"><div class="ttname"><a href="#a2f4485c08b45e7a21a2e86f9c3f01d8b">CycleCheck::isCyclicDFSHelper</a></div><div class="ttdeci">static bool isCyclicDFSHelper(AdjList const &adjList, std::vector< nodeStates > *state, unsigned int node)</div><div class="ttdef"><b>Definition</b> cycle_check_directed_graph.cpp:171</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -376,37 +376,37 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>true if graph has a cycle, else false. </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 172</span> {</div>
|
||||
<div class="line"><span class="lineno"> 173</span> <span class="comment">// Add node "in_stack" state.</span></div>
|
||||
<div class="line"><span class="lineno"> 174</span> (*state)[<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>] = in_stack;</div>
|
||||
<div class="line"><span class="lineno"> 175</span> </div>
|
||||
<div class="line"><span class="lineno"> 176</span> <span class="comment">// If the node has children, then recursively visit all children of the</span></div>
|
||||
<div class="line"><span class="lineno"> 177</span> <span class="comment">// node.</span></div>
|
||||
<div class="line"><span class="lineno"> 178</span> <span class="keyword">auto</span> <span class="keyword">const</span> it = adjList.find(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>);</div>
|
||||
<div class="line"><span class="lineno"> 179</span> <span class="keywordflow">if</span> (it != adjList.end()) {</div>
|
||||
<div class="line"><span class="lineno"> 180</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> child : it->second) {</div>
|
||||
<div class="line"><span class="lineno"> 181</span> <span class="comment">// If state of child node is "not_visited", evaluate that child</span></div>
|
||||
<div class="line"><span class="lineno"> 182</span> <span class="comment">// for presence of cycle.</span></div>
|
||||
<div class="line"><span class="lineno"> 183</span> <span class="keyword">auto</span> state_of_child = (*state)[child];</div>
|
||||
<div class="line"><span class="lineno"> 184</span> <span class="keywordflow">if</span> (state_of_child == not_visited) {</div>
|
||||
<div class="line"><span class="lineno"> 185</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="#a2f4485c08b45e7a21a2e86f9c3f01d8b">isCyclicDFSHelper</a>(adjList, state, child)) {</div>
|
||||
<div class="line"><span class="lineno"> 186</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 187</span> }</div>
|
||||
<div class="line"><span class="lineno"> 188</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (state_of_child == in_stack) {</div>
|
||||
<div class="line"><span class="lineno"> 189</span> <span class="comment">// If child node was "in_stack", then that means that there</span></div>
|
||||
<div class="line"><span class="lineno"> 190</span> <span class="comment">// is a cycle in the graph. Return true for presence of the</span></div>
|
||||
<div class="line"><span class="lineno"> 191</span> <span class="comment">// cycle.</span></div>
|
||||
<div class="line"><span class="lineno"> 192</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 193</span> }</div>
|
||||
<div class="line"><span class="lineno"> 194</span> }</div>
|
||||
<div class="line"><span class="lineno"> 195</span> }</div>
|
||||
<div class="line"><span class="lineno"> 196</span> </div>
|
||||
<div class="line"><span class="lineno"> 197</span> <span class="comment">// Current node has been evaluated for the presence of cycle and had no</span></div>
|
||||
<div class="line"><span class="lineno"> 198</span> <span class="comment">// cycle. Mark current node as "visited".</span></div>
|
||||
<div class="line"><span class="lineno"> 199</span> (*state)[<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>] = visited;</div>
|
||||
<div class="line"><span class="lineno"> 200</span> <span class="comment">// Return that current node didn't result in any cycles.</span></div>
|
||||
<div class="line"><span class="lineno"> 201</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 202</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 173</span> {</div>
|
||||
<div class="line"><span class="lineno"> 174</span> <span class="comment">// Add node "in_stack" state.</span></div>
|
||||
<div class="line"><span class="lineno"> 175</span> (*state)[<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>] = in_stack;</div>
|
||||
<div class="line"><span class="lineno"> 176</span> </div>
|
||||
<div class="line"><span class="lineno"> 177</span> <span class="comment">// If the node has children, then recursively visit all children of the</span></div>
|
||||
<div class="line"><span class="lineno"> 178</span> <span class="comment">// node.</span></div>
|
||||
<div class="line"><span class="lineno"> 179</span> <span class="keyword">auto</span> <span class="keyword">const</span> it = adjList.find(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>);</div>
|
||||
<div class="line"><span class="lineno"> 180</span> <span class="keywordflow">if</span> (it != adjList.end()) {</div>
|
||||
<div class="line"><span class="lineno"> 181</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> child : it->second) {</div>
|
||||
<div class="line"><span class="lineno"> 182</span> <span class="comment">// If state of child node is "not_visited", evaluate that child</span></div>
|
||||
<div class="line"><span class="lineno"> 183</span> <span class="comment">// for presence of cycle.</span></div>
|
||||
<div class="line"><span class="lineno"> 184</span> <span class="keyword">auto</span> state_of_child = (*state)[child];</div>
|
||||
<div class="line"><span class="lineno"> 185</span> <span class="keywordflow">if</span> (state_of_child == not_visited) {</div>
|
||||
<div class="line"><span class="lineno"> 186</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="#a2f4485c08b45e7a21a2e86f9c3f01d8b">isCyclicDFSHelper</a>(adjList, state, child)) {</div>
|
||||
<div class="line"><span class="lineno"> 187</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 188</span> }</div>
|
||||
<div class="line"><span class="lineno"> 189</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (state_of_child == in_stack) {</div>
|
||||
<div class="line"><span class="lineno"> 190</span> <span class="comment">// If child node was "in_stack", then that means that there</span></div>
|
||||
<div class="line"><span class="lineno"> 191</span> <span class="comment">// is a cycle in the graph. Return true for presence of the</span></div>
|
||||
<div class="line"><span class="lineno"> 192</span> <span class="comment">// cycle.</span></div>
|
||||
<div class="line"><span class="lineno"> 193</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 194</span> }</div>
|
||||
<div class="line"><span class="lineno"> 195</span> }</div>
|
||||
<div class="line"><span class="lineno"> 196</span> }</div>
|
||||
<div class="line"><span class="lineno"> 197</span> </div>
|
||||
<div class="line"><span class="lineno"> 198</span> <span class="comment">// Current node has been evaluated for the presence of cycle and had no</span></div>
|
||||
<div class="line"><span class="lineno"> 199</span> <span class="comment">// cycle. Mark current node as "visited".</span></div>
|
||||
<div class="line"><span class="lineno"> 200</span> (*state)[<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>] = visited;</div>
|
||||
<div class="line"><span class="lineno"> 201</span> <span class="comment">// Return that current node didn't result in any cycles.</span></div>
|
||||
<div class="line"><span class="lineno"> 202</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 203</span> }</div>
|
||||
<div class="ttc" id="aavltree_8cpp_html_a74f0cf18a0e5b832d9994e2f2d022287"><div class="ttname"><a href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a></div><div class="ttdeci">struct node { int data; int height; struct node *left; struct node *right;} node</div><div class="ttdoc">for std::queue</div><div class="ttdef"><b>Definition</b> avltree.cpp:13</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
<map id="others/kadanes3.cpp" name="others/kadanes3.cpp">
|
||||
<area shape="rect" id="Node000001" title="Efficient implementation for maximum contiguous subarray sum by Kadane's algorithm." alt="" coords="83,5,226,31"/>
|
||||
<area shape="rect" id="Node000001" title="Efficient implementation for maximum contiguous subarray sum by Kadane's algorithm." alt="" coords="126,5,268,31"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="5,79,56,105"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="135,34,66,73,63,69,132,29"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="170,34,71,76,69,71,168,29"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="80,79,144,105"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="150,33,129,67,125,64,145,30"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="184,34,139,71,136,67,181,29"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="168,79,227,105"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="164,30,184,64,180,67,159,33"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="251,79,322,105"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="178,29,252,69,250,74,176,34"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="200,31,200,63,194,63,194,31"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="251,79,311,105"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="213,30,257,67,254,71,210,34"/>
|
||||
<area shape="rect" id="Node000006" title=" " alt="" coords="335,79,406,105"/>
|
||||
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="228,29,328,70,326,75,226,34"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
2853e3e0287877a0c88304a3b3f0ebe6
|
||||
3163dfd62ad81ec4b4ed4dcc0bfcc2cb
|
||||
@@ -4,8 +4,8 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: others/kadanes3.cpp Pages: 1 -->
|
||||
<svg width="246pt" height="83pt"
|
||||
viewBox="0.00 0.00 245.62 82.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="309pt" height="83pt"
|
||||
viewBox="0.00 0.00 308.62 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="Efficient implementation for maximum contiguous subarray sum by Kadane's algorithm.">
|
||||
<polygon fill="#999999" stroke="#666666" points="165.25,-74.5 58.5,-74.5 58.5,-55.25 165.25,-55.25 165.25,-74.5"/>
|
||||
<text text-anchor="middle" x="111.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">others/kadanes3.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="197.25,-74.5 90.5,-74.5 90.5,-55.25 197.25,-55.25 197.25,-74.5"/>
|
||||
<text text-anchor="middle" x="143.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">others/kadanes3.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="M96.1,-54.84C81.94,-46.73 60.89,-34.68 44.35,-25.21"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="46.46,-22.39 36.04,-20.45 42.98,-28.46 46.46,-22.39"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M122.67,-54.84C102.32,-46.17 71.39,-33 48.59,-23.28"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="50.09,-20.12 39.52,-19.42 47.35,-26.56 50.09,-20.12"/>
|
||||
</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="M106.59,-55.08C102.4,-48.11 96.4,-38.12 91.14,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="94.2,-27.68 86.05,-20.91 88.2,-31.28 94.2,-27.68"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M133.02,-54.84C123.77,-47.15 110.25,-35.9 99.17,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="101.66,-24.2 91.73,-20.49 97.18,-29.58 101.66,-24.2"/>
|
||||
</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="M117.16,-55.08C121.35,-48.11 127.35,-38.12 132.61,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="135.55,-31.28 137.7,-20.91 129.55,-27.68 135.55,-31.28"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M143.88,-55.08C143.88,-48.57 143.88,-39.42 143.88,-31.12"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="147.38,-31.12 143.88,-21.12 140.38,-31.12 147.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="237.62,-19.25 184.12,-19.25 184.12,0 237.62,0 237.62,-19.25"/>
|
||||
<text text-anchor="middle" x="210.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="229.5,-19.25 184.25,-19.25 184.25,0 229.5,0 229.5,-19.25"/>
|
||||
<text text-anchor="middle" x="206.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</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="M128.67,-54.84C143.89,-46.66 166.57,-34.46 184.26,-24.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="185.52,-28.24 192.67,-20.42 182.2,-22.07 185.52,-28.24"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M154.56,-54.84C163.58,-47.22 176.71,-36.12 187.56,-26.95"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="189.81,-29.63 195.19,-20.5 185.29,-24.28 189.81,-29.63"/>
|
||||
</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="300.62,-19.25 247.12,-19.25 247.12,0 300.62,0 300.62,-19.25"/>
|
||||
<text text-anchor="middle" x="273.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</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="M165.93,-54.84C186.56,-46.39 217.66,-33.65 241.18,-24.02"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="242.39,-27.31 250.31,-20.28 239.73,-20.83 242.39,-27.31"/>
|
||||
</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: others/kadanes3.cpp Pages: 1 -->
|
||||
<svg width="246pt" height="83pt"
|
||||
viewBox="0.00 0.00 245.62 82.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="309pt" height="83pt"
|
||||
viewBox="0.00 0.00 308.62 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>others/kadanes3.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Efficient implementation for maximum contiguous subarray sum by Kadane's algorithm.">
|
||||
<polygon fill="#999999" stroke="#666666" points="165.25,-74.5 58.5,-74.5 58.5,-55.25 165.25,-55.25 165.25,-74.5"/>
|
||||
<text text-anchor="middle" x="111.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">others/kadanes3.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="197.25,-74.5 90.5,-74.5 90.5,-55.25 197.25,-55.25 197.25,-74.5"/>
|
||||
<text text-anchor="middle" x="143.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">others/kadanes3.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="M96.1,-54.84C81.94,-46.73 60.89,-34.68 44.35,-25.21"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="46.46,-22.39 36.04,-20.45 42.98,-28.46 46.46,-22.39"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M122.67,-54.84C102.32,-46.17 71.39,-33 48.59,-23.28"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="50.09,-20.12 39.52,-19.42 47.35,-26.56 50.09,-20.12"/>
|
||||
</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="M106.59,-55.08C102.4,-48.11 96.4,-38.12 91.14,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="94.2,-27.68 86.05,-20.91 88.2,-31.28 94.2,-27.68"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M133.02,-54.84C123.77,-47.15 110.25,-35.9 99.17,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="101.66,-24.2 91.73,-20.49 97.18,-29.58 101.66,-24.2"/>
|
||||
</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="M117.16,-55.08C121.35,-48.11 127.35,-38.12 132.61,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="135.55,-31.28 137.7,-20.91 129.55,-27.68 135.55,-31.28"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M143.88,-55.08C143.88,-48.57 143.88,-39.42 143.88,-31.12"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="147.38,-31.12 143.88,-21.12 140.38,-31.12 147.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="237.62,-19.25 184.12,-19.25 184.12,0 237.62,0 237.62,-19.25"/>
|
||||
<text text-anchor="middle" x="210.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="229.5,-19.25 184.25,-19.25 184.25,0 229.5,0 229.5,-19.25"/>
|
||||
<text text-anchor="middle" x="206.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</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="M128.67,-54.84C143.89,-46.66 166.57,-34.46 184.26,-24.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="185.52,-28.24 192.67,-20.42 182.2,-22.07 185.52,-28.24"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M154.56,-54.84C163.58,-47.22 176.71,-36.12 187.56,-26.95"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="189.81,-29.63 195.19,-20.5 185.29,-24.28 189.81,-29.63"/>
|
||||
</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="300.62,-19.25 247.12,-19.25 247.12,0 300.62,0 300.62,-19.25"/>
|
||||
<text text-anchor="middle" x="273.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</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="M165.93,-54.84C186.56,-46.39 217.66,-33.65 241.18,-24.02"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="242.39,-27.31 250.31,-20.28 239.73,-20.83 242.39,-27.31"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 4.6 KiB |
@@ -1,7 +1,9 @@
|
||||
<map id="bit_manipulation/count_bits_flip.cpp" name="bit_manipulation/count_bits_flip.cpp">
|
||||
<area shape="rect" id="Node000001" title="Implementation to [Count number of bits to be flipped to convert A to B] (https://www...." alt="" coords="7,5,158,46"/>
|
||||
<area shape="rect" id="Node000001" title="Implementation to [Count number of bits to be flipped to convert A to B] (https://www...." alt="" coords="48,5,200,46"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="5,94,70,120"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="74,48,54,82,50,79,69,45"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="94,94,165,120"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="97,45,117,79,112,82,92,48"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="105,48,64,85,60,81,101,44"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="94,94,154,120"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="127,46,127,78,122,78,122,46"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="178,94,249,120"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="148,44,190,82,187,86,144,48"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
db7caa113f953bd93d7f2cfdda744ab6
|
||||
f620a9205930fbd2d725c6b93b2ce1db
|
||||
@@ -4,8 +4,8 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: bit_manipulation/count_bits_flip.cpp Pages: 1 -->
|
||||
<svg width="128pt" height="94pt"
|
||||
viewBox="0.00 0.00 127.88 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="191pt" height="94pt"
|
||||
viewBox="0.00 0.00 190.88 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 [Count number of bits to be flipped to convert A to B] (https://www....">
|
||||
<polygon fill="#999999" stroke="#666666" points="114.88,-85.75 1.38,-85.75 1.38,-55.25 114.88,-55.25 114.88,-85.75"/>
|
||||
<text text-anchor="start" x="9.38" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">bit_manipulation/count</text>
|
||||
<text text-anchor="middle" x="58.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_bits_flip.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="145.88,-85.75 32.38,-85.75 32.38,-55.25 145.88,-55.25 145.88,-85.75"/>
|
||||
<text text-anchor="start" x="40.38" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">bit_manipulation/count</text>
|
||||
<text text-anchor="middle" x="89.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_bits_flip.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="M49.72,-54.95C45.29,-47.28 39.8,-37.77 35.05,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="38.16,-27.92 30.12,-21.01 32.09,-31.42 38.16,-27.92"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M73.06,-54.95C63.83,-46.59 52.2,-36.05 42.59,-27.35"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="45.03,-24.84 35.27,-20.72 40.33,-30.02 45.03,-24.84"/>
|
||||
</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,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="M66.78,-54.95C71.34,-47.28 76.99,-37.77 81.88,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="84.85,-31.39 86.96,-21 78.84,-27.81 84.85,-31.39"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M89.12,-54.95C89.12,-47.71 89.12,-38.84 89.12,-30.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="92.63,-31.21 89.13,-21.21 85.63,-31.21 92.63,-31.21"/>
|
||||
</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="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>
|
||||
<!-- 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="M105.69,-54.95C115.3,-46.5 127.44,-35.83 137.4,-27.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="139.46,-29.93 144.66,-20.7 134.84,-24.67 139.46,-29.93"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 4.0 KiB |
@@ -4,17 +4,17 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: bit_manipulation/count_bits_flip.cpp Pages: 1 -->
|
||||
<svg width="128pt" height="94pt"
|
||||
viewBox="0.00 0.00 127.88 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="191pt" height="94pt"
|
||||
viewBox="0.00 0.00 190.88 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/count_bits_flip.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Implementation to [Count number of bits to be flipped to convert A to B] (https://www....">
|
||||
<polygon fill="#999999" stroke="#666666" points="114.88,-85.75 1.38,-85.75 1.38,-55.25 114.88,-55.25 114.88,-85.75"/>
|
||||
<text text-anchor="start" x="9.38" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">bit_manipulation/count</text>
|
||||
<text text-anchor="middle" x="58.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_bits_flip.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="145.88,-85.75 32.38,-85.75 32.38,-55.25 145.88,-55.25 145.88,-85.75"/>
|
||||
<text text-anchor="start" x="40.38" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">bit_manipulation/count</text>
|
||||
<text text-anchor="middle" x="89.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_bits_flip.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="M49.72,-54.95C45.29,-47.28 39.8,-37.77 35.05,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="38.16,-27.92 30.12,-21.01 32.09,-31.42 38.16,-27.92"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M73.06,-54.95C63.83,-46.59 52.2,-36.05 42.59,-27.35"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="45.03,-24.84 35.27,-20.72 40.33,-30.02 45.03,-24.84"/>
|
||||
</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,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="M66.78,-54.95C71.34,-47.28 76.99,-37.77 81.88,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="84.85,-31.39 86.96,-21 78.84,-27.81 84.85,-31.39"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M89.12,-54.95C89.12,-47.71 89.12,-38.84 89.12,-30.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="92.63,-31.21 89.13,-21.21 85.63,-31.21 92.63,-31.21"/>
|
||||
</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="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>
|
||||
<!-- 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="M105.69,-54.95C115.3,-46.5 127.44,-35.83 137.4,-27.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="139.46,-29.93 144.66,-20.7 134.84,-24.67 139.46,-29.93"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 3.3 KiB |
@@ -113,15 +113,16 @@ $(function(){initNavTree('d3/df9/recursive__bubble__sort_8cpp.html','../../'); i
|
||||
|
||||
<p>This is an implementation of a recursive version of the <a href="https://www.geeksforgeeks.org/recursive-bubble-sort/" target="_blank">Bubble sort algorithm</a>
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <cassert></code><br />
|
||||
<div class="textblock"><code>#include <algorithm></code><br />
|
||||
<code>#include <array></code><br />
|
||||
<code>#include <cassert></code><br />
|
||||
<code>#include <cstdint></code><br />
|
||||
<code>#include <iostream></code><br />
|
||||
<code>#include <vector></code><br />
|
||||
<code>#include <array></code><br />
|
||||
<code>#include <algorithm></code><br />
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for recursive_bubble_sort.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d9/d31/recursive__bubble__sort_8cpp__incl.svg" width="424" 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="../../d9/d31/recursive__bubble__sort_8cpp__incl.svg" width="508" 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>
|
||||
@@ -176,11 +177,11 @@ Algorithm</h3>
|
||||
|
||||
<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"> 146</span> { </div>
|
||||
<div class="line"><span class="lineno"> 147</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"> 148</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 149</span>}</div>
|
||||
<div class="ttc" id="arecursive__bubble__sort_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> recursive_bubble_sort.cpp:95</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 155</span> {</div>
|
||||
<div class="line"><span class="lineno"> 156</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"> 157</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 158</span>}</div>
|
||||
<div class="ttc" id="arecursive__bubble__sort_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> recursive_bubble_sort.cpp:105</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -214,58 +215,57 @@ 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"> 95</span> {</div>
|
||||
<div class="line"><span class="lineno"> 96</span> <span class="comment">// 1st example. Creating an array of type `int`.</span></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">"1st test using `int`\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 98</span> <span class="keyword">const</span> uint64_t size = 6;</div>
|
||||
<div class="line"><span class="lineno"> 99</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> arr;</div>
|
||||
<div class="line"><span class="lineno"> 100</span> <span class="comment">// populating the array</span></div>
|
||||
<div class="line"><span class="lineno"> 101</span> arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(22);</div>
|
||||
<div class="line"><span class="lineno"> 102</span> arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(46);</div>
|
||||
<div class="line"><span class="lineno"> 103</span> arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(94);</div>
|
||||
<div class="line"><span class="lineno"> 104</span> arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(12);</div>
|
||||
<div class="line"><span class="lineno"> 105</span> arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(37);</div>
|
||||
<div class="line"><span class="lineno"> 106</span> arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(63);</div>
|
||||
<div class="line"><span class="lineno"> 107</span> <span class="comment">// array populating ends</span></div>
|
||||
<div class="line"><span class="lineno"> 108</span> </div>
|
||||
<div class="line"><span class="lineno"> 109</span> <a class="code hl_function" href="../../d5/d91/namespacesorting.html#ae3a775d99dbbb94c130a973df0cfddcf">sorting::recursive_bubble_sort</a>(&arr, size);</div>
|
||||
<div class="line"><span class="lineno"> 110</span> assert(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/is_sorted.html">std::is_sorted</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a>(arr), <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">std::end</a>(arr)));</div>
|
||||
<div class="line"><span class="lineno"> 111</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 passed!\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 112</span> <span class="comment">// printing the array</span></div>
|
||||
<div class="line"><span class="lineno"> 113</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < size; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 114</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << arr[i] << <span class="stringliteral">", "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 115</span> }</div>
|
||||
<div class="line"><span class="lineno"> 116</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <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"> 117</span> </div>
|
||||
<div class="line"><span class="lineno"> 118</span> <span class="comment">// 2nd example. Creating an array of type `double`.</span></div>
|
||||
<div class="line"><span class="lineno"> 119</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 using doubles\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 120</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<double></a> double_arr;</div>
|
||||
<div class="line"><span class="lineno"> 121</span> </div>
|
||||
<div class="line"><span class="lineno"> 122</span> <span class="comment">// populating the array</span></div>
|
||||
<div class="line"><span class="lineno"> 123</span> double_arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(20.4);</div>
|
||||
<div class="line"><span class="lineno"> 124</span> double_arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(62.7);</div>
|
||||
<div class="line"><span class="lineno"> 125</span> double_arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(12.2);</div>
|
||||
<div class="line"><span class="lineno"> 126</span> double_arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(43.6);</div>
|
||||
<div class="line"><span class="lineno"> 127</span> double_arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(74.1);</div>
|
||||
<div class="line"><span class="lineno"> 128</span> double_arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(57.9);</div>
|
||||
<div class="line"><span class="lineno"> 129</span> <span class="comment">// array populating ends</span></div>
|
||||
<div class="line"><span class="lineno"> 130</span> </div>
|
||||
<div class="line"><span class="lineno"> 131</span> <a class="code hl_function" href="../../d5/d91/namespacesorting.html#ae3a775d99dbbb94c130a973df0cfddcf">sorting::recursive_bubble_sort</a>(&double_arr, size);</div>
|
||||
<div class="line"><span class="lineno"> 132</span> assert(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/is_sorted.html">std::is_sorted</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a>(double_arr), <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">std::end</a>(double_arr)));</div>
|
||||
<div class="line"><span class="lineno"> 133</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 passed!\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 134</span> <span class="comment">// printing the array</span></div>
|
||||
<div class="line"><span class="lineno"> 135</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < size; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 136</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << double_arr[i] << <span class="stringliteral">", "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 137</span> }</div>
|
||||
<div class="line"><span class="lineno"> 138</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <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"> 139</span> </div>
|
||||
<div class="line"><span class="lineno"> 140</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 105</span> {</div>
|
||||
<div class="line"><span class="lineno"> 106</span> <span class="comment">// 1st example. Creating an array of type `int`.</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">"1st test using `int`\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 108</span> <span class="keyword">const</span> uint64_t size = 6;</div>
|
||||
<div class="line"><span class="lineno"> 109</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> arr;</div>
|
||||
<div class="line"><span class="lineno"> 110</span> <span class="comment">// populating the array</span></div>
|
||||
<div class="line"><span class="lineno"> 111</span> arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(22);</div>
|
||||
<div class="line"><span class="lineno"> 112</span> arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(46);</div>
|
||||
<div class="line"><span class="lineno"> 113</span> arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(94);</div>
|
||||
<div class="line"><span class="lineno"> 114</span> arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(12);</div>
|
||||
<div class="line"><span class="lineno"> 115</span> arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(37);</div>
|
||||
<div class="line"><span class="lineno"> 116</span> arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(63);</div>
|
||||
<div class="line"><span class="lineno"> 117</span> <span class="comment">// array populating ends</span></div>
|
||||
<div class="line"><span class="lineno"> 118</span> </div>
|
||||
<div class="line"><span class="lineno"> 119</span> <a class="code hl_function" href="../../d5/d91/namespacesorting.html#ae3a775d99dbbb94c130a973df0cfddcf">sorting::recursive_bubble_sort</a>(&arr, size);</div>
|
||||
<div class="line"><span class="lineno"> 120</span> assert(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/is_sorted.html">std::is_sorted</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a>(arr), <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">std::end</a>(arr)));</div>
|
||||
<div class="line"><span class="lineno"> 121</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 passed!\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 122</span> <span class="comment">// printing the array</span></div>
|
||||
<div class="line"><span class="lineno"> 123</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < size; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 124</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << arr[i] << <span class="stringliteral">", "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 125</span> }</div>
|
||||
<div class="line"><span class="lineno"> 126</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <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"> 127</span> </div>
|
||||
<div class="line"><span class="lineno"> 128</span> <span class="comment">// 2nd example. Creating an array of type `double`.</span></div>
|
||||
<div class="line"><span class="lineno"> 129</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 using doubles\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 130</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<double></a> double_arr;</div>
|
||||
<div class="line"><span class="lineno"> 131</span> </div>
|
||||
<div class="line"><span class="lineno"> 132</span> <span class="comment">// populating the array</span></div>
|
||||
<div class="line"><span class="lineno"> 133</span> double_arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(20.4);</div>
|
||||
<div class="line"><span class="lineno"> 134</span> double_arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(62.7);</div>
|
||||
<div class="line"><span class="lineno"> 135</span> double_arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(12.2);</div>
|
||||
<div class="line"><span class="lineno"> 136</span> double_arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(43.6);</div>
|
||||
<div class="line"><span class="lineno"> 137</span> double_arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(74.1);</div>
|
||||
<div class="line"><span class="lineno"> 138</span> double_arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(57.9);</div>
|
||||
<div class="line"><span class="lineno"> 139</span> <span class="comment">// array populating ends</span></div>
|
||||
<div class="line"><span class="lineno"> 140</span> </div>
|
||||
<div class="line"><span class="lineno"> 141</span> <a class="code hl_function" href="../../d5/d91/namespacesorting.html#ae3a775d99dbbb94c130a973df0cfddcf">sorting::recursive_bubble_sort</a>(&double_arr, size);</div>
|
||||
<div class="line"><span class="lineno"> 142</span> assert(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/is_sorted.html">std::is_sorted</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a>(double_arr), <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">std::end</a>(double_arr)));</div>
|
||||
<div class="line"><span class="lineno"> 143</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 passed!\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 144</span> <span class="comment">// printing the array</span></div>
|
||||
<div class="line"><span class="lineno"> 145</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < size; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 146</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << double_arr[i] << <span class="stringliteral">", "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 147</span> }</div>
|
||||
<div class="line"><span class="lineno"> 148</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <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"> 149</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="abegin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::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/iterator/end.html">std::end</a></div><div class="ttdeci">T end(T... args)</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="ais_sorted_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/is_sorted.html">std::is_sorted</a></div><div class="ttdeci">T is_sorted(T... args)</div></div>
|
||||
<div class="ttc" id="anamespacesorting_html_ae3a775d99dbbb94c130a973df0cfddcf"><div class="ttname"><a href="../../d5/d91/namespacesorting.html#ae3a775d99dbbb94c130a973df0cfddcf">sorting::recursive_bubble_sort</a></div><div class="ttdeci">void recursive_bubble_sort(std::vector< T > *nums, uint64_t n)</div><div class="ttdoc">This is an implementation of the recursive_bubble_sort. A vector is passed to the function which is t...</div><div class="ttdef"><b>Definition</b> recursive_bubble_sort.cpp:74</div></div>
|
||||
<div class="ttc" id="anamespacesorting_html_ae3a775d99dbbb94c130a973df0cfddcf"><div class="ttname"><a href="../../d5/d91/namespacesorting.html#ae3a775d99dbbb94c130a973df0cfddcf">sorting::recursive_bubble_sort</a></div><div class="ttdeci">void recursive_bubble_sort(std::vector< T > *nums, uint64_t n)</div><div class="ttdoc">This is an implementation of the recursive_bubble_sort. A vector is passed to the function which is t...</div><div class="ttdef"><b>Definition</b> recursive_bubble_sort.cpp:84</div></div>
|
||||
<div class="ttc" id="apush_back_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">std::vector::push_back</a></div><div class="ttdeci">T push_back(T... args)</div></div>
|
||||
<div 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">
|
||||
|
||||
@@ -127,7 +127,7 @@ Include dependency graph for perimeter.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>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
|
||||