Documentation for 53a6c16730
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.2"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: others/decimal_to_binary.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.2 -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
@@ -133,16 +133,16 @@ Functions</h2></td></tr>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<div class="fragment"><div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> {</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordtype">int</span> number;</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</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 a number:"</span>;</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> number;</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> </div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <a class="code hl_function" href="../../df/d06/decimal__to__binary_8cpp.html#a9240f2e79074a2a248395258aebbfa11">method1</a>(number);</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <a class="code hl_function" href="../../df/d06/decimal__to__binary_8cpp.html#a10df57491019f0ac39b492740fb388f7">method2</a>(number);</div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> </div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 46</span> {</div>
|
||||
<div class="line"><span class="lineno"> 47</span> <span class="keywordtype">int</span> number;</div>
|
||||
<div class="line"><span class="lineno"> 48</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 a number:"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 49</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> number;</div>
|
||||
<div class="line"><span class="lineno"> 50</span> </div>
|
||||
<div class="line"><span class="lineno"> 51</span> <a class="code hl_function" href="../../df/d06/decimal__to__binary_8cpp.html#a9240f2e79074a2a248395258aebbfa11">method1</a>(number);</div>
|
||||
<div class="line"><span class="lineno"> 52</span> <a class="code hl_function" href="../../df/d06/decimal__to__binary_8cpp.html#a10df57491019f0ac39b492740fb388f7">method2</a>(number);</div>
|
||||
<div class="line"><span class="lineno"> 53</span> </div>
|
||||
<div class="line"><span class="lineno"> 54</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 55</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="adecimal__to__binary_8cpp_html_a10df57491019f0ac39b492740fb388f7"><div class="ttname"><a href="../../df/d06/decimal__to__binary_8cpp.html#a10df57491019f0ac39b492740fb388f7">method2</a></div><div class="ttdeci">void method2(int number)</div><div class="ttdef"><b>Definition:</b> decimal_to_binary.cpp:27</div></div>
|
||||
@@ -166,17 +166,17 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >This method converts the bit representation and stores it as a decimal number. </p>
|
||||
<div class="fragment"><div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> {</div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> <span class="keywordtype">int</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/remainder.html">remainder</a>, binary = 0, var = 1;</div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="keywordflow">do</span> {</div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/remainder.html">remainder</a> = number % 2;</div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> number = number / 2;</div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> binary = binary + (<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/remainder.html">remainder</a> * var);</div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> var = var * 10;</div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> } <span class="keywordflow">while</span> (number > 0);</div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</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">"Method 1 : "</span> << binary << <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"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 11</span> {</div>
|
||||
<div class="line"><span class="lineno"> 12</span> <span class="keywordtype">int</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/remainder.html">remainder</a>, binary = 0, var = 1;</div>
|
||||
<div class="line"><span class="lineno"> 13</span> </div>
|
||||
<div class="line"><span class="lineno"> 14</span> <span class="keywordflow">do</span> {</div>
|
||||
<div class="line"><span class="lineno"> 15</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/remainder.html">remainder</a> = number % 2;</div>
|
||||
<div class="line"><span class="lineno"> 16</span> number = number / 2;</div>
|
||||
<div class="line"><span class="lineno"> 17</span> binary = binary + (<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/remainder.html">remainder</a> * var);</div>
|
||||
<div class="line"><span class="lineno"> 18</span> var = var * 10;</div>
|
||||
<div class="line"><span class="lineno"> 19</span> } <span class="keywordflow">while</span> (number > 0);</div>
|
||||
<div class="line"><span class="lineno"> 20</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">"Method 1 : "</span> << binary << <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"> 21</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="aremainder_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/remainder.html">std::remainder</a></div><div class="ttdeci">T remainder(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
@@ -204,24 +204,24 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >This method stores each bit value from LSB to MSB and then prints them back from MSB to LSB </p>
|
||||
<div class="fragment"><div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> {</div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordtype">int</span> num_bits = 0;</div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keywordtype">char</span> bit_string[50];</div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keywordflow">do</span> {</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keywordtype">bool</span> bit = number & 0x01; <span class="comment">// get last bit</span></div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keywordflow">if</span> (bit)</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> bit_string[num_bits++] = <span class="charliteral">'1'</span>;</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> bit_string[num_bits++] = <span class="charliteral">'0'</span>;</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> number >>= 1; <span class="comment">// right shift bit 1 bit</span></div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> } <span class="keywordflow">while</span> (number > 0);</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</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">"Method 2 : "</span>;</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keywordflow">while</span> (num_bits >= 0)</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << bit_string[num_bits--]; <span class="comment">// print from MSB to LSB</span></div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 27</span> {</div>
|
||||
<div class="line"><span class="lineno"> 28</span> <span class="keywordtype">int</span> num_bits = 0;</div>
|
||||
<div class="line"><span class="lineno"> 29</span> <span class="keywordtype">char</span> bit_string[50];</div>
|
||||
<div class="line"><span class="lineno"> 30</span> </div>
|
||||
<div class="line"><span class="lineno"> 31</span> <span class="keywordflow">do</span> {</div>
|
||||
<div class="line"><span class="lineno"> 32</span> <span class="keywordtype">bool</span> bit = number & 0x01; <span class="comment">// get last bit</span></div>
|
||||
<div class="line"><span class="lineno"> 33</span> <span class="keywordflow">if</span> (bit)</div>
|
||||
<div class="line"><span class="lineno"> 34</span> bit_string[num_bits++] = <span class="charliteral">'1'</span>;</div>
|
||||
<div class="line"><span class="lineno"> 35</span> <span class="keywordflow">else</span></div>
|
||||
<div class="line"><span class="lineno"> 36</span> bit_string[num_bits++] = <span class="charliteral">'0'</span>;</div>
|
||||
<div class="line"><span class="lineno"> 37</span> number >>= 1; <span class="comment">// right shift bit 1 bit</span></div>
|
||||
<div class="line"><span class="lineno"> 38</span> } <span class="keywordflow">while</span> (number > 0);</div>
|
||||
<div class="line"><span class="lineno"> 39</span> </div>
|
||||
<div class="line"><span class="lineno"> 40</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">"Method 2 : "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 41</span> <span class="keywordflow">while</span> (num_bits >= 0)</div>
|
||||
<div class="line"><span class="lineno"> 42</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << bit_string[num_bits--]; <span class="comment">// print from MSB to LSB</span></div>
|
||||
<div class="line"><span class="lineno"> 43</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 44</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -237,7 +237,7 @@ Here is the call graph for this function:</div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9510827d0b234b3cc54b29892f217477.html">others</a></li><li class="navelem"><a class="el" href="../../df/d06/decimal__to__binary_8cpp.html">decimal_to_binary.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<map id="method2" name="method2">
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,5,77,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="125,5,197,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="125,5,197,32"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1e001e7959323f32e995aedc09408961
|
||||
0c2eaf5bc59ed56c09d847b5da3d4128
|
||||
@@ -21,7 +21,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="90,-0.5 90,-19.5 144,-19.5 144,-0.5 90,-0.5"/>
|
||||
<text text-anchor="middle" x="117" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
@@ -1,4 +1,4 @@
|
||||
<map id="method1" name="method1">
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,5,77,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="125,5,197,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="125,5,197,32"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
65686abca30ac5d0ddd961b36cceef61
|
||||
eed485b8fa3d4e4146c1dc1e77393663
|
||||
@@ -21,7 +21,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="90,-0.5 90,-19.5 144,-19.5 144,-0.5 90,-0.5"/>
|
||||
<text text-anchor="middle" x="117" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.2"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: pancake_sort Namespace Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.2 -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
@@ -104,7 +104,7 @@ $(document).ready(function(){initNavTree('df/d10/namespacepancake__sort.html','.
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../df/d10/namespacepancake__sort.html">pancake_sort</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.2"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: Member List</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.2 -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
@@ -106,7 +106,7 @@ $(document).ready(function(){initNavTree('de/d9d/classdata__structures_1_1linked
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.2"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: numerical_methods/midpoint_integral_method.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.2 -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
@@ -177,7 +177,7 @@ Functions</h2></td></tr>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>the value of the dependent variable yi = f(xi) = sqrt(xi) + ln(xi) </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span>{ <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>(x) + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">std::log</a>(x); }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 90</span>{ <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>(x) + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">std::log</a>(x); }</div>
|
||||
<div class="ttc" id="alog_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/log.html">std::log</a></div><div class="ttdeci">T log(T... args)</div></div>
|
||||
<div class="ttc" id="asqrt_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a></div><div class="ttdeci">T sqrt(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
@@ -213,7 +213,7 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>the value of the dependent variable yi = g(xi) = e^(-xi) * (4 - xi^2) </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span>{ <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/exp.html">std::exp</a>(-x) * (4 - <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>(x, 2)); }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 97</span>{ <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/exp.html">std::exp</a>(-x) * (4 - <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>(x, 2)); }</div>
|
||||
<div class="ttc" id="aexp_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/exp.html">std::exp</a></div><div class="ttdeci">T exp(T... args)</div></div>
|
||||
<div class="ttc" id="apow_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a></div><div class="ttdeci">T pow(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
@@ -249,7 +249,7 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>the value of the dependent variable yi = k(xi) = sqrt(2*xi^3 + 3) </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span>{ <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>(2 * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>(x, 3) + 3); }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 103</span>{ <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>(2 * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>(x, 3) + 3); }</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -283,7 +283,7 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>the value of the dependent variable yi = l(xi) = xi + ln(2*xi + 1) </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span>{ <span class="keywordflow">return</span> x + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">std::log</a>(2 * x + 1); }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 109</span>{ <span class="keywordflow">return</span> x + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">std::log</a>(2 * x + 1); }</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -333,44 +333,44 @@ Here is the call graph for this function:</div>
|
||||
<p >Starting and ending point of the integration in</p>
|
||||
<p >the real axis</p>
|
||||
<p >Step, calculated by a, b and N</p>
|
||||
<div class="fragment"><div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> {</div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> =</div>
|
||||
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> 16; <span class="comment">/// Number of intervals to divide the integration interval.</span><span class="comment"></span></div>
|
||||
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span><span class="comment"> /// MUST BE EVEN</span></div>
|
||||
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span><span class="comment"></span> <span class="keywordtype">double</span> a = 1, b = 3; <span class="comment">/// Starting and ending point of the integration in</span><span class="comment"></span></div>
|
||||
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span><span class="comment"> /// the real axis</span></div>
|
||||
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span><span class="comment"></span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a> = NAN; <span class="comment">/// Step, calculated by a, b and N</span></div>
|
||||
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> </div>
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> <span class="keywordtype">bool</span> used_argv_parameters =</div>
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <span class="keyword">false</span>; <span class="comment">// If argv parameters are used then the assert must be omitted</span></div>
|
||||
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="comment">// for the test cases</span></div>
|
||||
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> </div>
|
||||
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> <span class="comment">// Get user input (by the command line parameters or the console after</span></div>
|
||||
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> <span class="comment">// displaying messages)</span></div>
|
||||
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> <span class="keywordflow">if</span> (argc == 4) {</div>
|
||||
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/atoi.html">std::atoi</a>(argv[1]);</div>
|
||||
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> a = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/atof.html">std::atof</a>(argv[2]);</div>
|
||||
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> b = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/atof.html">std::atof</a>(argv[3]);</div>
|
||||
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> <span class="comment">// Check if a<b else abort</span></div>
|
||||
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> assert(a < b && <span class="stringliteral">"a has to be less than b"</span>);</div>
|
||||
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> assert(N > 0 && <span class="stringliteral">"N has to be > 0"</span>);</div>
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> <span class="keywordflow">if</span> (N < 4 || a != 1 || b != 3) {</div>
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> used_argv_parameters = <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> }</div>
|
||||
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</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">"You selected N="</span> << <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> << <span class="stringliteral">", a="</span> << a << <span class="stringliteral">", b="</span> << b</div>
|
||||
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</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"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</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">"Default N="</span> << <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> << <span class="stringliteral">", a="</span> << a << <span class="stringliteral">", b="</span> << b</div>
|
||||
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</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"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> }</div>
|
||||
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> </div>
|
||||
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> <span class="comment">// Find the step</span></div>
|
||||
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a> = (b - a) / N;</div>
|
||||
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> </div>
|
||||
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#a2ae48a41e43dc6ab11b962742349646e">test</a>(N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, b, used_argv_parameters); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> </div>
|
||||
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 162</span> {</div>
|
||||
<div class="line"><span class="lineno"> 163</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> =</div>
|
||||
<div class="line"><span class="lineno"> 164</span> 16; <span class="comment">/// Number of intervals to divide the integration interval.</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 165</span><span class="comment"> /// MUST BE EVEN</span></div>
|
||||
<div class="line"><span class="lineno"> 166</span><span class="comment"></span> <span class="keywordtype">double</span> a = 1, b = 3; <span class="comment">/// Starting and ending point of the integration in</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 167</span><span class="comment"> /// the real axis</span></div>
|
||||
<div class="line"><span class="lineno"> 168</span><span class="comment"></span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a> = NAN; <span class="comment">/// Step, calculated by a, b and N</span></div>
|
||||
<div class="line"><span class="lineno"> 169</span> </div>
|
||||
<div class="line"><span class="lineno"> 170</span> <span class="keywordtype">bool</span> used_argv_parameters =</div>
|
||||
<div class="line"><span class="lineno"> 171</span> <span class="keyword">false</span>; <span class="comment">// If argv parameters are used then the assert must be omitted</span></div>
|
||||
<div class="line"><span class="lineno"> 172</span> <span class="comment">// for the test cases</span></div>
|
||||
<div class="line"><span class="lineno"> 173</span> </div>
|
||||
<div class="line"><span class="lineno"> 174</span> <span class="comment">// Get user input (by the command line parameters or the console after</span></div>
|
||||
<div class="line"><span class="lineno"> 175</span> <span class="comment">// displaying messages)</span></div>
|
||||
<div class="line"><span class="lineno"> 176</span> <span class="keywordflow">if</span> (argc == 4) {</div>
|
||||
<div class="line"><span class="lineno"> 177</span> <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/atoi.html">std::atoi</a>(argv[1]);</div>
|
||||
<div class="line"><span class="lineno"> 178</span> a = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/atof.html">std::atof</a>(argv[2]);</div>
|
||||
<div class="line"><span class="lineno"> 179</span> b = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/atof.html">std::atof</a>(argv[3]);</div>
|
||||
<div class="line"><span class="lineno"> 180</span> <span class="comment">// Check if a<b else abort</span></div>
|
||||
<div class="line"><span class="lineno"> 181</span> assert(a < b && <span class="stringliteral">"a has to be less than b"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 182</span> assert(N > 0 && <span class="stringliteral">"N has to be > 0"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 183</span> <span class="keywordflow">if</span> (N < 4 || a != 1 || b != 3) {</div>
|
||||
<div class="line"><span class="lineno"> 184</span> used_argv_parameters = <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 185</span> }</div>
|
||||
<div class="line"><span class="lineno"> 186</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">"You selected N="</span> << <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> << <span class="stringliteral">", a="</span> << a << <span class="stringliteral">", b="</span> << b</div>
|
||||
<div class="line"><span class="lineno"> 187</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"> 188</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 189</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">"Default N="</span> << <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> << <span class="stringliteral">", a="</span> << a << <span class="stringliteral">", b="</span> << b</div>
|
||||
<div class="line"><span class="lineno"> 190</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"> 191</span> }</div>
|
||||
<div class="line"><span class="lineno"> 192</span> </div>
|
||||
<div class="line"><span class="lineno"> 193</span> <span class="comment">// Find the step</span></div>
|
||||
<div class="line"><span class="lineno"> 194</span> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a> = (b - a) / N;</div>
|
||||
<div class="line"><span class="lineno"> 195</span> </div>
|
||||
<div class="line"><span class="lineno"> 196</span> <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#a2ae48a41e43dc6ab11b962742349646e">test</a>(N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, b, used_argv_parameters); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 197</span> </div>
|
||||
<div class="line"><span class="lineno"> 198</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 199</span>}</div>
|
||||
<div class="ttc" id="aatof_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/byte/atof.html">std::atof</a></div><div class="ttdeci">T atof(T... args)</div></div>
|
||||
<div class="ttc" id="aatoi_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/byte/atoi.html">std::atoi</a></div><div class="ttdeci">T atoi(T... args)</div></div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
@@ -437,37 +437,37 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>the result of the integration </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> {</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map.html">std::map<int, double></a></div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> data_table; <span class="comment">// Contains the data points, key: i, value: f(xi)</span></div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keywordtype">double</span> xi = a; <span class="comment">// Initialize xi to the starting point x0 = a</span></div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="comment">// Create the data table</span></div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="comment">// Loop from x0 to xN-1</span></div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="keywordtype">double</span> temp = NAN;</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordflow">for</span> (<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> i = 0; i < <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> temp = func(xi + <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a> / 2); <span class="comment">// find f(xi+h/2)</span></div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> data_table.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map/insert.html">insert</a>(</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<std::int32_t, double></a>(i, temp)); <span class="comment">// add i and f(xi)</span></div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> xi += <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>; <span class="comment">// Get the next point xi for the next iteration</span></div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> }</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> </div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="comment">// Evaluate the integral.</span></div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="comment">// Remember: {f(x0+h/2) + f(x1+h/2) + ... + f(xN-1+h/2)}</span></div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keywordtype">double</span> evaluate_integral = 0;</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keywordflow">for</span> (<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> i = 0; i < <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) evaluate_integral += data_table.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map/at.html">at</a>(i);</div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="comment">// Multiply by the coefficient h</span></div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> evaluate_integral *= <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>;</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> </div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="comment">// If the result calculated is nan, then the user has given wrong input</span></div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="comment">// interval.</span></div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> assert(!<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/isnan.html">std::isnan</a>(evaluate_integral) &&</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="stringliteral">"The definite integral can't be evaluated. Check the validity of "</span></div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="stringliteral">"your input.\n"</span>);</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="comment">// Else return</span></div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keywordflow">return</span> evaluate_integral;</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 53</span> {</div>
|
||||
<div class="line"><span class="lineno"> 54</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map.html">std::map<int, double></a></div>
|
||||
<div class="line"><span class="lineno"> 55</span> data_table; <span class="comment">// Contains the data points, key: i, value: f(xi)</span></div>
|
||||
<div class="line"><span class="lineno"> 56</span> <span class="keywordtype">double</span> xi = a; <span class="comment">// Initialize xi to the starting point x0 = a</span></div>
|
||||
<div class="line"><span class="lineno"> 57</span> </div>
|
||||
<div class="line"><span class="lineno"> 58</span> <span class="comment">// Create the data table</span></div>
|
||||
<div class="line"><span class="lineno"> 59</span> <span class="comment">// Loop from x0 to xN-1</span></div>
|
||||
<div class="line"><span class="lineno"> 60</span> <span class="keywordtype">double</span> temp = NAN;</div>
|
||||
<div class="line"><span class="lineno"> 61</span> <span class="keywordflow">for</span> (<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> i = 0; i < <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 62</span> temp = func(xi + <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a> / 2); <span class="comment">// find f(xi+h/2)</span></div>
|
||||
<div class="line"><span class="lineno"> 63</span> data_table.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map/insert.html">insert</a>(</div>
|
||||
<div class="line"><span class="lineno"> 64</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<std::int32_t, double></a>(i, temp)); <span class="comment">// add i and f(xi)</span></div>
|
||||
<div class="line"><span class="lineno"> 65</span> xi += <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>; <span class="comment">// Get the next point xi for the next iteration</span></div>
|
||||
<div class="line"><span class="lineno"> 66</span> }</div>
|
||||
<div class="line"><span class="lineno"> 67</span> </div>
|
||||
<div class="line"><span class="lineno"> 68</span> <span class="comment">// Evaluate the integral.</span></div>
|
||||
<div class="line"><span class="lineno"> 69</span> <span class="comment">// Remember: {f(x0+h/2) + f(x1+h/2) + ... + f(xN-1+h/2)}</span></div>
|
||||
<div class="line"><span class="lineno"> 70</span> <span class="keywordtype">double</span> evaluate_integral = 0;</div>
|
||||
<div class="line"><span class="lineno"> 71</span> <span class="keywordflow">for</span> (<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> i = 0; i < <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) evaluate_integral += data_table.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map/at.html">at</a>(i);</div>
|
||||
<div class="line"><span class="lineno"> 72</span> </div>
|
||||
<div class="line"><span class="lineno"> 73</span> <span class="comment">// Multiply by the coefficient h</span></div>
|
||||
<div class="line"><span class="lineno"> 74</span> evaluate_integral *= <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>;</div>
|
||||
<div class="line"><span class="lineno"> 75</span> </div>
|
||||
<div class="line"><span class="lineno"> 76</span> <span class="comment">// If the result calculated is nan, then the user has given wrong input</span></div>
|
||||
<div class="line"><span class="lineno"> 77</span> <span class="comment">// interval.</span></div>
|
||||
<div class="line"><span class="lineno"> 78</span> assert(!<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/isnan.html">std::isnan</a>(evaluate_integral) &&</div>
|
||||
<div class="line"><span class="lineno"> 79</span> <span class="stringliteral">"The definite integral can't be evaluated. Check the validity of "</span></div>
|
||||
<div class="line"><span class="lineno"> 80</span> <span class="stringliteral">"your input.\n"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 81</span> <span class="comment">// Else return</span></div>
|
||||
<div class="line"><span class="lineno"> 82</span> <span class="keywordflow">return</span> evaluate_integral;</div>
|
||||
<div class="line"><span class="lineno"> 83</span>}</div>
|
||||
<div class="ttc" id="aat_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/map/at.html">std::map::at</a></div><div class="ttdeci">T at(T... args)</div></div>
|
||||
<div class="ttc" id="ainsert_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/map/insert.html">std::map::insert</a></div><div class="ttdeci">T insert(T... args)</div></div>
|
||||
<div class="ttc" id="aisnan_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/isnan.html">std::isnan</a></div><div class="ttdeci">T isnan(T... args)</div></div>
|
||||
@@ -545,37 +545,37 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="fragment"><div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> {</div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="comment">// Call midpoint() for each of the test functions f, g, k, l</span></div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="comment">// Assert with two decimal point precision</span></div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keywordtype">double</span> result_f = <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#a7072493d1f0f8a91b2a71d4cc456c09c">numerical_methods::midpoint_rule::midpoint</a>(</div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::midpoint_rule::f);</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> assert((used_argv_parameters || (result_f >= 4.09 && result_f <= 4.10)) &&</div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <span class="stringliteral">"The result of f(x) is wrong"</span>);</div>
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</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">"The result of integral f(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> << <span class="stringliteral">"] is equal to: "</span> << result_f << <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"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> </div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keywordtype">double</span> result_g = <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#a7072493d1f0f8a91b2a71d4cc456c09c">numerical_methods::midpoint_rule::midpoint</a>(</div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::midpoint_rule::g);</div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> assert((used_argv_parameters || (result_g >= 0.27 && result_g <= 0.28)) &&</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="stringliteral">"The result of g(x) is wrong"</span>);</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The result of integral g(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> << <span class="stringliteral">"] is equal to: "</span> << result_g << <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"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> </div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="keywordtype">double</span> result_k = <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#a7072493d1f0f8a91b2a71d4cc456c09c">numerical_methods::midpoint_rule::midpoint</a>(</div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::midpoint_rule::k);</div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> assert((used_argv_parameters || (result_k >= 9.06 && result_k <= 9.07)) &&</div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="stringliteral">"The result of k(x) is wrong"</span>);</div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</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">"The result of integral k(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> << <span class="stringliteral">"] is equal to: "</span> << result_k << <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"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> </div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <span class="keywordtype">double</span> result_l = <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#a7072493d1f0f8a91b2a71d4cc456c09c">numerical_methods::midpoint_rule::midpoint</a>(</div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::midpoint_rule::l);</div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> assert((used_argv_parameters || (result_l >= 7.16 && result_l <= 7.17)) &&</div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <span class="stringliteral">"The result of l(x) is wrong"</span>);</div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</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">"The result of integral l(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> << <span class="stringliteral">"] is equal to: "</span> << result_l << <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"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 124</span> {</div>
|
||||
<div class="line"><span class="lineno"> 125</span> <span class="comment">// Call midpoint() for each of the test functions f, g, k, l</span></div>
|
||||
<div class="line"><span class="lineno"> 126</span> <span class="comment">// Assert with two decimal point precision</span></div>
|
||||
<div class="line"><span class="lineno"> 127</span> <span class="keywordtype">double</span> result_f = <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#a7072493d1f0f8a91b2a71d4cc456c09c">numerical_methods::midpoint_rule::midpoint</a>(</div>
|
||||
<div class="line"><span class="lineno"> 128</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::midpoint_rule::f);</div>
|
||||
<div class="line"><span class="lineno"> 129</span> assert((used_argv_parameters || (result_f >= 4.09 && result_f <= 4.10)) &&</div>
|
||||
<div class="line"><span class="lineno"> 130</span> <span class="stringliteral">"The result of f(x) is wrong"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 131</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">"The result of integral f(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><span class="lineno"> 132</span> << <span class="stringliteral">"] is equal to: "</span> << result_f << <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"> 133</span> </div>
|
||||
<div class="line"><span class="lineno"> 134</span> <span class="keywordtype">double</span> result_g = <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#a7072493d1f0f8a91b2a71d4cc456c09c">numerical_methods::midpoint_rule::midpoint</a>(</div>
|
||||
<div class="line"><span class="lineno"> 135</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::midpoint_rule::g);</div>
|
||||
<div class="line"><span class="lineno"> 136</span> assert((used_argv_parameters || (result_g >= 0.27 && result_g <= 0.28)) &&</div>
|
||||
<div class="line"><span class="lineno"> 137</span> <span class="stringliteral">"The result of g(x) is wrong"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 138</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The result of integral g(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><span class="lineno"> 139</span> << <span class="stringliteral">"] is equal to: "</span> << result_g << <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"> 140</span> </div>
|
||||
<div class="line"><span class="lineno"> 141</span> <span class="keywordtype">double</span> result_k = <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#a7072493d1f0f8a91b2a71d4cc456c09c">numerical_methods::midpoint_rule::midpoint</a>(</div>
|
||||
<div class="line"><span class="lineno"> 142</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::midpoint_rule::k);</div>
|
||||
<div class="line"><span class="lineno"> 143</span> assert((used_argv_parameters || (result_k >= 9.06 && result_k <= 9.07)) &&</div>
|
||||
<div class="line"><span class="lineno"> 144</span> <span class="stringliteral">"The result of k(x) is wrong"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 145</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">"The result of integral k(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><span class="lineno"> 146</span> << <span class="stringliteral">"] is equal to: "</span> << result_k << <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"> 147</span> </div>
|
||||
<div class="line"><span class="lineno"> 148</span> <span class="keywordtype">double</span> result_l = <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#a7072493d1f0f8a91b2a71d4cc456c09c">numerical_methods::midpoint_rule::midpoint</a>(</div>
|
||||
<div class="line"><span class="lineno"> 149</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::midpoint_rule::l);</div>
|
||||
<div class="line"><span class="lineno"> 150</span> assert((used_argv_parameters || (result_l >= 7.16 && result_l <= 7.17)) &&</div>
|
||||
<div class="line"><span class="lineno"> 151</span> <span class="stringliteral">"The result of l(x) is wrong"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 152</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The result of integral l(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><span class="lineno"> 153</span> << <span class="stringliteral">"] is equal to: "</span> << result_l << <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"> 154</span>}</div>
|
||||
<div class="ttc" id="amidpoint__integral__method_8cpp_html_a7072493d1f0f8a91b2a71d4cc456c09c"><div class="ttname"><a href="../../df/d11/midpoint__integral__method_8cpp.html#a7072493d1f0f8a91b2a71d4cc456c09c">numerical_methods::midpoint_rule::midpoint</a></div><div class="ttdeci">double midpoint(const std::int32_t N, const double h, const double a, const std::function< double(double)> &func)</div><div class="ttdoc">Main function for implementing the Midpoint Integral Method implementation.</div><div class="ttdef"><b>Definition:</b> midpoint_integral_method.cpp:52</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -592,7 +592,7 @@ Here is the call graph for this function:</div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../df/d11/midpoint__integral__method_8cpp.html">midpoint_integral_method.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<map id="test" name="test">
|
||||
<area shape="rect" id="node1" title="Self-test implementations." alt="" coords="5,31,49,57"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="97,5,169,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="97,5,169,32"/>
|
||||
<area shape="rect" id="node3" href="$d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001" title=" " alt="" coords="114,56,153,83"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
933cfa74fd0798b815fb68d8a2bb3bf4
|
||||
2dd0c715f328c8d93ad66278e469eabb
|
||||
@@ -21,7 +21,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="69,-38.5 69,-57.5 123,-57.5 123,-38.5 69,-38.5"/>
|
||||
<text text-anchor="middle" x="96" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -1,8 +1,8 @@
|
||||
<map id="main" name="main">
|
||||
<area shape="rect" id="node1" title="Main function." alt="" coords="5,107,56,133"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/byte/atof.html#" title=" " alt="" coords="104,5,175,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/byte/atoi.html#" title=" " alt="" coords="105,56,174,83"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="223,132,295,159"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/byte/atof#" title=" " alt="" coords="104,5,175,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/byte/atoi#" title=" " alt="" coords="105,56,174,83"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="223,132,295,159"/>
|
||||
<area shape="rect" id="node5" href="$d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001" title=" " alt="" coords="239,195,278,221"/>
|
||||
<area shape="rect" id="node6" href="$df/d11/midpoint__integral__method_8cpp.html#a2ae48a41e43dc6ab11b962742349646e" title="Self-test implementations." alt="" coords="117,157,161,184"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
789454801ae4af4a2066076e1a213e13
|
||||
fcc208b417cec07d7df93e1ac60d66f3
|
||||
@@ -21,7 +21,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/byte/atof.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/byte/atof#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="74,-142.5 74,-161.5 127,-161.5 127,-142.5 74,-142.5"/>
|
||||
<text text-anchor="middle" x="100.5" y="-149.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::atof</text>
|
||||
</a>
|
||||
@@ -36,7 +36,7 @@
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/byte/atoi.html#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/byte/atoi#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="74.5,-104.5 74.5,-123.5 126.5,-123.5 126.5,-104.5 74.5,-104.5"/>
|
||||
<text text-anchor="middle" x="100.5" y="-111.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::atoi</text>
|
||||
</a>
|
||||
@@ -51,7 +51,7 @@
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="163,-47.5 163,-66.5 217,-66.5 217,-47.5 163,-47.5"/>
|
||||
<text text-anchor="middle" x="190" y="-54.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
@@ -1,7 +1,7 @@
|
||||
<map id="numerical_methods::midpoint_rule::midpoint" name="numerical_methods::midpoint_rule::midpoint">
|
||||
<area shape="rect" id="node1" title="Main function for implementing the Midpoint Integral Method implementation." alt="" coords="5,74,161,115"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/map/at.html#" title=" " alt="" coords="220,5,312,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/map/at#" title=" " alt="" coords="220,5,312,32"/>
|
||||
<area shape="rect" id="node3" href="$d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001" title=" " alt="" coords="247,56,285,83"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/map/insert.html#" title=" " alt="" coords="209,107,323,133"/>
|
||||
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/isnan.html#" title=" " alt="" coords="227,157,305,184"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/map/insert#" title=" " alt="" coords="209,107,323,133"/>
|
||||
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/isnan#" title=" " alt="" coords="227,157,305,184"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
d371b96c9516262c01e1d8ad54bbfc8a
|
||||
a4a216cca5f60048d5a9f5a2377c49c9
|
||||
@@ -28,7 +28,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/map/at.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/map/at#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="161,-114.5 161,-133.5 230,-133.5 230,-114.5 161,-114.5"/>
|
||||
<text text-anchor="middle" x="195.5" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::map::at</text>
|
||||
</a>
|
||||
@@ -58,7 +58,7 @@
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/map/insert.html#" xlink:title=" ">
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/map/insert#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="153,-38.5 153,-57.5 238,-57.5 238,-38.5 153,-38.5"/>
|
||||
<text text-anchor="middle" x="195.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::map::insert</text>
|
||||
</a>
|
||||
@@ -73,7 +73,7 @@
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/isnan.html#" xlink:title=" ">
|
||||
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/isnan#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="166,-0.5 166,-19.5 225,-19.5 225,-0.5 166,-0.5"/>
|
||||
<text text-anchor="middle" x="195.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::isnan</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
@@ -1,5 +1,5 @@
|
||||
<map id="numerical_methods::midpoint_rule::f" name="numerical_methods::midpoint_rule::f">
|
||||
<area shape="rect" id="node1" title="A function f(x) that will be used to test the method." alt="" coords="5,23,148,65"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/log.html#" title=" " alt="" coords="199,5,264,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sqrt.html#" title=" " alt="" coords="196,56,267,83"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/log#" title=" " alt="" coords="199,5,264,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sqrt#" title=" " alt="" coords="196,56,267,83"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
14b10a7a555646d17aad5195d0f7b635
|
||||
90ee561f42a0954e1e2a8f663a0363f6
|
||||
@@ -22,7 +22,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/log.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/log#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="145,-38.5 145,-57.5 194,-57.5 194,-38.5 145,-38.5"/>
|
||||
<text text-anchor="middle" x="169.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::log</text>
|
||||
</a>
|
||||
@@ -37,7 +37,7 @@
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="143,-0.5 143,-19.5 196,-19.5 196,-0.5 143,-0.5"/>
|
||||
<text text-anchor="middle" x="169.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::sqrt</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
@@ -1,4 +1,4 @@
|
||||
<map id="numerical_methods::midpoint_rule::l" name="numerical_methods::midpoint_rule::l">
|
||||
<area shape="rect" id="node1" title="A function l(x) that will be used to test the method." alt="" coords="5,5,148,47"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/log.html#" title=" " alt="" coords="196,13,261,39"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/log#" title=" " alt="" coords="196,13,261,39"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
d5abfcad7fadbeafb46cd04e99d48445
|
||||
8f7196806733134ae2d55e93f107a8eb
|
||||
@@ -22,7 +22,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/log.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/log#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="143,-6 143,-25 192,-25 192,-6 143,-6"/>
|
||||
<text text-anchor="middle" x="167.5" y="-13" font-family="Helvetica,sans-Serif" font-size="10.00">std::log</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -1,5 +1,5 @@
|
||||
<map id="numerical_methods::midpoint_rule::g" name="numerical_methods::midpoint_rule::g">
|
||||
<area shape="rect" id="node1" title="A function g(x) that will be used to test the method." alt="" coords="5,23,148,65"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/exp.html#" title=" " alt="" coords="197,5,267,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/pow.html#" title=" " alt="" coords="196,56,268,83"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/exp#" title=" " alt="" coords="197,5,267,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/pow#" title=" " alt="" coords="196,56,268,83"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
e0e7e9dac70e811cbff046afde919d2c
|
||||
739f4d805be647deeaf2382e46235a15
|
||||
@@ -22,7 +22,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/exp.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/exp#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="144,-38.5 144,-57.5 196,-57.5 196,-38.5 144,-38.5"/>
|
||||
<text text-anchor="middle" x="170" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::exp</text>
|
||||
</a>
|
||||
@@ -37,7 +37,7 @@
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/pow.html#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/pow#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="143,-0.5 143,-19.5 197,-19.5 197,-0.5 143,-0.5"/>
|
||||
<text text-anchor="middle" x="170" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::pow</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
@@ -1,5 +1,5 @@
|
||||
<map id="numerical_methods::midpoint_rule::k" name="numerical_methods::midpoint_rule::k">
|
||||
<area shape="rect" id="node1" title="A function k(x) that will be used to test the method." alt="" coords="5,23,148,65"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/pow.html#" title=" " alt="" coords="196,5,268,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sqrt.html#" title=" " alt="" coords="197,56,267,83"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/pow#" title=" " alt="" coords="196,5,268,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sqrt#" title=" " alt="" coords="197,56,267,83"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
fa3974733db573d429f3652f4e3655d4
|
||||
5598d81b9c360d7699783707149f27e5
|
||||
@@ -22,7 +22,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/pow.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/pow#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="143,-38.5 143,-57.5 197,-57.5 197,-38.5 143,-38.5"/>
|
||||
<text text-anchor="middle" x="170" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::pow</text>
|
||||
</a>
|
||||
@@ -37,7 +37,7 @@
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="143.5,-0.5 143.5,-19.5 196.5,-19.5 196.5,-0.5 143.5,-0.5"/>
|
||||
<text text-anchor="middle" x="170" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::sqrt</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.2"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: stack_using_queue Namespace Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.2 -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
@@ -104,7 +104,7 @@ $(document).ready(function(){initNavTree('df/d1c/namespacestack__using__queue.ht
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../df/d1c/namespacestack__using__queue.html">stack_using_queue</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.2"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: data_structures/dsu_union_rank.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.2 -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
@@ -129,7 +129,8 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p ><a href="https://en.wikipedia.org/wiki/Disjoint-set-data_structure" target="_blank">DSU (Disjoint sets)</a> </p>
|
||||
<p >dsu : It is a very powerful data structure which keeps track of different clusters(sets) of elements, these sets are disjoint(doesnot have a common element). Disjoint sets uses cases : for finding connected components in a graph, used in Kruskal's algorithm for finding <a class="el" href="../../d4/d12/namespace_minimum.html" title="Implementation of Minimum Edit Distance algorithm.">Minimum</a> Spanning tree. Operations that can be performed: 1) UnionSet(i,j): add(element i and j to the set) 2) findSet(i): returns the representative of the set to which i belogngs to. 3) getParents(i): prints the parent of i and so on and so forth. Below is the class-based approach which uses the heuristic of union-ranks. Using union-rank in findSet(i),we are able to get to the representative of i in slightly delayed O(logN) time but it allows us to keep tracks of the parent of i. </p><dl class="section author"><dt>Author</dt><dd><a href="https://github.com/AayushVyasKIIT" target="_blank">AayushVyasKIIT</a> </dd></dl>
|
||||
<p >dsu : It is a very powerful data structure which keeps track of different clusters(sets) of elements, these sets are disjoint(doesnot have a common
|
||||
element). Disjoint sets uses cases : for finding connected components in a graph, used in Kruskal's algorithm for finding <a class="el" href="../../d4/d12/namespace_minimum.html" title="Implementation of Minimum Edit Distance algorithm.">Minimum</a> Spanning tree. Operations that can be performed: 1) UnionSet(i,j): add(element i and j to the set) 2) findSet(i): returns the representative of the set to which i belogngs to. 3) getParents(i): prints the parent of i and so on and so forth. Below is the class-based approach which uses the heuristic of union-ranks. Using union-rank in findSet(i),we are able to get to the representative of i in slightly delayed O(logN) time but it allows us to keep tracks of the parent of i. </p><dl class="section author"><dt>Author</dt><dd><a href="https://github.com/AayushVyasKIIT" target="_blank">AayushVyasKIIT</a> </dd></dl>
|
||||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d3/dae/dsu__path__compression_8cpp.html" title="DSU (Disjoint sets)">dsu_path_compression.cpp</a> </dd></dl>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
|
||||
@@ -150,18 +151,18 @@ Functions</h2></td></tr>
|
||||
|
||||
<p>Main function. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> {</div>
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> <a class="code hl_function" href="../../df/d28/dsu__union__rank_8cpp.html#ae7880ce913f3058a35ff106d5be9e243">test1</a>(); <span class="comment">// run 1st test case</span></div>
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <a class="code hl_function" href="../../df/d28/dsu__union__rank_8cpp.html#a45d94ead4cf4e1ff9f87c38bc99f59ae">test2</a>(); <span class="comment">// run 2nd test case</span></div>
|
||||
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> </div>
|
||||
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 182</span> {</div>
|
||||
<div class="line"><span class="lineno"> 183</span> <a class="code hl_function" href="../../df/d28/dsu__union__rank_8cpp.html#ae7880ce913f3058a35ff106d5be9e243">test1</a>(); <span class="comment">// run 1st test case</span></div>
|
||||
<div class="line"><span class="lineno"> 184</span> <a class="code hl_function" href="../../df/d28/dsu__union__rank_8cpp.html#a45d94ead4cf4e1ff9f87c38bc99f59ae">test2</a>(); <span class="comment">// run 2nd test case</span></div>
|
||||
<div class="line"><span class="lineno"> 185</span> </div>
|
||||
<div class="line"><span class="lineno"> 186</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 187</span>}</div>
|
||||
<div class="ttc" id="adsu__union__rank_8cpp_html_a45d94ead4cf4e1ff9f87c38bc99f59ae"><div class="ttname"><a href="../../df/d28/dsu__union__rank_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_union_rank.cpp:157</div></div>
|
||||
<div class="ttc" id="adsu__union__rank_8cpp_html_ae7880ce913f3058a35ff106d5be9e243"><div class="ttname"><a href="../../df/d28/dsu__union__rank_8cpp.html#ae7880ce913f3058a35ff106d5be9e243">test1</a></div><div class="ttdeci">static void test1()</div><div class="ttdoc">Self-implementations, 1st test.</div><div class="ttdef"><b>Definition:</b> dsu_union_rank.cpp:133</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d28/dsu__union__rank_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="606" height="207"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d28/dsu__union__rank_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="606" height="230"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -195,26 +196,26 @@ Here is the call graph for this function:</div>
|
||||
<p >< number of elements</p>
|
||||
<p >< object of class disjoint sets</p>
|
||||
<p >< performs union operation on 1 and 2</p>
|
||||
<div class="fragment"><div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> {</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="comment">/* checks the parents in the resultant structures */</span></div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> uint64_t n = 10; <span class="comment">///< number of elements</span></div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <a class="code hl_class" href="../../dd/d1f/classdsu.html">dsu</a> d(n + 1); <span class="comment">///< object of class disjoint sets</span></div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> d.unionSet(2, 1); <span class="comment">///< performs union operation on 1 and 2</span></div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> d.unionSet(1, 4);</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> d.unionSet(8, 1);</div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> d.unionSet(3, 5);</div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> d.unionSet(5, 6);</div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> d.unionSet(5, 7);</div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> d.unionSet(9, 10);</div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> d.unionSet(2, 10);</div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <span class="comment">// keeping track of the changes using parent pointers</span></div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<uint64_t></a> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a> = {7, 5};</div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>.size(); i++) {</div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> assert(d.getParents(7).at(i) ==</div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>[i]); <span class="comment">// makes sure algorithm works fine</span></div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> }</div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">cout</a> << <span class="stringliteral">"1st test passed!"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 133</span> {</div>
|
||||
<div class="line"><span class="lineno"> 134</span> <span class="comment">/* checks the parents in the resultant structures */</span></div>
|
||||
<div class="line"><span class="lineno"> 135</span> uint64_t n = 10; <span class="comment">///< number of elements</span></div>
|
||||
<div class="line"><span class="lineno"> 136</span> <a class="code hl_class" href="../../dd/d1f/classdsu.html">dsu</a> d(n + 1); <span class="comment">///< object of class disjoint sets</span></div>
|
||||
<div class="line"><span class="lineno"> 137</span> d.unionSet(2, 1); <span class="comment">///< performs union operation on 1 and 2</span></div>
|
||||
<div class="line"><span class="lineno"> 138</span> d.unionSet(1, 4);</div>
|
||||
<div class="line"><span class="lineno"> 139</span> d.unionSet(8, 1);</div>
|
||||
<div class="line"><span class="lineno"> 140</span> d.unionSet(3, 5);</div>
|
||||
<div class="line"><span class="lineno"> 141</span> d.unionSet(5, 6);</div>
|
||||
<div class="line"><span class="lineno"> 142</span> d.unionSet(5, 7);</div>
|
||||
<div class="line"><span class="lineno"> 143</span> d.unionSet(9, 10);</div>
|
||||
<div class="line"><span class="lineno"> 144</span> d.unionSet(2, 10);</div>
|
||||
<div class="line"><span class="lineno"> 145</span> <span class="comment">// keeping track of the changes using parent pointers</span></div>
|
||||
<div class="line"><span class="lineno"> 146</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<uint64_t></a> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a> = {7, 5};</div>
|
||||
<div class="line"><span class="lineno"> 147</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>.size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 148</span> assert(d.getParents(7).at(i) ==</div>
|
||||
<div class="line"><span class="lineno"> 149</span> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>[i]); <span class="comment">// makes sure algorithm works fine</span></div>
|
||||
<div class="line"><span class="lineno"> 150</span> }</div>
|
||||
<div class="line"><span class="lineno"> 151</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">cout</a> << <span class="stringliteral">"1st test passed!"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 152</span>}</div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="aclassdsu_html"><div class="ttname"><a href="../../dd/d1f/classdsu.html">dsu</a></div><div class="ttdoc">Disjoint sets union data structure, class based representation.</div><div class="ttdef"><b>Definition:</b> dsu_path_compression.cpp:33</div></div>
|
||||
<div class="ttc" id="amatrix__exponentiation_8cpp_html_a600eaf353befc174637855795f12d258"><div class="ttname"><a href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a></div><div class="ttdeci">#define endl</div><div class="ttdef"><b>Definition:</b> matrix_exponentiation.cpp:36</div></div>
|
||||
@@ -223,7 +224,7 @@ Here is the call graph for this function:</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d28/dsu__union__rank_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.svg" width="507" height="190"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d28/dsu__union__rank_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.svg" width="507" height="215"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -259,31 +260,31 @@ Here is the call graph for this function:</div>
|
||||
<p >performs union operation on 1 and 2</p>
|
||||
<p >keeping track of the changes using parent pointers</p>
|
||||
<p >makes sure algorithm works fine</p>
|
||||
<div class="fragment"><div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> {</div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <span class="comment">// checks the parents in the resultant structures</span></div>
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> uint64_t n = 10; <span class="comment">///< number of elements</span></div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <a class="code hl_class" href="../../dd/d1f/classdsu.html">dsu</a> d(n + 1); <span class="comment">///< object of class disjoint sets</span></div>
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> d.unionSet(2, 1); <span class="comment">/// performs union operation on 1 and 2</span></div>
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> d.unionSet(1, 4);</div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> d.unionSet(8, 1);</div>
|
||||
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> d.unionSet(3, 5);</div>
|
||||
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> d.unionSet(5, 6);</div>
|
||||
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> d.unionSet(5, 7);</div>
|
||||
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> d.unionSet(9, 10);</div>
|
||||
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> d.unionSet(2, 10);</div>
|
||||
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span><span class="comment"> /// keeping track of the changes using parent pointers</span></div>
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<uint64_t></a> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a> = {2, 1, 10};</div>
|
||||
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>.size(); i++) {</div>
|
||||
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> assert(d.getParents(2).at(i) ==</div>
|
||||
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>[i]); <span class="comment">/// makes sure algorithm works fine</span></div>
|
||||
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> }</div>
|
||||
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">cout</a> << <span class="stringliteral">"2nd test passed!"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 157</span> {</div>
|
||||
<div class="line"><span class="lineno"> 158</span> <span class="comment">// checks the parents in the resultant structures</span></div>
|
||||
<div class="line"><span class="lineno"> 159</span> uint64_t n = 10; <span class="comment">///< number of elements</span></div>
|
||||
<div class="line"><span class="lineno"> 160</span> <a class="code hl_class" href="../../dd/d1f/classdsu.html">dsu</a> d(n + 1); <span class="comment">///< object of class disjoint sets</span></div>
|
||||
<div class="line"><span class="lineno"> 161</span> d.unionSet(2, 1); <span class="comment">/// performs union operation on 1 and 2</span></div>
|
||||
<div class="line"><span class="lineno"> 162</span> d.unionSet(1, 4);</div>
|
||||
<div class="line"><span class="lineno"> 163</span> d.unionSet(8, 1);</div>
|
||||
<div class="line"><span class="lineno"> 164</span> d.unionSet(3, 5);</div>
|
||||
<div class="line"><span class="lineno"> 165</span> d.unionSet(5, 6);</div>
|
||||
<div class="line"><span class="lineno"> 166</span> d.unionSet(5, 7);</div>
|
||||
<div class="line"><span class="lineno"> 167</span> d.unionSet(9, 10);</div>
|
||||
<div class="line"><span class="lineno"> 168</span> d.unionSet(2, 10);</div>
|
||||
<div class="line"><span class="lineno"> 169</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 170</span><span class="comment"> /// keeping track of the changes using parent pointers</span></div>
|
||||
<div class="line"><span class="lineno"> 171</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<uint64_t></a> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a> = {2, 1, 10};</div>
|
||||
<div class="line"><span class="lineno"> 172</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>.size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 173</span> assert(d.getParents(2).at(i) ==</div>
|
||||
<div class="line"><span class="lineno"> 174</span> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>[i]); <span class="comment">/// makes sure algorithm works fine</span></div>
|
||||
<div class="line"><span class="lineno"> 175</span> }</div>
|
||||
<div class="line"><span class="lineno"> 176</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">cout</a> << <span class="stringliteral">"2nd test passed!"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 177</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d28/dsu__union__rank_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.svg" width="507" height="190"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d28/dsu__union__rank_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.svg" width="507" height="215"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -295,7 +296,7 @@ Here is the call graph for this function:</div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html">data_structures</a></li><li class="navelem"><a class="el" href="../../df/d28/dsu__union__rank_8cpp.html">dsu_union_rank.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<map id="test2" name="test2">
|
||||
<area shape="rect" id="node1" title="Self-implementations, 2nd test." alt="" coords="5,56,56,83"/>
|
||||
<area shape="rect" id="node2" href="$d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa" title=" " alt="" coords="293,5,335,32"/>
|
||||
<area shape="rect" id="node3" href="$dd/d1f/classdsu.html#ab8ee27083a3c2e2df80755165a2ec280" title="Method to print all the parents of i, or the path from i to representative." alt="" coords="104,56,219,83"/>
|
||||
<area shape="rect" id="node4" href="$dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f" title="Method that combines two disjoint sets to which i and j belongs to and make a single set having a com..." alt="" coords="110,107,213,133"/>
|
||||
<area shape="rect" id="node5" href="$dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" title="Method to find the representative of the set to which i belongs to, T(n) = O(1)" alt="" coords="409,81,501,108"/>
|
||||
<area shape="rect" id="node6" href="$dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303" title="A utility function which check whether i and j belongs to same set or not." alt="" coords="267,107,361,133"/>
|
||||
<area shape="rect" id="node7" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap.html#" title=" " alt="" coords="275,157,353,184"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/at#" title=" " alt="" coords="110,31,213,57"/>
|
||||
<area shape="rect" id="node4" href="$dd/d1f/classdsu.html#ab8ee27083a3c2e2df80755165a2ec280" title="Method to print all the parents of i, or the path from i to representative." alt="" coords="104,81,219,108"/>
|
||||
<area shape="rect" id="node5" href="$dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f" title="Method that combines two disjoint sets to which i and j belongs to and make a single set having a com..." alt="" coords="110,132,213,159"/>
|
||||
<area shape="rect" id="node6" href="$dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" title="Method to find the representative of the set to which i belongs to, T(n) = O(1)" alt="" coords="409,107,501,133"/>
|
||||
<area shape="rect" id="node7" href="$dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303" title="A utility function which check whether i and j belongs to same set or not." alt="" coords="267,132,361,159"/>
|
||||
<area shape="rect" id="node8" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap#" title=" " alt="" coords="275,183,353,209"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
413d5a9409029480fc4dd4ab917bdc62
|
||||
f85736719e3ae4a6bade539aa923067d
|
||||
@@ -4,17 +4,17 @@
|
||||
<!-- Generated by graphviz version 2.50.0 (20211204.2007)
|
||||
-->
|
||||
<!-- Title: test2 Pages: 1 -->
|
||||
<svg width="380pt" height="142pt"
|
||||
viewBox="0.00 0.00 380.00 142.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 138)">
|
||||
<svg width="380pt" height="161pt"
|
||||
viewBox="0.00 0.00 380.00 161.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 157)">
|
||||
<title>test2</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-138 376,-138 376,4 -4,4"/>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-157 376,-157 376,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Self-implementations, 2nd test.">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-76.5 0,-95.5 38,-95.5 38,-76.5 0,-76.5"/>
|
||||
<text text-anchor="middle" x="19" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">test2</text>
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-95.5 0,-114.5 38,-114.5 38,-95.5 0,-95.5"/>
|
||||
<text text-anchor="middle" x="19" y="-102.5" font-family="Helvetica,sans-Serif" font-size="10.00">test2</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -22,107 +22,122 @@
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a xlink:href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="215.5,-114.5 215.5,-133.5 247.5,-133.5 247.5,-114.5 215.5,-114.5"/>
|
||||
<text text-anchor="middle" x="231.5" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">ans</text>
|
||||
<polygon fill="white" stroke="black" points="215.5,-133.5 215.5,-152.5 247.5,-152.5 247.5,-133.5 215.5,-133.5"/>
|
||||
<text text-anchor="middle" x="231.5" y="-140.5" font-family="Helvetica,sans-Serif" font-size="10.00">ans</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.2,-93.52C48.53,-97.5 61.81,-102.15 74,-105 119.54,-115.64 174,-120.54 205.19,-122.62"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="205,-126.12 215.2,-123.25 205.44,-119.13 205,-126.12"/>
|
||||
<path fill="none" stroke="midnightblue" d="M29.71,-114.69C39.79,-124 56.51,-137.46 74,-143 118.49,-157.08 173.72,-152.27 205.26,-147.58"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="206.05,-150.99 215.37,-145.95 204.94,-144.08 206.05,-150.99"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a xlink:href="../../dd/d1f/classdsu.html#ab8ee27083a3c2e2df80755165a2ec280" target="_top" xlink:title="Method to print all the parents of i, or the path from i to representative.">
|
||||
<polygon fill="white" stroke="black" points="74,-76.5 74,-95.5 160,-95.5 160,-76.5 74,-76.5"/>
|
||||
<text text-anchor="middle" x="117" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::getParents</text>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/at#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="78.5,-114.5 78.5,-133.5 155.5,-133.5 155.5,-114.5 78.5,-114.5"/>
|
||||
<text text-anchor="middle" x="117" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::at</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.06,-86C45.48,-86 54.48,-86 63.7,-86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="63.73,-89.5 73.73,-86 63.73,-82.5 63.73,-89.5"/>
|
||||
<path fill="none" stroke="midnightblue" d="M38.06,-108.57C46.71,-110.29 57.52,-112.42 68.3,-114.56"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="67.66,-118 78.14,-116.51 69.01,-111.13 67.66,-118"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a xlink:href="../../dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f" target="_top" xlink:title="Method that combines two disjoint sets to which i and j belongs to and make a single set having a com...">
|
||||
<g id="a_node4"><a xlink:href="../../dd/d1f/classdsu.html#ab8ee27083a3c2e2df80755165a2ec280" target="_top" xlink:title="Method to print all the parents of i, or the path from i to representative.">
|
||||
<polygon fill="white" stroke="black" points="74,-76.5 74,-95.5 160,-95.5 160,-76.5 74,-76.5"/>
|
||||
<text text-anchor="middle" x="117" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::getParents</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.06,-101.43C45.48,-99.96 54.48,-98.18 63.7,-96.35"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="64.6,-99.74 73.73,-94.37 63.24,-92.87 64.6,-99.74"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a xlink:href="../../dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f" target="_top" xlink:title="Method that combines two disjoint sets to which i and j belongs to and make a single set having a com...">
|
||||
<polygon fill="white" stroke="black" points="78.5,-38.5 78.5,-57.5 155.5,-57.5 155.5,-38.5 78.5,-38.5"/>
|
||||
<text text-anchor="middle" x="117" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::unionSet</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<!-- Node1->Node5 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M32.43,-95.24C43.1,-87.11 59.07,-75.53 74,-67 77.01,-65.28 80.2,-63.6 83.43,-61.99"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="84.97,-65.14 92.5,-57.69 81.97,-58.81 84.97,-65.14"/>
|
||||
</g>
|
||||
<!-- Node4->Node2 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.06,-78.85C50.53,-73.91 67.5,-67.2 82.42,-61.29"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="83.85,-64.49 91.86,-57.56 81.27,-57.98 83.85,-64.49"/>
|
||||
<title>Node4->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M139.93,-95.58C146.44,-98.51 153.54,-101.8 160,-105 175.54,-112.69 192.68,-121.91 206.16,-129.34"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="204.81,-132.6 215.26,-134.39 208.21,-126.48 204.81,-132.6"/>
|
||||
</g>
|
||||
<!-- Node3->Node2 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node3->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M146.39,-95.59C164.67,-101.76 188.21,-109.71 205.73,-115.63"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="204.68,-118.97 215.27,-118.86 206.92,-112.34 204.68,-118.97"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a xlink:href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" target="_top" xlink:title="Method to find the representative of the set to which i belongs to, T(n) = O(1)">
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a xlink:href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" target="_top" xlink:title="Method to find the representative of the set to which i belongs to, T(n) = O(1)">
|
||||
<polygon fill="white" stroke="black" points="303,-57.5 303,-76.5 372,-76.5 372,-57.5 303,-57.5"/>
|
||||
<text text-anchor="middle" x="337.5" y="-64.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::findSet</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node5 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>Node4->Node5</title>
|
||||
<!-- Node5->Node6 -->
|
||||
<g id="edge6" class="edge">
|
||||
<title>Node5->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M149.56,-57.51C163.63,-61.27 180.5,-65.14 196,-67 228.21,-70.87 264.88,-70.72 292.68,-69.68"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="293.03,-73.17 302.87,-69.24 292.73,-66.17 293.03,-73.17"/>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a xlink:href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303" target="_top" xlink:title="A utility function which check whether i and j belongs to same set or not.">
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a xlink:href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303" target="_top" xlink:title="A utility function which check whether i and j belongs to same set or not.">
|
||||
<polygon fill="white" stroke="black" points="196,-38.5 196,-57.5 267,-57.5 267,-38.5 196,-38.5"/>
|
||||
<text text-anchor="middle" x="231.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::isSame</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node6 -->
|
||||
<g id="edge7" class="edge">
|
||||
<title>Node4->Node6</title>
|
||||
<!-- Node5->Node7 -->
|
||||
<g id="edge8" class="edge">
|
||||
<title>Node5->Node7</title>
|
||||
<path fill="none" stroke="midnightblue" d="M155.77,-48C165.34,-48 175.72,-48 185.6,-48"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="185.67,-51.5 195.67,-48 185.67,-44.5 185.67,-51.5"/>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
|
||||
<!-- Node8 -->
|
||||
<g id="node8" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_node8"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="202,-0.5 202,-19.5 261,-19.5 261,-0.5 202,-0.5"/>
|
||||
<text text-anchor="middle" x="231.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node7 -->
|
||||
<g id="edge9" class="edge">
|
||||
<title>Node4->Node7</title>
|
||||
<!-- Node5->Node8 -->
|
||||
<g id="edge10" class="edge">
|
||||
<title>Node5->Node8</title>
|
||||
<path fill="none" stroke="midnightblue" d="M146.39,-38.41C160.38,-33.69 177.44,-27.92 192.54,-22.82"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="193.77,-26.1 202.12,-19.59 191.53,-19.47 193.77,-26.1"/>
|
||||
</g>
|
||||
<!-- Node5->Node5 -->
|
||||
<g id="edge6" class="edge">
|
||||
<title>Node5->Node5</title>
|
||||
<!-- Node6->Node6 -->
|
||||
<g id="edge7" class="edge">
|
||||
<title>Node6->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M321.16,-76.76C313.21,-85.57 318.66,-95 337.5,-95 349.27,-95 355.82,-91.31 357.13,-86.4"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="360.38,-85.09 353.84,-76.76 353.76,-87.35 360.38,-85.09"/>
|
||||
</g>
|
||||
<!-- Node6->Node5 -->
|
||||
<g id="edge8" class="edge">
|
||||
<title>Node6->Node5</title>
|
||||
<!-- Node7->Node6 -->
|
||||
<g id="edge9" class="edge">
|
||||
<title>Node7->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M267.13,-54.33C275.37,-55.83 284.27,-57.46 292.85,-59.03"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="292.26,-62.48 302.73,-60.83 293.52,-55.59 292.26,-62.48"/>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 7.4 KiB |
@@ -1,11 +1,12 @@
|
||||
<map id="main" name="main">
|
||||
<area shape="rect" id="node1" title="Main function." alt="" coords="5,49,56,75"/>
|
||||
<area shape="rect" id="node2" href="$df/d28/dsu__union__rank_8cpp.html#ae7880ce913f3058a35ff106d5be9e243" title="Self-implementations, 1st test." alt="" coords="104,74,155,101"/>
|
||||
<area shape="rect" id="node9" href="$df/d28/dsu__union__rank_8cpp.html#a45d94ead4cf4e1ff9f87c38bc99f59ae" title="Self-implementations, 2nd test." alt="" coords="104,23,155,50"/>
|
||||
<area shape="rect" id="node3" href="$d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa" title=" " alt="" coords="391,23,434,50"/>
|
||||
<area shape="rect" id="node4" href="$dd/d1f/classdsu.html#ab8ee27083a3c2e2df80755165a2ec280" title="Method to print all the parents of i, or the path from i to representative." alt="" coords="203,23,317,50"/>
|
||||
<area shape="rect" id="node5" href="$dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f" title="Method that combines two disjoint sets to which i and j belongs to and make a single set having a com..." alt="" coords="209,125,311,151"/>
|
||||
<area shape="rect" id="node6" href="$dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" title="Method to find the representative of the set to which i belongs to, T(n) = O(1)" alt="" coords="508,99,600,126"/>
|
||||
<area shape="rect" id="node7" href="$dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303" title="A utility function which check whether i and j belongs to same set or not." alt="" coords="365,125,460,151"/>
|
||||
<area shape="rect" id="node8" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap.html#" title=" " alt="" coords="373,175,452,202"/>
|
||||
<area shape="rect" id="node1" title="Main function." alt="" coords="5,80,56,107"/>
|
||||
<area shape="rect" id="node2" href="$df/d28/dsu__union__rank_8cpp.html#ae7880ce913f3058a35ff106d5be9e243" title="Self-implementations, 1st test." alt="" coords="104,55,155,82"/>
|
||||
<area shape="rect" id="node10" href="$df/d28/dsu__union__rank_8cpp.html#a45d94ead4cf4e1ff9f87c38bc99f59ae" title="Self-implementations, 2nd test." alt="" coords="104,106,155,132"/>
|
||||
<area shape="rect" id="node3" href="$d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa" title=" " alt="" coords="391,80,434,107"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/at#" title=" " alt="" coords="209,30,311,56"/>
|
||||
<area shape="rect" id="node5" href="$dd/d1f/classdsu.html#ab8ee27083a3c2e2df80755165a2ec280" title="Method to print all the parents of i, or the path from i to representative." alt="" coords="203,80,317,107"/>
|
||||
<area shape="rect" id="node6" href="$dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f" title="Method that combines two disjoint sets to which i and j belongs to and make a single set having a com..." alt="" coords="209,182,311,208"/>
|
||||
<area shape="rect" id="node7" href="$dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" title="Method to find the representative of the set to which i belongs to, T(n) = O(1)" alt="" coords="508,182,600,208"/>
|
||||
<area shape="rect" id="node8" href="$dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303" title="A utility function which check whether i and j belongs to same set or not." alt="" coords="365,131,460,158"/>
|
||||
<area shape="rect" id="node9" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap#" title=" " alt="" coords="373,182,452,208"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
0a7e08d906379ef71155e6daf0c91734
|
||||
e3aee52fd339986d2cd0b76907479406
|
||||
@@ -4,17 +4,17 @@
|
||||
<!-- Generated by graphviz version 2.50.0 (20211204.2007)
|
||||
-->
|
||||
<!-- Title: main Pages: 1 -->
|
||||
<svg width="454pt" height="155pt"
|
||||
viewBox="0.00 0.00 454.00 155.47" 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 151.47)">
|
||||
<svg width="454pt" height="172pt"
|
||||
viewBox="0.00 0.00 454.00 172.22" 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 168.22)">
|
||||
<title>main</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-151.47 450,-151.47 450,4 -4,4"/>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-168.22 450,-168.22 450,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Main function.">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-95.5 0,-114.5 38,-114.5 38,-95.5 0,-95.5"/>
|
||||
<text text-anchor="middle" x="19" y="-102.5" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-88.54 0,-107.54 38,-107.54 38,-88.54 0,-88.54"/>
|
||||
<text text-anchor="middle" x="19" y="-95.54" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -22,157 +22,178 @@
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a xlink:href="../../df/d28/dsu__union__rank_8cpp.html#ae7880ce913f3058a35ff106d5be9e243" target="_top" xlink:title="Self-implementations, 1st test.">
|
||||
<polygon fill="white" stroke="black" points="74,-76.5 74,-95.5 112,-95.5 112,-76.5 74,-76.5"/>
|
||||
<text text-anchor="middle" x="93" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">test1</text>
|
||||
<polygon fill="white" stroke="black" points="74,-107.54 74,-126.54 112,-126.54 112,-107.54 74,-107.54"/>
|
||||
<text text-anchor="middle" x="93" y="-114.54" font-family="Helvetica,sans-Serif" font-size="10.00">test1</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.17,-100.21C45.95,-98.15 55.23,-95.7 63.87,-93.42"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="64.81,-96.79 73.59,-90.86 63.02,-90.03 64.81,-96.79"/>
|
||||
<path fill="none" stroke="midnightblue" d="M38.17,-102.83C45.95,-104.89 55.23,-107.34 63.87,-109.61"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="63.02,-113.01 73.59,-112.18 64.81,-106.24 63.02,-113.01"/>
|
||||
</g>
|
||||
<!-- Node9 -->
|
||||
<g id="node9" class="node">
|
||||
<title>Node9</title>
|
||||
<g id="a_node9"><a xlink:href="../../df/d28/dsu__union__rank_8cpp.html#a45d94ead4cf4e1ff9f87c38bc99f59ae" target="_top" xlink:title="Self-implementations, 2nd test.">
|
||||
<polygon fill="white" stroke="black" points="74,-114.5 74,-133.5 112,-133.5 112,-114.5 74,-114.5"/>
|
||||
<text text-anchor="middle" x="93" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">test2</text>
|
||||
<!-- Node10 -->
|
||||
<g id="node10" class="node">
|
||||
<title>Node10</title>
|
||||
<g id="a_node10"><a xlink:href="../../df/d28/dsu__union__rank_8cpp.html#a45d94ead4cf4e1ff9f87c38bc99f59ae" target="_top" xlink:title="Self-implementations, 2nd test.">
|
||||
<polygon fill="white" stroke="black" points="74,-69.54 74,-88.54 112,-88.54 112,-69.54 74,-69.54"/>
|
||||
<text text-anchor="middle" x="93" y="-76.54" font-family="Helvetica,sans-Serif" font-size="10.00">test2</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node9 -->
|
||||
<g id="edge11" class="edge">
|
||||
<title>Node1->Node9</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.17,-109.79C45.95,-111.85 55.23,-114.3 63.87,-116.58"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="63.02,-119.97 73.59,-119.14 64.81,-113.21 63.02,-119.97"/>
|
||||
<!-- Node1->Node10 -->
|
||||
<g id="edge12" class="edge">
|
||||
<title>Node1->Node10</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.17,-93.24C45.95,-91.19 55.23,-88.74 63.87,-86.46"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="64.81,-89.83 73.59,-83.9 63.02,-83.07 64.81,-89.83"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a xlink:href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="289.5,-114.5 289.5,-133.5 321.5,-133.5 321.5,-114.5 289.5,-114.5"/>
|
||||
<text text-anchor="middle" x="305.5" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">ans</text>
|
||||
<polygon fill="white" stroke="black" points="289.5,-88.54 289.5,-107.54 321.5,-107.54 321.5,-88.54 289.5,-88.54"/>
|
||||
<text text-anchor="middle" x="305.5" y="-95.54" font-family="Helvetica,sans-Serif" font-size="10.00">ans</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M112.25,-87.72C139.09,-90.42 190.72,-96.27 234,-105 249.2,-108.07 265.97,-112.54 279.33,-116.38"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="278.65,-119.82 289.23,-119.28 280.62,-113.1 278.65,-119.82"/>
|
||||
<path fill="none" stroke="midnightblue" d="M103.71,-126.73C113.79,-136.04 130.51,-149.5 148,-155.04 184.44,-166.58 197.97,-167.78 234,-155.04 256.33,-147.14 276.76,-128.84 289.82,-115.09"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="292.46,-117.38 296.61,-107.63 287.29,-112.67 292.46,-117.38"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a xlink:href="../../dd/d1f/classdsu.html#ab8ee27083a3c2e2df80755165a2ec280" target="_top" xlink:title="Method to print all the parents of i, or the path from i to representative.">
|
||||
<polygon fill="white" stroke="black" points="148,-114.5 148,-133.5 234,-133.5 234,-114.5 148,-114.5"/>
|
||||
<text text-anchor="middle" x="191" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::getParents</text>
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/at#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="152.5,-126.54 152.5,-145.54 229.5,-145.54 229.5,-126.54 152.5,-126.54"/>
|
||||
<text text-anchor="middle" x="191" y="-133.54" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::at</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node2->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M112.06,-93.15C124.53,-98.09 141.5,-104.8 156.42,-110.71"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="155.27,-114.02 165.86,-114.44 157.85,-107.51 155.27,-114.02"/>
|
||||
<path fill="none" stroke="midnightblue" d="M112.06,-120.61C120.71,-122.32 131.52,-124.46 142.3,-126.6"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="141.66,-130.04 152.14,-128.55 143.01,-123.17 141.66,-130.04"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a xlink:href="../../dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f" target="_top" xlink:title="Method that combines two disjoint sets to which i and j belongs to and make a single set having a com...">
|
||||
<polygon fill="white" stroke="black" points="152.5,-38.5 152.5,-57.5 229.5,-57.5 229.5,-38.5 152.5,-38.5"/>
|
||||
<text text-anchor="middle" x="191" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::unionSet</text>
|
||||
<g id="a_node5"><a xlink:href="../../dd/d1f/classdsu.html#ab8ee27083a3c2e2df80755165a2ec280" target="_top" xlink:title="Method to print all the parents of i, or the path from i to representative.">
|
||||
<polygon fill="white" stroke="black" points="148,-88.54 148,-107.54 234,-107.54 234,-88.54 148,-88.54"/>
|
||||
<text text-anchor="middle" x="191" y="-95.54" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::getParents</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node5 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>Node2->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M112.06,-78.85C124.53,-73.91 141.5,-67.2 156.42,-61.29"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="157.85,-64.49 165.86,-57.56 155.27,-57.98 157.85,-64.49"/>
|
||||
</g>
|
||||
<!-- Node4->Node3 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>Node4->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M234.21,-124C249.31,-124 265.85,-124 279.09,-124"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="279.34,-127.5 289.34,-124 279.34,-120.5 279.34,-127.5"/>
|
||||
<title>Node2->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M112.06,-113.47C119.48,-112 128.48,-110.21 137.7,-108.39"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="138.6,-111.78 147.73,-106.41 137.24,-104.91 138.6,-111.78"/>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a xlink:href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" target="_top" xlink:title="Method to find the representative of the set to which i belongs to, T(n) = O(1)">
|
||||
<polygon fill="white" stroke="black" points="377,-57.5 377,-76.5 446,-76.5 446,-57.5 377,-57.5"/>
|
||||
<text text-anchor="middle" x="411.5" y="-64.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::findSet</text>
|
||||
<g id="a_node6"><a xlink:href="../../dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f" target="_top" xlink:title="Method that combines two disjoint sets to which i and j belongs to and make a single set having a com...">
|
||||
<polygon fill="white" stroke="black" points="152.5,-12.54 152.5,-31.54 229.5,-31.54 229.5,-12.54 152.5,-12.54"/>
|
||||
<text text-anchor="middle" x="191" y="-19.54" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::unionSet</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node6 -->
|
||||
<!-- Node2->Node6 -->
|
||||
<g id="edge6" class="edge">
|
||||
<title>Node5->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M223.56,-57.51C237.63,-61.27 254.5,-65.14 270,-67 302.21,-70.87 338.88,-70.72 366.68,-69.68"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="367.03,-73.17 376.87,-69.24 366.73,-66.17 367.03,-73.17"/>
|
||||
<title>Node2->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M103.91,-107.23C120.24,-91.08 152.97,-58.69 173.03,-38.83"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="175.64,-41.18 180.28,-31.65 170.71,-36.2 175.64,-41.18"/>
|
||||
</g>
|
||||
<!-- Node5->Node3 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>Node5->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M234.21,-98.04C249.31,-98.04 265.85,-98.04 279.09,-98.04"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="279.34,-101.54 289.34,-98.04 279.34,-94.54 279.34,-101.54"/>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a xlink:href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303" target="_top" xlink:title="A utility function which check whether i and j belongs to same set or not.">
|
||||
<polygon fill="white" stroke="black" points="270,-38.5 270,-57.5 341,-57.5 341,-38.5 270,-38.5"/>
|
||||
<text text-anchor="middle" x="305.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::isSame</text>
|
||||
<g id="a_node7"><a xlink:href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" target="_top" xlink:title="Method to find the representative of the set to which i belongs to, T(n) = O(1)">
|
||||
<polygon fill="white" stroke="black" points="377,-12.54 377,-31.54 446,-31.54 446,-12.54 377,-12.54"/>
|
||||
<text text-anchor="middle" x="411.5" y="-19.54" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::findSet</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node7 -->
|
||||
<g id="edge8" class="edge">
|
||||
<title>Node5->Node7</title>
|
||||
<path fill="none" stroke="midnightblue" d="M229.77,-48C239.34,-48 249.72,-48 259.6,-48"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="259.67,-51.5 269.67,-48 259.67,-44.5 259.67,-51.5"/>
|
||||
<!-- Node6->Node7 -->
|
||||
<g id="edge7" class="edge">
|
||||
<title>Node6->Node7</title>
|
||||
<path fill="none" stroke="midnightblue" d="M223.56,-12.53C237.63,-8.77 254.5,-4.9 270,-3.04 301.33,0.72 309.72,1.16 341,-3.04 351.41,-4.44 362.48,-6.96 372.64,-9.73"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="371.87,-13.15 382.45,-12.54 373.8,-6.42 371.87,-13.15"/>
|
||||
</g>
|
||||
<!-- Node8 -->
|
||||
<g id="node8" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_node8"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="276,-0.5 276,-19.5 335,-19.5 335,-0.5 276,-0.5"/>
|
||||
<text text-anchor="middle" x="305.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
|
||||
<g id="a_node8"><a xlink:href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303" target="_top" xlink:title="A utility function which check whether i and j belongs to same set or not.">
|
||||
<polygon fill="white" stroke="black" points="270,-50.54 270,-69.54 341,-69.54 341,-50.54 270,-50.54"/>
|
||||
<text text-anchor="middle" x="305.5" y="-57.54" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::isSame</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node8 -->
|
||||
<g id="edge10" class="edge">
|
||||
<title>Node5->Node8</title>
|
||||
<path fill="none" stroke="midnightblue" d="M220.39,-38.41C234.38,-33.69 251.44,-27.92 266.54,-22.82"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="267.77,-26.1 276.12,-19.59 265.53,-19.47 267.77,-26.1"/>
|
||||
</g>
|
||||
<!-- Node6->Node6 -->
|
||||
<g id="edge7" class="edge">
|
||||
<title>Node6->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M395.16,-76.76C387.21,-85.57 392.66,-95 411.5,-95 423.27,-95 429.82,-91.31 431.13,-86.4"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="434.38,-85.09 427.84,-76.76 427.76,-87.35 434.38,-85.09"/>
|
||||
</g>
|
||||
<!-- Node7->Node6 -->
|
||||
<!-- Node6->Node8 -->
|
||||
<g id="edge9" class="edge">
|
||||
<title>Node7->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M341.13,-54.33C349.37,-55.83 358.27,-57.46 366.85,-59.03"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="366.26,-62.48 376.73,-60.83 367.52,-55.59 366.26,-62.48"/>
|
||||
<title>Node6->Node8</title>
|
||||
<path fill="none" stroke="midnightblue" d="M220.39,-31.63C234.38,-36.35 251.44,-42.12 266.54,-47.22"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="265.53,-50.57 276.12,-50.45 267.77,-43.94 265.53,-50.57"/>
|
||||
</g>
|
||||
<!-- Node9->Node3 -->
|
||||
<g id="edge12" class="edge">
|
||||
<title>Node9->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M112.08,-132.09C122.38,-136.26 135.66,-140.89 148,-143 185.68,-149.43 196.11,-148.02 234,-143 249.37,-140.97 266.14,-136.54 279.47,-132.47"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="280.86,-135.7 289.33,-129.33 278.74,-129.03 280.86,-135.7"/>
|
||||
<!-- Node9 -->
|
||||
<g id="node9" class="node">
|
||||
<title>Node9</title>
|
||||
<g id="a_node9"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="276,-12.54 276,-31.54 335,-31.54 335,-12.54 276,-12.54"/>
|
||||
<text text-anchor="middle" x="305.5" y="-19.54" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
|
||||
</a>
|
||||
</g>
|
||||
<!-- Node9->Node4 -->
|
||||
</g>
|
||||
<!-- Node6->Node9 -->
|
||||
<g id="edge11" class="edge">
|
||||
<title>Node6->Node9</title>
|
||||
<path fill="none" stroke="midnightblue" d="M229.77,-22.04C241.31,-22.04 254.01,-22.04 265.61,-22.04"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="265.9,-25.54 275.9,-22.04 265.9,-18.54 265.9,-25.54"/>
|
||||
</g>
|
||||
<!-- Node7->Node7 -->
|
||||
<g id="edge8" class="edge">
|
||||
<title>Node7->Node7</title>
|
||||
<path fill="none" stroke="midnightblue" d="M395.16,-31.8C387.21,-40.6 392.66,-50.04 411.5,-50.04 423.27,-50.04 429.82,-46.35 431.13,-41.44"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="434.38,-40.13 427.84,-31.8 427.76,-42.39 434.38,-40.13"/>
|
||||
</g>
|
||||
<!-- Node8->Node7 -->
|
||||
<g id="edge10" class="edge">
|
||||
<title>Node8->Node7</title>
|
||||
<path fill="none" stroke="midnightblue" d="M332.74,-50.45C345.43,-45.81 360.85,-40.18 374.61,-35.15"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="376.07,-38.34 384.26,-31.63 373.67,-31.77 376.07,-38.34"/>
|
||||
</g>
|
||||
<!-- Node10->Node3 -->
|
||||
<g id="edge13" class="edge">
|
||||
<title>Node9->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M112.06,-124C119.48,-124 128.48,-124 137.7,-124"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="137.73,-127.5 147.73,-124 137.73,-120.5 137.73,-127.5"/>
|
||||
<title>Node10->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M112.22,-77.52C139.03,-75.63 190.63,-73.3 234,-79.04 249.37,-81.07 266.14,-85.5 279.47,-89.57"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="278.74,-93.01 289.33,-92.7 280.86,-86.34 278.74,-93.01"/>
|
||||
</g>
|
||||
<!-- Node9->Node5 -->
|
||||
<!-- Node10->Node4 -->
|
||||
<g id="edge14" class="edge">
|
||||
<title>Node9->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M106.16,-114.37C122.24,-101.64 150.81,-79.03 170.07,-63.78"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="172.27,-66.5 177.94,-57.55 167.93,-61.01 172.27,-66.5"/>
|
||||
<title>Node10->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M106.43,-88.8C117.1,-96.93 133.07,-108.51 148,-117.04 151.01,-118.76 154.2,-120.44 157.43,-122.05"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="155.97,-125.23 166.5,-126.35 158.97,-118.9 155.97,-125.23"/>
|
||||
</g>
|
||||
<!-- Node10->Node5 -->
|
||||
<g id="edge15" class="edge">
|
||||
<title>Node10->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M112.06,-82.61C119.48,-84.08 128.48,-85.86 137.7,-87.69"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="137.24,-91.16 147.73,-89.67 138.6,-84.3 137.24,-91.16"/>
|
||||
</g>
|
||||
<!-- Node10->Node6 -->
|
||||
<g id="edge16" class="edge">
|
||||
<title>Node10->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M109.52,-69.39C120.28,-62.74 134.95,-53.75 148,-46.04 153.06,-43.05 158.49,-39.9 163.72,-36.9"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="165.82,-39.73 172.77,-31.73 162.35,-33.65 165.82,-39.73"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 10 KiB |
@@ -1,9 +1,10 @@
|
||||
<map id="test1" name="test1">
|
||||
<area shape="rect" id="node1" title="Self-implementations, 1st test." alt="" coords="5,56,56,83"/>
|
||||
<area shape="rect" id="node2" href="$d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa" title=" " alt="" coords="293,5,335,32"/>
|
||||
<area shape="rect" id="node3" href="$dd/d1f/classdsu.html#ab8ee27083a3c2e2df80755165a2ec280" title="Method to print all the parents of i, or the path from i to representative." alt="" coords="104,56,219,83"/>
|
||||
<area shape="rect" id="node4" href="$dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f" title="Method that combines two disjoint sets to which i and j belongs to and make a single set having a com..." alt="" coords="110,107,213,133"/>
|
||||
<area shape="rect" id="node5" href="$dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" title="Method to find the representative of the set to which i belongs to, T(n) = O(1)" alt="" coords="409,81,501,108"/>
|
||||
<area shape="rect" id="node6" href="$dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303" title="A utility function which check whether i and j belongs to same set or not." alt="" coords="267,107,361,133"/>
|
||||
<area shape="rect" id="node7" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap.html#" title=" " alt="" coords="275,157,353,184"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/at#" title=" " alt="" coords="110,31,213,57"/>
|
||||
<area shape="rect" id="node4" href="$dd/d1f/classdsu.html#ab8ee27083a3c2e2df80755165a2ec280" title="Method to print all the parents of i, or the path from i to representative." alt="" coords="104,81,219,108"/>
|
||||
<area shape="rect" id="node5" href="$dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f" title="Method that combines two disjoint sets to which i and j belongs to and make a single set having a com..." alt="" coords="110,132,213,159"/>
|
||||
<area shape="rect" id="node6" href="$dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" title="Method to find the representative of the set to which i belongs to, T(n) = O(1)" alt="" coords="409,107,501,133"/>
|
||||
<area shape="rect" id="node7" href="$dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303" title="A utility function which check whether i and j belongs to same set or not." alt="" coords="267,132,361,159"/>
|
||||
<area shape="rect" id="node8" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap#" title=" " alt="" coords="275,183,353,209"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
05fd810df88836bd72af8e5abb419c5c
|
||||
713091d4fdbace15593d7142a5580f78
|
||||
@@ -4,17 +4,17 @@
|
||||
<!-- Generated by graphviz version 2.50.0 (20211204.2007)
|
||||
-->
|
||||
<!-- Title: test1 Pages: 1 -->
|
||||
<svg width="380pt" height="142pt"
|
||||
viewBox="0.00 0.00 380.00 142.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 138)">
|
||||
<svg width="380pt" height="161pt"
|
||||
viewBox="0.00 0.00 380.00 161.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 157)">
|
||||
<title>test1</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-138 376,-138 376,4 -4,4"/>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-157 376,-157 376,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Self-implementations, 1st test.">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-76.5 0,-95.5 38,-95.5 38,-76.5 0,-76.5"/>
|
||||
<text text-anchor="middle" x="19" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">test1</text>
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-95.5 0,-114.5 38,-114.5 38,-95.5 0,-95.5"/>
|
||||
<text text-anchor="middle" x="19" y="-102.5" font-family="Helvetica,sans-Serif" font-size="10.00">test1</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -22,107 +22,122 @@
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a xlink:href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="215.5,-114.5 215.5,-133.5 247.5,-133.5 247.5,-114.5 215.5,-114.5"/>
|
||||
<text text-anchor="middle" x="231.5" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">ans</text>
|
||||
<polygon fill="white" stroke="black" points="215.5,-133.5 215.5,-152.5 247.5,-152.5 247.5,-133.5 215.5,-133.5"/>
|
||||
<text text-anchor="middle" x="231.5" y="-140.5" font-family="Helvetica,sans-Serif" font-size="10.00">ans</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.2,-93.52C48.53,-97.5 61.81,-102.15 74,-105 119.54,-115.64 174,-120.54 205.19,-122.62"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="205,-126.12 215.2,-123.25 205.44,-119.13 205,-126.12"/>
|
||||
<path fill="none" stroke="midnightblue" d="M29.71,-114.69C39.79,-124 56.51,-137.46 74,-143 118.49,-157.08 173.72,-152.27 205.26,-147.58"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="206.05,-150.99 215.37,-145.95 204.94,-144.08 206.05,-150.99"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a xlink:href="../../dd/d1f/classdsu.html#ab8ee27083a3c2e2df80755165a2ec280" target="_top" xlink:title="Method to print all the parents of i, or the path from i to representative.">
|
||||
<polygon fill="white" stroke="black" points="74,-76.5 74,-95.5 160,-95.5 160,-76.5 74,-76.5"/>
|
||||
<text text-anchor="middle" x="117" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::getParents</text>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/at#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="78.5,-114.5 78.5,-133.5 155.5,-133.5 155.5,-114.5 78.5,-114.5"/>
|
||||
<text text-anchor="middle" x="117" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::at</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.06,-86C45.48,-86 54.48,-86 63.7,-86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="63.73,-89.5 73.73,-86 63.73,-82.5 63.73,-89.5"/>
|
||||
<path fill="none" stroke="midnightblue" d="M38.06,-108.57C46.71,-110.29 57.52,-112.42 68.3,-114.56"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="67.66,-118 78.14,-116.51 69.01,-111.13 67.66,-118"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a xlink:href="../../dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f" target="_top" xlink:title="Method that combines two disjoint sets to which i and j belongs to and make a single set having a com...">
|
||||
<g id="a_node4"><a xlink:href="../../dd/d1f/classdsu.html#ab8ee27083a3c2e2df80755165a2ec280" target="_top" xlink:title="Method to print all the parents of i, or the path from i to representative.">
|
||||
<polygon fill="white" stroke="black" points="74,-76.5 74,-95.5 160,-95.5 160,-76.5 74,-76.5"/>
|
||||
<text text-anchor="middle" x="117" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::getParents</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.06,-101.43C45.48,-99.96 54.48,-98.18 63.7,-96.35"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="64.6,-99.74 73.73,-94.37 63.24,-92.87 64.6,-99.74"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a xlink:href="../../dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f" target="_top" xlink:title="Method that combines two disjoint sets to which i and j belongs to and make a single set having a com...">
|
||||
<polygon fill="white" stroke="black" points="78.5,-38.5 78.5,-57.5 155.5,-57.5 155.5,-38.5 78.5,-38.5"/>
|
||||
<text text-anchor="middle" x="117" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::unionSet</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<!-- Node1->Node5 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M32.43,-95.24C43.1,-87.11 59.07,-75.53 74,-67 77.01,-65.28 80.2,-63.6 83.43,-61.99"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="84.97,-65.14 92.5,-57.69 81.97,-58.81 84.97,-65.14"/>
|
||||
</g>
|
||||
<!-- Node4->Node2 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.06,-78.85C50.53,-73.91 67.5,-67.2 82.42,-61.29"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="83.85,-64.49 91.86,-57.56 81.27,-57.98 83.85,-64.49"/>
|
||||
<title>Node4->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M139.93,-95.58C146.44,-98.51 153.54,-101.8 160,-105 175.54,-112.69 192.68,-121.91 206.16,-129.34"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="204.81,-132.6 215.26,-134.39 208.21,-126.48 204.81,-132.6"/>
|
||||
</g>
|
||||
<!-- Node3->Node2 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node3->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M146.39,-95.59C164.67,-101.76 188.21,-109.71 205.73,-115.63"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="204.68,-118.97 215.27,-118.86 206.92,-112.34 204.68,-118.97"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a xlink:href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" target="_top" xlink:title="Method to find the representative of the set to which i belongs to, T(n) = O(1)">
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a xlink:href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" target="_top" xlink:title="Method to find the representative of the set to which i belongs to, T(n) = O(1)">
|
||||
<polygon fill="white" stroke="black" points="303,-57.5 303,-76.5 372,-76.5 372,-57.5 303,-57.5"/>
|
||||
<text text-anchor="middle" x="337.5" y="-64.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::findSet</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node5 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>Node4->Node5</title>
|
||||
<!-- Node5->Node6 -->
|
||||
<g id="edge6" class="edge">
|
||||
<title>Node5->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M149.56,-57.51C163.63,-61.27 180.5,-65.14 196,-67 228.21,-70.87 264.88,-70.72 292.68,-69.68"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="293.03,-73.17 302.87,-69.24 292.73,-66.17 293.03,-73.17"/>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a xlink:href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303" target="_top" xlink:title="A utility function which check whether i and j belongs to same set or not.">
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a xlink:href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303" target="_top" xlink:title="A utility function which check whether i and j belongs to same set or not.">
|
||||
<polygon fill="white" stroke="black" points="196,-38.5 196,-57.5 267,-57.5 267,-38.5 196,-38.5"/>
|
||||
<text text-anchor="middle" x="231.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::isSame</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node6 -->
|
||||
<g id="edge7" class="edge">
|
||||
<title>Node4->Node6</title>
|
||||
<!-- Node5->Node7 -->
|
||||
<g id="edge8" class="edge">
|
||||
<title>Node5->Node7</title>
|
||||
<path fill="none" stroke="midnightblue" d="M155.77,-48C165.34,-48 175.72,-48 185.6,-48"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="185.67,-51.5 195.67,-48 185.67,-44.5 185.67,-51.5"/>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
|
||||
<!-- Node8 -->
|
||||
<g id="node8" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_node8"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="202,-0.5 202,-19.5 261,-19.5 261,-0.5 202,-0.5"/>
|
||||
<text text-anchor="middle" x="231.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node7 -->
|
||||
<g id="edge9" class="edge">
|
||||
<title>Node4->Node7</title>
|
||||
<!-- Node5->Node8 -->
|
||||
<g id="edge10" class="edge">
|
||||
<title>Node5->Node8</title>
|
||||
<path fill="none" stroke="midnightblue" d="M146.39,-38.41C160.38,-33.69 177.44,-27.92 192.54,-22.82"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="193.77,-26.1 202.12,-19.59 191.53,-19.47 193.77,-26.1"/>
|
||||
</g>
|
||||
<!-- Node5->Node5 -->
|
||||
<g id="edge6" class="edge">
|
||||
<title>Node5->Node5</title>
|
||||
<!-- Node6->Node6 -->
|
||||
<g id="edge7" class="edge">
|
||||
<title>Node6->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M321.16,-76.76C313.21,-85.57 318.66,-95 337.5,-95 349.27,-95 355.82,-91.31 357.13,-86.4"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="360.38,-85.09 353.84,-76.76 353.76,-87.35 360.38,-85.09"/>
|
||||
</g>
|
||||
<!-- Node6->Node5 -->
|
||||
<g id="edge8" class="edge">
|
||||
<title>Node6->Node5</title>
|
||||
<!-- Node7->Node6 -->
|
||||
<g id="edge9" class="edge">
|
||||
<title>Node7->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M267.13,-54.33C275.37,-55.83 284.27,-57.46 292.85,-59.03"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="292.26,-62.48 302.73,-60.83 293.52,-55.59 292.26,-62.48"/>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 7.4 KiB |
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.2"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: ciphers/elliptic_curve_key_exchange.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.2 -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
@@ -178,12 +178,12 @@ Functions</h2></td></tr>
|
||||
|
||||
<p>Main function. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00320" name="l00320"></a><span class="lineno"> 320</span> {</div>
|
||||
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span> <a class="code hl_function" href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#a8800c8a84d77dadadb05ad5e83b77ef4">uint128_t_tests</a>(); <span class="comment">// running predefined 128-bit unsigned integer tests</span></div>
|
||||
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span> <a class="code hl_function" href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#a37775d1724ffe404c088dabbc8da91ae">uint256_t_tests</a>(); <span class="comment">// running predefined 256-bit unsigned integer tests</span></div>
|
||||
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno"> 323</span> <a class="code hl_function" href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// running self-test implementations</span></div>
|
||||
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno"> 324</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno"> 325</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 320</span> {</div>
|
||||
<div class="line"><span class="lineno"> 321</span> <a class="code hl_function" href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#a8800c8a84d77dadadb05ad5e83b77ef4">uint128_t_tests</a>(); <span class="comment">// running predefined 128-bit unsigned integer tests</span></div>
|
||||
<div class="line"><span class="lineno"> 322</span> <a class="code hl_function" href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#a37775d1724ffe404c088dabbc8da91ae">uint256_t_tests</a>(); <span class="comment">// running predefined 256-bit unsigned integer tests</span></div>
|
||||
<div class="line"><span class="lineno"> 323</span> <a class="code hl_function" href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// running self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 324</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 325</span>}</div>
|
||||
<div class="ttc" id="aelliptic__curve__key__exchange_8cpp_html_a37775d1724ffe404c088dabbc8da91ae"><div class="ttname"><a href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#a37775d1724ffe404c088dabbc8da91ae">uint256_t_tests</a></div><div class="ttdeci">static void uint256_t_tests()</div><div class="ttdoc">Function to test the uint256_t header.</div><div class="ttdef"><b>Definition:</b> elliptic_curve_key_exchange.cpp:230</div></div>
|
||||
<div class="ttc" id="aelliptic__curve__key__exchange_8cpp_html_a8800c8a84d77dadadb05ad5e83b77ef4"><div class="ttname"><a href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#a8800c8a84d77dadadb05ad5e83b77ef4">uint128_t_tests</a></div><div class="ttdeci">static void uint128_t_tests()</div><div class="ttdoc">Function to test the uint128_t header.</div><div class="ttdef"><b>Definition:</b> elliptic_curve_key_exchange.cpp:197</div></div>
|
||||
<div class="ttc" id="aelliptic__curve__key__exchange_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Function to test the provided algorithm above.</div><div class="ttdef"><b>Definition:</b> elliptic_curve_key_exchange.cpp:267</div></div>
|
||||
@@ -221,54 +221,54 @@ 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"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span> {</div>
|
||||
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> <span class="comment">// demonstration of key exchange using curve secp112r1</span></div>
|
||||
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> </div>
|
||||
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> <span class="comment">// Equation of the form y^2 = (x^3 + ax + b) % P (here p is mod)</span></div>
|
||||
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> a(<span class="stringliteral">"4451685225093714772084598273548424"</span>),</div>
|
||||
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> b(<span class="stringliteral">"2061118396808653202902996166388514"</span>),</div>
|
||||
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> mod(<span class="stringliteral">"4451685225093714772084598273548427"</span>);</div>
|
||||
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> </div>
|
||||
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> <span class="comment">// Generator value: is pre-defined for the given curve</span></div>
|
||||
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span> <a class="code hl_struct" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">ciphers::elliptic_curve_key_exchange::Point</a> ptr = {</div>
|
||||
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"188281465057972534892223778713752"</span>),</div>
|
||||
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"3419875491033170827167861896082688"</span>)};</div>
|
||||
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> </div>
|
||||
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> <span class="comment">// Shared key generation.</span></div>
|
||||
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> <span class="comment">// For alice</span></div>
|
||||
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</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">"For alice:\n"</span>;</div>
|
||||
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> <span class="comment">// Alice's private key (can be generated randomly)</span></div>
|
||||
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"> 284</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> alice_private_key(<span class="stringliteral">"164330438812053169644452143505618"</span>);</div>
|
||||
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span> <a class="code hl_struct" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">ciphers::elliptic_curve_key_exchange::Point</a> alice_public_key =</div>
|
||||
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"> 286</span> <a class="code hl_function" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#a17f3d667241b88115a95282cdd719cb2">multiply</a>(ptr, a, alice_private_key, mod);</div>
|
||||
<div class="line"><a id="l00287" name="l00287"></a><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">"\tPrivate key: "</span> << alice_private_key << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><a id="l00288" name="l00288"></a><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">"\tPublic Key: "</span> << alice_public_key << <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"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span> </div>
|
||||
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> <span class="comment">// For Bob</span></div>
|
||||
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</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">"For Bob:\n"</span>;</div>
|
||||
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span> <span class="comment">// Bob's private key (can be generated randomly)</span></div>
|
||||
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> bob_private_key(<span class="stringliteral">"1959473333748537081510525763478373"</span>);</div>
|
||||
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span> <a class="code hl_struct" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">ciphers::elliptic_curve_key_exchange::Point</a> bob_public_key =</div>
|
||||
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"> 295</span> <a class="code hl_function" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#a17f3d667241b88115a95282cdd719cb2">multiply</a>(ptr, a, bob_private_key, mod);</div>
|
||||
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</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">"\tPrivate key: "</span> << bob_private_key << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</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">"\tPublic Key: "</span> << bob_public_key << <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"><a id="l00298" name="l00298"></a><span class="lineno"> 298</span> </div>
|
||||
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span> <span class="comment">// After public key exchange, create a shared key for communication.</span></div>
|
||||
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span> <span class="comment">// create shared key:</span></div>
|
||||
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"> 301</span> <a class="code hl_struct" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">ciphers::elliptic_curve_key_exchange::Point</a> alice_shared_key = <a class="code hl_function" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#a17f3d667241b88115a95282cdd719cb2">multiply</a>(</div>
|
||||
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"> 302</span> bob_public_key, a,</div>
|
||||
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span> alice_private_key, mod),</div>
|
||||
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"> 304</span> bob_shared_key = <a class="code hl_function" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#a17f3d667241b88115a95282cdd719cb2">multiply</a>(</div>
|
||||
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span> alice_public_key, a,</div>
|
||||
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span> bob_private_key, mod);</div>
|
||||
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"> 307</span> </div>
|
||||
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</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">"Shared keys:\n"</span>;</div>
|
||||
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"> 309</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << alice_shared_key << <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"><a id="l00310" name="l00310"></a><span class="lineno"> 310</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << bob_shared_key << <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"><a id="l00311" name="l00311"></a><span class="lineno"> 311</span> </div>
|
||||
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span> <span class="comment">// Check whether shared keys are equal</span></div>
|
||||
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"> 313</span> assert(alice_shared_key == bob_shared_key);</div>
|
||||
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 267</span> {</div>
|
||||
<div class="line"><span class="lineno"> 268</span> <span class="comment">// demonstration of key exchange using curve secp112r1</span></div>
|
||||
<div class="line"><span class="lineno"> 269</span> </div>
|
||||
<div class="line"><span class="lineno"> 270</span> <span class="comment">// Equation of the form y^2 = (x^3 + ax + b) % P (here p is mod)</span></div>
|
||||
<div class="line"><span class="lineno"> 271</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> a(<span class="stringliteral">"4451685225093714772084598273548424"</span>),</div>
|
||||
<div class="line"><span class="lineno"> 272</span> b(<span class="stringliteral">"2061118396808653202902996166388514"</span>),</div>
|
||||
<div class="line"><span class="lineno"> 273</span> mod(<span class="stringliteral">"4451685225093714772084598273548427"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 274</span> </div>
|
||||
<div class="line"><span class="lineno"> 275</span> <span class="comment">// Generator value: is pre-defined for the given curve</span></div>
|
||||
<div class="line"><span class="lineno"> 276</span> <a class="code hl_struct" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">ciphers::elliptic_curve_key_exchange::Point</a> ptr = {</div>
|
||||
<div class="line"><span class="lineno"> 277</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"188281465057972534892223778713752"</span>),</div>
|
||||
<div class="line"><span class="lineno"> 278</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"3419875491033170827167861896082688"</span>)};</div>
|
||||
<div class="line"><span class="lineno"> 279</span> </div>
|
||||
<div class="line"><span class="lineno"> 280</span> <span class="comment">// Shared key generation.</span></div>
|
||||
<div class="line"><span class="lineno"> 281</span> <span class="comment">// For alice</span></div>
|
||||
<div class="line"><span class="lineno"> 282</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">"For alice:\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 283</span> <span class="comment">// Alice's private key (can be generated randomly)</span></div>
|
||||
<div class="line"><span class="lineno"> 284</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> alice_private_key(<span class="stringliteral">"164330438812053169644452143505618"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 285</span> <a class="code hl_struct" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">ciphers::elliptic_curve_key_exchange::Point</a> alice_public_key =</div>
|
||||
<div class="line"><span class="lineno"> 286</span> <a class="code hl_function" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#a17f3d667241b88115a95282cdd719cb2">multiply</a>(ptr, a, alice_private_key, mod);</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">"\tPrivate key: "</span> << alice_private_key << <span class="stringliteral">"\n"</span>;</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">"\tPublic Key: "</span> << alice_public_key << <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> </div>
|
||||
<div class="line"><span class="lineno"> 290</span> <span class="comment">// For Bob</span></div>
|
||||
<div class="line"><span class="lineno"> 291</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">"For Bob:\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 292</span> <span class="comment">// Bob's private key (can be generated randomly)</span></div>
|
||||
<div class="line"><span class="lineno"> 293</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> bob_private_key(<span class="stringliteral">"1959473333748537081510525763478373"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 294</span> <a class="code hl_struct" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">ciphers::elliptic_curve_key_exchange::Point</a> bob_public_key =</div>
|
||||
<div class="line"><span class="lineno"> 295</span> <a class="code hl_function" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#a17f3d667241b88115a95282cdd719cb2">multiply</a>(ptr, a, bob_private_key, mod);</div>
|
||||
<div class="line"><span class="lineno"> 296</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">"\tPrivate key: "</span> << bob_private_key << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 297</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">"\tPublic Key: "</span> << bob_public_key << <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"> 298</span> </div>
|
||||
<div class="line"><span class="lineno"> 299</span> <span class="comment">// After public key exchange, create a shared key for communication.</span></div>
|
||||
<div class="line"><span class="lineno"> 300</span> <span class="comment">// create shared key:</span></div>
|
||||
<div class="line"><span class="lineno"> 301</span> <a class="code hl_struct" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">ciphers::elliptic_curve_key_exchange::Point</a> alice_shared_key = <a class="code hl_function" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#a17f3d667241b88115a95282cdd719cb2">multiply</a>(</div>
|
||||
<div class="line"><span class="lineno"> 302</span> bob_public_key, a,</div>
|
||||
<div class="line"><span class="lineno"> 303</span> alice_private_key, mod),</div>
|
||||
<div class="line"><span class="lineno"> 304</span> bob_shared_key = <a class="code hl_function" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#a17f3d667241b88115a95282cdd719cb2">multiply</a>(</div>
|
||||
<div class="line"><span class="lineno"> 305</span> alice_public_key, a,</div>
|
||||
<div class="line"><span class="lineno"> 306</span> bob_private_key, mod);</div>
|
||||
<div class="line"><span class="lineno"> 307</span> </div>
|
||||
<div class="line"><span class="lineno"> 308</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">"Shared keys:\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 309</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << alice_shared_key << <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"> 310</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << bob_shared_key << <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"> 311</span> </div>
|
||||
<div class="line"><span class="lineno"> 312</span> <span class="comment">// Check whether shared keys are equal</span></div>
|
||||
<div class="line"><span class="lineno"> 313</span> assert(alice_shared_key == bob_shared_key);</div>
|
||||
<div class="line"><span class="lineno"> 314</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="aclassuint256__t_html"><div class="ttname"><a href="../../d1/d83/classuint256__t.html">uint256_t</a></div><div class="ttdoc">class for 256-bit unsigned integer</div><div class="ttdef"><b>Definition:</b> uint256_t.hpp:33</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>
|
||||
@@ -308,33 +308,33 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Function to test the <a class="el" href="../../db/d9a/classuint128__t.html" title="class for 128-bit unsigned integer">uint128_t</a> header. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> {</div>
|
||||
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> <span class="comment">// 1st test: Operations test</span></div>
|
||||
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a> a(<span class="stringliteral">"122"</span>), b(<span class="stringliteral">"2312"</span>);</div>
|
||||
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> assert(a + b == 2434);</div>
|
||||
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> assert(b - a == 2190);</div>
|
||||
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> assert(a * b == 282064);</div>
|
||||
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> assert(b / a == 18);</div>
|
||||
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> assert(b % a == 116);</div>
|
||||
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> assert((a & b) == 8);</div>
|
||||
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> assert((a | b) == 2426);</div>
|
||||
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> assert((a ^ b) == 2418);</div>
|
||||
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> assert((a << 64) == <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"2250502776992565297152"</span>));</div>
|
||||
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> assert((b >> 7) == 18);</div>
|
||||
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> </div>
|
||||
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> <span class="comment">// 2nd test: Operations test</span></div>
|
||||
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> a = <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"12321421424232142122"</span>);</div>
|
||||
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> b = <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"23123212"</span>);</div>
|
||||
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> assert(a + b == <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"12321421424255265334"</span>));</div>
|
||||
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> assert(a - b == <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"12321421424209018910"</span>));</div>
|
||||
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> assert(a * b == <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"284910839733861759501135864"</span>));</div>
|
||||
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> assert(a / b == 532859423865LL);</div>
|
||||
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> assert(a % b == 3887742);</div>
|
||||
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> assert((a & b) == 18912520);</div>
|
||||
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> assert((a | b) == <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"12321421424236352814"</span>));</div>
|
||||
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> assert((a ^ b) == <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"12321421424217440294"</span>));</div>
|
||||
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> assert((a << 64) == <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"227290107637132170748078080907806769152"</span>));</div>
|
||||
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 197</span> {</div>
|
||||
<div class="line"><span class="lineno"> 198</span> <span class="comment">// 1st test: Operations test</span></div>
|
||||
<div class="line"><span class="lineno"> 199</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a> a(<span class="stringliteral">"122"</span>), b(<span class="stringliteral">"2312"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 200</span> assert(a + b == 2434);</div>
|
||||
<div class="line"><span class="lineno"> 201</span> assert(b - a == 2190);</div>
|
||||
<div class="line"><span class="lineno"> 202</span> assert(a * b == 282064);</div>
|
||||
<div class="line"><span class="lineno"> 203</span> assert(b / a == 18);</div>
|
||||
<div class="line"><span class="lineno"> 204</span> assert(b % a == 116);</div>
|
||||
<div class="line"><span class="lineno"> 205</span> assert((a & b) == 8);</div>
|
||||
<div class="line"><span class="lineno"> 206</span> assert((a | b) == 2426);</div>
|
||||
<div class="line"><span class="lineno"> 207</span> assert((a ^ b) == 2418);</div>
|
||||
<div class="line"><span class="lineno"> 208</span> assert((a << 64) == <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"2250502776992565297152"</span>));</div>
|
||||
<div class="line"><span class="lineno"> 209</span> assert((b >> 7) == 18);</div>
|
||||
<div class="line"><span class="lineno"> 210</span> </div>
|
||||
<div class="line"><span class="lineno"> 211</span> <span class="comment">// 2nd test: Operations test</span></div>
|
||||
<div class="line"><span class="lineno"> 212</span> a = <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"12321421424232142122"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 213</span> b = <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"23123212"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 214</span> assert(a + b == <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"12321421424255265334"</span>));</div>
|
||||
<div class="line"><span class="lineno"> 215</span> assert(a - b == <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"12321421424209018910"</span>));</div>
|
||||
<div class="line"><span class="lineno"> 216</span> assert(a * b == <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"284910839733861759501135864"</span>));</div>
|
||||
<div class="line"><span class="lineno"> 217</span> assert(a / b == 532859423865LL);</div>
|
||||
<div class="line"><span class="lineno"> 218</span> assert(a % b == 3887742);</div>
|
||||
<div class="line"><span class="lineno"> 219</span> assert((a & b) == 18912520);</div>
|
||||
<div class="line"><span class="lineno"> 220</span> assert((a | b) == <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"12321421424236352814"</span>));</div>
|
||||
<div class="line"><span class="lineno"> 221</span> assert((a ^ b) == <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"12321421424217440294"</span>));</div>
|
||||
<div class="line"><span class="lineno"> 222</span> assert((a << 64) == <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">"227290107637132170748078080907806769152"</span>));</div>
|
||||
<div class="line"><span class="lineno"> 223</span>}</div>
|
||||
<div class="ttc" id="aclassuint128__t_html"><div class="ttname"><a href="../../db/d9a/classuint128__t.html">uint128_t</a></div><div class="ttdoc">class for 128-bit unsigned integer</div><div class="ttdef"><b>Definition:</b> uint128_t.hpp:59</div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -364,37 +364,37 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Function to test the <a class="el" href="../../d1/d83/classuint256__t.html" title="class for 256-bit unsigned integer">uint256_t</a> header. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> {</div>
|
||||
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> <span class="comment">// 1st test: Operations test</span></div>
|
||||
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> a(<span class="stringliteral">"122"</span>), b(<span class="stringliteral">"2312"</span>);</div>
|
||||
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> assert(a + b == 2434);</div>
|
||||
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> assert(b - a == 2190);</div>
|
||||
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> assert(a * b == 282064);</div>
|
||||
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> assert(b / a == 18);</div>
|
||||
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> assert(b % a == 116);</div>
|
||||
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> assert((a & b) == 8);</div>
|
||||
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> assert((a | b) == 2426);</div>
|
||||
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> assert((a ^ b) == 2418);</div>
|
||||
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> assert((a << 64) == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"2250502776992565297152"</span>));</div>
|
||||
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> assert((b >> 7) == 18);</div>
|
||||
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> </div>
|
||||
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> <span class="comment">// 2nd test: Operations test</span></div>
|
||||
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> a = <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"12321423124513251424232142122"</span>);</div>
|
||||
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> b = <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"23124312431243243215354315132413213212"</span>);</div>
|
||||
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> assert(a + b == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"23124312443564666339867566556645355334"</span>));</div>
|
||||
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span> <span class="comment">// Since a < b, the value is greater</span></div>
|
||||
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> assert(a - b == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"115792089237316195423570985008687907853246860353"</span></div>
|
||||
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> <span class="stringliteral">"221642219366742944204948568846"</span>));</div>
|
||||
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> assert(a * b == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"284924437928789743312147393953938013677909398222"</span></div>
|
||||
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> <span class="stringliteral">"169728183872115864"</span>));</div>
|
||||
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span> assert(b / a == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"1876756621"</span>));</div>
|
||||
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span> assert(b % a == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"2170491202688962563936723450"</span>));</div>
|
||||
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> assert((a & b) == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"3553901085693256462344"</span>));</div>
|
||||
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> assert((a | b) == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"23124312443564662785966480863388892990"</span>));</div>
|
||||
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> assert((a ^ b) == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"23124312443564659232065395170132430646"</span>));</div>
|
||||
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> assert((a << 128) == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"4192763024643754272961909047609369343091683"</span></div>
|
||||
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> <span class="stringliteral">"376561852756163540549632"</span>));</div>
|
||||
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 230</span> {</div>
|
||||
<div class="line"><span class="lineno"> 231</span> <span class="comment">// 1st test: Operations test</span></div>
|
||||
<div class="line"><span class="lineno"> 232</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> a(<span class="stringliteral">"122"</span>), b(<span class="stringliteral">"2312"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 233</span> assert(a + b == 2434);</div>
|
||||
<div class="line"><span class="lineno"> 234</span> assert(b - a == 2190);</div>
|
||||
<div class="line"><span class="lineno"> 235</span> assert(a * b == 282064);</div>
|
||||
<div class="line"><span class="lineno"> 236</span> assert(b / a == 18);</div>
|
||||
<div class="line"><span class="lineno"> 237</span> assert(b % a == 116);</div>
|
||||
<div class="line"><span class="lineno"> 238</span> assert((a & b) == 8);</div>
|
||||
<div class="line"><span class="lineno"> 239</span> assert((a | b) == 2426);</div>
|
||||
<div class="line"><span class="lineno"> 240</span> assert((a ^ b) == 2418);</div>
|
||||
<div class="line"><span class="lineno"> 241</span> assert((a << 64) == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"2250502776992565297152"</span>));</div>
|
||||
<div class="line"><span class="lineno"> 242</span> assert((b >> 7) == 18);</div>
|
||||
<div class="line"><span class="lineno"> 243</span> </div>
|
||||
<div class="line"><span class="lineno"> 244</span> <span class="comment">// 2nd test: Operations test</span></div>
|
||||
<div class="line"><span class="lineno"> 245</span> a = <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"12321423124513251424232142122"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 246</span> b = <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"23124312431243243215354315132413213212"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 247</span> assert(a + b == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"23124312443564666339867566556645355334"</span>));</div>
|
||||
<div class="line"><span class="lineno"> 248</span> <span class="comment">// Since a < b, the value is greater</span></div>
|
||||
<div class="line"><span class="lineno"> 249</span> assert(a - b == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"115792089237316195423570985008687907853246860353"</span></div>
|
||||
<div class="line"><span class="lineno"> 250</span> <span class="stringliteral">"221642219366742944204948568846"</span>));</div>
|
||||
<div class="line"><span class="lineno"> 251</span> assert(a * b == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"284924437928789743312147393953938013677909398222"</span></div>
|
||||
<div class="line"><span class="lineno"> 252</span> <span class="stringliteral">"169728183872115864"</span>));</div>
|
||||
<div class="line"><span class="lineno"> 253</span> assert(b / a == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"1876756621"</span>));</div>
|
||||
<div class="line"><span class="lineno"> 254</span> assert(b % a == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"2170491202688962563936723450"</span>));</div>
|
||||
<div class="line"><span class="lineno"> 255</span> assert((a & b) == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"3553901085693256462344"</span>));</div>
|
||||
<div class="line"><span class="lineno"> 256</span> assert((a | b) == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"23124312443564662785966480863388892990"</span>));</div>
|
||||
<div class="line"><span class="lineno"> 257</span> assert((a ^ b) == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"23124312443564659232065395170132430646"</span>));</div>
|
||||
<div class="line"><span class="lineno"> 258</span> assert((a << 128) == <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a>(<span class="stringliteral">"4192763024643754272961909047609369343091683"</span></div>
|
||||
<div class="line"><span class="lineno"> 259</span> <span class="stringliteral">"376561852756163540549632"</span>));</div>
|
||||
<div class="line"><span class="lineno"> 260</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -404,7 +404,7 @@ Here is the call graph for this function:</div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_4d6e05837bf820fb089a8a8cdf2f42b7.html">ciphers</a></li><li class="navelem"><a class="el" href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html">elliptic_curve_key_exchange.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<map id="test" name="test">
|
||||
<area shape="rect" id="node1" title="Function to test the provided algorithm above." alt="" coords="5,35,49,61"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="145,5,217,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="145,5,217,32"/>
|
||||
<area shape="rect" id="node3" href="$df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#a17f3d667241b88115a95282cdd719cb2" title="multiply Point and integer" alt="" coords="97,57,264,98"/>
|
||||
<area shape="rect" id="node4" href="$df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#acc5fe9c2032fb7582c38a20d1fa69bcf" title="Addition of points." alt="" coords="312,57,479,98"/>
|
||||
<area shape="rect" id="node5" href="$df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#ac00616a4e40d3cd5cfb4da87d9ff9af0" title="This function calculates number raised to exponent power under modulo mod using Modular Exponentiatio..." alt="" coords="527,57,675,98"/>
|
||||
|
||||
@@ -1 +1 @@
|
||||
a78a30a7294b2598849dd5a045626ad7
|
||||
ba86adc2bec3870edbe7d5989c4b471c
|
||||
@@ -67,7 +67,7 @@ var sectionId = 'dynsection-2';
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="104.5,-50 104.5,-69 158.5,-69 158.5,-50 104.5,-50"/>
|
||||
<text text-anchor="middle" x="131.5" y="-57" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
@@ -21,7 +21,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="104.5,-50 104.5,-69 158.5,-69 158.5,-50 104.5,-50"/>
|
||||
<text text-anchor="middle" x="131.5" y="-57" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
@@ -3,7 +3,7 @@
|
||||
<area shape="rect" id="node2" href="$df/d2c/elliptic__curve__key__exchange_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" title="Function to test the provided algorithm above." alt="" coords="137,35,181,61"/>
|
||||
<area shape="rect" id="node8" href="$df/d2c/elliptic__curve__key__exchange_8cpp.html#a8800c8a84d77dadadb05ad5e83b77ef4" title="Function to test the uint128_t header." alt="" coords="104,85,215,112"/>
|
||||
<area shape="rect" id="node9" href="$df/d2c/elliptic__curve__key__exchange_8cpp.html#a37775d1724ffe404c088dabbc8da91ae" title="Function to test the uint256_t header." alt="" coords="104,136,215,163"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="310,5,382,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="310,5,382,32"/>
|
||||
<area shape="rect" id="node4" href="$df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#a17f3d667241b88115a95282cdd719cb2" title="multiply Point and integer" alt="" coords="263,57,429,98"/>
|
||||
<area shape="rect" id="node5" href="$df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#acc5fe9c2032fb7582c38a20d1fa69bcf" title="Addition of points." alt="" coords="477,57,644,98"/>
|
||||
<area shape="rect" id="node6" href="$df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#ac00616a4e40d3cd5cfb4da87d9ff9af0" title="This function calculates number raised to exponent power under modulo mod using Modular Exponentiatio..." alt="" coords="692,57,840,98"/>
|
||||
|
||||
@@ -1 +1 @@
|
||||
870a0e9ad525106b3a307324e59c841c
|
||||
33c67ea317470a0d34691ef189f0c2f1
|
||||
@@ -112,7 +112,7 @@ var sectionId = 'dynsection-1';
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="228.5,-98.5 228.5,-117.5 282.5,-117.5 282.5,-98.5 228.5,-98.5"/>
|
||||
<text text-anchor="middle" x="255.5" y="-105.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@@ -66,7 +66,7 @@
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="228.5,-98.5 228.5,-117.5 282.5,-117.5 282.5,-98.5 228.5,-98.5"/>
|
||||
<text text-anchor="middle" x="255.5" y="-105.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.2"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: probability::windowed_median::WindowedMedian Class Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.2 -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
@@ -104,7 +104,7 @@ $(document).ready(function(){initNavTree('df/d34/classprobability_1_1windowed__m
|
||||
<div class="dynheader">
|
||||
Collaboration diagram for probability::windowed_median::WindowedMedian:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d2/d92/classprobability_1_1windowed__median_1_1_windowed_median__coll__graph.svg" width="194" height="142"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d2/d92/classprobability_1_1windowed__median_1_1_windowed_median__coll__graph.svg" width="270" height="156"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
<center><span class="legend">[<a target="top" href="../../graph_legend.html">legend</a>]</span></center></div>
|
||||
<table class="memberdecls">
|
||||
@@ -181,7 +181,7 @@ const size_type </td><td class="memItemRight" valign="bottom"><b>_windowSiz
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="fragment"><div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span>: <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aafda847b152684578dab891e5268d750">_windowSize</a>(windowSize){};</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 123</span>: <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aafda847b152684578dab891e5268d750">_windowSize</a>(windowSize){};</div>
|
||||
<div class="ttc" id="aclassprobability_1_1windowed__median_1_1_windowed_median_html_aafda847b152684578dab891e5268d750"><div class="ttname"><a href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aafda847b152684578dab891e5268d750">probability::windowed_median::WindowedMedian::_windowSize</a></div><div class="ttdeci">const size_type _windowSize</div><div class="ttdoc">sliding window size</div><div class="ttdef"><b>Definition:</b> windowed_median.cpp:57</div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -222,31 +222,40 @@ const size_type </td><td class="memItemRight" valign="bottom"><b>_windowSiz
|
||||
<p >O(1) - traversing one step to the right child</p>
|
||||
<p >However, if the erased value is on the right branch or the median itself, and the number of elements is odd, the new median will be the left child of the current one</p>
|
||||
<p >Find the (first) position of the value we want to erase, and erase it</p>
|
||||
<div class="fragment"><div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> {</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <span class="keyword">const</span> <span class="keyword">auto</span> sz = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.size();</div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span><span class="comment"> /// If the erased value is on the left branch or the median itself and</span></div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span><span class="comment"> /// the number of elements is even, the new median will be the right</span></div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span><span class="comment"> /// child of the current one</span></div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span><span class="comment"></span> <span class="keywordflow">if</span> (value <= *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> && sz % 2 == 0) {</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> ++<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">/// O(1) - traversing one step to the right child</span></div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> }</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span><span class="comment"> /// However, if the erased value is on the right branch or the median</span></div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span><span class="comment"> /// itself, and the number of elements is odd, the new median will be</span></div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span><span class="comment"> /// the left child of the current one</span></div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span><span class="comment"></span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (value >= *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> && sz % 2 != 0) {</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> --<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">// O(1) - traversing one step to the left child</span></div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> }</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span><span class="comment"> /// Find the (first) position of the value we want to erase, and erase</span></div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span><span class="comment"> /// it</span></div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span><span class="comment"></span> <span class="keyword">const</span> <span class="keyword">auto</span> it = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.find(value); <span class="comment">// O(logN)</span></div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.erase(it); <span class="comment">// O(logN)</span></div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 95</span> {</div>
|
||||
<div class="line"><span class="lineno"> 96</span> <span class="keyword">const</span> <span class="keyword">auto</span> sz = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/multiset/size.html">size</a>();</div>
|
||||
<div class="line"><span class="lineno"> 97</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 98</span><span class="comment"> /// If the erased value is on the left branch or the median itself and</span></div>
|
||||
<div class="line"><span class="lineno"> 99</span><span class="comment"> /// the number of elements is even, the new median will be the right</span></div>
|
||||
<div class="line"><span class="lineno"> 100</span><span class="comment"> /// child of the current one</span></div>
|
||||
<div class="line"><span class="lineno"> 101</span><span class="comment"></span> <span class="keywordflow">if</span> (value <= *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> && sz % 2 == 0) {</div>
|
||||
<div class="line"><span class="lineno"> 102</span> ++<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">/// O(1) - traversing one step to the right child</span></div>
|
||||
<div class="line"><span class="lineno"> 103</span> }</div>
|
||||
<div class="line"><span class="lineno"> 104</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 105</span><span class="comment"> /// However, if the erased value is on the right branch or the median</span></div>
|
||||
<div class="line"><span class="lineno"> 106</span><span class="comment"> /// itself, and the number of elements is odd, the new median will be</span></div>
|
||||
<div class="line"><span class="lineno"> 107</span><span class="comment"> /// the left child of the current one</span></div>
|
||||
<div class="line"><span class="lineno"> 108</span><span class="comment"></span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (value >= *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> && sz % 2 != 0) {</div>
|
||||
<div class="line"><span class="lineno"> 109</span> --<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">// O(1) - traversing one step to the left child</span></div>
|
||||
<div class="line"><span class="lineno"> 110</span> }</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"> /// Find the (first) position of the value we want to erase, and erase</span></div>
|
||||
<div class="line"><span class="lineno"> 113</span><span class="comment"> /// it</span></div>
|
||||
<div class="line"><span class="lineno"> 114</span><span class="comment"></span> <span class="keyword">const</span> <span class="keyword">auto</span> it = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/multiset/find.html">find</a>(value); <span class="comment">// O(logN)</span></div>
|
||||
<div class="line"><span class="lineno"> 115</span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/multiset/erase.html">erase</a>(it); <span class="comment">// O(logN)</span></div>
|
||||
<div class="line"><span class="lineno"> 116</span> }</div>
|
||||
<div class="ttc" id="aclassprobability_1_1windowed__median_1_1_windowed_median_html_a55ae3543a76045dffcb5ec7904a32a20"><div class="ttname"><a href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">probability::windowed_median::WindowedMedian::_itMedian</a></div><div class="ttdeci">std::multiset< int >::const_iterator _itMedian</div><div class="ttdef"><b>Definition:</b> windowed_median.cpp:62</div></div>
|
||||
<div class="ttc" id="aclassprobability_1_1windowed__median_1_1_windowed_median_html_aacd76f078632faee1a8788d031e6c2de"><div class="ttname"><a href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">probability::windowed_median::WindowedMedian::_sortedValues</a></div><div class="ttdeci">std::multiset< int > _sortedValues</div><div class="ttdef"><b>Definition:</b> windowed_median.cpp:59</div></div>
|
||||
</div><!-- fragment -->
|
||||
<div class="ttc" id="aerase_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/multiset/erase.html">std::multiset::erase</a></div><div class="ttdeci">T erase(T... args)</div></div>
|
||||
<div class="ttc" id="afind_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/multiset/find.html">std::multiset::find</a></div><div class="ttdeci">T find(T... args)</div></div>
|
||||
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/multiset/size.html">std::multiset::size</a></div><div class="ttdeci">T size(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median_af544e271ea19a6fd69a6b3ed6816453e_cgraph.svg" width="376" height="139"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="a938cafbdf70dc01e86e9bb12d29ec65d" name="a938cafbdf70dc01e86e9bb12d29ec65d"></a>
|
||||
@@ -275,14 +284,20 @@ const size_type </td><td class="memItemRight" valign="bottom"><b>_windowSiz
|
||||
<p>Gets the median of the values in the sliding window. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>Median of sliding window. For even window size return the average between the two values in the middle </dd></dl>
|
||||
<p >O(1)</p>
|
||||
<div class="fragment"><div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> {</div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.size() % 2 != 0) {</div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <span class="keywordflow">return</span> *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">// O(1)</span></div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> }</div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <span class="keywordflow">return</span> 0.5f * *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> + 0.5f * *<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a>(<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>); <span class="comment">/// O(1)</span></div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 148</span> {</div>
|
||||
<div class="line"><span class="lineno"> 149</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/multiset/size.html">size</a>() % 2 != 0) {</div>
|
||||
<div class="line"><span class="lineno"> 150</span> <span class="keywordflow">return</span> *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">// O(1)</span></div>
|
||||
<div class="line"><span class="lineno"> 151</span> }</div>
|
||||
<div class="line"><span class="lineno"> 152</span> <span class="keywordflow">return</span> 0.5f * *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> + 0.5f * *<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a>(<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>); <span class="comment">/// O(1)</span></div>
|
||||
<div class="line"><span class="lineno"> 153</span> }</div>
|
||||
<div class="ttc" id="anext_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/iterator/next.html">std::next</a></div><div class="ttdeci">T next(T... args)</div></div>
|
||||
</div><!-- fragment -->
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median_a938cafbdf70dc01e86e9bb12d29ec65d_cgraph.svg" width="368" height="67"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="a61804988fcb1a6caf640f8291979aaa6" name="a61804988fcb1a6caf640f8291979aaa6"></a>
|
||||
@@ -313,18 +328,18 @@ const size_type </td><td class="memItemRight" valign="bottom"><b>_windowSiz
|
||||
<p >Sort window - O(NlogN)</p>
|
||||
<p >Find value in the middle - O(N)</p>
|
||||
<p >O(N)</p>
|
||||
<div class="fragment"><div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> {</div>
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <span class="keyword">auto</span> window = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>;</div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> window.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/sort.html">sort</a>(); <span class="comment">/// Sort window - O(NlogN)</span></div>
|
||||
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <span class="keyword">auto</span> median =</div>
|
||||
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> *<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a>(window.begin(),</div>
|
||||
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> window.size() / 2); <span class="comment">/// Find value in the middle - O(N)</span></div>
|
||||
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <span class="keywordflow">if</span> (window.size() % 2 != 0) {</div>
|
||||
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <span class="keywordflow">return</span> median;</div>
|
||||
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> }</div>
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> <span class="keywordflow">return</span> 0.5f * median +</div>
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> 0.5f * *<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a>(window.begin(), window.size() / 2 - 1); <span class="comment">/// O(N)</span></div>
|
||||
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 161</span> {</div>
|
||||
<div class="line"><span class="lineno"> 162</span> <span class="keyword">auto</span> window = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>;</div>
|
||||
<div class="line"><span class="lineno"> 163</span> window.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/sort.html">sort</a>(); <span class="comment">/// Sort window - O(NlogN)</span></div>
|
||||
<div class="line"><span class="lineno"> 164</span> <span class="keyword">auto</span> median =</div>
|
||||
<div class="line"><span class="lineno"> 165</span> *<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a>(window.begin(),</div>
|
||||
<div class="line"><span class="lineno"> 166</span> window.size() / 2); <span class="comment">/// Find value in the middle - O(N)</span></div>
|
||||
<div class="line"><span class="lineno"> 167</span> <span class="keywordflow">if</span> (window.size() % 2 != 0) {</div>
|
||||
<div class="line"><span class="lineno"> 168</span> <span class="keywordflow">return</span> median;</div>
|
||||
<div class="line"><span class="lineno"> 169</span> }</div>
|
||||
<div class="line"><span class="lineno"> 170</span> <span class="keywordflow">return</span> 0.5f * median +</div>
|
||||
<div class="line"><span class="lineno"> 171</span> 0.5f * *<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a>(window.begin(), window.size() / 2 - 1); <span class="comment">/// O(N)</span></div>
|
||||
<div class="line"><span class="lineno"> 172</span> }</div>
|
||||
<div class="ttc" id="aclassprobability_1_1windowed__median_1_1_windowed_median_html_a825a7aaef844c9f743a27b268e8569b2"><div class="ttname"><a href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">probability::windowed_median::WindowedMedian::_window</a></div><div class="ttdeci">Window _window</div><div class="ttdoc">a sliding window of values along the stream</div><div class="ttdef"><b>Definition:</b> windowed_median.cpp:58</div></div>
|
||||
<div class="ttc" id="asort_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/list/sort.html">std::list::sort</a></div><div class="ttdeci">T sort(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
@@ -371,29 +386,28 @@ Here is the call graph for this function:</div>
|
||||
<p >If exceeding size of window, pop from its left side</p>
|
||||
<p >Erase from the multi-value BST the window left side value</p>
|
||||
<p >Pop the left side value from the window - O(1)</p>
|
||||
<div class="fragment"><div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> {<span class="comment"></span></div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span><span class="comment"> /// Push new value to the back of the sliding window - O(1)</span></div>
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span><span class="comment"></span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/push_back.html">push_back</a>(value);</div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <a class="code hl_function" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a3a7f57679e9cd6c9f042dfd0612b2b24">insertToSorted</a>(value); <span class="comment">// Insert value to the multi-value BST - O(logN)</span></div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/size.html">size</a>() > <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aafda847b152684578dab891e5268d750">_windowSize</a>) { <span class="comment">/// If exceeding size of window,</span><span class="comment"></span></div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span><span class="comment"> /// pop from its left side</span></div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span><span class="comment"></span> <a class="code hl_function" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#af544e271ea19a6fd69a6b3ed6816453e">eraseFromSorted</a>(</div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/front.html">front</a>()); <span class="comment">/// Erase from the multi-value BST</span><span class="comment"></span></div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span><span class="comment"> /// the window left side value</span></div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span><span class="comment"></span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/pop_front.html">pop_front</a>(); <span class="comment">/// Pop the left side value from the window -</span><span class="comment"></span></div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span><span class="comment"> /// O(1)</span></div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span><span class="comment"></span> }</div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 129</span> {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 130</span><span class="comment"> /// Push new value to the back of the sliding window - O(1)</span></div>
|
||||
<div class="line"><span class="lineno"> 131</span><span class="comment"></span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/push_back.html">push_back</a>(value);</div>
|
||||
<div class="line"><span class="lineno"> 132</span> <a class="code hl_function" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a3a7f57679e9cd6c9f042dfd0612b2b24">insertToSorted</a>(value); <span class="comment">// Insert value to the multi-value BST - O(logN)</span></div>
|
||||
<div class="line"><span class="lineno"> 133</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/size.html">size</a>() > <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aafda847b152684578dab891e5268d750">_windowSize</a>) { <span class="comment">/// If exceeding size of window,</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 134</span><span class="comment"> /// pop from its left side</span></div>
|
||||
<div class="line"><span class="lineno"> 135</span><span class="comment"></span> <a class="code hl_function" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#af544e271ea19a6fd69a6b3ed6816453e">eraseFromSorted</a>(</div>
|
||||
<div class="line"><span class="lineno"> 136</span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/front.html">front</a>()); <span class="comment">/// Erase from the multi-value BST</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 137</span><span class="comment"> /// the window left side value</span></div>
|
||||
<div class="line"><span class="lineno"> 138</span><span class="comment"></span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/pop_front.html">pop_front</a>(); <span class="comment">/// Pop the left side value from the window -</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 139</span><span class="comment"> /// O(1)</span></div>
|
||||
<div class="line"><span class="lineno"> 140</span><span class="comment"></span> }</div>
|
||||
<div class="line"><span class="lineno"> 141</span> }</div>
|
||||
<div class="ttc" id="aclassprobability_1_1windowed__median_1_1_windowed_median_html_a3a7f57679e9cd6c9f042dfd0612b2b24"><div class="ttname"><a href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a3a7f57679e9cd6c9f042dfd0612b2b24">probability::windowed_median::WindowedMedian::insertToSorted</a></div><div class="ttdeci">void insertToSorted(int value)</div><div class="ttdoc">Inserts a value to a sorted multi-value BST.</div><div class="ttdef"><b>Definition:</b> windowed_median.cpp:69</div></div>
|
||||
<div class="ttc" id="aclassprobability_1_1windowed__median_1_1_windowed_median_html_af544e271ea19a6fd69a6b3ed6816453e"><div class="ttname"><a href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#af544e271ea19a6fd69a6b3ed6816453e">probability::windowed_median::WindowedMedian::eraseFromSorted</a></div><div class="ttdeci">void eraseFromSorted(int value)</div><div class="ttdoc">Erases a value from a sorted multi-value BST.</div><div class="ttdef"><b>Definition:</b> windowed_median.cpp:95</div></div>
|
||||
<div class="ttc" id="afront_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/list/front.html">std::list::front</a></div><div class="ttdeci">T front(T... args)</div></div>
|
||||
<div class="ttc" id="apop_front_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/list/pop_front.html">std::list::pop_front</a></div><div class="ttdeci">T pop_front(T... args)</div></div>
|
||||
<div class="ttc" id="apush_back_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/list/push_back.html">std::list::push_back</a></div><div class="ttdeci">T push_back(T... args)</div></div>
|
||||
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/list/size.html">std::list::size</a></div><div class="ttdeci">T size(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median_a6b52b7851750f28d53508e63c52a69f7_cgraph.svg" width="424" height="350"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median_a6b52b7851750f28d53508e63c52a69f7_cgraph.svg" width="607" height="382"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -435,28 +449,36 @@ Here is the call graph for this function:</div>
|
||||
<p >If new value goes to left tree branch, and number of elements is even, the new median in the balanced tree is the left child of the median before the insertion</p>
|
||||
<p >However, if the new value goes to the right branch, the previous median's right child is the new median in the balanced tree</p>
|
||||
<p >O(1) - traversing one step to the right child</p>
|
||||
<div class="fragment"><div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> {</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.insert(value); <span class="comment">/// Insert value to BST - O(logN)</span></div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keyword">const</span> <span class="keyword">auto</span> sz = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.size();</div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordflow">if</span> (sz == 1) { <span class="comment">/// For the first value, set median iterator to BST root</span></div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.begin();</div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> }</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span><span class="comment"> /// If new value goes to left tree branch, and number of elements is</span></div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span><span class="comment"> /// even, the new median in the balanced tree is the left child of the</span></div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span><span class="comment"> /// median before the insertion</span></div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span><span class="comment"></span> <span class="keywordflow">if</span> (value < *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> && sz % 2 == 0) {</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> --<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">// O(1) - traversing one step to the left child</span></div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> }</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span><span class="comment"> /// However, if the new value goes to the right branch, the previous</span></div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span><span class="comment"> /// median's right child is the new median in the balanced tree</span></div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span><span class="comment"></span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (value >= *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> && sz % 2 != 0) {</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> ++<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">/// O(1) - traversing one step to the right child</span></div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> }</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> }</div>
|
||||
</div><!-- fragment -->
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 69</span> {</div>
|
||||
<div class="line"><span class="lineno"> 70</span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/multiset/insert.html">insert</a>(value); <span class="comment">/// Insert value to BST - O(logN)</span></div>
|
||||
<div class="line"><span class="lineno"> 71</span> <span class="keyword">const</span> <span class="keyword">auto</span> sz = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/multiset/size.html">size</a>();</div>
|
||||
<div class="line"><span class="lineno"> 72</span> <span class="keywordflow">if</span> (sz == 1) { <span class="comment">/// For the first value, set median iterator to BST root</span></div>
|
||||
<div class="line"><span class="lineno"> 73</span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/multiset/begin.html">begin</a>();</div>
|
||||
<div class="line"><span class="lineno"> 74</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 75</span> }</div>
|
||||
<div class="line"><span class="lineno"> 76</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 77</span><span class="comment"> /// If new value goes to left tree branch, and number of elements is</span></div>
|
||||
<div class="line"><span class="lineno"> 78</span><span class="comment"> /// even, the new median in the balanced tree is the left child of the</span></div>
|
||||
<div class="line"><span class="lineno"> 79</span><span class="comment"> /// median before the insertion</span></div>
|
||||
<div class="line"><span class="lineno"> 80</span><span class="comment"></span> <span class="keywordflow">if</span> (value < *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> && sz % 2 == 0) {</div>
|
||||
<div class="line"><span class="lineno"> 81</span> --<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">// O(1) - traversing one step to the left child</span></div>
|
||||
<div class="line"><span class="lineno"> 82</span> }</div>
|
||||
<div class="line"><span class="lineno"> 83</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 84</span><span class="comment"> /// However, if the new value goes to the right branch, the previous</span></div>
|
||||
<div class="line"><span class="lineno"> 85</span><span class="comment"> /// median's right child is the new median in the balanced tree</span></div>
|
||||
<div class="line"><span class="lineno"> 86</span><span class="comment"></span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (value >= *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> && sz % 2 != 0) {</div>
|
||||
<div class="line"><span class="lineno"> 87</span> ++<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">/// O(1) - traversing one step to the right child</span></div>
|
||||
<div class="line"><span class="lineno"> 88</span> }</div>
|
||||
<div class="line"><span class="lineno"> 89</span> }</div>
|
||||
<div class="ttc" id="abegin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/multiset/begin.html">std::multiset::begin</a></div><div class="ttdeci">T begin(T... args)</div></div>
|
||||
<div class="ttc" id="ainsert_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/multiset/insert.html">std::multiset::insert</a></div><div class="ttdeci">T insert(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median_a3a7f57679e9cd6c9f042dfd0612b2b24_cgraph.svg" width="376" height="139"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<h2 class="groupheader">Member Data Documentation</h2>
|
||||
@@ -515,7 +537,7 @@ Here is the call graph for this function:</div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d4/ded/namespaceprobability.html">probability</a></li><li class="navelem"><b>windowed_median</b></li><li class="navelem"><a class="el" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html">WindowedMedian</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<map id="probability::windowed_median::WindowedMedian::insertToSorted" name="probability::windowed_median::WindowedMedian::insertToSorted">
|
||||
<area shape="rect" id="node1" title="Inserts a value to a sorted multi-value BST." alt="" coords="5,41,188,97"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/multiset/begin#" title=" " alt="" coords="237,5,370,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/multiset/insert#" title=" " alt="" coords="236,56,371,83"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/multiset/size#" title=" " alt="" coords="240,107,367,133"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
4ec7c5490da1c748f6dc08f43d0d3c03
|
||||
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.50.0 (20211204.2007)
|
||||
-->
|
||||
<!-- Title: probability::windowed_median::WindowedMedian::insertToSorted Pages: 1 -->
|
||||
<svg width="282pt" height="104pt"
|
||||
viewBox="0.00 0.00 282.00 104.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 100)">
|
||||
<title>probability::windowed_median::WindowedMedian::insertToSorted</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-100 278,-100 278,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Inserts a value to a sorted multi-value BST.">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-27.5 0,-68.5 137,-68.5 137,-27.5 0,-27.5"/>
|
||||
<text text-anchor="start" x="8" y="-56.5" font-family="Helvetica,sans-Serif" font-size="10.00">probability::windowed</text>
|
||||
<text text-anchor="start" x="8" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">_median::WindowedMedian</text>
|
||||
<text text-anchor="middle" x="68.5" y="-34.5" font-family="Helvetica,sans-Serif" font-size="10.00">::insertToSorted</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/multiset/begin#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="173.5,-76.5 173.5,-95.5 273.5,-95.5 273.5,-76.5 173.5,-76.5"/>
|
||||
<text text-anchor="middle" x="223.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::multiset::begin</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M137.05,-64.78C149.56,-67.88 162.39,-71.07 174.18,-74"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="173.69,-77.48 184.24,-76.5 175.38,-70.69 173.69,-77.48"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/multiset/insert#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="173,-38.5 173,-57.5 274,-57.5 274,-38.5 173,-38.5"/>
|
||||
<text text-anchor="middle" x="223.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::multiset::insert</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M137.05,-48C145.59,-48 154.28,-48 162.68,-48"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="162.77,-51.5 172.77,-48 162.77,-44.5 162.77,-51.5"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/multiset/size#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="176,-0.5 176,-19.5 271,-19.5 271,-0.5 176,-0.5"/>
|
||||
<text text-anchor="middle" x="223.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::multiset::size</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M137.05,-31.22C149.56,-28.12 162.39,-24.93 174.18,-22"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="175.38,-25.31 184.24,-19.5 173.69,-18.52 175.38,-25.31"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.5 KiB |
@@ -1,4 +1,4 @@
|
||||
<map id="probability::windowed_median::WindowedMedian::getMedianNaive" name="probability::windowed_median::WindowedMedian::getMedianNaive">
|
||||
<area shape="rect" id="node1" title="A naive and inefficient method to obtain the median of the sliding window. Used for testing!" alt="" coords="5,5,188,61"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/list/sort.html#" title=" " alt="" coords="236,20,331,47"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/list/sort#" title=" " alt="" coords="236,20,331,47"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
19f277ade2370421aaae477775231f5b
|
||||
60ec4a316eec249d6a705f50aff5a873
|
||||
@@ -23,7 +23,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/list/sort.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/list/sort#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="173,-11.5 173,-30.5 244,-30.5 244,-11.5 173,-11.5"/>
|
||||
<text text-anchor="middle" x="208.5" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::list::sort</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
@@ -1,9 +1,14 @@
|
||||
<map id="probability::windowed_median::WindowedMedian::insert" name="probability::windowed_median::WindowedMedian::insert">
|
||||
<area shape="rect" id="node1" title="Insert a new value to the stream." alt="" coords="5,169,188,225"/>
|
||||
<area shape="rect" id="node2" href="$df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#af544e271ea19a6fd69a6b3ed6816453e" title="Erases a value from a sorted multi-value BST." alt="" coords="236,5,419,61"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/list/front.html#" title=" " alt="" coords="278,85,377,112"/>
|
||||
<area shape="rect" id="node4" href="$df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a3a7f57679e9cd6c9f042dfd0612b2b24" title="Inserts a value to a sorted multi-value BST." alt="" coords="236,136,419,192"/>
|
||||
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/list/pop_front.html#" title=" " alt="" coords="264,216,391,243"/>
|
||||
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/list/push_back.html#" title=" " alt="" coords="259,267,395,293"/>
|
||||
<area shape="rect" id="node7" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/list/size.html#" title=" " alt="" coords="279,317,376,344"/>
|
||||
<area shape="rect" id="node1" title="Insert a new value to the stream." alt="" coords="5,201,188,257"/>
|
||||
<area shape="rect" id="node2" href="$df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#af544e271ea19a6fd69a6b3ed6816453e" title="Erases a value from a sorted multi-value BST." alt="" coords="236,37,419,93"/>
|
||||
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/list/front#" title=" " alt="" coords="278,117,377,144"/>
|
||||
<area shape="rect" id="node7" href="$df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a3a7f57679e9cd6c9f042dfd0612b2b24" title="Inserts a value to a sorted multi-value BST." alt="" coords="236,168,419,224"/>
|
||||
<area shape="rect" id="node10" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/list/pop_front#" title=" " alt="" coords="264,248,391,275"/>
|
||||
<area shape="rect" id="node11" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/list/push_back#" title=" " alt="" coords="259,299,395,325"/>
|
||||
<area shape="rect" id="node12" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/list/size#" title=" " alt="" coords="279,349,376,376"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/multiset/erase#" title=" " alt="" coords="467,5,601,32"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/multiset/find#" title=" " alt="" coords="473,56,595,83"/>
|
||||
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/multiset/size#" title=" " alt="" coords="471,111,597,137"/>
|
||||
<area shape="rect" id="node8" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/multiset/begin#" title=" " alt="" coords="467,168,601,195"/>
|
||||
<area shape="rect" id="node9" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/multiset/insert#" title=" " alt="" coords="467,219,601,245"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
24134f419615a92131c5b25acb3a624d
|
||||
358802a3025258a6fa35e02a4b1aa373
|
||||
@@ -4,11 +4,11 @@
|
||||
<!-- Generated by graphviz version 2.50.0 (20211204.2007)
|
||||
-->
|
||||
<!-- Title: probability::windowed_median::WindowedMedian::insert Pages: 1 -->
|
||||
<svg width="318pt" height="262pt"
|
||||
viewBox="0.00 0.00 318.00 262.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 258)">
|
||||
<svg width="455pt" height="286pt"
|
||||
viewBox="0.00 0.00 455.00 286.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 282)">
|
||||
<title>probability::windowed_median::WindowedMedian::insert</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-258 314,-258 314,4 -4,4"/>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-282 451,-282 451,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
@@ -37,25 +37,25 @@
|
||||
<path fill="none" stroke="midnightblue" d="M88.57,-130.56C108.25,-150.9 140.57,-181.98 173,-203 175.42,-204.57 177.94,-206.09 180.52,-207.57"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="179,-210.73 189.46,-212.4 182.32,-204.57 179,-210.73"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/list/front.html#" xlink:title=" ">
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/list/front#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="204.5,-174.5 204.5,-193.5 278.5,-193.5 278.5,-174.5 204.5,-174.5"/>
|
||||
<text text-anchor="middle" x="241.5" y="-181.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::list::front</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<!-- Node1->Node6 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>Node1->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M104.05,-130.76C123.76,-141.98 149.2,-155.46 173,-165 179.84,-167.74 187.21,-170.25 194.49,-172.48"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="193.71,-175.9 204.29,-175.34 195.68,-169.18 193.71,-175.9"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a xlink:href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a3a7f57679e9cd6c9f042dfd0612b2b24" target="_top" xlink:title="Inserts a value to a sorted multi-value BST.">
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a xlink:href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a3a7f57679e9cd6c9f042dfd0612b2b24" target="_top" xlink:title="Inserts a value to a sorted multi-value BST.">
|
||||
<polygon fill="white" stroke="black" points="173,-114.5 173,-155.5 310,-155.5 310,-114.5 173,-114.5"/>
|
||||
<text text-anchor="start" x="181" y="-143.5" font-family="Helvetica,sans-Serif" font-size="10.00">probability::windowed</text>
|
||||
<text text-anchor="start" x="181" y="-132.5" font-family="Helvetica,sans-Serif" font-size="10.00">_median::WindowedMedian</text>
|
||||
@@ -63,56 +63,137 @@
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<!-- Node1->Node7 -->
|
||||
<g id="edge6" class="edge">
|
||||
<title>Node1->Node7</title>
|
||||
<path fill="none" stroke="midnightblue" d="M137.08,-119.88C145.54,-121.12 154.24,-122.39 162.83,-123.64"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="162.45,-127.13 172.85,-125.11 163.46,-120.2 162.45,-127.13"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/list/pop_front.html#" xlink:title=" ">
|
||||
<!-- Node10 -->
|
||||
<g id="node10" class="node">
|
||||
<title>Node10</title>
|
||||
<g id="a_node10"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/list/pop_front#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="194,-76.5 194,-95.5 289,-95.5 289,-76.5 194,-76.5"/>
|
||||
<text text-anchor="middle" x="241.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::list::pop_front</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node5 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<!-- Node1->Node10 -->
|
||||
<g id="edge10" class="edge">
|
||||
<title>Node1->Node10</title>
|
||||
<path fill="none" stroke="midnightblue" d="M137.08,-100.51C152.56,-98.34 168.85,-96.06 183.81,-93.96"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="184.51,-97.39 193.93,-92.54 183.54,-90.46 184.51,-97.39"/>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/list/push_back.html#" xlink:title=" ">
|
||||
<!-- Node11 -->
|
||||
<g id="node11" class="node">
|
||||
<title>Node11</title>
|
||||
<g id="a_node11"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/list/push_back#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="190.5,-38.5 190.5,-57.5 292.5,-57.5 292.5,-38.5 190.5,-38.5"/>
|
||||
<text text-anchor="middle" x="241.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::list::push_back</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node6 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>Node1->Node6</title>
|
||||
<!-- Node1->Node11 -->
|
||||
<g id="edge11" class="edge">
|
||||
<title>Node1->Node11</title>
|
||||
<path fill="none" stroke="midnightblue" d="M115.67,-89.43C133.42,-81.9 153.97,-73.6 173,-67 179.57,-64.72 186.57,-62.51 193.47,-60.46"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="194.84,-63.71 203.47,-57.57 192.89,-56.98 194.84,-63.71"/>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/list/size.html#" xlink:title=" ">
|
||||
<!-- Node12 -->
|
||||
<g id="node12" class="node">
|
||||
<title>Node12</title>
|
||||
<g id="a_node12"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/list/size#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="205,-0.5 205,-19.5 278,-19.5 278,-0.5 205,-0.5"/>
|
||||
<text text-anchor="middle" x="241.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::list::size</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node7 -->
|
||||
<g id="edge6" class="edge">
|
||||
<title>Node1->Node7</title>
|
||||
<!-- Node1->Node12 -->
|
||||
<g id="edge12" class="edge">
|
||||
<title>Node1->Node12</title>
|
||||
<path fill="none" stroke="midnightblue" d="M90.77,-89.24C110.57,-70.97 141.66,-44.89 173,-29 179.87,-25.52 187.47,-22.59 195.01,-20.17"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="196.24,-23.46 204.84,-17.26 194.26,-16.74 196.24,-23.46"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/multiset/erase#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="346,-258.5 346,-277.5 447,-277.5 447,-258.5 346,-258.5"/>
|
||||
<text text-anchor="middle" x="396.5" y="-265.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::multiset::erase</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M310.05,-248.45C321.45,-251.06 333.12,-253.73 344.03,-256.23"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="343.27,-259.64 353.8,-258.46 344.83,-252.82 343.27,-259.64"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/multiset/find#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="350.5,-220.5 350.5,-239.5 442.5,-239.5 442.5,-220.5 350.5,-220.5"/>
|
||||
<text text-anchor="middle" x="396.5" y="-227.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::multiset::find</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node2->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M310.05,-231.68C320.15,-231.48 330.46,-231.28 340.27,-231.08"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="340.34,-234.58 350.27,-230.89 340.21,-227.58 340.34,-234.58"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/multiset/size#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="349,-179.5 349,-198.5 444,-198.5 444,-179.5 349,-179.5"/>
|
||||
<text text-anchor="middle" x="396.5" y="-186.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::multiset::size</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node5 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>Node2->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M310.05,-213.57C324.47,-209.43 339.32,-205.16 352.51,-201.36"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="353.59,-204.69 362.24,-198.57 351.66,-197.97 353.59,-204.69"/>
|
||||
</g>
|
||||
<!-- Node7->Node5 -->
|
||||
<g id="edge9" class="edge">
|
||||
<title>Node7->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M300.78,-155.57C320.26,-162.45 341.42,-169.91 358.79,-176.04"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="357.94,-179.45 368.53,-179.48 360.27,-172.85 357.94,-179.45"/>
|
||||
</g>
|
||||
<!-- Node8 -->
|
||||
<g id="node8" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_node8"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/multiset/begin#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="346.5,-136.5 346.5,-155.5 446.5,-155.5 446.5,-136.5 346.5,-136.5"/>
|
||||
<text text-anchor="middle" x="396.5" y="-143.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::multiset::begin</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7->Node8 -->
|
||||
<g id="edge7" class="edge">
|
||||
<title>Node7->Node8</title>
|
||||
<path fill="none" stroke="midnightblue" d="M310.05,-139.86C318.7,-140.48 327.51,-141.11 336.02,-141.72"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="336,-145.23 346.22,-142.46 336.5,-138.25 336,-145.23"/>
|
||||
</g>
|
||||
<!-- Node9 -->
|
||||
<g id="node9" class="node">
|
||||
<title>Node9</title>
|
||||
<g id="a_node9"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/multiset/insert#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="346,-98.5 346,-117.5 447,-117.5 447,-98.5 346,-98.5"/>
|
||||
<text text-anchor="middle" x="396.5" y="-105.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::multiset::insert</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7->Node9 -->
|
||||
<g id="edge8" class="edge">
|
||||
<title>Node7->Node9</title>
|
||||
<path fill="none" stroke="midnightblue" d="M310.05,-123.08C318.59,-121.57 327.28,-120.04 335.68,-118.56"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="336.53,-121.96 345.77,-116.78 335.31,-115.07 336.53,-121.96"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1,4 @@
|
||||
<map id="probability::windowed_median::WindowedMedian::getMedian" name="probability::windowed_median::WindowedMedian::getMedian">
|
||||
<area shape="rect" id="node1" title="Gets the median of the values in the sliding window." alt="" coords="5,5,188,61"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/multiset/size#" title=" " alt="" coords="236,20,363,47"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
f214412b290472ad813379143944754f
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.50.0 (20211204.2007)
|
||||
-->
|
||||
<!-- Title: probability::windowed_median::WindowedMedian::getMedian Pages: 1 -->
|
||||
<svg width="276pt" height="50pt"
|
||||
viewBox="0.00 0.00 276.00 50.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 46)">
|
||||
<title>probability::windowed_median::WindowedMedian::getMedian</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-46 272,-46 272,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Gets the median of the values in the sliding window.">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-41.5 137,-41.5 137,-0.5 0,-0.5"/>
|
||||
<text text-anchor="start" x="8" y="-29.5" font-family="Helvetica,sans-Serif" font-size="10.00">probability::windowed</text>
|
||||
<text text-anchor="start" x="8" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">_median::WindowedMedian</text>
|
||||
<text text-anchor="middle" x="68.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">::getMedian</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/multiset/size#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="173,-11.5 173,-30.5 268,-30.5 268,-11.5 173,-11.5"/>
|
||||
<text text-anchor="middle" x="220.5" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::multiset::size</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M137.04,-21C145.66,-21 154.42,-21 162.85,-21"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="162.94,-24.5 172.94,-21 162.93,-17.5 162.94,-24.5"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1,6 @@
|
||||
<map id="probability::windowed_median::WindowedMedian::eraseFromSorted" name="probability::windowed_median::WindowedMedian::eraseFromSorted">
|
||||
<area shape="rect" id="node1" title="Erases a value from a sorted multi-value BST." alt="" coords="5,41,188,97"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/multiset/erase#" title=" " alt="" coords="236,5,371,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/multiset/find#" title=" " alt="" coords="242,56,365,83"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/multiset/size#" title=" " alt="" coords="240,107,367,133"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
460f85bf3f305720f4b853a53a3d8a61
|
||||
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.50.0 (20211204.2007)
|
||||
-->
|
||||
<!-- Title: probability::windowed_median::WindowedMedian::eraseFromSorted Pages: 1 -->
|
||||
<svg width="282pt" height="104pt"
|
||||
viewBox="0.00 0.00 282.00 104.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 100)">
|
||||
<title>probability::windowed_median::WindowedMedian::eraseFromSorted</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-100 278,-100 278,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Erases a value from a sorted multi-value BST.">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-27.5 0,-68.5 137,-68.5 137,-27.5 0,-27.5"/>
|
||||
<text text-anchor="start" x="8" y="-56.5" font-family="Helvetica,sans-Serif" font-size="10.00">probability::windowed</text>
|
||||
<text text-anchor="start" x="8" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">_median::WindowedMedian</text>
|
||||
<text text-anchor="middle" x="68.5" y="-34.5" font-family="Helvetica,sans-Serif" font-size="10.00">::eraseFromSorted</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/multiset/erase#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="173,-76.5 173,-95.5 274,-95.5 274,-76.5 173,-76.5"/>
|
||||
<text text-anchor="middle" x="223.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::multiset::erase</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M137.05,-64.78C149.56,-67.88 162.39,-71.07 174.18,-74"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="173.69,-77.48 184.24,-76.5 175.38,-70.69 173.69,-77.48"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/multiset/find#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="177.5,-38.5 177.5,-57.5 269.5,-57.5 269.5,-38.5 177.5,-38.5"/>
|
||||
<text text-anchor="middle" x="223.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::multiset::find</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M137.05,-48C147.15,-48 157.46,-48 167.27,-48"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="167.27,-51.5 177.27,-48 167.27,-44.5 167.27,-51.5"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/multiset/size#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="176,-0.5 176,-19.5 271,-19.5 271,-0.5 176,-0.5"/>
|
||||
<text text-anchor="middle" x="223.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::multiset::size</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M137.05,-31.22C149.56,-28.12 162.39,-24.93 174.18,-22"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="175.38,-25.31 184.24,-19.5 173.69,-18.52 175.38,-25.31"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.5 KiB |
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.2"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: search/interpolation_search2.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.2 -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
@@ -158,21 +158,21 @@ Functions</h2></td></tr>
|
||||
<dl class="section return"><dt>Returns</dt><dd>index where the value is found </dd>
|
||||
<dd>
|
||||
-1 if not found </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> {</div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keywordtype">int</span> low = 0;</div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keywordtype">int</span> high = n - 1;</div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keywordflow">while</span> (low <= high) {</div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keywordtype">int</span> mid = low + (((high - 1) * (x - A[low])) / (A[high] - A[low]));</div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keywordflow">if</span> (x == A[mid])</div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordflow">return</span> mid; <span class="comment">// Found x, return (exit)</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (x < A[mid])</div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> high = mid - 1; <span class="comment">// X lies before mid</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> low = mid + 1; <span class="comment">// x lies after mid</span></div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> }</div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> </div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordflow">return</span> -1;</div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 15</span> {</div>
|
||||
<div class="line"><span class="lineno"> 16</span> <span class="keywordtype">int</span> low = 0;</div>
|
||||
<div class="line"><span class="lineno"> 17</span> <span class="keywordtype">int</span> high = n - 1;</div>
|
||||
<div class="line"><span class="lineno"> 18</span> <span class="keywordflow">while</span> (low <= high) {</div>
|
||||
<div class="line"><span class="lineno"> 19</span> <span class="keywordtype">int</span> mid = low + (((high - 1) * (x - A[low])) / (A[high] - A[low]));</div>
|
||||
<div class="line"><span class="lineno"> 20</span> <span class="keywordflow">if</span> (x == A[mid])</div>
|
||||
<div class="line"><span class="lineno"> 21</span> <span class="keywordflow">return</span> mid; <span class="comment">// Found x, return (exit)</span></div>
|
||||
<div class="line"><span class="lineno"> 22</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (x < A[mid])</div>
|
||||
<div class="line"><span class="lineno"> 23</span> high = mid - 1; <span class="comment">// X lies before mid</span></div>
|
||||
<div class="line"><span class="lineno"> 24</span> <span class="keywordflow">else</span></div>
|
||||
<div class="line"><span class="lineno"> 25</span> low = mid + 1; <span class="comment">// x lies after mid</span></div>
|
||||
<div class="line"><span class="lineno"> 26</span> }</div>
|
||||
<div class="line"><span class="lineno"> 27</span> </div>
|
||||
<div class="line"><span class="lineno"> 28</span> <span class="keywordflow">return</span> -1;</div>
|
||||
<div class="line"><span class="lineno"> 29</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -193,17 +193,17 @@ Functions</h2></td></tr>
|
||||
</div><div class="memdoc">
|
||||
<p >main function </p>
|
||||
<p >< passed array A inside the InterpolationSearch function</p>
|
||||
<div class="fragment"><div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> {</div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keywordtype">int</span> A[] = {2, 4, 5, 7, 13, 14, 15, 23};</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keywordtype">int</span> x = 17;</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="comment"> ///< passed array A inside the InterpolationSearch function</span></div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="comment"></span> <span class="keywordtype">int</span> index = <a class="code hl_function" href="../../df/d39/interpolation__search2_8cpp.html#aa3ec659ec8394d186c761df81ad1f629">InterpolationSearch</a>(A, 8, x);</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keywordflow">if</span> (index < 0)</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</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">"Number "</span> << x << <span class="stringliteral">" not found"</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"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</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">"Number "</span> << x << <span class="stringliteral">" is at "</span> << index << <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"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 32</span> {</div>
|
||||
<div class="line"><span class="lineno"> 33</span> <span class="keywordtype">int</span> A[] = {2, 4, 5, 7, 13, 14, 15, 23};</div>
|
||||
<div class="line"><span class="lineno"> 34</span> <span class="keywordtype">int</span> x = 17;</div>
|
||||
<div class="line"><span class="lineno"> 35</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 36</span><span class="comment"> ///< passed array A inside the InterpolationSearch function</span></div>
|
||||
<div class="line"><span class="lineno"> 37</span><span class="comment"></span> <span class="keywordtype">int</span> index = <a class="code hl_function" href="../../df/d39/interpolation__search2_8cpp.html#aa3ec659ec8394d186c761df81ad1f629">InterpolationSearch</a>(A, 8, x);</div>
|
||||
<div class="line"><span class="lineno"> 38</span> <span class="keywordflow">if</span> (index < 0)</div>
|
||||
<div class="line"><span class="lineno"> 39</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">"Number "</span> << x << <span class="stringliteral">" not found"</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"> 40</span> <span class="keywordflow">else</span></div>
|
||||
<div class="line"><span class="lineno"> 41</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">"Number "</span> << x << <span class="stringliteral">" is at "</span> << index << <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"> 42</span>}</div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
|
||||
<div class="ttc" id="ainterpolation__search2_8cpp_html_aa3ec659ec8394d186c761df81ad1f629"><div class="ttname"><a href="../../df/d39/interpolation__search2_8cpp.html#aa3ec659ec8394d186c761df81ad1f629">InterpolationSearch</a></div><div class="ttdeci">int InterpolationSearch(int A[], int n, int x)</div><div class="ttdef"><b>Definition:</b> interpolation_search2.cpp:15</div></div>
|
||||
@@ -222,7 +222,7 @@ Here is the call graph for this function:</div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_19b2bf9199a15c634a08b1ede1dd896a.html">search</a></li><li class="navelem"><a class="el" href="../../df/d39/interpolation__search2_8cpp.html">interpolation_search2.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<map id="main" name="main">
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,31,56,57"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="135,5,207,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="135,5,207,32"/>
|
||||
<area shape="rect" id="node3" href="$df/d39/interpolation__search2_8cpp.html#aa3ec659ec8394d186c761df81ad1f629" title=" " alt="" coords="104,56,239,83"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
69f814f7aa0e7ae83c0090105aa7e2ab
|
||||
e318d649328bf40900ba8cc2f7d9fd8d
|
||||
@@ -21,7 +21,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="97.5,-38.5 97.5,-57.5 151.5,-57.5 151.5,-38.5 97.5,-38.5"/>
|
||||
<text text-anchor="middle" x="124.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.2"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: data_structures/binary_search_tree2.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.2 -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
@@ -168,16 +168,16 @@ Functions</h2></td></tr>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<div class="fragment"><div class="line"><a id="l00555" name="l00555"></a><span class="lineno"> 555</span> {</div>
|
||||
<div class="line"><a id="l00556" name="l00556"></a><span class="lineno"> 556</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#a8c882f43e1e52948a7841a8bfb091350">test_insert</a>();</div>
|
||||
<div class="line"><a id="l00557" name="l00557"></a><span class="lineno"> 557</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#ab1333c3ea06dcad896ee204bbd407c4e">test_remove</a>();</div>
|
||||
<div class="line"><a id="l00558" name="l00558"></a><span class="lineno"> 558</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#a1d42876440ac5346e2850a32497385c3">test_contains</a>();</div>
|
||||
<div class="line"><a id="l00559" name="l00559"></a><span class="lineno"> 559</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#a9856b68e2cba50d2e26a1cbe374e0365">test_find_max</a>();</div>
|
||||
<div class="line"><a id="l00560" name="l00560"></a><span class="lineno"> 560</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#af2847a901160fd45b4044550e9921cb4">test_find_min</a>();</div>
|
||||
<div class="line"><a id="l00561" name="l00561"></a><span class="lineno"> 561</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#a06f35064850e891d6fda0093c0d9ee6e">test_get_elements_inorder</a>();</div>
|
||||
<div class="line"><a id="l00562" name="l00562"></a><span class="lineno"> 562</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#ab00b8d0f21aeb5fbddb6decf3bcb640a">test_get_elements_preorder</a>();</div>
|
||||
<div class="line"><a id="l00563" name="l00563"></a><span class="lineno"> 563</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#a94b76f781fcbe1ad0e3397ace6bb1965">test_get_elements_postorder</a>();</div>
|
||||
<div class="line"><a id="l00564" name="l00564"></a><span class="lineno"> 564</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 555</span> {</div>
|
||||
<div class="line"><span class="lineno"> 556</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#a8c882f43e1e52948a7841a8bfb091350">test_insert</a>();</div>
|
||||
<div class="line"><span class="lineno"> 557</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#ab1333c3ea06dcad896ee204bbd407c4e">test_remove</a>();</div>
|
||||
<div class="line"><span class="lineno"> 558</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#a1d42876440ac5346e2850a32497385c3">test_contains</a>();</div>
|
||||
<div class="line"><span class="lineno"> 559</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#a9856b68e2cba50d2e26a1cbe374e0365">test_find_max</a>();</div>
|
||||
<div class="line"><span class="lineno"> 560</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#af2847a901160fd45b4044550e9921cb4">test_find_min</a>();</div>
|
||||
<div class="line"><span class="lineno"> 561</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#a06f35064850e891d6fda0093c0d9ee6e">test_get_elements_inorder</a>();</div>
|
||||
<div class="line"><span class="lineno"> 562</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#ab00b8d0f21aeb5fbddb6decf3bcb640a">test_get_elements_preorder</a>();</div>
|
||||
<div class="line"><span class="lineno"> 563</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#a94b76f781fcbe1ad0e3397ace6bb1965">test_get_elements_postorder</a>();</div>
|
||||
<div class="line"><span class="lineno"> 564</span>}</div>
|
||||
<div class="ttc" id="abinary__search__tree2_8cpp_html_a06f35064850e891d6fda0093c0d9ee6e"><div class="ttname"><a href="../../df/d42/binary__search__tree2_8cpp.html#a06f35064850e891d6fda0093c0d9ee6e">test_get_elements_inorder</a></div><div class="ttdeci">static void test_get_elements_inorder()</div><div class="ttdoc">Function for testing get_elements_inorder().</div><div class="ttdef"><b>Definition:</b> binary_search_tree2.cpp:497</div></div>
|
||||
<div class="ttc" id="abinary__search__tree2_8cpp_html_a1d42876440ac5346e2850a32497385c3"><div class="ttname"><a href="../../df/d42/binary__search__tree2_8cpp.html#a1d42876440ac5346e2850a32497385c3">test_contains</a></div><div class="ttdeci">static void test_contains()</div><div class="ttdoc">Function for testing contains().</div><div class="ttdef"><b>Definition:</b> binary_search_tree2.cpp:428</div></div>
|
||||
<div class="ttc" id="abinary__search__tree2_8cpp_html_a8c882f43e1e52948a7841a8bfb091350"><div class="ttname"><a href="../../df/d42/binary__search__tree2_8cpp.html#a8c882f43e1e52948a7841a8bfb091350">test_insert</a></div><div class="ttdeci">static void test_insert()</div><div class="ttdoc">Function for testing insert().</div><div class="ttdef"><b>Definition:</b> binary_search_tree2.cpp:357</div></div>
|
||||
@@ -214,23 +214,23 @@ Functions</h2></td></tr>
|
||||
|
||||
<p>Function for testing contains(). </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd><code>void</code> </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00428" name="l00428"></a><span class="lineno"> 428</span> {</div>
|
||||
<div class="line"><a id="l00429" name="l00429"></a><span class="lineno"> 429</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">"Testing BST contains..."</span>;</div>
|
||||
<div class="line"><a id="l00430" name="l00430"></a><span class="lineno"> 430</span> </div>
|
||||
<div class="line"><a id="l00431" name="l00431"></a><span class="lineno"> 431</span> <a class="code hl_class" href="../../d9/dde/classbinary__search__tree.html">binary_search_tree<int></a> tree;</div>
|
||||
<div class="line"><a id="l00432" name="l00432"></a><span class="lineno"> 432</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(5);</div>
|
||||
<div class="line"><a id="l00433" name="l00433"></a><span class="lineno"> 433</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(4);</div>
|
||||
<div class="line"><a id="l00434" name="l00434"></a><span class="lineno"> 434</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(3);</div>
|
||||
<div class="line"><a id="l00435" name="l00435"></a><span class="lineno"> 435</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(6);</div>
|
||||
<div class="line"><a id="l00436" name="l00436"></a><span class="lineno"> 436</span> </div>
|
||||
<div class="line"><a id="l00437" name="l00437"></a><span class="lineno"> 437</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#aa4f84b2eec9b9201af1840868ddb5fb2">contains</a>(5));</div>
|
||||
<div class="line"><a id="l00438" name="l00438"></a><span class="lineno"> 438</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#aa4f84b2eec9b9201af1840868ddb5fb2">contains</a>(4));</div>
|
||||
<div class="line"><a id="l00439" name="l00439"></a><span class="lineno"> 439</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#aa4f84b2eec9b9201af1840868ddb5fb2">contains</a>(3));</div>
|
||||
<div class="line"><a id="l00440" name="l00440"></a><span class="lineno"> 440</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#aa4f84b2eec9b9201af1840868ddb5fb2">contains</a>(6));</div>
|
||||
<div class="line"><a id="l00441" name="l00441"></a><span class="lineno"> 441</span> assert(!tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#aa4f84b2eec9b9201af1840868ddb5fb2">contains</a>(999));</div>
|
||||
<div class="line"><a id="l00442" name="l00442"></a><span class="lineno"> 442</span> </div>
|
||||
<div class="line"><a id="l00443" name="l00443"></a><span class="lineno"> 443</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">"ok"</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"><a id="l00444" name="l00444"></a><span class="lineno"> 444</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 428</span> {</div>
|
||||
<div class="line"><span class="lineno"> 429</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">"Testing BST contains..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 430</span> </div>
|
||||
<div class="line"><span class="lineno"> 431</span> <a class="code hl_class" href="../../d9/dde/classbinary__search__tree.html">binary_search_tree<int></a> tree;</div>
|
||||
<div class="line"><span class="lineno"> 432</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(5);</div>
|
||||
<div class="line"><span class="lineno"> 433</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(4);</div>
|
||||
<div class="line"><span class="lineno"> 434</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(3);</div>
|
||||
<div class="line"><span class="lineno"> 435</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(6);</div>
|
||||
<div class="line"><span class="lineno"> 436</span> </div>
|
||||
<div class="line"><span class="lineno"> 437</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#aa4f84b2eec9b9201af1840868ddb5fb2">contains</a>(5));</div>
|
||||
<div class="line"><span class="lineno"> 438</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#aa4f84b2eec9b9201af1840868ddb5fb2">contains</a>(4));</div>
|
||||
<div class="line"><span class="lineno"> 439</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#aa4f84b2eec9b9201af1840868ddb5fb2">contains</a>(3));</div>
|
||||
<div class="line"><span class="lineno"> 440</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#aa4f84b2eec9b9201af1840868ddb5fb2">contains</a>(6));</div>
|
||||
<div class="line"><span class="lineno"> 441</span> assert(!tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#aa4f84b2eec9b9201af1840868ddb5fb2">contains</a>(999));</div>
|
||||
<div class="line"><span class="lineno"> 442</span> </div>
|
||||
<div class="line"><span class="lineno"> 443</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">"ok"</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"> 444</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="aclassbinary__search__tree_html"><div class="ttname"><a href="../../d9/dde/classbinary__search__tree.html">binary_search_tree</a></div><div class="ttdoc">The Binary Search Tree class.</div><div class="ttdef"><b>Definition:</b> binary_search_tree2.cpp:19</div></div>
|
||||
<div class="ttc" id="aclassbinary__search__tree_html_a9d1e7e10efa74d741bf48cf032df3778"><div class="ttname"><a href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">binary_search_tree::insert</a></div><div class="ttdeci">bool insert(std::unique_ptr< bst_node > &node, T new_value)</div><div class="ttdoc">Recursive function to insert a value into the BST.</div><div class="ttdef"><b>Definition:</b> binary_search_tree2.cpp:89</div></div>
|
||||
@@ -270,23 +270,23 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Function for testing find_max(). </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd><code>void</code> </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00474" name="l00474"></a><span class="lineno"> 474</span> {</div>
|
||||
<div class="line"><a id="l00475" name="l00475"></a><span class="lineno"> 475</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">"Testing BST find_max..."</span>;</div>
|
||||
<div class="line"><a id="l00476" name="l00476"></a><span class="lineno"> 476</span> </div>
|
||||
<div class="line"><a id="l00477" name="l00477"></a><span class="lineno"> 477</span> <span class="keywordtype">int</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/max.html">max</a> = 0;</div>
|
||||
<div class="line"><a id="l00478" name="l00478"></a><span class="lineno"> 478</span> <a class="code hl_class" href="../../d9/dde/classbinary__search__tree.html">binary_search_tree<int></a> tree;</div>
|
||||
<div class="line"><a id="l00479" name="l00479"></a><span class="lineno"> 479</span> assert(!tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a75f897af6aa732a9901454401c869bcb">find_max</a>(max));</div>
|
||||
<div class="line"><a id="l00480" name="l00480"></a><span class="lineno"> 480</span> </div>
|
||||
<div class="line"><a id="l00481" name="l00481"></a><span class="lineno"> 481</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(5);</div>
|
||||
<div class="line"><a id="l00482" name="l00482"></a><span class="lineno"> 482</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(4);</div>
|
||||
<div class="line"><a id="l00483" name="l00483"></a><span class="lineno"> 483</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(3);</div>
|
||||
<div class="line"><a id="l00484" name="l00484"></a><span class="lineno"> 484</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(6);</div>
|
||||
<div class="line"><a id="l00485" name="l00485"></a><span class="lineno"> 485</span> </div>
|
||||
<div class="line"><a id="l00486" name="l00486"></a><span class="lineno"> 486</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a75f897af6aa732a9901454401c869bcb">find_max</a>(max));</div>
|
||||
<div class="line"><a id="l00487" name="l00487"></a><span class="lineno"> 487</span> assert(max == 6);</div>
|
||||
<div class="line"><a id="l00488" name="l00488"></a><span class="lineno"> 488</span> </div>
|
||||
<div class="line"><a id="l00489" name="l00489"></a><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">"ok"</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"><a id="l00490" name="l00490"></a><span class="lineno"> 490</span>}</div>
|
||||
<div class="fragment"><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/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Testing BST find_max..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 476</span> </div>
|
||||
<div class="line"><span class="lineno"> 477</span> <span class="keywordtype">int</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/max.html">max</a> = 0;</div>
|
||||
<div class="line"><span class="lineno"> 478</span> <a class="code hl_class" href="../../d9/dde/classbinary__search__tree.html">binary_search_tree<int></a> tree;</div>
|
||||
<div class="line"><span class="lineno"> 479</span> assert(!tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a75f897af6aa732a9901454401c869bcb">find_max</a>(max));</div>
|
||||
<div class="line"><span class="lineno"> 480</span> </div>
|
||||
<div class="line"><span class="lineno"> 481</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(5);</div>
|
||||
<div class="line"><span class="lineno"> 482</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(4);</div>
|
||||
<div class="line"><span class="lineno"> 483</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(3);</div>
|
||||
<div class="line"><span class="lineno"> 484</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(6);</div>
|
||||
<div class="line"><span class="lineno"> 485</span> </div>
|
||||
<div class="line"><span class="lineno"> 486</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a75f897af6aa732a9901454401c869bcb">find_max</a>(max));</div>
|
||||
<div class="line"><span class="lineno"> 487</span> assert(max == 6);</div>
|
||||
<div class="line"><span class="lineno"> 488</span> </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">"ok"</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"> 490</span>}</div>
|
||||
<div class="ttc" id="aclassbinary__search__tree_html_a75f897af6aa732a9901454401c869bcb"><div class="ttname"><a href="../../d9/dde/classbinary__search__tree.html#a75f897af6aa732a9901454401c869bcb">binary_search_tree::find_max</a></div><div class="ttdeci">bool find_max(std::unique_ptr< bst_node > &node, T &ret_value)</div><div class="ttdoc">Recursive function to find the maximum value in the BST.</div><div class="ttdef"><b>Definition:</b> binary_search_tree2.cpp:52</div></div>
|
||||
<div class="ttc" id="amax_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/max.html">std::max</a></div><div class="ttdeci">T max(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
@@ -323,23 +323,23 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Function for testing find_min(). </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd><code>void</code> </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00451" name="l00451"></a><span class="lineno"> 451</span> {</div>
|
||||
<div class="line"><a id="l00452" name="l00452"></a><span class="lineno"> 452</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">"Testing BST find_min..."</span>;</div>
|
||||
<div class="line"><a id="l00453" name="l00453"></a><span class="lineno"> 453</span> </div>
|
||||
<div class="line"><a id="l00454" name="l00454"></a><span class="lineno"> 454</span> <span class="keywordtype">int</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">min</a> = 0;</div>
|
||||
<div class="line"><a id="l00455" name="l00455"></a><span class="lineno"> 455</span> <a class="code hl_class" href="../../d9/dde/classbinary__search__tree.html">binary_search_tree<int></a> tree;</div>
|
||||
<div class="line"><a id="l00456" name="l00456"></a><span class="lineno"> 456</span> assert(!tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af9a2c7c187a7ca3142c77ce342ef3153">find_min</a>(min));</div>
|
||||
<div class="line"><a id="l00457" name="l00457"></a><span class="lineno"> 457</span> </div>
|
||||
<div class="line"><a id="l00458" name="l00458"></a><span class="lineno"> 458</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(5);</div>
|
||||
<div class="line"><a id="l00459" name="l00459"></a><span class="lineno"> 459</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(4);</div>
|
||||
<div class="line"><a id="l00460" name="l00460"></a><span class="lineno"> 460</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(3);</div>
|
||||
<div class="line"><a id="l00461" name="l00461"></a><span class="lineno"> 461</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(6);</div>
|
||||
<div class="line"><a id="l00462" name="l00462"></a><span class="lineno"> 462</span> </div>
|
||||
<div class="line"><a id="l00463" name="l00463"></a><span class="lineno"> 463</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af9a2c7c187a7ca3142c77ce342ef3153">find_min</a>(min));</div>
|
||||
<div class="line"><a id="l00464" name="l00464"></a><span class="lineno"> 464</span> assert(min == 3);</div>
|
||||
<div class="line"><a id="l00465" name="l00465"></a><span class="lineno"> 465</span> </div>
|
||||
<div class="line"><a id="l00466" name="l00466"></a><span class="lineno"> 466</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">"ok"</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"><a id="l00467" name="l00467"></a><span class="lineno"> 467</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 451</span> {</div>
|
||||
<div class="line"><span class="lineno"> 452</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">"Testing BST find_min..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 453</span> </div>
|
||||
<div class="line"><span class="lineno"> 454</span> <span class="keywordtype">int</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">min</a> = 0;</div>
|
||||
<div class="line"><span class="lineno"> 455</span> <a class="code hl_class" href="../../d9/dde/classbinary__search__tree.html">binary_search_tree<int></a> tree;</div>
|
||||
<div class="line"><span class="lineno"> 456</span> assert(!tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af9a2c7c187a7ca3142c77ce342ef3153">find_min</a>(min));</div>
|
||||
<div class="line"><span class="lineno"> 457</span> </div>
|
||||
<div class="line"><span class="lineno"> 458</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(5);</div>
|
||||
<div class="line"><span class="lineno"> 459</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(4);</div>
|
||||
<div class="line"><span class="lineno"> 460</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(3);</div>
|
||||
<div class="line"><span class="lineno"> 461</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(6);</div>
|
||||
<div class="line"><span class="lineno"> 462</span> </div>
|
||||
<div class="line"><span class="lineno"> 463</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af9a2c7c187a7ca3142c77ce342ef3153">find_min</a>(min));</div>
|
||||
<div class="line"><span class="lineno"> 464</span> assert(min == 3);</div>
|
||||
<div class="line"><span class="lineno"> 465</span> </div>
|
||||
<div class="line"><span class="lineno"> 466</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">"ok"</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"> 467</span>}</div>
|
||||
<div class="ttc" id="aclassbinary__search__tree_html_af9a2c7c187a7ca3142c77ce342ef3153"><div class="ttname"><a href="../../d9/dde/classbinary__search__tree.html#af9a2c7c187a7ca3142c77ce342ef3153">binary_search_tree::find_min</a></div><div class="ttdeci">bool find_min(std::unique_ptr< bst_node > &node, T &ret_value)</div><div class="ttdoc">Recursive function to find the minimum value in the BST.</div><div class="ttdef"><b>Definition:</b> binary_search_tree2.cpp:70</div></div>
|
||||
<div class="ttc" id="amin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a></div><div class="ttdeci">T min(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
@@ -376,23 +376,23 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Function for testing get_elements_inorder(). </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd><code>void</code> </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00497" name="l00497"></a><span class="lineno"> 497</span> {</div>
|
||||
<div class="line"><a id="l00498" name="l00498"></a><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">"Testing BST get_elements_inorder..."</span>;</div>
|
||||
<div class="line"><a id="l00499" name="l00499"></a><span class="lineno"> 499</span> </div>
|
||||
<div class="line"><a id="l00500" name="l00500"></a><span class="lineno"> 500</span> <a class="code hl_class" href="../../d9/dde/classbinary__search__tree.html">binary_search_tree<int></a> tree;</div>
|
||||
<div class="line"><a id="l00501" name="l00501"></a><span class="lineno"> 501</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(5);</div>
|
||||
<div class="line"><a id="l00502" name="l00502"></a><span class="lineno"> 502</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(4);</div>
|
||||
<div class="line"><a id="l00503" name="l00503"></a><span class="lineno"> 503</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(3);</div>
|
||||
<div class="line"><a id="l00504" name="l00504"></a><span class="lineno"> 504</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(6);</div>
|
||||
<div class="line"><a id="l00505" name="l00505"></a><span class="lineno"> 505</span> </div>
|
||||
<div class="line"><a id="l00506" name="l00506"></a><span class="lineno"> 506</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int></a> expected = {3, 4, 5, 6};</div>
|
||||
<div class="line"><a id="l00507" name="l00507"></a><span class="lineno"> 507</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int></a> actual = tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a1f23830316204664514f396a4eb5275a">get_elements_inorder</a>();</div>
|
||||
<div class="line"><a id="l00508" name="l00508"></a><span class="lineno"> 508</span> assert(actual == expected);</div>
|
||||
<div class="line"><a id="l00509" name="l00509"></a><span class="lineno"> 509</span> </div>
|
||||
<div class="line"><a id="l00510" name="l00510"></a><span class="lineno"> 510</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">"ok"</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"><a id="l00511" name="l00511"></a><span class="lineno"> 511</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 497</span> {</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">"Testing BST get_elements_inorder..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 499</span> </div>
|
||||
<div class="line"><span class="lineno"> 500</span> <a class="code hl_class" href="../../d9/dde/classbinary__search__tree.html">binary_search_tree<int></a> tree;</div>
|
||||
<div class="line"><span class="lineno"> 501</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(5);</div>
|
||||
<div class="line"><span class="lineno"> 502</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(4);</div>
|
||||
<div class="line"><span class="lineno"> 503</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(3);</div>
|
||||
<div class="line"><span class="lineno"> 504</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(6);</div>
|
||||
<div class="line"><span class="lineno"> 505</span> </div>
|
||||
<div class="line"><span class="lineno"> 506</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int></a> expected = {3, 4, 5, 6};</div>
|
||||
<div class="line"><span class="lineno"> 507</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int></a> actual = tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a1f23830316204664514f396a4eb5275a">get_elements_inorder</a>();</div>
|
||||
<div class="line"><span class="lineno"> 508</span> assert(actual == expected);</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/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"ok"</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"> 511</span>}</div>
|
||||
<div class="ttc" id="aclassbinary__search__tree_html_a1f23830316204664514f396a4eb5275a"><div class="ttname"><a href="../../d9/dde/classbinary__search__tree.html#a1f23830316204664514f396a4eb5275a">binary_search_tree::get_elements_inorder</a></div><div class="ttdeci">std::vector< T > get_elements_inorder()</div><div class="ttdoc">Get all values of the BST in in-order order.</div><div class="ttdef"><b>Definition:</b> binary_search_tree2.cpp:320</div></div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector< int ></a></div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -427,21 +427,21 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Function for testing get_elements_postorder(). </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd><code>void</code> </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00539" name="l00539"></a><span class="lineno"> 539</span> {</div>
|
||||
<div class="line"><a id="l00540" name="l00540"></a><span class="lineno"> 540</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">"Testing BST get_elements_postorder..."</span>;</div>
|
||||
<div class="line"><a id="l00541" name="l00541"></a><span class="lineno"> 541</span> </div>
|
||||
<div class="line"><a id="l00542" name="l00542"></a><span class="lineno"> 542</span> <a class="code hl_class" href="../../d9/dde/classbinary__search__tree.html">binary_search_tree<int></a> tree;</div>
|
||||
<div class="line"><a id="l00543" name="l00543"></a><span class="lineno"> 543</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(5);</div>
|
||||
<div class="line"><a id="l00544" name="l00544"></a><span class="lineno"> 544</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(4);</div>
|
||||
<div class="line"><a id="l00545" name="l00545"></a><span class="lineno"> 545</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(3);</div>
|
||||
<div class="line"><a id="l00546" name="l00546"></a><span class="lineno"> 546</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(6);</div>
|
||||
<div class="line"><a id="l00547" name="l00547"></a><span class="lineno"> 547</span> </div>
|
||||
<div class="line"><a id="l00548" name="l00548"></a><span class="lineno"> 548</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int></a> expected = {3, 4, 6, 5};</div>
|
||||
<div class="line"><a id="l00549" name="l00549"></a><span class="lineno"> 549</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int></a> actual = tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a5c011e1b0863d79c3a7c11a0426bdcff">get_elements_postorder</a>();</div>
|
||||
<div class="line"><a id="l00550" name="l00550"></a><span class="lineno"> 550</span> assert(actual == expected);</div>
|
||||
<div class="line"><a id="l00551" name="l00551"></a><span class="lineno"> 551</span> </div>
|
||||
<div class="line"><a id="l00552" name="l00552"></a><span class="lineno"> 552</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">"ok"</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"><a id="l00553" name="l00553"></a><span class="lineno"> 553</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 539</span> {</div>
|
||||
<div class="line"><span class="lineno"> 540</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">"Testing BST get_elements_postorder..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 541</span> </div>
|
||||
<div class="line"><span class="lineno"> 542</span> <a class="code hl_class" href="../../d9/dde/classbinary__search__tree.html">binary_search_tree<int></a> tree;</div>
|
||||
<div class="line"><span class="lineno"> 543</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(5);</div>
|
||||
<div class="line"><span class="lineno"> 544</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(4);</div>
|
||||
<div class="line"><span class="lineno"> 545</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(3);</div>
|
||||
<div class="line"><span class="lineno"> 546</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(6);</div>
|
||||
<div class="line"><span class="lineno"> 547</span> </div>
|
||||
<div class="line"><span class="lineno"> 548</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int></a> expected = {3, 4, 6, 5};</div>
|
||||
<div class="line"><span class="lineno"> 549</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int></a> actual = tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a5c011e1b0863d79c3a7c11a0426bdcff">get_elements_postorder</a>();</div>
|
||||
<div class="line"><span class="lineno"> 550</span> assert(actual == expected);</div>
|
||||
<div class="line"><span class="lineno"> 551</span> </div>
|
||||
<div class="line"><span class="lineno"> 552</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">"ok"</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"> 553</span>}</div>
|
||||
<div class="ttc" id="aclassbinary__search__tree_html_a5c011e1b0863d79c3a7c11a0426bdcff"><div class="ttname"><a href="../../d9/dde/classbinary__search__tree.html#a5c011e1b0863d79c3a7c11a0426bdcff">binary_search_tree::get_elements_postorder</a></div><div class="ttdeci">std::vector< T > get_elements_postorder()</div><div class="ttdoc">Get all values of the BST in post-order order.</div><div class="ttdef"><b>Definition:</b> binary_search_tree2.cpp:344</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -477,21 +477,21 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Function for testing get_elements_preorder(). </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd><code>void</code> </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00518" name="l00518"></a><span class="lineno"> 518</span> {</div>
|
||||
<div class="line"><a id="l00519" name="l00519"></a><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">"Testing BST get_elements_preorder..."</span>;</div>
|
||||
<div class="line"><a id="l00520" name="l00520"></a><span class="lineno"> 520</span> </div>
|
||||
<div class="line"><a id="l00521" name="l00521"></a><span class="lineno"> 521</span> <a class="code hl_class" href="../../d9/dde/classbinary__search__tree.html">binary_search_tree<int></a> tree;</div>
|
||||
<div class="line"><a id="l00522" name="l00522"></a><span class="lineno"> 522</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(5);</div>
|
||||
<div class="line"><a id="l00523" name="l00523"></a><span class="lineno"> 523</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(4);</div>
|
||||
<div class="line"><a id="l00524" name="l00524"></a><span class="lineno"> 524</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(3);</div>
|
||||
<div class="line"><a id="l00525" name="l00525"></a><span class="lineno"> 525</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(6);</div>
|
||||
<div class="line"><a id="l00526" name="l00526"></a><span class="lineno"> 526</span> </div>
|
||||
<div class="line"><a id="l00527" name="l00527"></a><span class="lineno"> 527</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int></a> expected = {5, 4, 3, 6};</div>
|
||||
<div class="line"><a id="l00528" name="l00528"></a><span class="lineno"> 528</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int></a> actual = tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a5764c1cf848f84a5b77462036a6d8c13">get_elements_preorder</a>();</div>
|
||||
<div class="line"><a id="l00529" name="l00529"></a><span class="lineno"> 529</span> assert(actual == expected);</div>
|
||||
<div class="line"><a id="l00530" name="l00530"></a><span class="lineno"> 530</span> </div>
|
||||
<div class="line"><a id="l00531" name="l00531"></a><span class="lineno"> 531</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">"ok"</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"><a id="l00532" name="l00532"></a><span class="lineno"> 532</span>}</div>
|
||||
<div class="fragment"><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/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Testing BST get_elements_preorder..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 520</span> </div>
|
||||
<div class="line"><span class="lineno"> 521</span> <a class="code hl_class" href="../../d9/dde/classbinary__search__tree.html">binary_search_tree<int></a> tree;</div>
|
||||
<div class="line"><span class="lineno"> 522</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(5);</div>
|
||||
<div class="line"><span class="lineno"> 523</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(4);</div>
|
||||
<div class="line"><span class="lineno"> 524</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(3);</div>
|
||||
<div class="line"><span class="lineno"> 525</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(6);</div>
|
||||
<div class="line"><span class="lineno"> 526</span> </div>
|
||||
<div class="line"><span class="lineno"> 527</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int></a> expected = {5, 4, 3, 6};</div>
|
||||
<div class="line"><span class="lineno"> 528</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int></a> actual = tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a5764c1cf848f84a5b77462036a6d8c13">get_elements_preorder</a>();</div>
|
||||
<div class="line"><span class="lineno"> 529</span> assert(actual == expected);</div>
|
||||
<div class="line"><span class="lineno"> 530</span> </div>
|
||||
<div class="line"><span class="lineno"> 531</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">"ok"</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"> 532</span>}</div>
|
||||
<div class="ttc" id="aclassbinary__search__tree_html_a5764c1cf848f84a5b77462036a6d8c13"><div class="ttname"><a href="../../d9/dde/classbinary__search__tree.html#a5764c1cf848f84a5b77462036a6d8c13">binary_search_tree::get_elements_preorder</a></div><div class="ttdeci">std::vector< T > get_elements_preorder()</div><div class="ttdoc">Get all values of the BST in pre-order order.</div><div class="ttdef"><b>Definition:</b> binary_search_tree2.cpp:332</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -527,34 +527,34 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Function for testing <a class="el" href="../../d8/dee/avltree_8cpp.html#a2473fe7416332495b2678ebe89652e4b">insert()</a>. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd><code>void</code> </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00357" name="l00357"></a><span class="lineno"> 357</span> {</div>
|
||||
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno"> 358</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">"Testing BST insert..."</span>;</div>
|
||||
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno"> 359</span> </div>
|
||||
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno"> 360</span> <a class="code hl_class" href="../../d9/dde/classbinary__search__tree.html">binary_search_tree<int></a> tree;</div>
|
||||
<div class="line"><a id="l00361" name="l00361"></a><span class="lineno"> 361</span> <span class="keywordtype">bool</span> res = tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(5);</div>
|
||||
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno"> 362</span> <span class="keywordtype">int</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">min</a> = -1, <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/max.html">max</a> = -1;</div>
|
||||
<div class="line"><a id="l00363" name="l00363"></a><span class="lineno"> 363</span> assert(res);</div>
|
||||
<div class="line"><a id="l00364" name="l00364"></a><span class="lineno"> 364</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a75f897af6aa732a9901454401c869bcb">find_max</a>(max));</div>
|
||||
<div class="line"><a id="l00365" name="l00365"></a><span class="lineno"> 365</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af9a2c7c187a7ca3142c77ce342ef3153">find_min</a>(min));</div>
|
||||
<div class="line"><a id="l00366" name="l00366"></a><span class="lineno"> 366</span> assert(max == 5);</div>
|
||||
<div class="line"><a id="l00367" name="l00367"></a><span class="lineno"> 367</span> assert(min == 5);</div>
|
||||
<div class="line"><a id="l00368" name="l00368"></a><span class="lineno"> 368</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a564fe43e7e8f7ecb6f10667a70fbc6f3">size</a>() == 1);</div>
|
||||
<div class="line"><a id="l00369" name="l00369"></a><span class="lineno"> 369</span> </div>
|
||||
<div class="line"><a id="l00370" name="l00370"></a><span class="lineno"> 370</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(4);</div>
|
||||
<div class="line"><a id="l00371" name="l00371"></a><span class="lineno"> 371</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(3);</div>
|
||||
<div class="line"><a id="l00372" name="l00372"></a><span class="lineno"> 372</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(6);</div>
|
||||
<div class="line"><a id="l00373" name="l00373"></a><span class="lineno"> 373</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a75f897af6aa732a9901454401c869bcb">find_max</a>(max));</div>
|
||||
<div class="line"><a id="l00374" name="l00374"></a><span class="lineno"> 374</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af9a2c7c187a7ca3142c77ce342ef3153">find_min</a>(min));</div>
|
||||
<div class="line"><a id="l00375" name="l00375"></a><span class="lineno"> 375</span> assert(max == 6);</div>
|
||||
<div class="line"><a id="l00376" name="l00376"></a><span class="lineno"> 376</span> assert(min == 3);</div>
|
||||
<div class="line"><a id="l00377" name="l00377"></a><span class="lineno"> 377</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a564fe43e7e8f7ecb6f10667a70fbc6f3">size</a>() == 4);</div>
|
||||
<div class="line"><a id="l00378" name="l00378"></a><span class="lineno"> 378</span> </div>
|
||||
<div class="line"><a id="l00379" name="l00379"></a><span class="lineno"> 379</span> <span class="keywordtype">bool</span> fail_res = tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(4);</div>
|
||||
<div class="line"><a id="l00380" name="l00380"></a><span class="lineno"> 380</span> assert(!fail_res);</div>
|
||||
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno"> 381</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a564fe43e7e8f7ecb6f10667a70fbc6f3">size</a>() == 4);</div>
|
||||
<div class="line"><a id="l00382" name="l00382"></a><span class="lineno"> 382</span> </div>
|
||||
<div class="line"><a id="l00383" name="l00383"></a><span class="lineno"> 383</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">"ok"</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"><a id="l00384" name="l00384"></a><span class="lineno"> 384</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 357</span> {</div>
|
||||
<div class="line"><span class="lineno"> 358</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">"Testing BST insert..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 359</span> </div>
|
||||
<div class="line"><span class="lineno"> 360</span> <a class="code hl_class" href="../../d9/dde/classbinary__search__tree.html">binary_search_tree<int></a> tree;</div>
|
||||
<div class="line"><span class="lineno"> 361</span> <span class="keywordtype">bool</span> res = tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(5);</div>
|
||||
<div class="line"><span class="lineno"> 362</span> <span class="keywordtype">int</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">min</a> = -1, <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/max.html">max</a> = -1;</div>
|
||||
<div class="line"><span class="lineno"> 363</span> assert(res);</div>
|
||||
<div class="line"><span class="lineno"> 364</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a75f897af6aa732a9901454401c869bcb">find_max</a>(max));</div>
|
||||
<div class="line"><span class="lineno"> 365</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af9a2c7c187a7ca3142c77ce342ef3153">find_min</a>(min));</div>
|
||||
<div class="line"><span class="lineno"> 366</span> assert(max == 5);</div>
|
||||
<div class="line"><span class="lineno"> 367</span> assert(min == 5);</div>
|
||||
<div class="line"><span class="lineno"> 368</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a564fe43e7e8f7ecb6f10667a70fbc6f3">size</a>() == 1);</div>
|
||||
<div class="line"><span class="lineno"> 369</span> </div>
|
||||
<div class="line"><span class="lineno"> 370</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(4);</div>
|
||||
<div class="line"><span class="lineno"> 371</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(3);</div>
|
||||
<div class="line"><span class="lineno"> 372</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(6);</div>
|
||||
<div class="line"><span class="lineno"> 373</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a75f897af6aa732a9901454401c869bcb">find_max</a>(max));</div>
|
||||
<div class="line"><span class="lineno"> 374</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af9a2c7c187a7ca3142c77ce342ef3153">find_min</a>(min));</div>
|
||||
<div class="line"><span class="lineno"> 375</span> assert(max == 6);</div>
|
||||
<div class="line"><span class="lineno"> 376</span> assert(min == 3);</div>
|
||||
<div class="line"><span class="lineno"> 377</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a564fe43e7e8f7ecb6f10667a70fbc6f3">size</a>() == 4);</div>
|
||||
<div class="line"><span class="lineno"> 378</span> </div>
|
||||
<div class="line"><span class="lineno"> 379</span> <span class="keywordtype">bool</span> fail_res = tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(4);</div>
|
||||
<div class="line"><span class="lineno"> 380</span> assert(!fail_res);</div>
|
||||
<div class="line"><span class="lineno"> 381</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a564fe43e7e8f7ecb6f10667a70fbc6f3">size</a>() == 4);</div>
|
||||
<div class="line"><span class="lineno"> 382</span> </div>
|
||||
<div class="line"><span class="lineno"> 383</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">"ok"</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"> 384</span>}</div>
|
||||
<div class="ttc" id="aclassbinary__search__tree_html_a564fe43e7e8f7ecb6f10667a70fbc6f3"><div class="ttname"><a href="../../d9/dde/classbinary__search__tree.html#a564fe43e7e8f7ecb6f10667a70fbc6f3">binary_search_tree::size</a></div><div class="ttdeci">std::size_t size()</div><div class="ttdoc">Get the number of values in the BST.</div><div class="ttdef"><b>Definition:</b> binary_search_tree2.cpp:313</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -590,37 +590,37 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Function for testing <a class="el" href="../../d0/d65/namespacedouble__hashing.html#a28083ecac6eb94b643281875c8665931">remove()</a>. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd><code>void</code> </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00391" name="l00391"></a><span class="lineno"> 391</span> {</div>
|
||||
<div class="line"><a id="l00392" name="l00392"></a><span class="lineno"> 392</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">"Testing BST remove..."</span>;</div>
|
||||
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno"> 393</span> </div>
|
||||
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno"> 394</span> <a class="code hl_class" href="../../d9/dde/classbinary__search__tree.html">binary_search_tree<int></a> tree;</div>
|
||||
<div class="line"><a id="l00395" name="l00395"></a><span class="lineno"> 395</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(5);</div>
|
||||
<div class="line"><a id="l00396" name="l00396"></a><span class="lineno"> 396</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(4);</div>
|
||||
<div class="line"><a id="l00397" name="l00397"></a><span class="lineno"> 397</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(3);</div>
|
||||
<div class="line"><a id="l00398" name="l00398"></a><span class="lineno"> 398</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(6);</div>
|
||||
<div class="line"><a id="l00399" name="l00399"></a><span class="lineno"> 399</span> </div>
|
||||
<div class="line"><a id="l00400" name="l00400"></a><span class="lineno"> 400</span> <span class="keywordtype">bool</span> res = tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af4a865ce5244608819b169fc78a41153">remove</a>(5);</div>
|
||||
<div class="line"><a id="l00401" name="l00401"></a><span class="lineno"> 401</span> <span class="keywordtype">int</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">min</a> = -1, <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/max.html">max</a> = -1;</div>
|
||||
<div class="line"><a id="l00402" name="l00402"></a><span class="lineno"> 402</span> assert(res);</div>
|
||||
<div class="line"><a id="l00403" name="l00403"></a><span class="lineno"> 403</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a75f897af6aa732a9901454401c869bcb">find_max</a>(max));</div>
|
||||
<div class="line"><a id="l00404" name="l00404"></a><span class="lineno"> 404</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af9a2c7c187a7ca3142c77ce342ef3153">find_min</a>(min));</div>
|
||||
<div class="line"><a id="l00405" name="l00405"></a><span class="lineno"> 405</span> assert(max == 6);</div>
|
||||
<div class="line"><a id="l00406" name="l00406"></a><span class="lineno"> 406</span> assert(min == 3);</div>
|
||||
<div class="line"><a id="l00407" name="l00407"></a><span class="lineno"> 407</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a564fe43e7e8f7ecb6f10667a70fbc6f3">size</a>() == 3);</div>
|
||||
<div class="line"><a id="l00408" name="l00408"></a><span class="lineno"> 408</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#aa4f84b2eec9b9201af1840868ddb5fb2">contains</a>(5) == <span class="keyword">false</span>);</div>
|
||||
<div class="line"><a id="l00409" name="l00409"></a><span class="lineno"> 409</span> </div>
|
||||
<div class="line"><a id="l00410" name="l00410"></a><span class="lineno"> 410</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af4a865ce5244608819b169fc78a41153">remove</a>(4);</div>
|
||||
<div class="line"><a id="l00411" name="l00411"></a><span class="lineno"> 411</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af4a865ce5244608819b169fc78a41153">remove</a>(3);</div>
|
||||
<div class="line"><a id="l00412" name="l00412"></a><span class="lineno"> 412</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af4a865ce5244608819b169fc78a41153">remove</a>(6);</div>
|
||||
<div class="line"><a id="l00413" name="l00413"></a><span class="lineno"> 413</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a564fe43e7e8f7ecb6f10667a70fbc6f3">size</a>() == 0);</div>
|
||||
<div class="line"><a id="l00414" name="l00414"></a><span class="lineno"> 414</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#aa4f84b2eec9b9201af1840868ddb5fb2">contains</a>(6) == <span class="keyword">false</span>);</div>
|
||||
<div class="line"><a id="l00415" name="l00415"></a><span class="lineno"> 415</span> </div>
|
||||
<div class="line"><a id="l00416" name="l00416"></a><span class="lineno"> 416</span> <span class="keywordtype">bool</span> fail_res = tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af4a865ce5244608819b169fc78a41153">remove</a>(5);</div>
|
||||
<div class="line"><a id="l00417" name="l00417"></a><span class="lineno"> 417</span> assert(!fail_res);</div>
|
||||
<div class="line"><a id="l00418" name="l00418"></a><span class="lineno"> 418</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a564fe43e7e8f7ecb6f10667a70fbc6f3">size</a>() == 0);</div>
|
||||
<div class="line"><a id="l00419" name="l00419"></a><span class="lineno"> 419</span> </div>
|
||||
<div class="line"><a id="l00420" name="l00420"></a><span class="lineno"> 420</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"ok"</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"><a id="l00421" name="l00421"></a><span class="lineno"> 421</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 391</span> {</div>
|
||||
<div class="line"><span class="lineno"> 392</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">"Testing BST remove..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 393</span> </div>
|
||||
<div class="line"><span class="lineno"> 394</span> <a class="code hl_class" href="../../d9/dde/classbinary__search__tree.html">binary_search_tree<int></a> tree;</div>
|
||||
<div class="line"><span class="lineno"> 395</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(5);</div>
|
||||
<div class="line"><span class="lineno"> 396</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(4);</div>
|
||||
<div class="line"><span class="lineno"> 397</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(3);</div>
|
||||
<div class="line"><span class="lineno"> 398</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(6);</div>
|
||||
<div class="line"><span class="lineno"> 399</span> </div>
|
||||
<div class="line"><span class="lineno"> 400</span> <span class="keywordtype">bool</span> res = tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af4a865ce5244608819b169fc78a41153">remove</a>(5);</div>
|
||||
<div class="line"><span class="lineno"> 401</span> <span class="keywordtype">int</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">min</a> = -1, <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/max.html">max</a> = -1;</div>
|
||||
<div class="line"><span class="lineno"> 402</span> assert(res);</div>
|
||||
<div class="line"><span class="lineno"> 403</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a75f897af6aa732a9901454401c869bcb">find_max</a>(max));</div>
|
||||
<div class="line"><span class="lineno"> 404</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af9a2c7c187a7ca3142c77ce342ef3153">find_min</a>(min));</div>
|
||||
<div class="line"><span class="lineno"> 405</span> assert(max == 6);</div>
|
||||
<div class="line"><span class="lineno"> 406</span> assert(min == 3);</div>
|
||||
<div class="line"><span class="lineno"> 407</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a564fe43e7e8f7ecb6f10667a70fbc6f3">size</a>() == 3);</div>
|
||||
<div class="line"><span class="lineno"> 408</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#aa4f84b2eec9b9201af1840868ddb5fb2">contains</a>(5) == <span class="keyword">false</span>);</div>
|
||||
<div class="line"><span class="lineno"> 409</span> </div>
|
||||
<div class="line"><span class="lineno"> 410</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af4a865ce5244608819b169fc78a41153">remove</a>(4);</div>
|
||||
<div class="line"><span class="lineno"> 411</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af4a865ce5244608819b169fc78a41153">remove</a>(3);</div>
|
||||
<div class="line"><span class="lineno"> 412</span> tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af4a865ce5244608819b169fc78a41153">remove</a>(6);</div>
|
||||
<div class="line"><span class="lineno"> 413</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a564fe43e7e8f7ecb6f10667a70fbc6f3">size</a>() == 0);</div>
|
||||
<div class="line"><span class="lineno"> 414</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#aa4f84b2eec9b9201af1840868ddb5fb2">contains</a>(6) == <span class="keyword">false</span>);</div>
|
||||
<div class="line"><span class="lineno"> 415</span> </div>
|
||||
<div class="line"><span class="lineno"> 416</span> <span class="keywordtype">bool</span> fail_res = tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af4a865ce5244608819b169fc78a41153">remove</a>(5);</div>
|
||||
<div class="line"><span class="lineno"> 417</span> assert(!fail_res);</div>
|
||||
<div class="line"><span class="lineno"> 418</span> assert(tree.<a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a564fe43e7e8f7ecb6f10667a70fbc6f3">size</a>() == 0);</div>
|
||||
<div class="line"><span class="lineno"> 419</span> </div>
|
||||
<div class="line"><span class="lineno"> 420</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">"ok"</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"> 421</span>}</div>
|
||||
<div class="ttc" id="aclassbinary__search__tree_html_af4a865ce5244608819b169fc78a41153"><div class="ttname"><a href="../../d9/dde/classbinary__search__tree.html#af4a865ce5244608819b169fc78a41153">binary_search_tree::remove</a></div><div class="ttdeci">bool remove(std::unique_ptr< bst_node > &parent, std::unique_ptr< bst_node > &node, T rm_value)</div><div class="ttdoc">Recursive function to remove a value from the BST.</div><div class="ttdef"><b>Definition:</b> binary_search_tree2.cpp:124</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -637,7 +637,7 @@ Here is the call graph for this function:</div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html">data_structures</a></li><li class="navelem"><a class="el" href="../../df/d42/binary__search__tree2_8cpp.html">binary_search_tree2.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<map id="test_get_elements_inorder" name="test_get_elements_inorder">
|
||||
<area shape="rect" id="node1" title="Function for testing get_elements_inorder()." alt="" coords="5,64,180,91"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="269,5,341,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="269,5,341,32"/>
|
||||
<area shape="rect" id="node3" href="$d9/dde/classbinary__search__tree.html#a1f23830316204664514f396a4eb5275a" title="Get all values of the BST in in-order order." alt="" coords="228,57,383,98"/>
|
||||
<area shape="rect" id="node5" href="$d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778" title="Recursive function to insert a value into the BST." alt="" coords="239,146,371,187"/>
|
||||
<area shape="rect" id="node4" href="$d9/dde/classbinary__search__tree.html#a2fcf37549bd002c174a45b0b4203c2bd" title="Recursive function to traverse the tree in in-order order." alt="" coords="431,57,563,98"/>
|
||||
|
||||
@@ -1 +1 @@
|
||||
5e5607f8fbb296358816e10f8aabd958
|
||||
559cd5a858cacf8b9879d59eecfa5a85
|
||||
@@ -21,7 +21,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="198,-117 198,-136 252,-136 252,-117 198,-117"/>
|
||||
<text text-anchor="middle" x="225" y="-124" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
@@ -1,6 +1,6 @@
|
||||
<map id="test_contains" name="test_contains">
|
||||
<area shape="rect" id="node1" title="Function for testing contains()." alt="" coords="5,95,105,122"/>
|
||||
<area shape="rect" id="node2" href="$d9/dde/classbinary__search__tree.html#aa4f84b2eec9b9201af1840868ddb5fb2" title="Recursive function to check if a value is in the BST." alt="" coords="153,29,285,71"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="183,95,255,122"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="183,95,255,122"/>
|
||||
<area shape="rect" id="node4" href="$d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778" title="Recursive function to insert a value into the BST." alt="" coords="153,171,285,212"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
819d37149ae01f88ff380bb10dfebe1b
|
||||
c25b961d01ef53e7ece512cd238911df
|
||||
@@ -37,7 +37,7 @@
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="133.5,-68 133.5,-87 187.5,-87 187.5,-68 133.5,-68"/>
|
||||
<text text-anchor="middle" x="160.5" y="-75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
@@ -1,6 +1,6 @@
|
||||
<map id="test_insert" name="test_insert">
|
||||
<area shape="rect" id="node1" title="Function for testing insert()." alt="" coords="5,177,88,204"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="166,5,238,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="166,5,238,32"/>
|
||||
<area shape="rect" id="node3" href="$d9/dde/classbinary__search__tree.html#a75f897af6aa732a9901454401c869bcb" title="Recursive function to find the maximum value in the BST." alt="" coords="136,81,268,122"/>
|
||||
<area shape="rect" id="node4" href="$d9/dde/classbinary__search__tree.html#af9a2c7c187a7ca3142c77ce342ef3153" title="Recursive function to find the minimum value in the BST." alt="" coords="136,170,268,211"/>
|
||||
<area shape="rect" id="node5" href="$d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778" title="Recursive function to insert a value into the BST." alt="" coords="136,259,268,301"/>
|
||||
|
||||
@@ -1 +1 @@
|
||||
8edc15d24a4aad7ecdb1cab4e9a5d843
|
||||
53f73be8ef58d1d3809ca77a4b46392a
|
||||
@@ -21,7 +21,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="120.5,-251 120.5,-270 174.5,-270 174.5,-251 120.5,-251"/>
|
||||
<text text-anchor="middle" x="147.5" y="-258" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
@@ -1,6 +1,6 @@
|
||||
<map id="test_get_elements_postorder" name="test_get_elements_postorder">
|
||||
<area shape="rect" id="node1" title="Function for testing get_elements_postorder()." alt="" coords="5,64,196,91"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="293,5,365,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="293,5,365,32"/>
|
||||
<area shape="rect" id="node3" href="$d9/dde/classbinary__search__tree.html#a5c011e1b0863d79c3a7c11a0426bdcff" title="Get all values of the BST in post-order order." alt="" coords="244,57,413,98"/>
|
||||
<area shape="rect" id="node5" href="$d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778" title="Recursive function to insert a value into the BST." alt="" coords="263,146,395,187"/>
|
||||
<area shape="rect" id="node4" href="$d9/dde/classbinary__search__tree.html#a87c0a35845d27e0f6fc1f4eaa0333362" title="Recursive function to traverse the tree in post-order order." alt="" coords="461,57,600,98"/>
|
||||
|
||||
@@ -1 +1 @@
|
||||
af9d15dd4b46bc392c1839b38ff060a7
|
||||
2d5c858001d595f2b326de222e10e00f
|
||||
@@ -21,7 +21,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="215.5,-117 215.5,-136 269.5,-136 269.5,-117 215.5,-117"/>
|
||||
<text text-anchor="middle" x="242.5" y="-124" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
@@ -1,6 +1,6 @@
|
||||
<map id="test_find_max" name="test_find_max">
|
||||
<area shape="rect" id="node1" title="Function for testing find_max()." alt="" coords="5,88,109,115"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="187,5,259,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="187,5,259,32"/>
|
||||
<area shape="rect" id="node3" href="$d9/dde/classbinary__search__tree.html#a75f897af6aa732a9901454401c869bcb" title="Recursive function to find the maximum value in the BST." alt="" coords="157,81,289,122"/>
|
||||
<area shape="rect" id="node4" href="$d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778" title="Recursive function to insert a value into the BST." alt="" coords="157,170,289,211"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
b7a98215c134bf189eb01a0907506cf4
|
||||
78f0a0a6d7bf472c5be92a7d1f7be401
|
||||
@@ -21,7 +21,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="136.5,-135 136.5,-154 190.5,-154 190.5,-135 136.5,-135"/>
|
||||
<text text-anchor="middle" x="163.5" y="-142" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
@@ -1,6 +1,6 @@
|
||||
<map id="test_get_elements_preorder" name="test_get_elements_preorder">
|
||||
<area shape="rect" id="node1" title="Function for testing get_elements_preorder()." alt="" coords="5,64,188,91"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="281,5,353,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="281,5,353,32"/>
|
||||
<area shape="rect" id="node3" href="$d9/dde/classbinary__search__tree.html#a5764c1cf848f84a5b77462036a6d8c13" title="Get all values of the BST in pre-order order." alt="" coords="236,57,399,98"/>
|
||||
<area shape="rect" id="node5" href="$d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778" title="Recursive function to insert a value into the BST." alt="" coords="251,146,383,187"/>
|
||||
<area shape="rect" id="node4" href="$d9/dde/classbinary__search__tree.html#ab81edd415324d372632c42dc7dbcb9e1" title="Recursive function to traverse the tree in pre-order order." alt="" coords="447,57,579,98"/>
|
||||
|
||||
@@ -1 +1 @@
|
||||
53e93168197ff2cbc7112ac01d051b64
|
||||
5c5583df42c08a27b63231a04aec41a0
|
||||
@@ -21,7 +21,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="207,-117 207,-136 261,-136 261,-117 207,-117"/>
|
||||
<text text-anchor="middle" x="234" y="-124" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
@@ -1,7 +1,7 @@
|
||||
<map id="test_remove" name="test_remove">
|
||||
<area shape="rect" id="node1" title="Function for testing remove()." alt="" coords="5,267,100,294"/>
|
||||
<area shape="rect" id="node2" href="$d9/dde/classbinary__search__tree.html#aa4f84b2eec9b9201af1840868ddb5fb2" title="Recursive function to check if a value is in the BST." alt="" coords="148,29,280,71"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="178,95,250,122"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="178,95,250,122"/>
|
||||
<area shape="rect" id="node4" href="$d9/dde/classbinary__search__tree.html#a75f897af6aa732a9901454401c869bcb" title="Recursive function to find the maximum value in the BST." alt="" coords="148,171,280,212"/>
|
||||
<area shape="rect" id="node5" href="$d9/dde/classbinary__search__tree.html#af9a2c7c187a7ca3142c77ce342ef3153" title="Recursive function to find the minimum value in the BST." alt="" coords="148,260,280,301"/>
|
||||
<area shape="rect" id="node6" href="$d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778" title="Recursive function to insert a value into the BST." alt="" coords="148,349,280,391"/>
|
||||
|
||||
@@ -1 +1 @@
|
||||
2e7bc9b01c27c11af923b49abdd0e751
|
||||
b32aaa41066744394b9065b1fdc86b75
|
||||
@@ -37,7 +37,7 @@
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="129.5,-300 129.5,-319 183.5,-319 183.5,-300 129.5,-300"/>
|
||||
<text text-anchor="middle" x="156.5" y="-307" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
@@ -1,6 +1,6 @@
|
||||
<map id="test_find_min" name="test_find_min">
|
||||
<area shape="rect" id="node1" title="Function for testing find_min()." alt="" coords="5,88,105,115"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="183,5,255,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="183,5,255,32"/>
|
||||
<area shape="rect" id="node3" href="$d9/dde/classbinary__search__tree.html#af9a2c7c187a7ca3142c77ce342ef3153" title="Recursive function to find the minimum value in the BST." alt="" coords="153,81,285,122"/>
|
||||
<area shape="rect" id="node4" href="$d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778" title="Recursive function to insert a value into the BST." alt="" coords="153,170,285,211"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
538aed02119d9bbd41dc78a396991224
|
||||
bb10b89a6830d5772d7ee09eaef16dce
|
||||
@@ -21,7 +21,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="133.5,-135 133.5,-154 187.5,-154 187.5,-135 133.5,-135"/>
|
||||
<text text-anchor="middle" x="160.5" y="-142" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.2"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: n_queens_all_solutions Namespace Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.2 -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
@@ -104,7 +104,7 @@ $(document).ready(function(){initNavTree('df/d44/namespacen__queens__all__soluti
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../df/d44/namespacen__queens__all__solutions.html">n_queens_all_solutions</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.2"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: cpu_scheduling_algorithms/fcfs_scheduling.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.2 -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
@@ -171,31 +171,31 @@ template<typename S , typename T , typename E > </div>
|
||||
</dd>
|
||||
</dl>
|
||||
<p>Sorts the input vector according to arrival time. Processes whose arrival times are same get sorted according to process ID For each process, completion time, turnaround time and completion time are calculated, inserted in a tuple, which is added to the vector result. </p><dl class="section return"><dt>Returns</dt><dd>A vector of tuples consisting of process ID, arrival time, burst time, completion time, turnaround time and waiting time for each process. </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> {</div>
|
||||
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/sort.html">sort</a>(input.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/begin.html">begin</a>(), input.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/end.html">end</a>(), sortcol<S, T, E>);</div>
|
||||
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<tuple<S, T, E, double, double, double></a>> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>(input.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>());</div>
|
||||
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> <span class="keywordtype">double</span> timeElapsed = 0;</div>
|
||||
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i{}; i < input.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); i++) {</div>
|
||||
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> T arrival = get<1>(input[i]);</div>
|
||||
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> E burst = get<2>(input[i]);</div>
|
||||
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> </div>
|
||||
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> <span class="keywordflow">if</span> (arrival > timeElapsed) {</div>
|
||||
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> timeElapsed += arrival - timeElapsed;</div>
|
||||
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> }</div>
|
||||
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> timeElapsed += burst;</div>
|
||||
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> <span class="keywordtype">double</span> completion = timeElapsed;</div>
|
||||
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> <span class="keywordtype">double</span> turnaround = completion - arrival;</div>
|
||||
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> <span class="keywordtype">double</span> waiting = turnaround - burst;</div>
|
||||
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> </div>
|
||||
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> get<0>(result[i]) = get<0>(input[i]);</div>
|
||||
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> get<1>(result[i]) = arrival;</div>
|
||||
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> get<2>(result[i]) = burst;</div>
|
||||
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> get<3>(result[i]) = completion;</div>
|
||||
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> get<4>(result[i]) = turnaround;</div>
|
||||
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> get<5>(result[i]) = waiting;</div>
|
||||
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span> }</div>
|
||||
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
|
||||
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 226</span> {</div>
|
||||
<div class="line"><span class="lineno"> 227</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/sort.html">sort</a>(input.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/begin.html">begin</a>(), input.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/end.html">end</a>(), sortcol<S, T, E>);</div>
|
||||
<div class="line"><span class="lineno"> 228</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<tuple<S, T, E, double, double, double></a>> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>(input.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>());</div>
|
||||
<div class="line"><span class="lineno"> 229</span> <span class="keywordtype">double</span> timeElapsed = 0;</div>
|
||||
<div class="line"><span class="lineno"> 230</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i{}; i < input.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 231</span> T arrival = get<1>(input[i]);</div>
|
||||
<div class="line"><span class="lineno"> 232</span> E burst = get<2>(input[i]);</div>
|
||||
<div class="line"><span class="lineno"> 233</span> </div>
|
||||
<div class="line"><span class="lineno"> 234</span> <span class="keywordflow">if</span> (arrival > timeElapsed) {</div>
|
||||
<div class="line"><span class="lineno"> 235</span> timeElapsed += arrival - timeElapsed;</div>
|
||||
<div class="line"><span class="lineno"> 236</span> }</div>
|
||||
<div class="line"><span class="lineno"> 237</span> timeElapsed += burst;</div>
|
||||
<div class="line"><span class="lineno"> 238</span> <span class="keywordtype">double</span> completion = timeElapsed;</div>
|
||||
<div class="line"><span class="lineno"> 239</span> <span class="keywordtype">double</span> turnaround = completion - arrival;</div>
|
||||
<div class="line"><span class="lineno"> 240</span> <span class="keywordtype">double</span> waiting = turnaround - burst;</div>
|
||||
<div class="line"><span class="lineno"> 241</span> </div>
|
||||
<div class="line"><span class="lineno"> 242</span> get<0>(result[i]) = get<0>(input[i]);</div>
|
||||
<div class="line"><span class="lineno"> 243</span> get<1>(result[i]) = arrival;</div>
|
||||
<div class="line"><span class="lineno"> 244</span> get<2>(result[i]) = burst;</div>
|
||||
<div class="line"><span class="lineno"> 245</span> get<3>(result[i]) = completion;</div>
|
||||
<div class="line"><span class="lineno"> 246</span> get<4>(result[i]) = turnaround;</div>
|
||||
<div class="line"><span class="lineno"> 247</span> get<5>(result[i]) = waiting;</div>
|
||||
<div class="line"><span class="lineno"> 248</span> }</div>
|
||||
<div class="line"><span class="lineno"> 249</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
|
||||
<div class="line"><span class="lineno"> 250</span>}</div>
|
||||
<div class="ttc" id="abegin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/begin.html">std::vector::begin</a></div><div class="ttdeci">T begin(T... args)</div></div>
|
||||
<div class="ttc" id="aend_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/end.html">std::vector::end</a></div><div class="ttdeci">T end(T... args)</div></div>
|
||||
<div class="ttc" id="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>
|
||||
@@ -223,15 +223,15 @@ template<typename S , typename T , typename E > </div>
|
||||
|
||||
<p>Entry point of the program. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00287" name="l00287"></a><span class="lineno"> 287</span> {</div>
|
||||
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"> 288</span> <a class="code hl_function" href="../../df/d47/fcfs__scheduling_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 287</span> {</div>
|
||||
<div class="line"><span class="lineno"> 288</span> <a class="code hl_function" href="../../df/d47/fcfs__scheduling_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 289</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 290</span>}</div>
|
||||
<div class="ttc" id="afcfs__scheduling_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../df/d47/fcfs__scheduling_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> fcfs_scheduling.cpp:256</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d47/fcfs__scheduling_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="571" height="170"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d47/fcfs__scheduling_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="571" height="402"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -284,14 +284,14 @@ template<typename S , typename T , typename E > </div>
|
||||
<dl class="section return"><dt>Returns</dt><dd>true if t1 and t2 are in the CORRECT order </dd>
|
||||
<dd>
|
||||
false if t1 and t2 are in the INCORRECT order </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> {</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keywordflow">if</span> (get<1>(t1) < get<1>(t2)) {</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (get<1>(t1) == get<1>(t2) && get<0>(t1) < get<0>(t2)) {</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> }</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 45</span> {</div>
|
||||
<div class="line"><span class="lineno"> 46</span> <span class="keywordflow">if</span> (get<1>(t1) < get<1>(t2)) {</div>
|
||||
<div class="line"><span class="lineno"> 47</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 48</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (get<1>(t1) == get<1>(t2) && get<0>(t1) < get<0>(t2)) {</div>
|
||||
<div class="line"><span class="lineno"> 49</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 50</span> }</div>
|
||||
<div class="line"><span class="lineno"> 51</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 52</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -320,32 +320,32 @@ false if t1 and t2 are in the INCORRECT order </dd></dl>
|
||||
|
||||
<p>Self-test implementations. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> {</div>
|
||||
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i{}; i < 1000; i++) {</div>
|
||||
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/srand.html">srand</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">time</a>(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> uint32_t n = 1 + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/rand.html">rand</a>() % 1000;</div>
|
||||
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> <a class="code hl_class" href="../../dd/dca/class_f_c_f_s.html">FCFS<uint32_t, uint32_t, uint32_t></a> readyQueue;</div>
|
||||
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<tuple<uint32_t, uint32_t, uint32_t></a>> input(n);</div>
|
||||
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> </div>
|
||||
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span> <span class="keywordflow">for</span> (uint32_t i{}; i < n; i++) {</div>
|
||||
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span> get<0>(input[i]) = i;</div>
|
||||
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"> 265</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/srand.html">srand</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">time</a>(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span> get<1>(input[i]) = 1 + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/rand.html">rand</a>() % 10000;</div>
|
||||
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/srand.html">srand</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">time</a>(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> get<2>(input[i]) = 1 + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/rand.html">rand</a>() % 10000;</div>
|
||||
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> }</div>
|
||||
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> </div>
|
||||
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> <span class="keywordflow">for</span> (uint32_t i{}; i < n; i++) {</div>
|
||||
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> readyQueue.<a class="code hl_function" href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69">addProcess</a>(get<0>(input[i]), get<1>(input[i]),</div>
|
||||
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> get<2>(input[i]));</div>
|
||||
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> }</div>
|
||||
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<tuple<uint32_t, uint32_t, uint32_t, double, double, double></a>></div>
|
||||
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span> res = get_final_status<uint32_t, uint32_t, uint32_t>(input);</div>
|
||||
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> assert(res == readyQueue.<a class="code hl_function" href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91">scheduleForFcfs</a>());</div>
|
||||
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> <span class="comment">// readyQueue.printResult();</span></div>
|
||||
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> }</div>
|
||||
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">cout</a> << <span class="stringliteral">"All the tests have successfully passed!"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 256</span> {</div>
|
||||
<div class="line"><span class="lineno"> 257</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i{}; i < 1000; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 258</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/srand.html">srand</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">time</a>(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><span class="lineno"> 259</span> uint32_t n = 1 + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/rand.html">rand</a>() % 1000;</div>
|
||||
<div class="line"><span class="lineno"> 260</span> <a class="code hl_class" href="../../dd/dca/class_f_c_f_s.html">FCFS<uint32_t, uint32_t, uint32_t></a> readyQueue;</div>
|
||||
<div class="line"><span class="lineno"> 261</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<tuple<uint32_t, uint32_t, uint32_t></a>> input(n);</div>
|
||||
<div class="line"><span class="lineno"> 262</span> </div>
|
||||
<div class="line"><span class="lineno"> 263</span> <span class="keywordflow">for</span> (uint32_t i{}; i < n; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 264</span> get<0>(input[i]) = i;</div>
|
||||
<div class="line"><span class="lineno"> 265</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/srand.html">srand</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">time</a>(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><span class="lineno"> 266</span> get<1>(input[i]) = 1 + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/rand.html">rand</a>() % 10000;</div>
|
||||
<div class="line"><span class="lineno"> 267</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/srand.html">srand</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">time</a>(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><span class="lineno"> 268</span> get<2>(input[i]) = 1 + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/rand.html">rand</a>() % 10000;</div>
|
||||
<div class="line"><span class="lineno"> 269</span> }</div>
|
||||
<div class="line"><span class="lineno"> 270</span> </div>
|
||||
<div class="line"><span class="lineno"> 271</span> <span class="keywordflow">for</span> (uint32_t i{}; i < n; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 272</span> readyQueue.<a class="code hl_function" href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69">addProcess</a>(get<0>(input[i]), get<1>(input[i]),</div>
|
||||
<div class="line"><span class="lineno"> 273</span> get<2>(input[i]));</div>
|
||||
<div class="line"><span class="lineno"> 274</span> }</div>
|
||||
<div class="line"><span class="lineno"> 275</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<tuple<uint32_t, uint32_t, uint32_t, double, double, double></a>></div>
|
||||
<div class="line"><span class="lineno"> 276</span> res = get_final_status<uint32_t, uint32_t, uint32_t>(input);</div>
|
||||
<div class="line"><span class="lineno"> 277</span> assert(res == readyQueue.<a class="code hl_function" href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91">scheduleForFcfs</a>());</div>
|
||||
<div class="line"><span class="lineno"> 278</span> <span class="comment">// readyQueue.printResult();</span></div>
|
||||
<div class="line"><span class="lineno"> 279</span> }</div>
|
||||
<div class="line"><span class="lineno"> 280</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">cout</a> << <span class="stringliteral">"All the tests have successfully passed!"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 281</span>}</div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="aclass_f_c_f_s_html"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html">FCFS</a></div><div class="ttdoc">Class which implements the FCFS scheduling algorithm.</div><div class="ttdef"><b>Definition:</b> fcfs_scheduling.cpp:97</div></div>
|
||||
<div class="ttc" id="aclass_f_c_f_s_html_a8fbfe4d85f7576b4a7aade07d29fbd69"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69">FCFS::addProcess</a></div><div class="ttdeci">void addProcess(S id, T arrival, E burst)</div><div class="ttdoc">Adds the process to the ready queue if it isn't already there.</div><div class="ttdef"><b>Definition:</b> fcfs_scheduling.cpp:129</div></div>
|
||||
@@ -357,7 +357,7 @@ false if t1 and t2 are in the INCORRECT order </dd></dl>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d47/fcfs__scheduling_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg" width="472" height="170"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d47/fcfs__scheduling_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg" width="472" height="402"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -369,7 +369,7 @@ Here is the call graph for this function:</div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_cc8e79ed9d2b7756c78e8d0c87c6c0c7.html">cpu_scheduling_algorithms</a></li><li class="navelem"><a class="el" href="../../df/d47/fcfs__scheduling_8cpp.html">fcfs_scheduling.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
<map id="test" name="test">
|
||||
<area shape="rect" id="node1" title="Self-test implementations." alt="" coords="5,89,49,116"/>
|
||||
<area shape="rect" id="node2" href="$dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69" title="Adds the process to the ready queue if it isn't already there." alt="" coords="111,64,246,91"/>
|
||||
<area shape="rect" id="node6" href="$dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91" title="Algorithm for scheduling CPU processes according to the First Come First Serve(FCFS) scheduling algor..." alt="" coords="97,115,260,141"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/unordered_set/end.html#" title=" " alt="" coords="308,5,467,32"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/unordered_set/find.html#" title=" " alt="" coords="322,57,453,98"/>
|
||||
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/unordered_set/insert.html#" title=" " alt="" coords="322,122,453,163"/>
|
||||
<area shape="rect" id="node1" title="Self-test implementations." alt="" coords="5,224,49,251"/>
|
||||
<area shape="rect" id="node2" href="$dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69" title="Adds the process to the ready queue if it isn't already there." alt="" coords="111,129,246,156"/>
|
||||
<area shape="rect" id="node7" href="$dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91" title="Algorithm for scheduling CPU processes according to the First Come First Serve(FCFS) scheduling algor..." alt="" coords="97,289,260,316"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/unordered_set/end#" title=" " alt="" coords="308,5,467,32"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/unordered_set/find#" title=" " alt="" coords="322,57,453,98"/>
|
||||
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/unordered_set/insert#" title=" " alt="" coords="322,122,453,163"/>
|
||||
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/priority_queue/push#" title=" " alt="" coords="323,187,452,229"/>
|
||||
<area shape="rect" id="node8" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/priority_queue/empty#" title=" " alt="" coords="323,253,452,294"/>
|
||||
<area shape="rect" id="node9" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/priority_queue/pop#" title=" " alt="" coords="308,319,467,345"/>
|
||||
<area shape="rect" id="node10" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/priority_queue/top#" title=" " alt="" coords="310,369,465,396"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
eb25f61bb3c01f732953e7b177f935be
|
||||
dd8504a723938ac379d7970db9fe62c5
|
||||