Documentation for c6af943508
@@ -114,13 +114,14 @@ $(function(){initNavTree('d7/d00/list__array_8cpp.html','../../'); initResizable
|
||||
|
||||
<p><a href="https://en.wikipedia.org/wiki/Dynamic_array" target="_blank">Dynamic Array</a>
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <iostream></code><br />
|
||||
<code>#include <array></code><br />
|
||||
<div class="textblock"><code>#include <array></code><br />
|
||||
<code>#include <cassert></code><br />
|
||||
<code>#include <cstdint></code><br />
|
||||
<code>#include <iostream></code><br />
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for list_array.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dd/d4d/list__array_8cpp__incl.svg" width="246" 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="../../dd/d4d/list__array_8cpp__incl.svg" width="330" 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>
|
||||
@@ -171,11 +172,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"> 248</span> {</div>
|
||||
<div class="line"><span class="lineno"> 249</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// Execute the tests</span></div>
|
||||
<div class="line"><span class="lineno"> 250</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 251</span>}</div>
|
||||
<div class="ttc" id="alist__array_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> list_array.cpp:206</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 260</span> {</div>
|
||||
<div class="line"><span class="lineno"> 261</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// Execute the tests</span></div>
|
||||
<div class="line"><span class="lineno"> 262</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 263</span>}</div>
|
||||
<div class="ttc" id="alist__array_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> list_array.cpp:218</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -209,48 +210,48 @@ 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"> 206</span> {</div>
|
||||
<div class="line"><span class="lineno"> 207</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">data_structures::list_array::list<50></a> L;</div>
|
||||
<div class="line"><span class="lineno"> 208</span> </div>
|
||||
<div class="line"><span class="lineno"> 209</span> <span class="comment">// Insert testing</span></div>
|
||||
<div class="line"><span class="lineno"> 210</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#aa960d714d449612f25256850d72325f1">insert</a>(11);</div>
|
||||
<div class="line"><span class="lineno"> 211</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#aa960d714d449612f25256850d72325f1">insert</a>(12);</div>
|
||||
<div class="line"><span class="lineno"> 212</span> assert(L.top == 2);</div>
|
||||
<div class="line"><span class="lineno"> 213</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#aa960d714d449612f25256850d72325f1">insert</a>(15);</div>
|
||||
<div class="line"><span class="lineno"> 214</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#aa960d714d449612f25256850d72325f1">insert</a>(10);</div>
|
||||
<div class="line"><span class="lineno"> 215</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#aa960d714d449612f25256850d72325f1">insert</a>(12);</div>
|
||||
<div class="line"><span class="lineno"> 216</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#aa960d714d449612f25256850d72325f1">insert</a>(20);</div>
|
||||
<div class="line"><span class="lineno"> 217</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#aa960d714d449612f25256850d72325f1">insert</a>(18);</div>
|
||||
<div class="line"><span class="lineno"> 218</span> assert(L.top == 7);</div>
|
||||
<div class="line"><span class="lineno"> 219</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#a0b7acf65026df1e9dd13eebf309dda5e">show</a>(); <span class="comment">// To print the array</span></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 218</span> {</div>
|
||||
<div class="line"><span class="lineno"> 219</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">data_structures::list_array::list<50></a> L;</div>
|
||||
<div class="line"><span class="lineno"> 220</span> </div>
|
||||
<div class="line"><span class="lineno"> 221</span> <span class="comment">// Remove testing</span></div>
|
||||
<div class="line"><span class="lineno"> 222</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#a98f7d9079c0868e0f4e67d5c52174fb6">remove</a>(12); <span class="comment">// Remove Duplicate value in the list</span></div>
|
||||
<div class="line"><span class="lineno"> 223</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#a98f7d9079c0868e0f4e67d5c52174fb6">remove</a>(15); <span class="comment">// Remove the existing value in the list</span></div>
|
||||
<div class="line"><span class="lineno"> 224</span> assert(L.top == 5);</div>
|
||||
<div class="line"><span class="lineno"> 225</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#a98f7d9079c0868e0f4e67d5c52174fb6">remove</a>(50); <span class="comment">// Try to remove the non-existing value in the list</span></div>
|
||||
<div class="line"><span class="lineno"> 226</span> assert(L.top == 5);</div>
|
||||
<div class="line"><span class="lineno"> 227</span> </div>
|
||||
<div class="line"><span class="lineno"> 228</span> <span class="comment">// LinearSearch testing</span></div>
|
||||
<div class="line"><span class="lineno"> 229</span> assert(L.search(11) == 0); <span class="comment">// search for the existing element</span></div>
|
||||
<div class="line"><span class="lineno"> 230</span> assert(L.search(12) == 2);</div>
|
||||
<div class="line"><span class="lineno"> 231</span> assert(L.search(50) == -1); <span class="comment">// search for the non-existing element</span></div>
|
||||
<div class="line"><span class="lineno"> 221</span> <span class="comment">// Insert testing</span></div>
|
||||
<div class="line"><span class="lineno"> 222</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#aa960d714d449612f25256850d72325f1">insert</a>(11);</div>
|
||||
<div class="line"><span class="lineno"> 223</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#aa960d714d449612f25256850d72325f1">insert</a>(12);</div>
|
||||
<div class="line"><span class="lineno"> 224</span> assert(L.top == 2);</div>
|
||||
<div class="line"><span class="lineno"> 225</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#aa960d714d449612f25256850d72325f1">insert</a>(15);</div>
|
||||
<div class="line"><span class="lineno"> 226</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#aa960d714d449612f25256850d72325f1">insert</a>(10);</div>
|
||||
<div class="line"><span class="lineno"> 227</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#aa960d714d449612f25256850d72325f1">insert</a>(12);</div>
|
||||
<div class="line"><span class="lineno"> 228</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#aa960d714d449612f25256850d72325f1">insert</a>(20);</div>
|
||||
<div class="line"><span class="lineno"> 229</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#aa960d714d449612f25256850d72325f1">insert</a>(18);</div>
|
||||
<div class="line"><span class="lineno"> 230</span> assert(L.top == 7);</div>
|
||||
<div class="line"><span class="lineno"> 231</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#a0b7acf65026df1e9dd13eebf309dda5e">show</a>(); <span class="comment">// To print the array</span></div>
|
||||
<div class="line"><span class="lineno"> 232</span> </div>
|
||||
<div class="line"><span class="lineno"> 233</span> <span class="comment">// Sort testing</span></div>
|
||||
<div class="line"><span class="lineno"> 234</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#a133635ad53bd89e3947ca02448819180">sort</a>();</div>
|
||||
<div class="line"><span class="lineno"> 235</span> assert(L.isSorted == <span class="keyword">true</span>);</div>
|
||||
<div class="line"><span class="lineno"> 236</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#a0b7acf65026df1e9dd13eebf309dda5e">show</a>();</div>
|
||||
<div class="line"><span class="lineno"> 237</span> </div>
|
||||
<div class="line"><span class="lineno"> 238</span> <span class="comment">// BinarySearch testing</span></div>
|
||||
<div class="line"><span class="lineno"> 239</span> assert(L.search(11) == 1); <span class="comment">// search for the existing element</span></div>
|
||||
<div class="line"><span class="lineno"> 240</span> assert(L.search(12) == 2);</div>
|
||||
<div class="line"><span class="lineno"> 241</span> assert(L.search(50) == -1); <span class="comment">// search for the non-existing element</span></div>
|
||||
<div class="line"><span class="lineno"> 242</span>}</div>
|
||||
<div class="ttc" id="astructdata__structures_1_1list__array_1_1list_html"><div class="ttname"><a href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">data_structures::list_array::list</a></div><div class="ttdoc">Structure of List with supporting methods.</div><div class="ttdef"><b>Definition</b> list_array.cpp:33</div></div>
|
||||
<div class="ttc" id="astructdata__structures_1_1list__array_1_1list_html_a0b7acf65026df1e9dd13eebf309dda5e"><div class="ttname"><a href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#a0b7acf65026df1e9dd13eebf309dda5e">data_structures::list_array::list::show</a></div><div class="ttdeci">void show()</div><div class="ttdoc">Utility function to print array.</div><div class="ttdef"><b>Definition</b> list_array.cpp:191</div></div>
|
||||
<div class="ttc" id="astructdata__structures_1_1list__array_1_1list_html_a133635ad53bd89e3947ca02448819180"><div class="ttname"><a href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#a133635ad53bd89e3947ca02448819180">data_structures::list_array::list::sort</a></div><div class="ttdeci">void sort()</div><div class="ttdoc">Sort the list.</div><div class="ttdef"><b>Definition</b> list_array.cpp:111</div></div>
|
||||
<div class="ttc" id="astructdata__structures_1_1list__array_1_1list_html_a98f7d9079c0868e0f4e67d5c52174fb6"><div class="ttname"><a href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#a98f7d9079c0868e0f4e67d5c52174fb6">data_structures::list_array::list::remove</a></div><div class="ttdeci">void remove(const uint64_t &val)</div><div class="ttdoc">To remove the element from the list.</div><div class="ttdef"><b>Definition</b> list_array.cpp:172</div></div>
|
||||
<div class="ttc" id="astructdata__structures_1_1list__array_1_1list_html_aa960d714d449612f25256850d72325f1"><div class="ttname"><a href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#aa960d714d449612f25256850d72325f1">data_structures::list_array::list::insert</a></div><div class="ttdeci">void insert(const uint64_t &val)</div><div class="ttdoc">Insert the new element in the list.</div><div class="ttdef"><b>Definition</b> list_array.cpp:133</div></div>
|
||||
<div class="line"><span class="lineno"> 233</span> <span class="comment">// Remove testing</span></div>
|
||||
<div class="line"><span class="lineno"> 234</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#a98f7d9079c0868e0f4e67d5c52174fb6">remove</a>(12); <span class="comment">// Remove Duplicate value in the list</span></div>
|
||||
<div class="line"><span class="lineno"> 235</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#a98f7d9079c0868e0f4e67d5c52174fb6">remove</a>(15); <span class="comment">// Remove the existing value in the list</span></div>
|
||||
<div class="line"><span class="lineno"> 236</span> assert(L.top == 5);</div>
|
||||
<div class="line"><span class="lineno"> 237</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#a98f7d9079c0868e0f4e67d5c52174fb6">remove</a>(50); <span class="comment">// Try to remove the non-existing value in the list</span></div>
|
||||
<div class="line"><span class="lineno"> 238</span> assert(L.top == 5);</div>
|
||||
<div class="line"><span class="lineno"> 239</span> </div>
|
||||
<div class="line"><span class="lineno"> 240</span> <span class="comment">// LinearSearch testing</span></div>
|
||||
<div class="line"><span class="lineno"> 241</span> assert(L.search(11) == 0); <span class="comment">// search for the existing element</span></div>
|
||||
<div class="line"><span class="lineno"> 242</span> assert(L.search(12) == 2);</div>
|
||||
<div class="line"><span class="lineno"> 243</span> assert(L.search(50) == -1); <span class="comment">// search for the non-existing element</span></div>
|
||||
<div class="line"><span class="lineno"> 244</span> </div>
|
||||
<div class="line"><span class="lineno"> 245</span> <span class="comment">// Sort testing</span></div>
|
||||
<div class="line"><span class="lineno"> 246</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#a133635ad53bd89e3947ca02448819180">sort</a>();</div>
|
||||
<div class="line"><span class="lineno"> 247</span> assert(L.isSorted == <span class="keyword">true</span>);</div>
|
||||
<div class="line"><span class="lineno"> 248</span> L.<a class="code hl_function" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#a0b7acf65026df1e9dd13eebf309dda5e">show</a>();</div>
|
||||
<div class="line"><span class="lineno"> 249</span> </div>
|
||||
<div class="line"><span class="lineno"> 250</span> <span class="comment">// BinarySearch testing</span></div>
|
||||
<div class="line"><span class="lineno"> 251</span> assert(L.search(11) == 1); <span class="comment">// search for the existing element</span></div>
|
||||
<div class="line"><span class="lineno"> 252</span> assert(L.search(12) == 2);</div>
|
||||
<div class="line"><span class="lineno"> 253</span> assert(L.search(50) == -1); <span class="comment">// search for the non-existing element</span></div>
|
||||
<div class="line"><span class="lineno"> 254</span>}</div>
|
||||
<div class="ttc" id="astructdata__structures_1_1list__array_1_1list_html"><div class="ttname"><a href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">data_structures::list_array::list</a></div><div class="ttdoc">Structure of List with supporting methods.</div><div class="ttdef"><b>Definition</b> list_array.cpp:37</div></div>
|
||||
<div class="ttc" id="astructdata__structures_1_1list__array_1_1list_html_a0b7acf65026df1e9dd13eebf309dda5e"><div class="ttname"><a href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#a0b7acf65026df1e9dd13eebf309dda5e">data_structures::list_array::list::show</a></div><div class="ttdeci">void show()</div><div class="ttdoc">Utility function to print array.</div><div class="ttdef"><b>Definition</b> list_array.cpp:203</div></div>
|
||||
<div class="ttc" id="astructdata__structures_1_1list__array_1_1list_html_a133635ad53bd89e3947ca02448819180"><div class="ttname"><a href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#a133635ad53bd89e3947ca02448819180">data_structures::list_array::list::sort</a></div><div class="ttdeci">void sort()</div><div class="ttdoc">Sort the list.</div><div class="ttdef"><b>Definition</b> list_array.cpp:121</div></div>
|
||||
<div class="ttc" id="astructdata__structures_1_1list__array_1_1list_html_a98f7d9079c0868e0f4e67d5c52174fb6"><div class="ttname"><a href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#a98f7d9079c0868e0f4e67d5c52174fb6">data_structures::list_array::list::remove</a></div><div class="ttdeci">void remove(const uint64_t &val)</div><div class="ttdoc">To remove the element from the list.</div><div class="ttdef"><b>Definition</b> list_array.cpp:183</div></div>
|
||||
<div class="ttc" id="astructdata__structures_1_1list__array_1_1list_html_aa960d714d449612f25256850d72325f1"><div class="ttname"><a href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html#aa960d714d449612f25256850d72325f1">data_structures::list_array::list::insert</a></div><div class="ttdeci">void insert(const uint64_t &val)</div><div class="ttdoc">Insert the new element in the list.</div><div class="ttdef"><b>Definition</b> list_array.cpp:143</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
|
||||
@@ -115,6 +115,7 @@ $(function(){initNavTree('d7/d07/bidirectional__dijkstra_8cpp.html','../../'); i
|
||||
<p>[Bidirectional Dijkstra Shortest Path Algorithm] (<a href="https://www.coursera.org/learn/algorithms-on-graphs/lecture/7ml18/bidirectional-dijkstra">https://www.coursera.org/learn/algorithms-on-graphs/lecture/7ml18/bidirectional-dijkstra</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 <limits></code><br />
|
||||
<code>#include <queue></code><br />
|
||||
@@ -123,7 +124,7 @@ $(function(){initNavTree('d7/d07/bidirectional__dijkstra_8cpp.html','../../'); i
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for bidirectional_dijkstra.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d1/df6/bidirectional__dijkstra_8cpp__incl.svg" width="486" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d1/df6/bidirectional__dijkstra_8cpp__incl.svg" width="570" 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>
|
||||
@@ -156,6 +157,7 @@ Functions</h2></td></tr>
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
|
||||
Variables</h2></td></tr>
|
||||
<tr class="memitem:a330a2b0a904f01802ada1f8f3b28e76c" id="r_a330a2b0a904f01802ada1f8f3b28e76c"><td class="memItemLeft" align="right" valign="top">constexpr int64_t </td><td class="memItemRight" valign="bottom"><a class="el" href="#a330a2b0a904f01802ada1f8f3b28e76c">INF</a> = <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/numeric_limits.html">std::numeric_limits</a><int64_t>::max()</td></tr>
|
||||
<tr class="memdesc:a330a2b0a904f01802ada1f8f3b28e76c"><td class="mdescLeft"> </td><td class="mdescRight">for assert <br /></td></tr>
|
||||
<tr class="separator:a330a2b0a904f01802ada1f8f3b28e76c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
@@ -207,11 +209,11 @@ Variables</h2></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 47</span> {</div>
|
||||
<div class="line"><span class="lineno"> 48</span> (*adj1)[u - 1].push_back(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(v - 1, w));</div>
|
||||
<div class="line"><span class="lineno"> 49</span> (*adj2)[v - 1].push_back(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(u - 1, w));</div>
|
||||
<div class="line"><span class="lineno"> 50</span> <span class="comment">// (*adj)[v - 1].push_back(std::make_pair(u - 1, w));</span></div>
|
||||
<div class="line"><span class="lineno"> 51</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 48</span> {</div>
|
||||
<div class="line"><span class="lineno"> 49</span> (*adj1)[u - 1].push_back(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(v - 1, w));</div>
|
||||
<div class="line"><span class="lineno"> 50</span> (*adj2)[v - 1].push_back(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(u - 1, w));</div>
|
||||
<div class="line"><span class="lineno"> 51</span> <span class="comment">// (*adj)[v - 1].push_back(std::make_pair(u - 1, w));</span></div>
|
||||
<div class="line"><span class="lineno"> 52</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><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -283,111 +285,111 @@ Here is the call graph for this function:</div>
|
||||
<p>for all the reachable vertex from the currently exploring vertex we will try to minimize the distance</p>
|
||||
<p>minimizing distances</p>
|
||||
<p>check if currentNode has already been visited</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 88</span> {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 89</span><span class="comment"> /// n denotes the number of vertices in graph</span></div>
|
||||
<div class="line"><span class="lineno"> 90</span><span class="comment"></span> uint64_t n = adj1-><a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>();</div>
|
||||
<div class="line"><span class="lineno"> 91</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 92</span><span class="comment"> /// setting all the distances initially to INF</span></div>
|
||||
<div class="line"><span class="lineno"> 93</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::vector<uint64_t></a>> dist(2, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a>(n, <a class="code hl_variable" href="#a330a2b0a904f01802ada1f8f3b28e76c">INF</a>));</div>
|
||||
<div class="line"><span class="lineno"> 94</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 95</span><span class="comment"> /// creating a a vector of min heap using priority queue</span></div>
|
||||
<div class="line"><span class="lineno"> 96</span><span class="comment"> /// pq[0] contains the min heap for the direct search</span></div>
|
||||
<div class="line"><span class="lineno"> 97</span><span class="comment"> /// pq[1] contains the min heap for the reverse search</span></div>
|
||||
<div class="line"><span class="lineno"> 98</span><span class="comment"></span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 99</span><span class="comment"> /// first element of pair contains the distance</span></div>
|
||||
<div class="line"><span class="lineno"> 100</span><span class="comment"> /// second element of pair contains the vertex</span></div>
|
||||
<div class="line"><span class="lineno"> 101</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a><</div>
|
||||
<div class="line"><span class="lineno"> 102</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/priority_queue.html">std::priority_queue<std::pair<uint64_t, uint64_t></a>,</div>
|
||||
<div class="line"><span class="lineno"> 103</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::pair<uint64_t, uint64_t></a>>,</div>
|
||||
<div class="line"><span class="lineno"> 104</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/functional/greater.html">std::greater<std::pair<uint64_t, uint64_t></a>>>></div>
|
||||
<div class="line"><span class="lineno"> 105</span> pq(2);<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 106</span><span class="comment"> /// vector for store the nodes or vertices in the shortest path</span></div>
|
||||
<div class="line"><span class="lineno"> 107</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> workset(n);<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 108</span><span class="comment"> /// vector for store the nodes or vertices visited</span></div>
|
||||
<div class="line"><span class="lineno"> 109</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<bool></a> visited(n);</div>
|
||||
<div class="line"><span class="lineno"> 110</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 111</span><span class="comment"> /// pushing the source vertex 's' with 0 distance in pq[0] min heap</span></div>
|
||||
<div class="line"><span class="lineno"> 112</span><span class="comment"></span> pq[0].push(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(0, s));</div>
|
||||
<div class="line"><span class="lineno"> 113</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 114</span><span class="comment"> /// marking the distance of source as 0</span></div>
|
||||
<div class="line"><span class="lineno"> 115</span><span class="comment"></span> dist[0][s] = 0;</div>
|
||||
<div class="line"><span class="lineno"> 116</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 117</span><span class="comment"> /// pushing the target vertex 't' with 0 distance in pq[1] min heap</span></div>
|
||||
<div class="line"><span class="lineno"> 118</span><span class="comment"></span> pq[1].push(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(0, t));</div>
|
||||
<div class="line"><span class="lineno"> 119</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 120</span><span class="comment"> /// marking the distance of target as 0</span></div>
|
||||
<div class="line"><span class="lineno"> 121</span><span class="comment"></span> dist[1][t] = 0;</div>
|
||||
<div class="line"><span class="lineno"> 122</span> </div>
|
||||
<div class="line"><span class="lineno"> 123</span> <span class="keywordflow">while</span> (<span class="keyword">true</span>) {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 124</span><span class="comment"> /// direct search</span></div>
|
||||
<div class="line"><span class="lineno"> 125</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 126</span> <span class="comment">// If pq[0].size() is equal to zero then the node/ vertex is not</span></div>
|
||||
<div class="line"><span class="lineno"> 127</span> <span class="comment">// reachable from s</span></div>
|
||||
<div class="line"><span class="lineno"> 128</span> <span class="keywordflow">if</span> (pq[0].size() == 0) {</div>
|
||||
<div class="line"><span class="lineno"> 129</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><span class="lineno"> 130</span> }<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 131</span><span class="comment"> /// second element of pair denotes the node / vertex</span></div>
|
||||
<div class="line"><span class="lineno"> 132</span><span class="comment"></span> uint64_t currentNode = pq[0].top().second;</div>
|
||||
<div class="line"><span class="lineno"> 133</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 134</span><span class="comment"> /// first element of pair denotes the distance</span></div>
|
||||
<div class="line"><span class="lineno"> 135</span><span class="comment"></span> uint64_t currentDist = pq[0].top().first;</div>
|
||||
<div class="line"><span class="lineno"> 136</span> </div>
|
||||
<div class="line"><span class="lineno"> 137</span> pq[0].pop();</div>
|
||||
<div class="line"><span class="lineno"> 138</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 139</span><span class="comment"> /// for all the reachable vertex from the currently exploring vertex</span></div>
|
||||
<div class="line"><span class="lineno"> 140</span><span class="comment"> /// we will try to minimize the distance</span></div>
|
||||
<div class="line"><span class="lineno"> 141</span><span class="comment"></span> <span class="keywordflow">for</span> (<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<int, int></a> edge : (*adj1)[currentNode]) {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 142</span><span class="comment"> /// minimizing distances</span></div>
|
||||
<div class="line"><span class="lineno"> 143</span><span class="comment"></span> <span class="keywordflow">if</span> (currentDist + edge.second < dist[0][edge.first]) {</div>
|
||||
<div class="line"><span class="lineno"> 144</span> dist[0][edge.first] = currentDist + edge.second;</div>
|
||||
<div class="line"><span class="lineno"> 145</span> pq[0].push(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(dist[0][edge.first], edge.first));</div>
|
||||
<div class="line"><span class="lineno"> 146</span> }</div>
|
||||
<div class="line"><span class="lineno"> 147</span> }</div>
|
||||
<div class="line"><span class="lineno"> 148</span> <span class="comment">// store the processed node/ vertex</span></div>
|
||||
<div class="line"><span class="lineno"> 149</span> workset.push_back(currentNode);</div>
|
||||
<div class="line"><span class="lineno"> 150</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 151</span><span class="comment"> /// check if currentNode has already been visited</span></div>
|
||||
<div class="line"><span class="lineno"> 152</span><span class="comment"></span> <span class="keywordflow">if</span> (visited[currentNode] == 1) {</div>
|
||||
<div class="line"><span class="lineno"> 153</span> <span class="keywordflow">return</span> <a class="code hl_function" href="#a22f1b7277e1dd4190f25014b48487ce6">Shortest_Path_Distance</a>(workset, dist);</div>
|
||||
<div class="line"><span class="lineno"> 154</span> }</div>
|
||||
<div class="line"><span class="lineno"> 155</span> visited[currentNode] = <span class="keyword">true</span>;<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 156</span><span class="comment"> /// reversed search</span></div>
|
||||
<div class="line"><span class="lineno"> 157</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 158</span> <span class="comment">// If pq[1].size() is equal to zero then the node/ vertex is not</span></div>
|
||||
<div class="line"><span class="lineno"> 159</span> <span class="comment">// reachable from t</span></div>
|
||||
<div class="line"><span class="lineno"> 160</span> <span class="keywordflow">if</span> (pq[1].size() == 0) {</div>
|
||||
<div class="line"><span class="lineno"> 161</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><span class="lineno"> 162</span> }<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 163</span><span class="comment"> /// second element of pair denotes the node / vertex</span></div>
|
||||
<div class="line"><span class="lineno"> 164</span><span class="comment"></span> currentNode = pq[1].top().second;</div>
|
||||
<div class="line"><span class="lineno"> 165</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 166</span><span class="comment"> /// first element of pair denotes the distance</span></div>
|
||||
<div class="line"><span class="lineno"> 167</span><span class="comment"></span> currentDist = pq[1].top().first;</div>
|
||||
<div class="line"><span class="lineno"> 168</span> </div>
|
||||
<div class="line"><span class="lineno"> 169</span> pq[1].pop();</div>
|
||||
<div class="line"><span class="lineno"> 170</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 171</span><span class="comment"> /// for all the reachable vertex from the currently exploring vertex</span></div>
|
||||
<div class="line"><span class="lineno"> 172</span><span class="comment"> /// we will try to minimize the distance</span></div>
|
||||
<div class="line"><span class="lineno"> 173</span><span class="comment"></span> <span class="keywordflow">for</span> (<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<int, int></a> edge : (*adj2)[currentNode]) {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 174</span><span class="comment"> /// minimizing distances</span></div>
|
||||
<div class="line"><span class="lineno"> 175</span><span class="comment"></span> <span class="keywordflow">if</span> (currentDist + edge.second < dist[1][edge.first]) {</div>
|
||||
<div class="line"><span class="lineno"> 176</span> dist[1][edge.first] = currentDist + edge.second;</div>
|
||||
<div class="line"><span class="lineno"> 177</span> pq[1].push(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(dist[1][edge.first], edge.first));</div>
|
||||
<div class="line"><span class="lineno"> 178</span> }</div>
|
||||
<div class="line"><span class="lineno"> 179</span> }</div>
|
||||
<div class="line"><span class="lineno"> 180</span> <span class="comment">// store the processed node/ vertex</span></div>
|
||||
<div class="line"><span class="lineno"> 181</span> workset.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(currentNode);</div>
|
||||
<div class="line"><span class="lineno"> 182</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 183</span><span class="comment"> /// check if currentNode has already been visited</span></div>
|
||||
<div class="line"><span class="lineno"> 184</span><span class="comment"></span> <span class="keywordflow">if</span> (visited[currentNode] == 1) {</div>
|
||||
<div class="line"><span class="lineno"> 185</span> <span class="keywordflow">return</span> <a class="code hl_function" href="#a22f1b7277e1dd4190f25014b48487ce6">Shortest_Path_Distance</a>(workset, dist);</div>
|
||||
<div class="line"><span class="lineno"> 186</span> }</div>
|
||||
<div class="line"><span class="lineno"> 187</span> visited[currentNode] = <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">return</span> -1;</div>
|
||||
<div class="line"><span class="lineno"> 190</span>}</div>
|
||||
<div class="ttc" id="abidirectional__dijkstra_8cpp_html_a22f1b7277e1dd4190f25014b48487ce6"><div class="ttname"><a href="#a22f1b7277e1dd4190f25014b48487ce6">graph::bidirectional_dijkstra::Shortest_Path_Distance</a></div><div class="ttdeci">uint64_t Shortest_Path_Distance(const std::vector< uint64_t > &workset_, const std::vector< std::vector< uint64_t > > &distance_)</div><div class="ttdoc">This function returns the shortest distance from the source to the target if there is path between ve...</div><div class="ttdef"><b>Definition</b> bidirectional_dijkstra.cpp:61</div></div>
|
||||
<div class="ttc" id="abidirectional__dijkstra_8cpp_html_a330a2b0a904f01802ada1f8f3b28e76c"><div class="ttname"><a href="#a330a2b0a904f01802ada1f8f3b28e76c">INF</a></div><div class="ttdeci">constexpr int64_t INF</div><div class="ttdef"><b>Definition</b> bidirectional_dijkstra.cpp:23</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 89</span> {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 90</span><span class="comment"> /// n denotes the number of vertices in graph</span></div>
|
||||
<div class="line"><span class="lineno"> 91</span><span class="comment"></span> uint64_t n = adj1-><a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>();</div>
|
||||
<div class="line"><span class="lineno"> 92</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 93</span><span class="comment"> /// setting all the distances initially to INF</span></div>
|
||||
<div class="line"><span class="lineno"> 94</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::vector<uint64_t></a>> dist(2, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a>(n, <a class="code hl_variable" href="#a330a2b0a904f01802ada1f8f3b28e76c">INF</a>));</div>
|
||||
<div class="line"><span class="lineno"> 95</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 96</span><span class="comment"> /// creating a a vector of min heap using priority queue</span></div>
|
||||
<div class="line"><span class="lineno"> 97</span><span class="comment"> /// pq[0] contains the min heap for the direct search</span></div>
|
||||
<div class="line"><span class="lineno"> 98</span><span class="comment"> /// pq[1] contains the min heap for the reverse search</span></div>
|
||||
<div class="line"><span class="lineno"> 99</span><span class="comment"></span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 100</span><span class="comment"> /// first element of pair contains the distance</span></div>
|
||||
<div class="line"><span class="lineno"> 101</span><span class="comment"> /// second element of pair contains the vertex</span></div>
|
||||
<div class="line"><span class="lineno"> 102</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a><</div>
|
||||
<div class="line"><span class="lineno"> 103</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/priority_queue.html">std::priority_queue<std::pair<uint64_t, uint64_t></a>,</div>
|
||||
<div class="line"><span class="lineno"> 104</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::pair<uint64_t, uint64_t></a>>,</div>
|
||||
<div class="line"><span class="lineno"> 105</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/functional/greater.html">std::greater<std::pair<uint64_t, uint64_t></a>>>></div>
|
||||
<div class="line"><span class="lineno"> 106</span> pq(2);<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 107</span><span class="comment"> /// vector for store the nodes or vertices in the shortest path</span></div>
|
||||
<div class="line"><span class="lineno"> 108</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> workset(n);<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 109</span><span class="comment"> /// vector for store the nodes or vertices visited</span></div>
|
||||
<div class="line"><span class="lineno"> 110</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<bool></a> visited(n);</div>
|
||||
<div class="line"><span class="lineno"> 111</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 112</span><span class="comment"> /// pushing the source vertex 's' with 0 distance in pq[0] min heap</span></div>
|
||||
<div class="line"><span class="lineno"> 113</span><span class="comment"></span> pq[0].push(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(0, s));</div>
|
||||
<div class="line"><span class="lineno"> 114</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 115</span><span class="comment"> /// marking the distance of source as 0</span></div>
|
||||
<div class="line"><span class="lineno"> 116</span><span class="comment"></span> dist[0][s] = 0;</div>
|
||||
<div class="line"><span class="lineno"> 117</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 118</span><span class="comment"> /// pushing the target vertex 't' with 0 distance in pq[1] min heap</span></div>
|
||||
<div class="line"><span class="lineno"> 119</span><span class="comment"></span> pq[1].push(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(0, t));</div>
|
||||
<div class="line"><span class="lineno"> 120</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 121</span><span class="comment"> /// marking the distance of target as 0</span></div>
|
||||
<div class="line"><span class="lineno"> 122</span><span class="comment"></span> dist[1][t] = 0;</div>
|
||||
<div class="line"><span class="lineno"> 123</span> </div>
|
||||
<div class="line"><span class="lineno"> 124</span> <span class="keywordflow">while</span> (<span class="keyword">true</span>) {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 125</span><span class="comment"> /// direct search</span></div>
|
||||
<div class="line"><span class="lineno"> 126</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 127</span> <span class="comment">// If pq[0].size() is equal to zero then the node/ vertex is not</span></div>
|
||||
<div class="line"><span class="lineno"> 128</span> <span class="comment">// reachable from s</span></div>
|
||||
<div class="line"><span class="lineno"> 129</span> <span class="keywordflow">if</span> (pq[0].size() == 0) {</div>
|
||||
<div class="line"><span class="lineno"> 130</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><span class="lineno"> 131</span> }<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 132</span><span class="comment"> /// second element of pair denotes the node / vertex</span></div>
|
||||
<div class="line"><span class="lineno"> 133</span><span class="comment"></span> uint64_t currentNode = pq[0].top().second;</div>
|
||||
<div class="line"><span class="lineno"> 134</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 135</span><span class="comment"> /// first element of pair denotes the distance</span></div>
|
||||
<div class="line"><span class="lineno"> 136</span><span class="comment"></span> uint64_t currentDist = pq[0].top().first;</div>
|
||||
<div class="line"><span class="lineno"> 137</span> </div>
|
||||
<div class="line"><span class="lineno"> 138</span> pq[0].pop();</div>
|
||||
<div class="line"><span class="lineno"> 139</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 140</span><span class="comment"> /// for all the reachable vertex from the currently exploring vertex</span></div>
|
||||
<div class="line"><span class="lineno"> 141</span><span class="comment"> /// we will try to minimize the distance</span></div>
|
||||
<div class="line"><span class="lineno"> 142</span><span class="comment"></span> <span class="keywordflow">for</span> (<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<int, int></a> edge : (*adj1)[currentNode]) {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 143</span><span class="comment"> /// minimizing distances</span></div>
|
||||
<div class="line"><span class="lineno"> 144</span><span class="comment"></span> <span class="keywordflow">if</span> (currentDist + edge.second < dist[0][edge.first]) {</div>
|
||||
<div class="line"><span class="lineno"> 145</span> dist[0][edge.first] = currentDist + edge.second;</div>
|
||||
<div class="line"><span class="lineno"> 146</span> pq[0].push(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(dist[0][edge.first], edge.first));</div>
|
||||
<div class="line"><span class="lineno"> 147</span> }</div>
|
||||
<div class="line"><span class="lineno"> 148</span> }</div>
|
||||
<div class="line"><span class="lineno"> 149</span> <span class="comment">// store the processed node/ vertex</span></div>
|
||||
<div class="line"><span class="lineno"> 150</span> workset.push_back(currentNode);</div>
|
||||
<div class="line"><span class="lineno"> 151</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 152</span><span class="comment"> /// check if currentNode has already been visited</span></div>
|
||||
<div class="line"><span class="lineno"> 153</span><span class="comment"></span> <span class="keywordflow">if</span> (visited[currentNode] == 1) {</div>
|
||||
<div class="line"><span class="lineno"> 154</span> <span class="keywordflow">return</span> <a class="code hl_function" href="#a22f1b7277e1dd4190f25014b48487ce6">Shortest_Path_Distance</a>(workset, dist);</div>
|
||||
<div class="line"><span class="lineno"> 155</span> }</div>
|
||||
<div class="line"><span class="lineno"> 156</span> visited[currentNode] = <span class="keyword">true</span>;<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 157</span><span class="comment"> /// reversed search</span></div>
|
||||
<div class="line"><span class="lineno"> 158</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 159</span> <span class="comment">// If pq[1].size() is equal to zero then the node/ vertex is not</span></div>
|
||||
<div class="line"><span class="lineno"> 160</span> <span class="comment">// reachable from t</span></div>
|
||||
<div class="line"><span class="lineno"> 161</span> <span class="keywordflow">if</span> (pq[1].size() == 0) {</div>
|
||||
<div class="line"><span class="lineno"> 162</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><span class="lineno"> 163</span> }<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 164</span><span class="comment"> /// second element of pair denotes the node / vertex</span></div>
|
||||
<div class="line"><span class="lineno"> 165</span><span class="comment"></span> currentNode = pq[1].top().second;</div>
|
||||
<div class="line"><span class="lineno"> 166</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 167</span><span class="comment"> /// first element of pair denotes the distance</span></div>
|
||||
<div class="line"><span class="lineno"> 168</span><span class="comment"></span> currentDist = pq[1].top().first;</div>
|
||||
<div class="line"><span class="lineno"> 169</span> </div>
|
||||
<div class="line"><span class="lineno"> 170</span> pq[1].pop();</div>
|
||||
<div class="line"><span class="lineno"> 171</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 172</span><span class="comment"> /// for all the reachable vertex from the currently exploring vertex</span></div>
|
||||
<div class="line"><span class="lineno"> 173</span><span class="comment"> /// we will try to minimize the distance</span></div>
|
||||
<div class="line"><span class="lineno"> 174</span><span class="comment"></span> <span class="keywordflow">for</span> (<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<int, int></a> edge : (*adj2)[currentNode]) {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 175</span><span class="comment"> /// minimizing distances</span></div>
|
||||
<div class="line"><span class="lineno"> 176</span><span class="comment"></span> <span class="keywordflow">if</span> (currentDist + edge.second < dist[1][edge.first]) {</div>
|
||||
<div class="line"><span class="lineno"> 177</span> dist[1][edge.first] = currentDist + edge.second;</div>
|
||||
<div class="line"><span class="lineno"> 178</span> pq[1].push(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair/make_pair.html">std::make_pair</a>(dist[1][edge.first], edge.first));</div>
|
||||
<div class="line"><span class="lineno"> 179</span> }</div>
|
||||
<div class="line"><span class="lineno"> 180</span> }</div>
|
||||
<div class="line"><span class="lineno"> 181</span> <span class="comment">// store the processed node/ vertex</span></div>
|
||||
<div class="line"><span class="lineno"> 182</span> workset.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(currentNode);</div>
|
||||
<div class="line"><span class="lineno"> 183</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 184</span><span class="comment"> /// check if currentNode has already been visited</span></div>
|
||||
<div class="line"><span class="lineno"> 185</span><span class="comment"></span> <span class="keywordflow">if</span> (visited[currentNode] == 1) {</div>
|
||||
<div class="line"><span class="lineno"> 186</span> <span class="keywordflow">return</span> <a class="code hl_function" href="#a22f1b7277e1dd4190f25014b48487ce6">Shortest_Path_Distance</a>(workset, dist);</div>
|
||||
<div class="line"><span class="lineno"> 187</span> }</div>
|
||||
<div class="line"><span class="lineno"> 188</span> visited[currentNode] = <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 189</span> }</div>
|
||||
<div class="line"><span class="lineno"> 190</span> <span class="keywordflow">return</span> -1;</div>
|
||||
<div class="line"><span class="lineno"> 191</span>}</div>
|
||||
<div class="ttc" id="abidirectional__dijkstra_8cpp_html_a22f1b7277e1dd4190f25014b48487ce6"><div class="ttname"><a href="#a22f1b7277e1dd4190f25014b48487ce6">graph::bidirectional_dijkstra::Shortest_Path_Distance</a></div><div class="ttdeci">uint64_t Shortest_Path_Distance(const std::vector< uint64_t > &workset_, const std::vector< std::vector< uint64_t > > &distance_)</div><div class="ttdoc">This function returns the shortest distance from the source to the target if there is path between ve...</div><div class="ttdef"><b>Definition</b> bidirectional_dijkstra.cpp:62</div></div>
|
||||
<div class="ttc" id="abidirectional__dijkstra_8cpp_html_a330a2b0a904f01802ada1f8f3b28e76c"><div class="ttname"><a href="#a330a2b0a904f01802ada1f8f3b28e76c">INF</a></div><div class="ttdeci">constexpr int64_t INF</div><div class="ttdoc">for assert</div><div class="ttdef"><b>Definition</b> bidirectional_dijkstra.cpp:24</div></div>
|
||||
<div class="ttc" id="agreater_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/functional/greater.html">std::greater</a></div></div>
|
||||
<div class="ttc" id="apair_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a></div></div>
|
||||
<div class="ttc" id="apriority_queue_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/priority_queue.html">std::priority_queue</a></div></div>
|
||||
@@ -419,57 +421,57 @@ 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"> 248</span> {</div>
|
||||
<div class="line"><span class="lineno"> 249</span> <a class="code hl_function" href="#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>(); <span class="comment">// running predefined tests</span></div>
|
||||
<div class="line"><span class="lineno"> 250</span> uint64_t vertices = uint64_t();</div>
|
||||
<div class="line"><span class="lineno"> 251</span> uint64_t edges = uint64_t();</div>
|
||||
<div class="line"><span class="lineno"> 252</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">"Enter the number of vertices : "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 253</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> vertices;</div>
|
||||
<div class="line"><span class="lineno"> 254</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">"Enter the number of edges : "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 255</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> edges;</div>
|
||||
<div class="line"><span class="lineno"> 256</span> </div>
|
||||
<div class="line"><span class="lineno"> 257</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::vector<std::pair<uint64_t, uint64_t></a>>> adj1(</div>
|
||||
<div class="line"><span class="lineno"> 258</span> vertices, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a><<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<uint64_t, uint64_t></a>>());</div>
|
||||
<div class="line"><span class="lineno"> 259</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::vector<std::pair<uint64_t, uint64_t></a>>> adj2(</div>
|
||||
<div class="line"><span class="lineno"> 260</span> vertices, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a><<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<uint64_t, uint64_t></a>>());</div>
|
||||
<div class="line"><span class="lineno"> 261</span> </div>
|
||||
<div class="line"><span class="lineno"> 262</span> uint64_t u = uint64_t(), v = uint64_t(), w = uint64_t();</div>
|
||||
<div class="line"><span class="lineno"> 263</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">"Enter the edges by three integers in this form: u v w "</span></div>
|
||||
<div class="line"><span class="lineno"> 264</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"> 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">"Example: if there is and edge between node 1 and node 4 with "</span></div>
|
||||
<div class="line"><span class="lineno"> 266</span> <span class="stringliteral">"weight 7 enter: 1 4 7, and then press enter"</span></div>
|
||||
<div class="line"><span class="lineno"> 267</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"> 268</span> <span class="keywordflow">while</span> (edges--) {</div>
|
||||
<div class="line"><span class="lineno"> 269</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> u >> v >> w;</div>
|
||||
<div class="line"><span class="lineno"> 270</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj1, &adj2, u, v, w);</div>
|
||||
<div class="line"><span class="lineno"> 271</span> <span class="keywordflow">if</span> (edges != 0) {</div>
|
||||
<div class="line"><span class="lineno"> 272</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">"Enter the next edge"</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"> 273</span> }</div>
|
||||
<div class="line"><span class="lineno"> 274</span> }</div>
|
||||
<div class="line"><span class="lineno"> 275</span> </div>
|
||||
<div class="line"><span class="lineno"> 276</span> uint64_t s = uint64_t(), t = uint64_t();</div>
|
||||
<div class="line"><span class="lineno"> 277</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div>
|
||||
<div class="line"><span class="lineno"> 278</span> << <span class="stringliteral">"Enter the source node and the target node separated by a space"</span></div>
|
||||
<div class="line"><span class="lineno"> 279</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"> 280</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">"Example: If the source node is 5 and the target node is 6 "</span></div>
|
||||
<div class="line"><span class="lineno"> 281</span> <span class="stringliteral">"enter: 5 6 and press enter"</span></div>
|
||||
<div class="line"><span class="lineno"> 282</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"> 283</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> s >> t;</div>
|
||||
<div class="line"><span class="lineno"> 284</span> <span class="keywordtype">int</span> dist =</div>
|
||||
<div class="line"><span class="lineno"> 285</span> <a class="code hl_function" href="#a1b2df3d52a403ad46523ab90d3a723c1">graph::bidirectional_dijkstra::Bidijkstra</a>(&adj1, &adj2, s - 1, t - 1);</div>
|
||||
<div class="line"><span class="lineno"> 286</span> <span class="keywordflow">if</span> (dist == -1) {</div>
|
||||
<div class="line"><span class="lineno"> 287</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">"Target not reachable from source"</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"> 288</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 289</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">"Shortest Path Distance : "</span> << dist << <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"> 290</span> }</div>
|
||||
<div class="line"><span class="lineno"> 291</span> </div>
|
||||
<div class="line"><span class="lineno"> 292</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 293</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 249</span> {</div>
|
||||
<div class="line"><span class="lineno"> 250</span> <a class="code hl_function" href="#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>(); <span class="comment">// running predefined tests</span></div>
|
||||
<div class="line"><span class="lineno"> 251</span> uint64_t vertices = uint64_t();</div>
|
||||
<div class="line"><span class="lineno"> 252</span> uint64_t edges = uint64_t();</div>
|
||||
<div class="line"><span class="lineno"> 253</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">"Enter the number of vertices : "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 254</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> vertices;</div>
|
||||
<div class="line"><span class="lineno"> 255</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">"Enter the number of edges : "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 256</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> edges;</div>
|
||||
<div class="line"><span class="lineno"> 257</span> </div>
|
||||
<div class="line"><span class="lineno"> 258</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::vector<std::pair<uint64_t, uint64_t></a>>> adj1(</div>
|
||||
<div class="line"><span class="lineno"> 259</span> vertices, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a><<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<uint64_t, uint64_t></a>>());</div>
|
||||
<div class="line"><span class="lineno"> 260</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::vector<std::pair<uint64_t, uint64_t></a>>> adj2(</div>
|
||||
<div class="line"><span class="lineno"> 261</span> vertices, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a><<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<uint64_t, uint64_t></a>>());</div>
|
||||
<div class="line"><span class="lineno"> 262</span> </div>
|
||||
<div class="line"><span class="lineno"> 263</span> uint64_t u = uint64_t(), v = uint64_t(), w = uint64_t();</div>
|
||||
<div class="line"><span class="lineno"> 264</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">"Enter the edges by three integers in this form: u v w "</span></div>
|
||||
<div class="line"><span class="lineno"> 265</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"> 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">"Example: if there is and edge between node 1 and node 4 with "</span></div>
|
||||
<div class="line"><span class="lineno"> 267</span> <span class="stringliteral">"weight 7 enter: 1 4 7, and then press enter"</span></div>
|
||||
<div class="line"><span class="lineno"> 268</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"> 269</span> <span class="keywordflow">while</span> (edges--) {</div>
|
||||
<div class="line"><span class="lineno"> 270</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> u >> v >> w;</div>
|
||||
<div class="line"><span class="lineno"> 271</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj1, &adj2, u, v, w);</div>
|
||||
<div class="line"><span class="lineno"> 272</span> <span class="keywordflow">if</span> (edges != 0) {</div>
|
||||
<div class="line"><span class="lineno"> 273</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">"Enter the next edge"</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"> 274</span> }</div>
|
||||
<div class="line"><span class="lineno"> 275</span> }</div>
|
||||
<div class="line"><span class="lineno"> 276</span> </div>
|
||||
<div class="line"><span class="lineno"> 277</span> uint64_t s = uint64_t(), t = uint64_t();</div>
|
||||
<div class="line"><span class="lineno"> 278</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div>
|
||||
<div class="line"><span class="lineno"> 279</span> << <span class="stringliteral">"Enter the source node and the target node separated by a space"</span></div>
|
||||
<div class="line"><span class="lineno"> 280</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"> 281</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">"Example: If the source node is 5 and the target node is 6 "</span></div>
|
||||
<div class="line"><span class="lineno"> 282</span> <span class="stringliteral">"enter: 5 6 and press enter"</span></div>
|
||||
<div class="line"><span class="lineno"> 283</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"> 284</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> s >> t;</div>
|
||||
<div class="line"><span class="lineno"> 285</span> <span class="keywordtype">int</span> dist =</div>
|
||||
<div class="line"><span class="lineno"> 286</span> <a class="code hl_function" href="#a1b2df3d52a403ad46523ab90d3a723c1">graph::bidirectional_dijkstra::Bidijkstra</a>(&adj1, &adj2, s - 1, t - 1);</div>
|
||||
<div class="line"><span class="lineno"> 287</span> <span class="keywordflow">if</span> (dist == -1) {</div>
|
||||
<div class="line"><span class="lineno"> 288</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">"Target not reachable from source"</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"> 289</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 290</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">"Shortest Path Distance : "</span> << dist << <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"> 291</span> }</div>
|
||||
<div class="line"><span class="lineno"> 292</span> </div>
|
||||
<div class="line"><span class="lineno"> 293</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 294</span>}</div>
|
||||
<div class="ttc" id="abasic_istream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a></div></div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="abidirectional__dijkstra_8cpp_html_a1b2df3d52a403ad46523ab90d3a723c1"><div class="ttname"><a href="#a1b2df3d52a403ad46523ab90d3a723c1">graph::bidirectional_dijkstra::Bidijkstra</a></div><div class="ttdeci">int Bidijkstra(std::vector< std::vector< std::pair< uint64_t, uint64_t > > > *adj1, std::vector< std::vector< std::pair< uint64_t, uint64_t > > > *adj2, uint64_t s, uint64_t t)</div><div class="ttdoc">Function runs the dijkstra algorithm for some source vertex and target vertex in the graph and return...</div><div class="ttdef"><b>Definition</b> bidirectional_dijkstra.cpp:86</div></div>
|
||||
<div class="ttc" id="abidirectional__dijkstra_8cpp_html_a483bb8ccf42aaf7375a83e91490eda1e"><div class="ttname"><a href="#a483bb8ccf42aaf7375a83e91490eda1e">tests</a></div><div class="ttdeci">static void tests()</div><div class="ttdoc">Function to test the provided algorithm above.</div><div class="ttdef"><b>Definition</b> bidirectional_dijkstra.cpp:199</div></div>
|
||||
<div class="ttc" id="abidirectional__dijkstra_8cpp_html_a69172365aebde9be1997157f6f80e0cf"><div class="ttname"><a href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a></div><div class="ttdeci">void addEdge(std::vector< std::vector< std::pair< uint64_t, uint64_t > > > *adj1, std::vector< std::vector< std::pair< uint64_t, uint64_t > > > *adj2, uint64_t u, uint64_t v, uint64_t w)</div><div class="ttdoc">Function that add edge between two nodes or vertices of graph.</div><div class="ttdef"><b>Definition</b> bidirectional_dijkstra.cpp:45</div></div>
|
||||
<div class="ttc" id="abidirectional__dijkstra_8cpp_html_a1b2df3d52a403ad46523ab90d3a723c1"><div class="ttname"><a href="#a1b2df3d52a403ad46523ab90d3a723c1">graph::bidirectional_dijkstra::Bidijkstra</a></div><div class="ttdeci">int Bidijkstra(std::vector< std::vector< std::pair< uint64_t, uint64_t > > > *adj1, std::vector< std::vector< std::pair< uint64_t, uint64_t > > > *adj2, uint64_t s, uint64_t t)</div><div class="ttdoc">Function runs the dijkstra algorithm for some source vertex and target vertex in the graph and return...</div><div class="ttdef"><b>Definition</b> bidirectional_dijkstra.cpp:87</div></div>
|
||||
<div class="ttc" id="abidirectional__dijkstra_8cpp_html_a483bb8ccf42aaf7375a83e91490eda1e"><div class="ttname"><a href="#a483bb8ccf42aaf7375a83e91490eda1e">tests</a></div><div class="ttdeci">static void tests()</div><div class="ttdoc">Function to test the provided algorithm above.</div><div class="ttdef"><b>Definition</b> bidirectional_dijkstra.cpp:200</div></div>
|
||||
<div class="ttc" id="abidirectional__dijkstra_8cpp_html_a69172365aebde9be1997157f6f80e0cf"><div class="ttname"><a href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a></div><div class="ttdeci">void addEdge(std::vector< std::vector< std::pair< uint64_t, uint64_t > > > *adj1, std::vector< std::vector< std::pair< uint64_t, uint64_t > > > *adj2, uint64_t u, uint64_t v, uint64_t w)</div><div class="ttdoc">Function that add edge between two nodes or vertices of graph.</div><div class="ttdef"><b>Definition</b> bidirectional_dijkstra.cpp:46</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">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -506,15 +508,15 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 63</span> {</div>
|
||||
<div class="line"><span class="lineno"> 64</span> int64_t <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/distance.html">distance</a> = <a class="code hl_variable" href="#a330a2b0a904f01802ada1f8f3b28e76c">INF</a>;</div>
|
||||
<div class="line"><span class="lineno"> 65</span> <span class="keywordflow">for</span> (uint64_t i : workset_) {</div>
|
||||
<div class="line"><span class="lineno"> 66</span> <span class="keywordflow">if</span> (distance_[0][i] + distance_[1][i] < distance) {</div>
|
||||
<div class="line"><span class="lineno"> 67</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/distance.html">distance</a> = distance_[0][i] + distance_[1][i];</div>
|
||||
<div class="line"><span class="lineno"> 68</span> }</div>
|
||||
<div class="line"><span class="lineno"> 69</span> }</div>
|
||||
<div class="line"><span class="lineno"> 70</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/distance.html">distance</a>;</div>
|
||||
<div class="line"><span class="lineno"> 71</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 64</span> {</div>
|
||||
<div class="line"><span class="lineno"> 65</span> int64_t <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/distance.html">distance</a> = <a class="code hl_variable" href="#a330a2b0a904f01802ada1f8f3b28e76c">INF</a>;</div>
|
||||
<div class="line"><span class="lineno"> 66</span> <span class="keywordflow">for</span> (uint64_t i : workset_) {</div>
|
||||
<div class="line"><span class="lineno"> 67</span> <span class="keywordflow">if</span> (distance_[0][i] + distance_[1][i] < distance) {</div>
|
||||
<div class="line"><span class="lineno"> 68</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/distance.html">distance</a> = distance_[0][i] + distance_[1][i];</div>
|
||||
<div class="line"><span class="lineno"> 69</span> }</div>
|
||||
<div class="line"><span class="lineno"> 70</span> }</div>
|
||||
<div class="line"><span class="lineno"> 71</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/distance.html">distance</a>;</div>
|
||||
<div class="line"><span class="lineno"> 72</span>}</div>
|
||||
<div class="ttc" id="adistance_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/iterator/distance.html">std::distance</a></div><div class="ttdeci">T distance(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -549,50 +551,50 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Function to test the provided algorithm above. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 199</span> {</div>
|
||||
<div class="line"><span class="lineno"> 200</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">"Initiatinig Predefined Tests..."</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"> 201</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">"Initiating Test 1..."</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"> 202</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::vector<std::pair<uint64_t, uint64_t></a>>> adj1_1(</div>
|
||||
<div class="line"><span class="lineno"> 203</span> 4, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a><<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<uint64_t, uint64_t></a>>());</div>
|
||||
<div class="line"><span class="lineno"> 204</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::vector<std::pair<uint64_t, uint64_t></a>>> adj1_2(</div>
|
||||
<div class="line"><span class="lineno"> 205</span> 4, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a><<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<uint64_t, uint64_t></a>>());</div>
|
||||
<div class="line"><span class="lineno"> 206</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj1_1, &adj1_2, 1, 2, 1);</div>
|
||||
<div class="line"><span class="lineno"> 207</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj1_1, &adj1_2, 4, 1, 2);</div>
|
||||
<div class="line"><span class="lineno"> 208</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj1_1, &adj1_2, 2, 3, 2);</div>
|
||||
<div class="line"><span class="lineno"> 209</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj1_1, &adj1_2, 1, 3, 5);</div>
|
||||
<div class="line"><span class="lineno"> 210</span> </div>
|
||||
<div class="line"><span class="lineno"> 211</span> uint64_t s = 1, t = 3;</div>
|
||||
<div class="line"><span class="lineno"> 212</span> assert(graph::bidirectional_dijkstra::Bidijkstra(&adj1_1, &adj1_2, s - 1,</div>
|
||||
<div class="line"><span class="lineno"> 213</span> t - 1) == 3);</div>
|
||||
<div class="line"><span class="lineno"> 214</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 1 Passed..."</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 215</span> </div>
|
||||
<div class="line"><span class="lineno"> 216</span> s = 4, t = 3;</div>
|
||||
<div class="line"><span class="lineno"> 217</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">"Initiating Test 2..."</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"> 218</span> assert(graph::bidirectional_dijkstra::Bidijkstra(&adj1_1, &adj1_2, s - 1,</div>
|
||||
<div class="line"><span class="lineno"> 219</span> t - 1) == 5);</div>
|
||||
<div class="line"><span class="lineno"> 220</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 2 Passed..."</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 221</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<std::vector<std::pair<uint64_t, uint64_t></a>>> adj2_1(</div>
|
||||
<div class="line"><span class="lineno"> 223</span> 5, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a><<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<uint64_t, uint64_t></a>>());</div>
|
||||
<div class="line"><span class="lineno"> 224</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::vector<std::pair<uint64_t, uint64_t></a>>> adj2_2(</div>
|
||||
<div class="line"><span class="lineno"> 225</span> 5, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a><<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<uint64_t, uint64_t></a>>());</div>
|
||||
<div class="line"><span class="lineno"> 226</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj2_1, &adj2_2, 1, 2, 4);</div>
|
||||
<div class="line"><span class="lineno"> 227</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj2_1, &adj2_2, 1, 3, 2);</div>
|
||||
<div class="line"><span class="lineno"> 228</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj2_1, &adj2_2, 2, 3, 2);</div>
|
||||
<div class="line"><span class="lineno"> 229</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj2_1, &adj2_2, 3, 2, 1);</div>
|
||||
<div class="line"><span class="lineno"> 230</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj2_1, &adj2_2, 2, 4, 2);</div>
|
||||
<div class="line"><span class="lineno"> 231</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj2_1, &adj2_2, 3, 5, 4);</div>
|
||||
<div class="line"><span class="lineno"> 232</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj2_1, &adj2_2, 5, 4, 1);</div>
|
||||
<div class="line"><span class="lineno"> 233</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj2_1, &adj2_2, 2, 5, 3);</div>
|
||||
<div class="line"><span class="lineno"> 234</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj2_1, &adj2_2, 3, 4, 4);</div>
|
||||
<div class="line"><span class="lineno"> 235</span> </div>
|
||||
<div class="line"><span class="lineno"> 236</span> s = 1, t = 5;</div>
|
||||
<div class="line"><span class="lineno"> 237</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">"Initiating Test 3..."</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"> 238</span> assert(graph::bidirectional_dijkstra::Bidijkstra(&adj2_1, &adj2_2, s - 1,</div>
|
||||
<div class="line"><span class="lineno"> 239</span> t - 1) == 6);</div>
|
||||
<div class="line"><span class="lineno"> 240</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 3 Passed..."</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 241</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 Test Passed..."</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</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"> 242</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 200</span> {</div>
|
||||
<div class="line"><span class="lineno"> 201</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">"Initiatinig Predefined Tests..."</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"> 202</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">"Initiating Test 1..."</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"> 203</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::vector<std::pair<uint64_t, uint64_t></a>>> adj1_1(</div>
|
||||
<div class="line"><span class="lineno"> 204</span> 4, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a><<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<uint64_t, uint64_t></a>>());</div>
|
||||
<div class="line"><span class="lineno"> 205</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::vector<std::pair<uint64_t, uint64_t></a>>> adj1_2(</div>
|
||||
<div class="line"><span class="lineno"> 206</span> 4, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a><<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<uint64_t, uint64_t></a>>());</div>
|
||||
<div class="line"><span class="lineno"> 207</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj1_1, &adj1_2, 1, 2, 1);</div>
|
||||
<div class="line"><span class="lineno"> 208</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj1_1, &adj1_2, 4, 1, 2);</div>
|
||||
<div class="line"><span class="lineno"> 209</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj1_1, &adj1_2, 2, 3, 2);</div>
|
||||
<div class="line"><span class="lineno"> 210</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj1_1, &adj1_2, 1, 3, 5);</div>
|
||||
<div class="line"><span class="lineno"> 211</span> </div>
|
||||
<div class="line"><span class="lineno"> 212</span> uint64_t s = 1, t = 3;</div>
|
||||
<div class="line"><span class="lineno"> 213</span> assert(graph::bidirectional_dijkstra::Bidijkstra(&adj1_1, &adj1_2, s - 1,</div>
|
||||
<div class="line"><span class="lineno"> 214</span> t - 1) == 3);</div>
|
||||
<div class="line"><span class="lineno"> 215</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 1 Passed..."</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 216</span> </div>
|
||||
<div class="line"><span class="lineno"> 217</span> s = 4, t = 3;</div>
|
||||
<div class="line"><span class="lineno"> 218</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">"Initiating Test 2..."</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"> 219</span> assert(graph::bidirectional_dijkstra::Bidijkstra(&adj1_1, &adj1_2, s - 1,</div>
|
||||
<div class="line"><span class="lineno"> 220</span> t - 1) == 5);</div>
|
||||
<div class="line"><span class="lineno"> 221</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 2 Passed..."</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 222</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<std::vector<std::pair<uint64_t, uint64_t></a>>> adj2_1(</div>
|
||||
<div class="line"><span class="lineno"> 224</span> 5, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a><<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<uint64_t, uint64_t></a>>());</div>
|
||||
<div class="line"><span class="lineno"> 225</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::vector<std::pair<uint64_t, uint64_t></a>>> adj2_2(</div>
|
||||
<div class="line"><span class="lineno"> 226</span> 5, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a><<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<uint64_t, uint64_t></a>>());</div>
|
||||
<div class="line"><span class="lineno"> 227</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj2_1, &adj2_2, 1, 2, 4);</div>
|
||||
<div class="line"><span class="lineno"> 228</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj2_1, &adj2_2, 1, 3, 2);</div>
|
||||
<div class="line"><span class="lineno"> 229</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj2_1, &adj2_2, 2, 3, 2);</div>
|
||||
<div class="line"><span class="lineno"> 230</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj2_1, &adj2_2, 3, 2, 1);</div>
|
||||
<div class="line"><span class="lineno"> 231</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj2_1, &adj2_2, 2, 4, 2);</div>
|
||||
<div class="line"><span class="lineno"> 232</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj2_1, &adj2_2, 3, 5, 4);</div>
|
||||
<div class="line"><span class="lineno"> 233</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj2_1, &adj2_2, 5, 4, 1);</div>
|
||||
<div class="line"><span class="lineno"> 234</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj2_1, &adj2_2, 2, 5, 3);</div>
|
||||
<div class="line"><span class="lineno"> 235</span> <a class="code hl_function" href="#a69172365aebde9be1997157f6f80e0cf">graph::bidirectional_dijkstra::addEdge</a>(&adj2_1, &adj2_2, 3, 4, 4);</div>
|
||||
<div class="line"><span class="lineno"> 236</span> </div>
|
||||
<div class="line"><span class="lineno"> 237</span> s = 1, t = 5;</div>
|
||||
<div class="line"><span class="lineno"> 238</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">"Initiating Test 3..."</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"> 239</span> assert(graph::bidirectional_dijkstra::Bidijkstra(&adj2_1, &adj2_2, s - 1,</div>
|
||||
<div class="line"><span class="lineno"> 240</span> t - 1) == 6);</div>
|
||||
<div class="line"><span class="lineno"> 241</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 3 Passed..."</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 242</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 Test Passed..."</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</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"> 243</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -621,7 +623,9 @@ Here is the call graph for this function:</div>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>for assert for io operations for variable INF for the priority_queue of distances for make_pair function for store the graph, the distances, and the path </p>
|
||||
|
||||
<p>for assert </p>
|
||||
<p>for io operations for variable INF for the priority_queue of distances for make_pair function for store the graph, the distances, and the path </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
<map id="math/fibonacci_sum.cpp" name="math/fibonacci_sum.cpp">
|
||||
<area shape="rect" id="Node000001" title="An algorithm to calculate the sum of Fibonacci Sequence:  ." alt="" coords="48,5,211,31"/>
|
||||
<area shape="rect" id="Node000001" title="An algorithm to calculate the sum of Fibonacci Sequence:  ." alt="" coords="86,5,250,31"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="5,79,70,105"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="116,34,66,72,63,67,112,29"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="94,79,165,105"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="132,31,132,63,127,63,127,31"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="189,79,246,105"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="146,29,193,67,189,71,143,34"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="147,34,74,74,71,69,145,29"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="94,79,154,105"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="163,33,142,67,137,64,159,30"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="178,79,249,105"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="178,30,200,64,196,67,173,33"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="273,79,330,105"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="192,29,267,69,264,74,190,34"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
b3ac3bdf7e5270b4ba08c72084cbd6fa
|
||||
2354e40ad8a9859ed14b96430254621d
|
||||
@@ -4,8 +4,8 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: math/fibonacci_sum.cpp Pages: 1 -->
|
||||
<svg width="189pt" height="83pt"
|
||||
viewBox="0.00 0.00 188.62 82.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="252pt" height="83pt"
|
||||
viewBox="0.00 0.00 251.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="An algorithm to calculate the sum of Fibonacci Sequence:  .">
|
||||
<polygon fill="#999999" stroke="#666666" points="154.38,-74.5 31.88,-74.5 31.88,-55.25 154.38,-55.25 154.38,-74.5"/>
|
||||
<text text-anchor="middle" x="93.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">math/fibonacci_sum.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="183.38,-74.5 60.88,-74.5 60.88,-55.25 183.38,-55.25 183.38,-74.5"/>
|
||||
<text text-anchor="middle" x="122.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">math/fibonacci_sum.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="M81.42,-54.84C71.35,-47.07 56.58,-35.67 44.56,-26.4"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="46.91,-23.79 36.86,-20.45 42.63,-29.33 46.91,-23.79"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M105.5,-54.84C90.44,-46.66 67.98,-34.46 50.47,-24.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="52.62,-22.12 42.16,-20.43 49.28,-28.27 52.62,-22.12"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -50,8 +50,8 @@
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="119.88,-19.25 66.38,-19.25 66.38,0 119.88,0 119.88,-19.25"/>
|
||||
<text text-anchor="middle" x="93.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="111.75,-19.25 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>
|
||||
@@ -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="M93.12,-55.08C93.12,-48.57 93.12,-39.42 93.12,-31.12"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="96.63,-31.12 93.13,-21.12 89.63,-31.12 96.63,-31.12"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M116.68,-55.08C112.35,-48.11 106.16,-38.12 100.74,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="103.73,-27.55 95.49,-20.9 97.78,-31.24 103.73,-27.55"/>
|
||||
</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="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>
|
||||
@@ -77,8 +77,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="M104.32,-54.84C113.86,-47.15 127.8,-35.9 139.23,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="141.33,-29.48 146.92,-20.48 136.94,-24.03 141.33,-29.48"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M127.74,-55.08C132.24,-48.03 138.71,-37.9 144.34,-29.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="147.14,-31.2 149.57,-20.88 141.24,-27.43 147.14,-31.2"/>
|
||||
</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="M139.09,-54.84C154.39,-46.69 177.16,-34.57 194.99,-25.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="196.56,-28.2 203.74,-20.41 193.27,-22.02 196.56,-28.2"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 4.6 KiB |
@@ -4,16 +4,16 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: math/fibonacci_sum.cpp Pages: 1 -->
|
||||
<svg width="189pt" height="83pt"
|
||||
viewBox="0.00 0.00 188.62 82.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="252pt" height="83pt"
|
||||
viewBox="0.00 0.00 251.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>math/fibonacci_sum.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="An algorithm to calculate the sum of Fibonacci Sequence:  .">
|
||||
<polygon fill="#999999" stroke="#666666" points="154.38,-74.5 31.88,-74.5 31.88,-55.25 154.38,-55.25 154.38,-74.5"/>
|
||||
<text text-anchor="middle" x="93.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">math/fibonacci_sum.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="183.38,-74.5 60.88,-74.5 60.88,-55.25 183.38,-55.25 183.38,-74.5"/>
|
||||
<text text-anchor="middle" x="122.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">math/fibonacci_sum.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="M81.42,-54.84C71.35,-47.07 56.58,-35.67 44.56,-26.4"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="46.91,-23.79 36.86,-20.45 42.63,-29.33 46.91,-23.79"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M105.5,-54.84C90.44,-46.66 67.98,-34.46 50.47,-24.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="52.62,-22.12 42.16,-20.43 49.28,-28.27 52.62,-22.12"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -39,8 +39,8 @@
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="119.88,-19.25 66.38,-19.25 66.38,0 119.88,0 119.88,-19.25"/>
|
||||
<text text-anchor="middle" x="93.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="111.75,-19.25 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>
|
||||
@@ -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="M93.12,-55.08C93.12,-48.57 93.12,-39.42 93.12,-31.12"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="96.63,-31.12 93.13,-21.12 89.63,-31.12 96.63,-31.12"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M116.68,-55.08C112.35,-48.11 106.16,-38.12 100.74,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="103.73,-27.55 95.49,-20.9 97.78,-31.24 103.73,-27.55"/>
|
||||
</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="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>
|
||||
@@ -66,8 +66,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="M104.32,-54.84C113.86,-47.15 127.8,-35.9 139.23,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="141.33,-29.48 146.92,-20.48 136.94,-24.03 141.33,-29.48"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M127.74,-55.08C132.24,-48.03 138.71,-37.9 144.34,-29.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="147.14,-31.2 149.57,-20.88 141.24,-27.43 147.14,-31.2"/>
|
||||
</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="M139.09,-54.84C154.39,-46.69 177.16,-34.57 194.99,-25.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="196.56,-28.2 203.74,-20.41 193.27,-22.02 196.56,-28.2"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.8 KiB |
@@ -1,11 +1,13 @@
|
||||
<map id="math/inv_sqrt.cpp" name="math/inv_sqrt.cpp">
|
||||
<area shape="rect" id="Node000001" title="Implementation of the inverse square root Root." alt="" coords="104,5,230,31"/>
|
||||
<area shape="rect" id="Node000001" title="Implementation of the inverse square root Root." alt="" coords="143,5,268,31"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="5,79,70,105"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="146,34,74,73,72,69,144,29"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="178,34,81,75,79,70,176,29"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="94,79,152,105"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="162,33,141,67,136,64,157,30"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="175,79,246,105"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="176,30,198,64,193,67,172,33"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="270,79,322,105"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="190,29,262,69,259,73,187,34"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="193,34,150,71,146,67,190,30"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="175,79,236,105"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="208,31,208,63,203,63,203,31"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="259,79,330,105"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="222,29,270,67,266,71,219,34"/>
|
||||
<area shape="rect" id="Node000006" title=" " alt="" coords="354,79,406,105"/>
|
||||
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="236,29,341,72,339,76,234,34"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6c79d44fbefb0ef08af5a8a0e0fc9b20
|
||||
eef3c857d557ea8e8c0881f2307b2279
|
||||
@@ -4,8 +4,8 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: math/inv_sqrt.cpp Pages: 1 -->
|
||||
<svg width="246pt" height="83pt"
|
||||
viewBox="0.00 0.00 245.75 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.75 82.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Implementation of the inverse square root Root.">
|
||||
<polygon fill="#999999" stroke="#666666" points="168.12,-74.5 74.12,-74.5 74.12,-55.25 168.12,-55.25 168.12,-74.5"/>
|
||||
<text text-anchor="middle" x="121.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">math/inv_sqrt.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="197.12,-74.5 103.12,-74.5 103.12,-55.25 197.12,-55.25 197.12,-74.5"/>
|
||||
<text text-anchor="middle" x="150.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">math/inv_sqrt.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="M104.67,-54.84C89.9,-46.73 67.95,-34.68 50.69,-25.21"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="52.44,-22.18 41.99,-20.43 49.07,-28.31 52.44,-22.18"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M128.75,-54.84C108.84,-46.43 78.89,-33.77 56.12,-24.15"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="57.57,-20.96 47,-20.29 54.85,-27.41 57.57,-20.96"/>
|
||||
</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="M115.68,-55.08C111.35,-48.11 105.16,-38.12 99.74,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="102.73,-27.55 94.49,-20.9 96.78,-31.24 102.73,-27.55"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M139.61,-54.84C130.74,-47.22 117.81,-36.12 107.14,-26.95"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="109.5,-24.37 99.64,-20.51 104.94,-29.68 109.5,-24.37"/>
|
||||
</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="180.88,-19.25 127.38,-19.25 127.38,0 180.88,0 180.88,-19.25"/>
|
||||
<text text-anchor="middle" x="154.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="172.75,-19.25 127.5,-19.25 127.5,0 172.75,0 172.75,-19.25"/>
|
||||
<text text-anchor="middle" x="150.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -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="M126.57,-55.08C130.9,-48.11 137.09,-38.12 142.51,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="145.47,-31.24 147.76,-20.9 139.52,-27.55 145.47,-31.24"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M150.12,-55.08C150.12,-48.57 150.12,-39.42 150.12,-31.12"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="153.63,-31.12 150.13,-21.12 146.63,-31.12 153.63,-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.75,-19.25 198.5,-19.25 198.5,0 237.75,0 237.75,-19.25"/>
|
||||
<text text-anchor="middle" x="218.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">limits</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="243.88,-19.25 190.38,-19.25 190.38,0 243.88,0 243.88,-19.25"/>
|
||||
<text text-anchor="middle" x="217.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -95,8 +95,26 @@
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M137.58,-54.84C152.35,-46.73 174.3,-34.68 191.56,-25.21"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="193.18,-28.31 200.26,-20.43 189.81,-22.18 193.18,-28.31"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M161.49,-54.84C171.17,-47.15 185.32,-35.9 196.93,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="199.09,-29.43 204.74,-20.47 194.74,-23.95 199.09,-29.43"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="300.75,-19.25 261.5,-19.25 261.5,0 300.75,0 300.75,-19.25"/>
|
||||
<text text-anchor="middle" x="281.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">limits</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="M172.35,-54.84C193.9,-46.08 226.77,-32.72 250.73,-22.98"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="252.02,-26.23 259.97,-19.23 249.38,-19.75 252.02,-26.23"/>
|
||||
</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: math/inv_sqrt.cpp Pages: 1 -->
|
||||
<svg width="246pt" height="83pt"
|
||||
viewBox="0.00 0.00 245.75 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.75 82.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 78.5)">
|
||||
<title>math/inv_sqrt.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Implementation of the inverse square root Root.">
|
||||
<polygon fill="#999999" stroke="#666666" points="168.12,-74.5 74.12,-74.5 74.12,-55.25 168.12,-55.25 168.12,-74.5"/>
|
||||
<text text-anchor="middle" x="121.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">math/inv_sqrt.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="197.12,-74.5 103.12,-74.5 103.12,-55.25 197.12,-55.25 197.12,-74.5"/>
|
||||
<text text-anchor="middle" x="150.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">math/inv_sqrt.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="M104.67,-54.84C89.9,-46.73 67.95,-34.68 50.69,-25.21"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="52.44,-22.18 41.99,-20.43 49.07,-28.31 52.44,-22.18"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M128.75,-54.84C108.84,-46.43 78.89,-33.77 56.12,-24.15"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="57.57,-20.96 47,-20.29 54.85,-27.41 57.57,-20.96"/>
|
||||
</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="M115.68,-55.08C111.35,-48.11 105.16,-38.12 99.74,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="102.73,-27.55 94.49,-20.9 96.78,-31.24 102.73,-27.55"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M139.61,-54.84C130.74,-47.22 117.81,-36.12 107.14,-26.95"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="109.5,-24.37 99.64,-20.51 104.94,-29.68 109.5,-24.37"/>
|
||||
</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="180.88,-19.25 127.38,-19.25 127.38,0 180.88,0 180.88,-19.25"/>
|
||||
<text text-anchor="middle" x="154.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="172.75,-19.25 127.5,-19.25 127.5,0 172.75,0 172.75,-19.25"/>
|
||||
<text text-anchor="middle" x="150.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -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="M126.57,-55.08C130.9,-48.11 137.09,-38.12 142.51,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="145.47,-31.24 147.76,-20.9 139.52,-27.55 145.47,-31.24"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M150.12,-55.08C150.12,-48.57 150.12,-39.42 150.12,-31.12"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="153.63,-31.12 150.13,-21.12 146.63,-31.12 153.63,-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.75,-19.25 198.5,-19.25 198.5,0 237.75,0 237.75,-19.25"/>
|
||||
<text text-anchor="middle" x="218.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">limits</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="243.88,-19.25 190.38,-19.25 190.38,0 243.88,0 243.88,-19.25"/>
|
||||
<text text-anchor="middle" x="217.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -84,8 +84,26 @@
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M137.58,-54.84C152.35,-46.73 174.3,-34.68 191.56,-25.21"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="193.18,-28.31 200.26,-20.43 189.81,-22.18 193.18,-28.31"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M161.49,-54.84C171.17,-47.15 185.32,-35.9 196.93,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="199.09,-29.43 204.74,-20.47 194.74,-23.95 199.09,-29.43"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="300.75,-19.25 261.5,-19.25 261.5,0 300.75,0 300.75,-19.25"/>
|
||||
<text text-anchor="middle" x="281.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">limits</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="M172.35,-54.84C193.9,-46.08 226.77,-32.72 250.73,-22.98"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="252.02,-26.23 259.97,-19.23 249.38,-19.75 252.02,-26.23"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 4.5 KiB |
@@ -114,17 +114,18 @@ $(function(){initNavTree('d7/d56/count__bits__flip_8cpp.html','../../'); initRes
|
||||
<p>Implementation to [Count number of bits to be flipped to convert A to B] (<a href="https://www.geeksforgeeks.org/count-number-of-bits-to-be-flipped-to-convert-a-to-b/">https://www.geeksforgeeks.org/count-number-of-bits-to-be-flipped-to-convert-a-to-b/</a>) in an integer.
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <cassert></code><br />
|
||||
<code>#include <cstdint></code><br />
|
||||
<code>#include <iostream></code><br />
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for count_bits_flip.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d3/dcc/count__bits__flip_8cpp__incl.svg" width="171" 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="../../d3/dcc/count__bits__flip_8cpp__incl.svg" width="255" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
</div><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
|
||||
Namespaces</h2></td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d81/namespacebit__manipulation.html">bit_manipulation</a></td></tr>
|
||||
<tr class="memdesc:d7/d81/namespacebit__manipulation"><td class="mdescLeft"> </td><td class="mdescRight">for IO operations <br /></td></tr>
|
||||
<tr class="memdesc:d7/d81/namespacebit__manipulation"><td class="mdescLeft"> </td><td class="mdescRight">for assert <br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d38/namespacecount__bits__flip.html">count_bits_flip</a></td></tr>
|
||||
<tr class="memdesc:d4/d38/namespacecount__bits__flip"><td class="mdescLeft"> </td><td class="mdescRight">Functions for the <a href="https://www.geeksforgeeks.org/count-set-bits-in-an-integer/" target="_blank">count bits flip</a> implementation. <br /></td></tr>
|
||||
@@ -177,19 +178,19 @@ Functions</h2></td></tr>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>total number of bits needed to be flipped to convert A to B </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 44</span> { <span class="comment">// int64_t is preferred over int so that</span></div>
|
||||
<div class="line"><span class="lineno"> 45</span> <span class="comment">// no Overflow can be there.</span></div>
|
||||
<div class="line"><span class="lineno"> 46</span> </div>
|
||||
<div class="line"><span class="lineno"> 47</span> <span class="keywordtype">int</span> count =</div>
|
||||
<div class="line"><span class="lineno"> 48</span> 0; <span class="comment">// "count" variable is used to count number of bits flip of the</span></div>
|
||||
<div class="line"><span class="lineno"> 49</span> <span class="comment">// number A to form B in binary representation of number 'n'</span></div>
|
||||
<div class="line"><span class="lineno"> 50</span> A = A ^ B;</div>
|
||||
<div class="line"><span class="lineno"> 51</span> <span class="keywordflow">while</span> (A) {</div>
|
||||
<div class="line"><span class="lineno"> 52</span> A = A & (A - 1);</div>
|
||||
<div class="line"><span class="lineno"> 53</span> count++;</div>
|
||||
<div class="line"><span class="lineno"> 54</span> }</div>
|
||||
<div class="line"><span class="lineno"> 55</span> <span class="keywordflow">return</span> count;</div>
|
||||
<div class="line"><span class="lineno"> 56</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 45</span> { <span class="comment">// int64_t is preferred over int so that</span></div>
|
||||
<div class="line"><span class="lineno"> 46</span> <span class="comment">// no Overflow can be there.</span></div>
|
||||
<div class="line"><span class="lineno"> 47</span> </div>
|
||||
<div class="line"><span class="lineno"> 48</span> <span class="keywordtype">int</span> count =</div>
|
||||
<div class="line"><span class="lineno"> 49</span> 0; <span class="comment">// "count" variable is used to count number of bits flip of the</span></div>
|
||||
<div class="line"><span class="lineno"> 50</span> <span class="comment">// number A to form B in binary representation of number 'n'</span></div>
|
||||
<div class="line"><span class="lineno"> 51</span> A = A ^ B;</div>
|
||||
<div class="line"><span class="lineno"> 52</span> <span class="keywordflow">while</span> (A) {</div>
|
||||
<div class="line"><span class="lineno"> 53</span> A = A & (A - 1);</div>
|
||||
<div class="line"><span class="lineno"> 54</span> count++;</div>
|
||||
<div class="line"><span class="lineno"> 55</span> }</div>
|
||||
<div class="line"><span class="lineno"> 56</span> <span class="keywordflow">return</span> count;</div>
|
||||
<div class="line"><span class="lineno"> 57</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -215,11 +216,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"> 85</span> {</div>
|
||||
<div class="line"><span class="lineno"> 86</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"> 87</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 88</span>}</div>
|
||||
<div class="ttc" id="acount__bits__flip_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> count_bits_flip.cpp:64</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 86</span> {</div>
|
||||
<div class="line"><span class="lineno"> 87</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"> 88</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 89</span>}</div>
|
||||
<div class="ttc" id="acount__bits__flip_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> count_bits_flip.cpp:65</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -253,23 +254,23 @@ 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"> 64</span> {</div>
|
||||
<div class="line"><span class="lineno"> 65</span> <span class="comment">// A = 10, B = 20 return 4</span></div>
|
||||
<div class="line"><span class="lineno"> 66</span> assert(bit_manipulation::count_bits_flip::countBitsFlip(10, 20) == 4);</div>
|
||||
<div class="line"><span class="lineno"> 67</span> <span class="comment">// A = 20, B = 25 return 3</span></div>
|
||||
<div class="line"><span class="lineno"> 68</span> assert(bit_manipulation::count_bits_flip::countBitsFlip(20, 25) == 3);</div>
|
||||
<div class="line"><span class="lineno"> 69</span> <span class="comment">// A = 7, B = 10 return 3</span></div>
|
||||
<div class="line"><span class="lineno"> 70</span> assert(bit_manipulation::count_bits_flip::countBitsFlip(7, 10) == 3);</div>
|
||||
<div class="line"><span class="lineno"> 71</span> <span class="comment">// A = 17, B = 25 return 1</span></div>
|
||||
<div class="line"><span class="lineno"> 72</span> assert(bit_manipulation::count_bits_flip::countBitsFlip(17, 25) == 1);</div>
|
||||
<div class="line"><span class="lineno"> 73</span> <span class="comment">// A = 11, B = 8 return 2</span></div>
|
||||
<div class="line"><span class="lineno"> 74</span> assert(bit_manipulation::count_bits_flip::countBitsFlip(11, 8) == 2);</div>
|
||||
<div class="line"><span class="lineno"> 75</span> <span class="comment">// A = 21, B = 22 return 2</span></div>
|
||||
<div class="line"><span class="lineno"> 76</span> assert(bit_manipulation::count_bits_flip::countBitsFlip(21, 22) == 2);</div>
|
||||
<div class="line"><span class="lineno"> 77</span> <span class="comment">// A = 7, B = 786 return 5</span></div>
|
||||
<div class="line"><span class="lineno"> 78</span> assert(bit_manipulation::count_bits_flip::countBitsFlip(7, 786) == 5);</div>
|
||||
<div class="line"><span class="lineno"> 79</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"All test cases successfully 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"> 80</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 65</span> {</div>
|
||||
<div class="line"><span class="lineno"> 66</span> <span class="comment">// A = 10, B = 20 return 4</span></div>
|
||||
<div class="line"><span class="lineno"> 67</span> assert(bit_manipulation::count_bits_flip::countBitsFlip(10, 20) == 4);</div>
|
||||
<div class="line"><span class="lineno"> 68</span> <span class="comment">// A = 20, B = 25 return 3</span></div>
|
||||
<div class="line"><span class="lineno"> 69</span> assert(bit_manipulation::count_bits_flip::countBitsFlip(20, 25) == 3);</div>
|
||||
<div class="line"><span class="lineno"> 70</span> <span class="comment">// A = 7, B = 10 return 3</span></div>
|
||||
<div class="line"><span class="lineno"> 71</span> assert(bit_manipulation::count_bits_flip::countBitsFlip(7, 10) == 3);</div>
|
||||
<div class="line"><span class="lineno"> 72</span> <span class="comment">// A = 17, B = 25 return 1</span></div>
|
||||
<div class="line"><span class="lineno"> 73</span> assert(bit_manipulation::count_bits_flip::countBitsFlip(17, 25) == 1);</div>
|
||||
<div class="line"><span class="lineno"> 74</span> <span class="comment">// A = 11, B = 8 return 2</span></div>
|
||||
<div class="line"><span class="lineno"> 75</span> assert(bit_manipulation::count_bits_flip::countBitsFlip(11, 8) == 2);</div>
|
||||
<div class="line"><span class="lineno"> 76</span> <span class="comment">// A = 21, B = 22 return 2</span></div>
|
||||
<div class="line"><span class="lineno"> 77</span> assert(bit_manipulation::count_bits_flip::countBitsFlip(21, 22) == 2);</div>
|
||||
<div class="line"><span class="lineno"> 78</span> <span class="comment">// A = 7, B = 786 return 5</span></div>
|
||||
<div class="line"><span class="lineno"> 79</span> assert(bit_manipulation::count_bits_flip::countBitsFlip(7, 786) == 5);</div>
|
||||
<div class="line"><span class="lineno"> 80</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 test cases successfully 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"> 81</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">
|
||||
|
||||
@@ -245,7 +245,7 @@ Here is the call graph for this function:</div>
|
||||
<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/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Self-test implementations 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"> 72</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><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
|
||||
@@ -219,7 +219,7 @@ Algorithm</h3>
|
||||
<div class="line"><span class="lineno"> 142</span> }</div>
|
||||
<div class="line"><span class="lineno"> 143</span> <span class="keywordflow">return</span> memo.back().back();</div>
|
||||
<div class="line"><span class="lineno"> 144</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="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><!-- fragment --><div class="dynheader">
|
||||
|
||||
@@ -185,7 +185,7 @@ unsigned int </td><td class="memItemRight" valign="bottom"><b>dest</b></td>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 41</span> : src(source), dest(destination) {}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 42</span> : src(source), dest(destination) {}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -110,7 +110,7 @@ $(function(){initNavTree('d7/d81/namespacebit__manipulation.html','../../'); ini
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p>for IO operations
|
||||
<p>for assert
|
||||
<a href="#details">More...</a></p>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
@@ -123,20 +123,19 @@ Functions</h2></td></tr>
|
||||
<tr class="separator:a5032470c9974bbd6ec254bf296530a5f"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p>for IO operations </p>
|
||||
<p>Bit manipulation algorithms.</p>
|
||||
<p>for io operations</p>
|
||||
<div class="textblock"><p>for assert </p>
|
||||
<p>Program to generate n-bit <a href="https://en.wikipedia.org/wiki/Gray_code" target="_blank">Gray code</a></p>
|
||||
<p>storing the numbers</p>
|
||||
<p>for assert</p>
|
||||
<p>for IO operations</p>
|
||||
<p>Bit manipulation algorithms</p>
|
||||
<p>for assert for IO operations</p>
|
||||
<p>Bit manipulation algorithms</p>
|
||||
<p>Gray code is a binary numeral system where consecutive values differ in exactly 1 bit. The following code offers one of many possible Gray codes given some pre-determined number of bits. for gray code representation for assert for IO operations for vector data structure</p>
|
||||
<p>Bit manipulation algorithms</p>
|
||||
<p>for assert</p>
|
||||
<p>for io operations</p>
|
||||
<p>Bit Manipulation algorithms</p>
|
||||
<p>for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a> for assert for IO operations for limits of integral types for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a> </p>
|
||||
<p>for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a> for IO operations for limits of integral types for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></p>
|
||||
<p>Bit manipulation algorithms </p>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="a5032470c9974bbd6ec254bf296530a5f" name="a5032470c9974bbd6ec254bf296530a5f"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a5032470c9974bbd6ec254bf296530a5f">◆ </a></span>isPowerOfTwo()</h2>
|
||||
@@ -161,17 +160,17 @@ Functions</h2></td></tr>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>either true or false </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 31</span> { <span class="comment">// int64_t is preferred over int so that</span></div>
|
||||
<div class="line"><span class="lineno"> 32</span> <span class="comment">// no Overflow can be there.</span></div>
|
||||
<div class="line"><span class="lineno"> 33</span> </div>
|
||||
<div class="line"><span class="lineno"> 34</span> <span class="keywordflow">return</span> n > 0 && !(n & n - 1); <span class="comment">// If we subtract a power of 2 numbers by 1</span></div>
|
||||
<div class="line"><span class="lineno"> 35</span> <span class="comment">// then all unset bits after the only set bit become set; and the set bit</span></div>
|
||||
<div class="line"><span class="lineno"> 36</span> <span class="comment">// becomes unset.</span></div>
|
||||
<div class="line"><span class="lineno"> 37</span> </div>
|
||||
<div class="line"><span class="lineno"> 38</span> <span class="comment">// If a number n is a power of 2 then bitwise and of n-1 and n will be zero.</span></div>
|
||||
<div class="line"><span class="lineno"> 39</span> <span class="comment">// The expression n&(n-1) will not work when n is 0.</span></div>
|
||||
<div class="line"><span class="lineno"> 40</span> <span class="comment">// To handle this case also, our expression will become n& (!n&(n-1))</span></div>
|
||||
<div class="line"><span class="lineno"> 41</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 32</span> { <span class="comment">// int64_t is preferred over int so that</span></div>
|
||||
<div class="line"><span class="lineno"> 33</span> <span class="comment">// no Overflow can be there.</span></div>
|
||||
<div class="line"><span class="lineno"> 34</span> </div>
|
||||
<div class="line"><span class="lineno"> 35</span> <span class="keywordflow">return</span> n > 0 && !(n & n - 1); <span class="comment">// If we subtract a power of 2 numbers by 1</span></div>
|
||||
<div class="line"><span class="lineno"> 36</span> <span class="comment">// then all unset bits after the only set bit become set; and the set bit</span></div>
|
||||
<div class="line"><span class="lineno"> 37</span> <span class="comment">// becomes unset.</span></div>
|
||||
<div class="line"><span class="lineno"> 38</span> </div>
|
||||
<div class="line"><span class="lineno"> 39</span> <span class="comment">// If a number n is a power of 2 then bitwise and of n-1 and n will be zero.</span></div>
|
||||
<div class="line"><span class="lineno"> 40</span> <span class="comment">// The expression n&(n-1) will not work when n is 0.</span></div>
|
||||
<div class="line"><span class="lineno"> 41</span> <span class="comment">// To handle this case also, our expression will become n& (!n&(n-1))</span></div>
|
||||
<div class="line"><span class="lineno"> 42</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -198,40 +197,40 @@ Functions</h2></td></tr>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a number </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 32</span> {</div>
|
||||
<div class="line"><span class="lineno"> 33</span> uint64_t rightOne = 0;</div>
|
||||
<div class="line"><span class="lineno"> 34</span> uint64_t nextHigherOneBit = 0;</div>
|
||||
<div class="line"><span class="lineno"> 35</span> uint64_t rightOnesPattern = 0;</div>
|
||||
<div class="line"><span class="lineno"> 36</span> </div>
|
||||
<div class="line"><span class="lineno"> 37</span> uint64_t next = 0;</div>
|
||||
<div class="line"><span class="lineno"> 38</span> </div>
|
||||
<div class="line"><span class="lineno"> 39</span> <span class="keywordflow">if</span> (x) {</div>
|
||||
<div class="line"><span class="lineno"> 40</span> <span class="comment">// right most set bit</span></div>
|
||||
<div class="line"><span class="lineno"> 41</span> rightOne = x & -<span class="keyword">static_cast<</span><span class="keywordtype">signed</span><span class="keyword">></span>(x);</div>
|
||||
<div class="line"><span class="lineno"> 42</span> </div>
|
||||
<div class="line"><span class="lineno"> 43</span> <span class="comment">// reset the pattern and set next higher bit</span></div>
|
||||
<div class="line"><span class="lineno"> 44</span> <span class="comment">// left part of x will be here</span></div>
|
||||
<div class="line"><span class="lineno"> 45</span> nextHigherOneBit = x + rightOne;</div>
|
||||
<div class="line"><span class="lineno"> 46</span> </div>
|
||||
<div class="line"><span class="lineno"> 47</span> <span class="comment">// nextHigherOneBit is now part [D] of the above explanation.</span></div>
|
||||
<div class="line"><span class="lineno"> 48</span> </div>
|
||||
<div class="line"><span class="lineno"> 49</span> <span class="comment">// isolate the pattern</span></div>
|
||||
<div class="line"><span class="lineno"> 50</span> rightOnesPattern = x ^ nextHigherOneBit;</div>
|
||||
<div class="line"><span class="lineno"> 51</span> </div>
|
||||
<div class="line"><span class="lineno"> 52</span> <span class="comment">// right adjust pattern</span></div>
|
||||
<div class="line"><span class="lineno"> 53</span> rightOnesPattern = (rightOnesPattern) / rightOne;</div>
|
||||
<div class="line"><span class="lineno"> 54</span> </div>
|
||||
<div class="line"><span class="lineno"> 55</span> <span class="comment">// correction factor</span></div>
|
||||
<div class="line"><span class="lineno"> 56</span> rightOnesPattern >>= 2;</div>
|
||||
<div class="line"><span class="lineno"> 57</span> </div>
|
||||
<div class="line"><span class="lineno"> 58</span> <span class="comment">// rightOnesPattern is now part [A] of the above explanation.</span></div>
|
||||
<div class="line"><span class="lineno"> 59</span> </div>
|
||||
<div class="line"><span class="lineno"> 60</span> <span class="comment">// integrate new pattern (Add [D] and [A])</span></div>
|
||||
<div class="line"><span class="lineno"> 61</span> next = nextHigherOneBit | rightOnesPattern;</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> next;</div>
|
||||
<div class="line"><span class="lineno"> 65</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 33</span> {</div>
|
||||
<div class="line"><span class="lineno"> 34</span> uint64_t rightOne = 0;</div>
|
||||
<div class="line"><span class="lineno"> 35</span> uint64_t nextHigherOneBit = 0;</div>
|
||||
<div class="line"><span class="lineno"> 36</span> uint64_t rightOnesPattern = 0;</div>
|
||||
<div class="line"><span class="lineno"> 37</span> </div>
|
||||
<div class="line"><span class="lineno"> 38</span> uint64_t next = 0;</div>
|
||||
<div class="line"><span class="lineno"> 39</span> </div>
|
||||
<div class="line"><span class="lineno"> 40</span> <span class="keywordflow">if</span> (x) {</div>
|
||||
<div class="line"><span class="lineno"> 41</span> <span class="comment">// right most set bit</span></div>
|
||||
<div class="line"><span class="lineno"> 42</span> rightOne = x & -<span class="keyword">static_cast<</span><span class="keywordtype">signed</span><span class="keyword">></span>(x);</div>
|
||||
<div class="line"><span class="lineno"> 43</span> </div>
|
||||
<div class="line"><span class="lineno"> 44</span> <span class="comment">// reset the pattern and set next higher bit</span></div>
|
||||
<div class="line"><span class="lineno"> 45</span> <span class="comment">// left part of x will be here</span></div>
|
||||
<div class="line"><span class="lineno"> 46</span> nextHigherOneBit = x + rightOne;</div>
|
||||
<div class="line"><span class="lineno"> 47</span> </div>
|
||||
<div class="line"><span class="lineno"> 48</span> <span class="comment">// nextHigherOneBit is now part [D] of the above explanation.</span></div>
|
||||
<div class="line"><span class="lineno"> 49</span> </div>
|
||||
<div class="line"><span class="lineno"> 50</span> <span class="comment">// isolate the pattern</span></div>
|
||||
<div class="line"><span class="lineno"> 51</span> rightOnesPattern = x ^ nextHigherOneBit;</div>
|
||||
<div class="line"><span class="lineno"> 52</span> </div>
|
||||
<div class="line"><span class="lineno"> 53</span> <span class="comment">// right adjust pattern</span></div>
|
||||
<div class="line"><span class="lineno"> 54</span> rightOnesPattern = (rightOnesPattern) / rightOne;</div>
|
||||
<div class="line"><span class="lineno"> 55</span> </div>
|
||||
<div class="line"><span class="lineno"> 56</span> <span class="comment">// correction factor</span></div>
|
||||
<div class="line"><span class="lineno"> 57</span> rightOnesPattern >>= 2;</div>
|
||||
<div class="line"><span class="lineno"> 58</span> </div>
|
||||
<div class="line"><span class="lineno"> 59</span> <span class="comment">// rightOnesPattern is now part [A] of the above explanation.</span></div>
|
||||
<div class="line"><span class="lineno"> 60</span> </div>
|
||||
<div class="line"><span class="lineno"> 61</span> <span class="comment">// integrate new pattern (Add [D] and [A])</span></div>
|
||||
<div class="line"><span class="lineno"> 62</span> next = nextHigherOneBit | rightOnesPattern;</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> next;</div>
|
||||
<div class="line"><span class="lineno"> 66</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -113,11 +113,12 @@ $(function(){initNavTree('d7/d89/double__factorial_8cpp.html','../../'); initRes
|
||||
<p>Compute <a href="https://en.wikipedia.org/wiki/Double_factorial" target="_blank">double factorial</a>: \(n!!\).
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <cassert></code><br />
|
||||
<code>#include <cstdint></code><br />
|
||||
<code>#include <iostream></code><br />
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for double_factorial.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dd/d0e/double__factorial_8cpp__incl.svg" width="182" 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/d0e/double__factorial_8cpp__incl.svg" width="255" height="111"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
</div><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
@@ -153,15 +154,15 @@ It is also called as semifactorial of a number and is denoted by \(n!!\) </p>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Compute double factorial using iterative method </p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 17</span> {</div>
|
||||
<div class="line"><span class="lineno"> 18</span> uint64_t res = 1;</div>
|
||||
<div class="line"><span class="lineno"> 19</span> <span class="keywordflow">for</span> (uint64_t i = n;; i -= 2) {</div>
|
||||
<div class="line"><span class="lineno"> 20</span> <span class="keywordflow">if</span> (i == 0 || i == 1)</div>
|
||||
<div class="line"><span class="lineno"> 21</span> <span class="keywordflow">return</span> res;</div>
|
||||
<div class="line"><span class="lineno"> 22</span> res *= i;</div>
|
||||
<div class="line"><span class="lineno"> 23</span> }</div>
|
||||
<div class="line"><span class="lineno"> 24</span> <span class="keywordflow">return</span> res;</div>
|
||||
<div class="line"><span class="lineno"> 25</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 18</span> {</div>
|
||||
<div class="line"><span class="lineno"> 19</span> uint64_t res = 1;</div>
|
||||
<div class="line"><span class="lineno"> 20</span> <span class="keywordflow">for</span> (uint64_t i = n;; i -= 2) {</div>
|
||||
<div class="line"><span class="lineno"> 21</span> <span class="keywordflow">if</span> (i == 0 || i == 1)</div>
|
||||
<div class="line"><span class="lineno"> 22</span> <span class="keywordflow">return</span> res;</div>
|
||||
<div class="line"><span class="lineno"> 23</span> res *= i;</div>
|
||||
<div class="line"><span class="lineno"> 24</span> }</div>
|
||||
<div class="line"><span class="lineno"> 25</span> <span class="keywordflow">return</span> res;</div>
|
||||
<div class="line"><span class="lineno"> 26</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -181,12 +182,12 @@ It is also called as semifactorial of a number and is denoted by \(n!!\) </p>
|
||||
</div><div class="memdoc">
|
||||
<p>Compute double factorial using resursive method. <br />
|
||||
Recursion can be costly for large numbers. </p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 30</span> {</div>
|
||||
<div class="line"><span class="lineno"> 31</span> <span class="keywordflow">if</span> (n <= 1)</div>
|
||||
<div class="line"><span class="lineno"> 32</span> <span class="keywordflow">return</span> 1;</div>
|
||||
<div class="line"><span class="lineno"> 33</span> <span class="keywordflow">return</span> n * <a class="code hl_function" href="#a68ba20fed2ce427f6469c7689437829d">double_factorial_recursive</a>(n - 2);</div>
|
||||
<div class="line"><span class="lineno"> 34</span>}</div>
|
||||
<div class="ttc" id="adouble__factorial_8cpp_html_a68ba20fed2ce427f6469c7689437829d"><div class="ttname"><a href="#a68ba20fed2ce427f6469c7689437829d">double_factorial_recursive</a></div><div class="ttdeci">uint64_t double_factorial_recursive(uint64_t n)</div><div class="ttdef"><b>Definition</b> double_factorial.cpp:30</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 31</span> {</div>
|
||||
<div class="line"><span class="lineno"> 32</span> <span class="keywordflow">if</span> (n <= 1)</div>
|
||||
<div class="line"><span class="lineno"> 33</span> <span class="keywordflow">return</span> 1;</div>
|
||||
<div class="line"><span class="lineno"> 34</span> <span class="keywordflow">return</span> n * <a class="code hl_function" href="#a68ba20fed2ce427f6469c7689437829d">double_factorial_recursive</a>(n - 2);</div>
|
||||
<div class="line"><span class="lineno"> 35</span>}</div>
|
||||
<div class="ttc" id="adouble__factorial_8cpp_html_a68ba20fed2ce427f6469c7689437829d"><div class="ttname"><a href="#a68ba20fed2ce427f6469c7689437829d">double_factorial_recursive</a></div><div class="ttdeci">uint64_t double_factorial_recursive(uint64_t n)</div><div class="ttdef"><b>Definition</b> double_factorial.cpp:31</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -210,11 +211,11 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Main function </p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 67</span> {</div>
|
||||
<div class="line"><span class="lineno"> 68</span> <a class="code hl_function" href="#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>();</div>
|
||||
<div class="line"><span class="lineno"> 69</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 70</span>}</div>
|
||||
<div class="ttc" id="adouble__factorial_8cpp_html_a88ec9ad42717780d6caaff9d3d6977f9"><div class="ttname"><a href="#a88ec9ad42717780d6caaff9d3d6977f9">tests</a></div><div class="ttdeci">void tests()</div><div class="ttdef"><b>Definition</b> double_factorial.cpp:50</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 68</span> {</div>
|
||||
<div class="line"><span class="lineno"> 69</span> <a class="code hl_function" href="#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>();</div>
|
||||
<div class="line"><span class="lineno"> 70</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 71</span>}</div>
|
||||
<div class="ttc" id="adouble__factorial_8cpp_html_a88ec9ad42717780d6caaff9d3d6977f9"><div class="ttname"><a href="#a88ec9ad42717780d6caaff9d3d6977f9">tests</a></div><div class="ttdeci">void tests()</div><div class="ttdef"><b>Definition</b> double_factorial.cpp:51</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -248,11 +249,11 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 42</span> {</div>
|
||||
<div class="line"><span class="lineno"> 43</span> assert(<a class="code hl_function" href="#a0a3c417360400093891a9ccddaa4be26">double_factorial_iterative</a>(n) == expected);</div>
|
||||
<div class="line"><span class="lineno"> 44</span> assert(<a class="code hl_function" href="#a68ba20fed2ce427f6469c7689437829d">double_factorial_recursive</a>(n) == expected);</div>
|
||||
<div class="line"><span class="lineno"> 45</span>}</div>
|
||||
<div class="ttc" id="adouble__factorial_8cpp_html_a0a3c417360400093891a9ccddaa4be26"><div class="ttname"><a href="#a0a3c417360400093891a9ccddaa4be26">double_factorial_iterative</a></div><div class="ttdeci">uint64_t double_factorial_iterative(uint64_t n)</div><div class="ttdef"><b>Definition</b> double_factorial.cpp:17</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 43</span> {</div>
|
||||
<div class="line"><span class="lineno"> 44</span> assert(<a class="code hl_function" href="#a0a3c417360400093891a9ccddaa4be26">double_factorial_iterative</a>(n) == expected);</div>
|
||||
<div class="line"><span class="lineno"> 45</span> assert(<a class="code hl_function" href="#a68ba20fed2ce427f6469c7689437829d">double_factorial_recursive</a>(n) == expected);</div>
|
||||
<div class="line"><span class="lineno"> 46</span>}</div>
|
||||
<div class="ttc" id="adouble__factorial_8cpp_html_a0a3c417360400093891a9ccddaa4be26"><div class="ttname"><a href="#a0a3c417360400093891a9ccddaa4be26">double_factorial_iterative</a></div><div class="ttdeci">uint64_t double_factorial_iterative(uint64_t n)</div><div class="ttdef"><b>Definition</b> double_factorial.cpp:18</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -276,19 +277,19 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Test implementations </p>
|
||||
<div class="fragment"><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/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 1:\t n=5\t..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 52</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(5, 15);</div>
|
||||
<div class="line"><span class="lineno"> 53</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 54</span> </div>
|
||||
<div class="line"><span class="lineno"> 55</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 2:\t n=15\t..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 56</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(15, 2027025);</div>
|
||||
<div class="line"><span class="lineno"> 57</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 58</span> </div>
|
||||
<div class="line"><span class="lineno"> 59</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 3:\t n=0\t..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 60</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(0, 1);</div>
|
||||
<div class="line"><span class="lineno"> 61</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 62</span>}</div>
|
||||
<div class="fragment"><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/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 1:\t n=5\t..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 53</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(5, 15);</div>
|
||||
<div class="line"><span class="lineno"> 54</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 55</span> </div>
|
||||
<div class="line"><span class="lineno"> 56</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 2:\t n=15\t..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 57</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(15, 2027025);</div>
|
||||
<div class="line"><span class="lineno"> 58</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 59</span> </div>
|
||||
<div class="line"><span class="lineno"> 60</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 3:\t n=0\t..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 61</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(0, 1);</div>
|
||||
<div class="line"><span class="lineno"> 62</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 63</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="agenerate__parentheses_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> generate_parentheses.cpp:82</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
<map id="search/sublist_search.cpp" name="search/sublist_search.cpp">
|
||||
<area shape="rect" id="Node000001" title="Implementation of the Sublist Search Algorithm" alt="" coords="43,5,216,31"/>
|
||||
<area shape="rect" id="Node000001" title="Implementation of the Sublist Search Algorithm" alt="" coords="82,5,255,31"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="5,79,70,105"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="116,34,66,72,63,67,112,29"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="94,79,165,105"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="132,31,132,63,127,63,127,31"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="189,79,246,105"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="146,29,193,67,189,71,143,34"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="147,34,74,74,71,69,145,29"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="94,79,154,105"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="163,33,142,67,137,64,159,30"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="178,79,249,105"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="178,30,200,64,196,67,173,33"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="273,79,330,105"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="192,29,267,69,264,74,190,34"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
a0ff07d62ef782f958ca6e5943637ef6
|
||||
4470452431be0d661e991d966c4e1f43
|
||||
@@ -4,8 +4,8 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: search/sublist_search.cpp Pages: 1 -->
|
||||
<svg width="189pt" height="83pt"
|
||||
viewBox="0.00 0.00 188.62 82.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="252pt" height="83pt"
|
||||
viewBox="0.00 0.00 251.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="Implementation of the Sublist Search Algorithm">
|
||||
<polygon fill="#999999" stroke="#666666" points="158.12,-74.5 28.12,-74.5 28.12,-55.25 158.12,-55.25 158.12,-74.5"/>
|
||||
<text text-anchor="middle" x="93.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">search/sublist_search.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="187.12,-74.5 57.12,-74.5 57.12,-55.25 187.12,-55.25 187.12,-74.5"/>
|
||||
<text text-anchor="middle" x="122.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">search/sublist_search.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="M81.42,-54.84C71.35,-47.07 56.58,-35.67 44.56,-26.4"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="46.91,-23.79 36.86,-20.45 42.63,-29.33 46.91,-23.79"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M105.5,-54.84C90.44,-46.66 67.98,-34.46 50.47,-24.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="52.62,-22.12 42.16,-20.43 49.28,-28.27 52.62,-22.12"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -50,8 +50,8 @@
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="119.88,-19.25 66.38,-19.25 66.38,0 119.88,0 119.88,-19.25"/>
|
||||
<text text-anchor="middle" x="93.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="111.75,-19.25 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>
|
||||
@@ -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="M93.12,-55.08C93.12,-48.57 93.12,-39.42 93.12,-31.12"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="96.63,-31.12 93.13,-21.12 89.63,-31.12 96.63,-31.12"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M116.68,-55.08C112.35,-48.11 106.16,-38.12 100.74,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="103.73,-27.55 95.49,-20.9 97.78,-31.24 103.73,-27.55"/>
|
||||
</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="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>
|
||||
@@ -77,8 +77,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="M104.32,-54.84C113.86,-47.15 127.8,-35.9 139.23,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="141.33,-29.48 146.92,-20.48 136.94,-24.03 141.33,-29.48"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M127.74,-55.08C132.24,-48.03 138.71,-37.9 144.34,-29.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="147.14,-31.2 149.57,-20.88 141.24,-27.43 147.14,-31.2"/>
|
||||
</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="M139.09,-54.84C154.39,-46.69 177.16,-34.57 194.99,-25.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="196.56,-28.2 203.74,-20.41 193.27,-22.02 196.56,-28.2"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 4.6 KiB |
@@ -4,16 +4,16 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: search/sublist_search.cpp Pages: 1 -->
|
||||
<svg width="189pt" height="83pt"
|
||||
viewBox="0.00 0.00 188.62 82.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="252pt" height="83pt"
|
||||
viewBox="0.00 0.00 251.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>search/sublist_search.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Implementation of the Sublist Search Algorithm">
|
||||
<polygon fill="#999999" stroke="#666666" points="158.12,-74.5 28.12,-74.5 28.12,-55.25 158.12,-55.25 158.12,-74.5"/>
|
||||
<text text-anchor="middle" x="93.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">search/sublist_search.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="187.12,-74.5 57.12,-74.5 57.12,-55.25 187.12,-55.25 187.12,-74.5"/>
|
||||
<text text-anchor="middle" x="122.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">search/sublist_search.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="M81.42,-54.84C71.35,-47.07 56.58,-35.67 44.56,-26.4"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="46.91,-23.79 36.86,-20.45 42.63,-29.33 46.91,-23.79"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M105.5,-54.84C90.44,-46.66 67.98,-34.46 50.47,-24.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="52.62,-22.12 42.16,-20.43 49.28,-28.27 52.62,-22.12"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -39,8 +39,8 @@
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="119.88,-19.25 66.38,-19.25 66.38,0 119.88,0 119.88,-19.25"/>
|
||||
<text text-anchor="middle" x="93.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="111.75,-19.25 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>
|
||||
@@ -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="M93.12,-55.08C93.12,-48.57 93.12,-39.42 93.12,-31.12"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="96.63,-31.12 93.13,-21.12 89.63,-31.12 96.63,-31.12"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M116.68,-55.08C112.35,-48.11 106.16,-38.12 100.74,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="103.73,-27.55 95.49,-20.9 97.78,-31.24 103.73,-27.55"/>
|
||||
</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="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>
|
||||
@@ -66,8 +66,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="M104.32,-54.84C113.86,-47.15 127.8,-35.9 139.23,-26.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="141.33,-29.48 146.92,-20.48 136.94,-24.03 141.33,-29.48"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M127.74,-55.08C132.24,-48.03 138.71,-37.9 144.34,-29.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="147.14,-31.2 149.57,-20.88 141.24,-27.43 147.14,-31.2"/>
|
||||
</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="M139.09,-54.84C154.39,-46.69 177.16,-34.57 194.99,-25.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="196.56,-28.2 203.74,-20.41 193.27,-22.02 196.56,-28.2"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.8 KiB |
@@ -127,7 +127,7 @@ Include dependency graph for eratosthenes.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>
|
||||
|
||||
@@ -117,6 +117,7 @@ $(function(){initNavTree('d7/db9/hill__cipher_8cpp.html','../../'); initResizabl
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <cassert></code><br />
|
||||
<code>#include <cmath></code><br />
|
||||
<code>#include <cstdint></code><br />
|
||||
<code>#include <cstring></code><br />
|
||||
<code>#include <ctime></code><br />
|
||||
<code>#include <fstream></code><br />
|
||||
@@ -189,23 +190,23 @@ The matrix generation algorithm is very rudimentary and does not guarantee an in
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Main function </p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 532</span> {</div>
|
||||
<div class="line"><span class="lineno"> 533</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/srand.html">std::srand</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">std::time</a>(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><span class="lineno"> 534</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">"Key dictionary: ("</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/strlen.html">std::strlen</a>(<a class="code hl_variable" href="../../d6/d4e/namespaceciphers.html#ab9aec0ccf4b6809f652bb540be87c216">ciphers::STRKEY</a>) << <span class="stringliteral">")\n\t"</span></div>
|
||||
<div class="line"><span class="lineno"> 535</span> << <a class="code hl_variable" href="../../d6/d4e/namespaceciphers.html#ab9aec0ccf4b6809f652bb540be87c216">ciphers::STRKEY</a> << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 536</span> </div>
|
||||
<div class="line"><span class="lineno"> 537</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> text = <span class="stringliteral">"This is a simple text with numb3r5 and exclamat!0n."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 538</span> </div>
|
||||
<div class="line"><span class="lineno"> 539</span> <a class="code hl_function" href="../../d3/dae/dsu__path__compression_8cpp.html#ae7880ce913f3058a35ff106d5be9e243">test1</a>(text);</div>
|
||||
<div class="line"><span class="lineno"> 540</span> <a class="code hl_function" href="../../d3/dae/dsu__path__compression_8cpp.html#a45d94ead4cf4e1ff9f87c38bc99f59ae">test2</a>(text);</div>
|
||||
<div class="line"><span class="lineno"> 541</span> </div>
|
||||
<div class="line"><span class="lineno"> 542</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 543</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 533</span> {</div>
|
||||
<div class="line"><span class="lineno"> 534</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/srand.html">std::srand</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">std::time</a>(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><span class="lineno"> 535</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">"Key dictionary: ("</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/strlen.html">std::strlen</a>(<a class="code hl_variable" href="../../d6/d4e/namespaceciphers.html#ab9aec0ccf4b6809f652bb540be87c216">ciphers::STRKEY</a>) << <span class="stringliteral">")\n\t"</span></div>
|
||||
<div class="line"><span class="lineno"> 536</span> << <a class="code hl_variable" href="../../d6/d4e/namespaceciphers.html#ab9aec0ccf4b6809f652bb540be87c216">ciphers::STRKEY</a> << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 537</span> </div>
|
||||
<div class="line"><span class="lineno"> 538</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> text = <span class="stringliteral">"This is a simple text with numb3r5 and exclamat!0n."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 539</span> </div>
|
||||
<div class="line"><span class="lineno"> 540</span> <a class="code hl_function" href="../../d3/dae/dsu__path__compression_8cpp.html#ae7880ce913f3058a35ff106d5be9e243">test1</a>(text);</div>
|
||||
<div class="line"><span class="lineno"> 541</span> <a class="code hl_function" href="../../d3/dae/dsu__path__compression_8cpp.html#a45d94ead4cf4e1ff9f87c38bc99f59ae">test2</a>(text);</div>
|
||||
<div class="line"><span class="lineno"> 542</span> </div>
|
||||
<div class="line"><span class="lineno"> 543</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 544</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="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="adsu__path__compression_8cpp_html_a45d94ead4cf4e1ff9f87c38bc99f59ae"><div class="ttname"><a href="../../d3/dae/dsu__path__compression_8cpp.html#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="../../d3/dae/dsu__path__compression_8cpp.html#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="ttc" id="anamespaceciphers_html_ab9aec0ccf4b6809f652bb540be87c216"><div class="ttname"><a href="../../d6/d4e/namespaceciphers.html#ab9aec0ccf4b6809f652bb540be87c216">ciphers::STRKEY</a></div><div class="ttdeci">static const char * STRKEY</div><div class="ttdef"><b>Definition</b> hill_cipher.cpp:73</div></div>
|
||||
<div class="ttc" id="adsu__path__compression_8cpp_html_a45d94ead4cf4e1ff9f87c38bc99f59ae"><div class="ttname"><a href="../../d3/dae/dsu__path__compression_8cpp.html#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="../../d3/dae/dsu__path__compression_8cpp.html#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 class="ttc" id="anamespaceciphers_html_ab9aec0ccf4b6809f652bb540be87c216"><div class="ttname"><a href="../../d6/d4e/namespaceciphers.html#ab9aec0ccf4b6809f652bb540be87c216">ciphers::STRKEY</a></div><div class="ttdeci">static const char * STRKEY</div><div class="ttdef"><b>Definition</b> hill_cipher.cpp:74</div></div>
|
||||
<div class="ttc" id="asrand_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/random/srand.html">std::srand</a></div><div class="ttdeci">T srand(T... args)</div></div>
|
||||
<div class="ttc" id="astrlen_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/byte/strlen.html">std::strlen</a></div><div class="ttdeci">T strlen(T... args)</div></div>
|
||||
<div class="ttc" id="atime_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/chrono/c/time.html">std::time</a></div><div class="ttdeci">T time(T... args)</div></div>
|
||||
@@ -246,19 +247,19 @@ template<typename T > </div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>operator to print a matrix </p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 54</span> {</div>
|
||||
<div class="line"><span class="lineno"> 55</span> <span class="keyword">const</span> <span class="keywordtype">int</span> width = 15;</div>
|
||||
<div class="line"><span class="lineno"> 56</span> <span class="keyword">const</span> <span class="keywordtype">char</span> separator = <span class="charliteral">' '</span>;</div>
|
||||
<div class="line"><span class="lineno"> 57</span> </div>
|
||||
<div class="line"><span class="lineno"> 58</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> row = 0; row < v.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); row++) {</div>
|
||||
<div class="line"><span class="lineno"> 59</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> col = 0; col < v[row].<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); col++)</div>
|
||||
<div class="line"><span class="lineno"> 60</span> out << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">std::left</a> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a>(width) << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setfill.html">std::setfill</a>(separator)</div>
|
||||
<div class="line"><span class="lineno"> 61</span> << v[row][col];</div>
|
||||
<div class="line"><span class="lineno"> 62</span> out << <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"> 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> out;</div>
|
||||
<div class="line"><span class="lineno"> 66</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 55</span> {</div>
|
||||
<div class="line"><span class="lineno"> 56</span> <span class="keyword">const</span> <span class="keywordtype">int</span> width = 15;</div>
|
||||
<div class="line"><span class="lineno"> 57</span> <span class="keyword">const</span> <span class="keywordtype">char</span> separator = <span class="charliteral">' '</span>;</div>
|
||||
<div class="line"><span class="lineno"> 58</span> </div>
|
||||
<div class="line"><span class="lineno"> 59</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> row = 0; row < v.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); row++) {</div>
|
||||
<div class="line"><span class="lineno"> 60</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> col = 0; col < v[row].<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); col++)</div>
|
||||
<div class="line"><span class="lineno"> 61</span> out << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">std::left</a> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a>(width) << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setfill.html">std::setfill</a>(separator)</div>
|
||||
<div class="line"><span class="lineno"> 62</span> << v[row][col];</div>
|
||||
<div class="line"><span class="lineno"> 63</span> out << <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"> 64</span> }</div>
|
||||
<div class="line"><span class="lineno"> 65</span> </div>
|
||||
<div class="line"><span class="lineno"> 66</span> <span class="keywordflow">return</span> out;</div>
|
||||
<div class="line"><span class="lineno"> 67</span>}</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="aleft_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/left.html">std::left</a></div><div class="ttdeci">T left(T... args)</div></div>
|
||||
<div class="ttc" id="asetfill_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/setfill.html">std::setfill</a></div><div class="ttdeci">T setfill(T... args)</div></div>
|
||||
@@ -294,39 +295,39 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 470</span> {</div>
|
||||
<div class="line"><span class="lineno"> 471</span> <span class="comment">// std::string text = "Hello world!";</span></div>
|
||||
<div class="line"><span class="lineno"> 472</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"======Test 1 (3x3 key) ======\nOriginal text:\n\t"</span> << text</div>
|
||||
<div class="line"><span class="lineno"> 473</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"> 474</span> </div>
|
||||
<div class="line"><span class="lineno"> 475</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<matrix<int></a>, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix<int></a>> p =</div>
|
||||
<div class="line"><span class="lineno"> 476</span> <a class="code hl_function" href="../../d6/d26/classciphers_1_1_hill_cipher.html#a405b0a28d66a61239d3565d5256f9cb5">ciphers::HillCipher::generate_keys</a>(3, 0, 100);</div>
|
||||
<div class="line"><span class="lineno"> 477</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix<int></a> ekey = p.first;</div>
|
||||
<div class="line"><span class="lineno"> 478</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix<int></a> dkey = p.second;</div>
|
||||
<div class="line"><span class="lineno"> 479</span> </div>
|
||||
<div class="line"><span class="lineno"> 480</span> <span class="comment">// matrix<int> ekey = {{22, 28, 25}, {5, 26, 15}, {14, 18, 9}};</span></div>
|
||||
<div class="line"><span class="lineno"> 481</span> <span class="comment">// std::cout << "Encryption key: \n" << ekey;</span></div>
|
||||
<div class="line"><span class="lineno"> 482</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> gibberish = <a class="code hl_function" href="../../d6/d26/classciphers_1_1_hill_cipher.html#aa8bbb6e4a5749f6008b06602d5103917">ciphers::HillCipher::encrypt_text</a>(text, ekey);</div>
|
||||
<div class="line"><span class="lineno"> 483</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">"Encrypted text:\n\t"</span> << gibberish << <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"> 484</span> </div>
|
||||
<div class="line"><span class="lineno"> 485</span> <span class="comment">// matrix<int> dkey = ciphers::HillCipher::generate_decryption_key(ekey);</span></div>
|
||||
<div class="line"><span class="lineno"> 486</span> <span class="comment">// std::cout << "Decryption key: \n" << dkey;</span></div>
|
||||
<div class="line"><span class="lineno"> 487</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> txt_back = <a class="code hl_function" href="../../d6/d26/classciphers_1_1_hill_cipher.html#a427acfac1dbff3f48a2b071d449d965b">ciphers::HillCipher::decrypt_text</a>(gibberish, dkey);</div>
|
||||
<div class="line"><span class="lineno"> 488</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">"Reconstruct text:\n\t"</span> << txt_back << <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"> 489</span> </div>
|
||||
<div class="line"><span class="lineno"> 490</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ofstream.html">std::ofstream</a> out_file(<span class="stringliteral">"hill_cipher_test1.txt"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 491</span> out_file << <span class="stringliteral">"Block size: "</span> << ekey.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 492</span> out_file << <span class="stringliteral">"Encryption Key:\n"</span> << ekey;</div>
|
||||
<div class="line"><span class="lineno"> 493</span> out_file << <span class="stringliteral">"\nDecryption Key:\n"</span> << dkey;</div>
|
||||
<div class="line"><span class="lineno"> 494</span> out_file.close();</div>
|
||||
<div class="line"><span class="lineno"> 495</span> </div>
|
||||
<div class="line"><span class="lineno"> 496</span> assert(txt_back == text);</div>
|
||||
<div class="line"><span class="lineno"> 497</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Passed :)\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 498</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 471</span> {</div>
|
||||
<div class="line"><span class="lineno"> 472</span> <span class="comment">// std::string text = "Hello world!";</span></div>
|
||||
<div class="line"><span class="lineno"> 473</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"======Test 1 (3x3 key) ======\nOriginal text:\n\t"</span> << text</div>
|
||||
<div class="line"><span class="lineno"> 474</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"> 475</span> </div>
|
||||
<div class="line"><span class="lineno"> 476</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<matrix<int></a>, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix<int></a>> p =</div>
|
||||
<div class="line"><span class="lineno"> 477</span> <a class="code hl_function" href="../../d6/d26/classciphers_1_1_hill_cipher.html#a405b0a28d66a61239d3565d5256f9cb5">ciphers::HillCipher::generate_keys</a>(3, 0, 100);</div>
|
||||
<div class="line"><span class="lineno"> 478</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix<int></a> ekey = p.first;</div>
|
||||
<div class="line"><span class="lineno"> 479</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix<int></a> dkey = p.second;</div>
|
||||
<div class="line"><span class="lineno"> 480</span> </div>
|
||||
<div class="line"><span class="lineno"> 481</span> <span class="comment">// matrix<int> ekey = {{22, 28, 25}, {5, 26, 15}, {14, 18, 9}};</span></div>
|
||||
<div class="line"><span class="lineno"> 482</span> <span class="comment">// std::cout << "Encryption key: \n" << ekey;</span></div>
|
||||
<div class="line"><span class="lineno"> 483</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> gibberish = <a class="code hl_function" href="../../d6/d26/classciphers_1_1_hill_cipher.html#aa8bbb6e4a5749f6008b06602d5103917">ciphers::HillCipher::encrypt_text</a>(text, ekey);</div>
|
||||
<div class="line"><span class="lineno"> 484</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">"Encrypted text:\n\t"</span> << gibberish << <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"> 485</span> </div>
|
||||
<div class="line"><span class="lineno"> 486</span> <span class="comment">// matrix<int> dkey = ciphers::HillCipher::generate_decryption_key(ekey);</span></div>
|
||||
<div class="line"><span class="lineno"> 487</span> <span class="comment">// std::cout << "Decryption key: \n" << dkey;</span></div>
|
||||
<div class="line"><span class="lineno"> 488</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> txt_back = <a class="code hl_function" href="../../d6/d26/classciphers_1_1_hill_cipher.html#a427acfac1dbff3f48a2b071d449d965b">ciphers::HillCipher::decrypt_text</a>(gibberish, dkey);</div>
|
||||
<div class="line"><span class="lineno"> 489</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">"Reconstruct text:\n\t"</span> << txt_back << <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"> 490</span> </div>
|
||||
<div class="line"><span class="lineno"> 491</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ofstream.html">std::ofstream</a> out_file(<span class="stringliteral">"hill_cipher_test1.txt"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 492</span> out_file << <span class="stringliteral">"Block size: "</span> << ekey.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 493</span> out_file << <span class="stringliteral">"Encryption Key:\n"</span> << ekey;</div>
|
||||
<div class="line"><span class="lineno"> 494</span> out_file << <span class="stringliteral">"\nDecryption Key:\n"</span> << dkey;</div>
|
||||
<div class="line"><span class="lineno"> 495</span> out_file.close();</div>
|
||||
<div class="line"><span class="lineno"> 496</span> </div>
|
||||
<div class="line"><span class="lineno"> 497</span> assert(txt_back == text);</div>
|
||||
<div class="line"><span class="lineno"> 498</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Passed :)\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 499</span>}</div>
|
||||
<div class="ttc" id="abasic_ofstream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ofstream.html">std::ofstream</a></div></div>
|
||||
<div class="ttc" id="aclassciphers_1_1_hill_cipher_html_a405b0a28d66a61239d3565d5256f9cb5"><div class="ttname"><a href="../../d6/d26/classciphers_1_1_hill_cipher.html#a405b0a28d66a61239d3565d5256f9cb5">ciphers::HillCipher::generate_keys</a></div><div class="ttdeci">static std::pair< matrix< int >, matrix< int > > generate_keys(size_t size, int limit1=0, int limit2=10)</div><div class="ttdoc">Generate encryption and decryption key pair.</div><div class="ttdef"><b>Definition</b> hill_cipher.cpp:424</div></div>
|
||||
<div class="ttc" id="aclassciphers_1_1_hill_cipher_html_a427acfac1dbff3f48a2b071d449d965b"><div class="ttname"><a href="../../d6/d26/classciphers_1_1_hill_cipher.html#a427acfac1dbff3f48a2b071d449d965b">ciphers::HillCipher::decrypt_text</a></div><div class="ttdeci">static const std::string decrypt_text(const std::string &text, const matrix< int > &decrypt_key)</div><div class="ttdoc">Decrypt a given text using a given key.</div><div class="ttdef"><b>Definition</b> hill_cipher.cpp:457</div></div>
|
||||
<div class="ttc" id="aclassciphers_1_1_hill_cipher_html_aa8bbb6e4a5749f6008b06602d5103917"><div class="ttname"><a href="../../d6/d26/classciphers_1_1_hill_cipher.html#aa8bbb6e4a5749f6008b06602d5103917">ciphers::HillCipher::encrypt_text</a></div><div class="ttdeci">static const std::string encrypt_text(const std::string &text, const matrix< int > &encrypt_key)</div><div class="ttdoc">Encrypt a given text using a given key.</div><div class="ttdef"><b>Definition</b> hill_cipher.cpp:445</div></div>
|
||||
<div class="ttc" id="aclassciphers_1_1_hill_cipher_html_a405b0a28d66a61239d3565d5256f9cb5"><div class="ttname"><a href="../../d6/d26/classciphers_1_1_hill_cipher.html#a405b0a28d66a61239d3565d5256f9cb5">ciphers::HillCipher::generate_keys</a></div><div class="ttdeci">static std::pair< matrix< int >, matrix< int > > generate_keys(size_t size, int limit1=0, int limit2=10)</div><div class="ttdoc">Generate encryption and decryption key pair.</div><div class="ttdef"><b>Definition</b> hill_cipher.cpp:425</div></div>
|
||||
<div class="ttc" id="aclassciphers_1_1_hill_cipher_html_a427acfac1dbff3f48a2b071d449d965b"><div class="ttname"><a href="../../d6/d26/classciphers_1_1_hill_cipher.html#a427acfac1dbff3f48a2b071d449d965b">ciphers::HillCipher::decrypt_text</a></div><div class="ttdeci">static const std::string decrypt_text(const std::string &text, const matrix< int > &decrypt_key)</div><div class="ttdoc">Decrypt a given text using a given key.</div><div class="ttdef"><b>Definition</b> hill_cipher.cpp:458</div></div>
|
||||
<div class="ttc" id="aclassciphers_1_1_hill_cipher_html_aa8bbb6e4a5749f6008b06602d5103917"><div class="ttname"><a href="../../d6/d26/classciphers_1_1_hill_cipher.html#aa8bbb6e4a5749f6008b06602d5103917">ciphers::HillCipher::encrypt_text</a></div><div class="ttdeci">static const std::string encrypt_text(const std::string &text, const matrix< int > &encrypt_key)</div><div class="ttdoc">Encrypt a given text using a given key.</div><div class="ttdef"><b>Definition</b> hill_cipher.cpp:446</div></div>
|
||||
<div class="ttc" id="apair_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a></div></div>
|
||||
<div class="ttc" id="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">
|
||||
@@ -359,31 +360,31 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 505</span> {</div>
|
||||
<div class="line"><span class="lineno"> 506</span> <span class="comment">// std::string text = "Hello world!";</span></div>
|
||||
<div class="line"><span class="lineno"> 507</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"======Test 2 (8x8 key) ======\nOriginal text:\n\t"</span> << text</div>
|
||||
<div class="line"><span class="lineno"> 508</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"> 509</span> </div>
|
||||
<div class="line"><span class="lineno"> 510</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<matrix<int></a>, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix<int></a>> p =</div>
|
||||
<div class="line"><span class="lineno"> 511</span> <a class="code hl_function" href="../../d6/d26/classciphers_1_1_hill_cipher.html#a405b0a28d66a61239d3565d5256f9cb5">ciphers::HillCipher::generate_keys</a>(8, 0, 3);</div>
|
||||
<div class="line"><span class="lineno"> 512</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix<int></a> ekey = p.first;</div>
|
||||
<div class="line"><span class="lineno"> 513</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix<int></a> dkey = p.second;</div>
|
||||
<div class="line"><span class="lineno"> 514</span> </div>
|
||||
<div class="line"><span class="lineno"> 515</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> gibberish = <a class="code hl_function" href="../../d6/d26/classciphers_1_1_hill_cipher.html#aa8bbb6e4a5749f6008b06602d5103917">ciphers::HillCipher::encrypt_text</a>(text, ekey);</div>
|
||||
<div class="line"><span class="lineno"> 516</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">"Encrypted text:\n\t"</span> << gibberish << <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"> 517</span> </div>
|
||||
<div class="line"><span class="lineno"> 518</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> txt_back = <a class="code hl_function" href="../../d6/d26/classciphers_1_1_hill_cipher.html#a427acfac1dbff3f48a2b071d449d965b">ciphers::HillCipher::decrypt_text</a>(gibberish, dkey);</div>
|
||||
<div class="line"><span class="lineno"> 519</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">"Reconstruct text:\n\t"</span> << txt_back << <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"> 520</span> </div>
|
||||
<div class="line"><span class="lineno"> 521</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ofstream.html">std::ofstream</a> out_file(<span class="stringliteral">"hill_cipher_test2.txt"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 522</span> out_file << <span class="stringliteral">"Block size: "</span> << ekey.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 523</span> out_file << <span class="stringliteral">"Encryption Key:\n"</span> << ekey;</div>
|
||||
<div class="line"><span class="lineno"> 524</span> out_file << <span class="stringliteral">"\nDecryption Key:\n"</span> << dkey;</div>
|
||||
<div class="line"><span class="lineno"> 525</span> out_file.close();</div>
|
||||
<div class="line"><span class="lineno"> 526</span> </div>
|
||||
<div class="line"><span class="lineno"> 527</span> assert(txt_back.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/compare.html">compare</a>(0, text.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>(), text) == 0);</div>
|
||||
<div class="line"><span class="lineno"> 528</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Passed :)\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 529</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 506</span> {</div>
|
||||
<div class="line"><span class="lineno"> 507</span> <span class="comment">// std::string text = "Hello world!";</span></div>
|
||||
<div class="line"><span class="lineno"> 508</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"======Test 2 (8x8 key) ======\nOriginal text:\n\t"</span> << text</div>
|
||||
<div class="line"><span class="lineno"> 509</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"> 510</span> </div>
|
||||
<div class="line"><span class="lineno"> 511</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<matrix<int></a>, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix<int></a>> p =</div>
|
||||
<div class="line"><span class="lineno"> 512</span> <a class="code hl_function" href="../../d6/d26/classciphers_1_1_hill_cipher.html#a405b0a28d66a61239d3565d5256f9cb5">ciphers::HillCipher::generate_keys</a>(8, 0, 3);</div>
|
||||
<div class="line"><span class="lineno"> 513</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix<int></a> ekey = p.first;</div>
|
||||
<div class="line"><span class="lineno"> 514</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">matrix<int></a> dkey = p.second;</div>
|
||||
<div class="line"><span class="lineno"> 515</span> </div>
|
||||
<div class="line"><span class="lineno"> 516</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> gibberish = <a class="code hl_function" href="../../d6/d26/classciphers_1_1_hill_cipher.html#aa8bbb6e4a5749f6008b06602d5103917">ciphers::HillCipher::encrypt_text</a>(text, ekey);</div>
|
||||
<div class="line"><span class="lineno"> 517</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">"Encrypted text:\n\t"</span> << gibberish << <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"> 518</span> </div>
|
||||
<div class="line"><span class="lineno"> 519</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> txt_back = <a class="code hl_function" href="../../d6/d26/classciphers_1_1_hill_cipher.html#a427acfac1dbff3f48a2b071d449d965b">ciphers::HillCipher::decrypt_text</a>(gibberish, dkey);</div>
|
||||
<div class="line"><span class="lineno"> 520</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">"Reconstruct text:\n\t"</span> << txt_back << <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"> 521</span> </div>
|
||||
<div class="line"><span class="lineno"> 522</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ofstream.html">std::ofstream</a> out_file(<span class="stringliteral">"hill_cipher_test2.txt"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 523</span> out_file << <span class="stringliteral">"Block size: "</span> << ekey.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 524</span> out_file << <span class="stringliteral">"Encryption Key:\n"</span> << ekey;</div>
|
||||
<div class="line"><span class="lineno"> 525</span> out_file << <span class="stringliteral">"\nDecryption Key:\n"</span> << dkey;</div>
|
||||
<div class="line"><span class="lineno"> 526</span> out_file.close();</div>
|
||||
<div class="line"><span class="lineno"> 527</span> </div>
|
||||
<div class="line"><span class="lineno"> 528</span> assert(txt_back.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/compare.html">compare</a>(0, text.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>(), text) == 0);</div>
|
||||
<div class="line"><span class="lineno"> 529</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Passed :)\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 530</span>}</div>
|
||||
<div class="ttc" id="acompare_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string/compare.html">std::string::compare</a></div><div class="ttdeci">T compare(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
<map id="data_structures/dsu_union_rank.cpp" name="data_structures/dsu_union_rank.cpp">
|
||||
<area shape="rect" id="Node000001" title="DSU (Disjoint sets)" alt="" coords="61,5,198,46"/>
|
||||
<area shape="rect" id="Node000001" title="DSU (Disjoint sets)" alt="" coords="100,5,236,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 @@
|
||||
7989b087308834ec7a089a96b7d312d4
|
||||
9b18df4fa984f90779d6e590869be616
|
||||
@@ -4,8 +4,8 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: data_structures/dsu_union_rank.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="DSU (Disjoint sets)">
|
||||
<polygon fill="#999999" stroke="#666666" points="144.25,-85.75 42,-85.75 42,-55.25 144.25,-55.25 144.25,-85.75"/>
|
||||
<text text-anchor="start" x="50" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">data_structures/dsu</text>
|
||||
<text text-anchor="middle" x="93.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_union_rank.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="173.25,-85.75 71,-85.75 71,-55.25 173.25,-55.25 173.25,-85.75"/>
|
||||
<text text-anchor="start" x="79" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">data_structures/dsu</text>
|
||||
<text text-anchor="middle" x="122.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_union_rank.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: data_structures/dsu_union_rank.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>data_structures/dsu_union_rank.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="DSU (Disjoint sets)">
|
||||
<polygon fill="#999999" stroke="#666666" points="144.25,-85.75 42,-85.75 42,-55.25 144.25,-55.25 144.25,-85.75"/>
|
||||
<text text-anchor="start" x="50" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">data_structures/dsu</text>
|
||||
<text text-anchor="middle" x="93.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_union_rank.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="173.25,-85.75 71,-85.75 71,-55.25 173.25,-55.25 173.25,-85.75"/>
|
||||
<text text-anchor="start" x="79" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">data_structures/dsu</text>
|
||||
<text text-anchor="middle" x="122.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_union_rank.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -31,8 +31,8 @@
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M76.07,-54.95C66.17,-46.5 53.67,-35.83 43.41,-27.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="45.79,-24.51 35.91,-20.68 41.25,-29.84 45.79,-24.51"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M97.65,-54.8C82.72,-45.83 63.71,-34.41 48.76,-25.42"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="50.83,-22.58 40.45,-20.43 47.22,-28.58 50.83,-22.58"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -40,8 +40,8 @@
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="119.88,-19.25 66.38,-19.25 66.38,0 119.88,0 119.88,-19.25"/>
|
||||
<text text-anchor="middle" x="93.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="111.75,-19.25 66.5,-19.25 66.5,0 111.75,0 111.75,-19.25"/>
|
||||
<text text-anchor="middle" x="89.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -49,8 +49,8 @@
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M93.12,-54.95C93.12,-47.71 93.12,-38.84 93.12,-30.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="96.63,-31.21 93.13,-21.21 89.63,-31.21 96.63,-31.21"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M113.97,-54.95C109.67,-47.28 104.34,-37.77 99.73,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="102.89,-28.03 94.95,-21.02 96.79,-31.46 102.89,-28.03"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -58,8 +58,8 @@
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="180.62,-19.25 137.62,-19.25 137.62,0 180.62,0 180.62,-19.25"/>
|
||||
<text text-anchor="middle" x="159.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="182.88,-19.25 129.38,-19.25 129.38,0 182.88,0 182.88,-19.25"/>
|
||||
<text text-anchor="middle" x="156.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -67,8 +67,26 @@
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M109.44,-54.95C118.81,-46.59 130.62,-36.05 140.38,-27.35"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="142.69,-29.98 147.82,-20.71 138.03,-24.75 142.69,-29.98"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M130.53,-54.95C134.96,-47.28 140.45,-37.77 145.2,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="148.16,-31.42 150.13,-21.01 142.09,-27.92 148.16,-31.42"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="243.62,-19.25 200.62,-19.25 200.62,0 243.62,0 243.62,-19.25"/>
|
||||
<text text-anchor="middle" x="222.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node5 -->
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M147.1,-54.8C162.33,-45.83 181.73,-34.41 196.99,-25.42"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="198.64,-28.51 205.48,-20.42 195.09,-22.48 198.64,-28.51"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.9 KiB |