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++: MinHeap 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');
|
||||
@@ -168,11 +168,11 @@ int </td><td class="memItemRight" valign="bottom"><b>heap_size</b></td></tr
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="fragment"><div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> {</div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a> = 0;</div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a88b4aa3e66392a3eabbf2517a9a79a02">capacity</a> = cap;</div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a> = <span class="keyword">new</span> <span class="keywordtype">int</span>[cap];</div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 19</span> {</div>
|
||||
<div class="line"><span class="lineno"> 20</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a> = 0;</div>
|
||||
<div class="line"><span class="lineno"> 21</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a88b4aa3e66392a3eabbf2517a9a79a02">capacity</a> = cap;</div>
|
||||
<div class="line"><span class="lineno"> 22</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a> = <span class="keyword">new</span> <span class="keywordtype">int</span>[cap];</div>
|
||||
<div class="line"><span class="lineno"> 23</span> }</div>
|
||||
<div class="ttc" id="aclass_min_heap_html_a34a93a87967308eb516328c0aca3c48e"><div class="ttname"><a href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">MinHeap::harr</a></div><div class="ttdeci">int * harr</div><div class="ttdoc">pointer to array of elements in heap</div><div class="ttdef"><b>Definition:</b> binaryheap.cpp:11</div></div>
|
||||
<div class="ttc" id="aclass_min_heap_html_a88b4aa3e66392a3eabbf2517a9a79a02"><div class="ttname"><a href="../../d2/d05/class_min_heap.html#a88b4aa3e66392a3eabbf2517a9a79a02">MinHeap::capacity</a></div><div class="ttdeci">int capacity</div><div class="ttdoc">maximum possible size of min heap</div><div class="ttdef"><b>Definition:</b> binaryheap.cpp:12</div></div>
|
||||
<div class="ttc" id="aclass_min_heap_html_ae4d358bf063bb196a1945b3fb99b4913"><div class="ttname"><a href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">MinHeap::heap_size</a></div><div class="ttdeci">int heap_size</div><div class="ttdoc">Current number of elements in min heap.</div><div class="ttdef"><b>Definition:</b> binaryheap.cpp:13</div></div>
|
||||
@@ -201,7 +201,7 @@ int </td><td class="memItemRight" valign="bottom"><b>heap_size</b></td></tr
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<div class="fragment"><div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span>{ <span class="keyword">delete</span>[] <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>; }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 51</span>{ <span class="keyword">delete</span>[] <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>; }</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -233,13 +233,13 @@ int </td><td class="memItemRight" valign="bottom"><b>heap_size</b></td></tr
|
||||
</div><div class="memdoc">
|
||||
<p >Decreases key value of key at index i to new_val</p>
|
||||
<p >Decreases value of key at index 'i' to new_val. It is assumed that new_val is smaller than harr[i]. </p>
|
||||
<div class="fragment"><div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> {</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[i] = new_val;</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keywordflow">while</span> (i != 0 && <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[parent(i)] > <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[i]) {</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/swap.html">std::swap</a>(<a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[i], <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[parent(i)]);</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> i = parent(i);</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> }</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 76</span> {</div>
|
||||
<div class="line"><span class="lineno"> 77</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[i] = new_val;</div>
|
||||
<div class="line"><span class="lineno"> 78</span> <span class="keywordflow">while</span> (i != 0 && <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[parent(i)] > <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[i]) {</div>
|
||||
<div class="line"><span class="lineno"> 79</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/swap.html">std::swap</a>(<a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[i], <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[parent(i)]);</div>
|
||||
<div class="line"><span class="lineno"> 80</span> i = parent(i);</div>
|
||||
<div class="line"><span class="lineno"> 81</span> }</div>
|
||||
<div class="line"><span class="lineno"> 82</span>}</div>
|
||||
<div class="ttc" id="aswap_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/swap.html">std::swap</a></div><div class="ttdeci">T swap(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -267,10 +267,10 @@ Here is the call graph for this function:</div>
|
||||
</div><div class="memdoc">
|
||||
<p >Deletes a key stored at index i</p>
|
||||
<p >This function deletes key at index i. It first reduced value to minus infinite, then calls <a class="el" href="../../d2/d05/class_min_heap.html#a4014f1edaed0bd7db0c0d2ca53228980">extractMin()</a> </p>
|
||||
<div class="fragment"><div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> {</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <a class="code hl_function" href="../../d2/d05/class_min_heap.html#aa7f726cc6327955d22871592227432f5">decreaseKey</a>(i, INT_MIN);</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <a class="code hl_function" href="../../d2/d05/class_min_heap.html#a4014f1edaed0bd7db0c0d2ca53228980">extractMin</a>();</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 105</span> {</div>
|
||||
<div class="line"><span class="lineno"> 106</span> <a class="code hl_function" href="../../d2/d05/class_min_heap.html#aa7f726cc6327955d22871592227432f5">decreaseKey</a>(i, INT_MIN);</div>
|
||||
<div class="line"><span class="lineno"> 107</span> <a class="code hl_function" href="../../d2/d05/class_min_heap.html#a4014f1edaed0bd7db0c0d2ca53228980">extractMin</a>();</div>
|
||||
<div class="line"><span class="lineno"> 108</span>}</div>
|
||||
<div class="ttc" id="aclass_min_heap_html_a4014f1edaed0bd7db0c0d2ca53228980"><div class="ttname"><a href="../../d2/d05/class_min_heap.html#a4014f1edaed0bd7db0c0d2ca53228980">MinHeap::extractMin</a></div><div class="ttdeci">int extractMin()</div><div class="ttdef"><b>Definition:</b> binaryheap.cpp:85</div></div>
|
||||
<div class="ttc" id="aclass_min_heap_html_aa7f726cc6327955d22871592227432f5"><div class="ttname"><a href="../../d2/d05/class_min_heap.html#aa7f726cc6327955d22871592227432f5">MinHeap::decreaseKey</a></div><div class="ttdeci">void decreaseKey(int i, int new_val)</div><div class="ttdef"><b>Definition:</b> binaryheap.cpp:76</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
@@ -297,22 +297,22 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >to extract the root which is the minimum element </p>
|
||||
<div class="fragment"><div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> {</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a> <= 0)</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordflow">return</span> INT_MAX;</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a> == 1) {</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a>--;</div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordflow">return</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[0];</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> }</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> </div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="comment">// Store the minimum value, and remove it from heap</span></div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordtype">int</span> root = <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[0];</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[0] = <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[<a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a> - 1];</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a>--;</div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <a class="code hl_function" href="../../d2/d05/class_min_heap.html#aaef438c1056492cb62c4a4d9035b5cad">MinHeapify</a>(0);</div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> </div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="keywordflow">return</span> root;</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 85</span> {</div>
|
||||
<div class="line"><span class="lineno"> 86</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a> <= 0)</div>
|
||||
<div class="line"><span class="lineno"> 87</span> <span class="keywordflow">return</span> INT_MAX;</div>
|
||||
<div class="line"><span class="lineno"> 88</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a> == 1) {</div>
|
||||
<div class="line"><span class="lineno"> 89</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a>--;</div>
|
||||
<div class="line"><span class="lineno"> 90</span> <span class="keywordflow">return</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[0];</div>
|
||||
<div class="line"><span class="lineno"> 91</span> }</div>
|
||||
<div class="line"><span class="lineno"> 92</span> </div>
|
||||
<div class="line"><span class="lineno"> 93</span> <span class="comment">// Store the minimum value, and remove it from heap</span></div>
|
||||
<div class="line"><span class="lineno"> 94</span> <span class="keywordtype">int</span> root = <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[0];</div>
|
||||
<div class="line"><span class="lineno"> 95</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[0] = <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[<a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a> - 1];</div>
|
||||
<div class="line"><span class="lineno"> 96</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a>--;</div>
|
||||
<div class="line"><span class="lineno"> 97</span> <a class="code hl_function" href="../../d2/d05/class_min_heap.html#aaef438c1056492cb62c4a4d9035b5cad">MinHeapify</a>(0);</div>
|
||||
<div class="line"><span class="lineno"> 98</span> </div>
|
||||
<div class="line"><span class="lineno"> 99</span> <span class="keywordflow">return</span> root;</div>
|
||||
<div class="line"><span class="lineno"> 100</span>}</div>
|
||||
<div class="ttc" id="aclass_min_heap_html_aaef438c1056492cb62c4a4d9035b5cad"><div class="ttname"><a href="../../d2/d05/class_min_heap.html#aaef438c1056492cb62c4a4d9035b5cad">MinHeap::MinHeapify</a></div><div class="ttdeci">void MinHeapify(int)</div><div class="ttdef"><b>Definition:</b> binaryheap.cpp:113</div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -340,7 +340,7 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Returns the minimum key (key at root) from min heap </p>
|
||||
<div class="fragment"><div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span>{ <span class="keywordflow">return</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[0]; }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 43</span>{ <span class="keywordflow">return</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[0]; }</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -360,23 +360,23 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Inserts a new key 'k' </p>
|
||||
<div class="fragment"><div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> {</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a> == <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a88b4aa3e66392a3eabbf2517a9a79a02">capacity</a>) {</div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"\nOverflow: Could not insertKey\n"</span>;</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> }</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> </div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="comment">// First insert the new key at the end</span></div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a>++;</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordtype">int</span> i = <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a> - 1;</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[i] = <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>;</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="comment">// Fix the min heap property if it is violated</span></div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keywordflow">while</span> (i != 0 && <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[parent(i)] > <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[i]) {</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/swap.html">std::swap</a>(<a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[i], <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[parent(i)]);</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> i = parent(i);</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> }</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 55</span> {</div>
|
||||
<div class="line"><span class="lineno"> 56</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a> == <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a88b4aa3e66392a3eabbf2517a9a79a02">capacity</a>) {</div>
|
||||
<div class="line"><span class="lineno"> 57</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"\nOverflow: Could not insertKey\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 58</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 59</span> }</div>
|
||||
<div class="line"><span class="lineno"> 60</span> </div>
|
||||
<div class="line"><span class="lineno"> 61</span> <span class="comment">// First insert the new key at the end</span></div>
|
||||
<div class="line"><span class="lineno"> 62</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a>++;</div>
|
||||
<div class="line"><span class="lineno"> 63</span> <span class="keywordtype">int</span> i = <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a> - 1;</div>
|
||||
<div class="line"><span class="lineno"> 64</span> <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[i] = <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>;</div>
|
||||
<div class="line"><span class="lineno"> 65</span> </div>
|
||||
<div class="line"><span class="lineno"> 66</span> <span class="comment">// Fix the min heap property if it is violated</span></div>
|
||||
<div class="line"><span class="lineno"> 67</span> <span class="keywordflow">while</span> (i != 0 && <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[parent(i)] > <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[i]) {</div>
|
||||
<div class="line"><span class="lineno"> 68</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/swap.html">std::swap</a>(<a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[i], <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[parent(i)]);</div>
|
||||
<div class="line"><span class="lineno"> 69</span> i = parent(i);</div>
|
||||
<div class="line"><span class="lineno"> 70</span> }</div>
|
||||
<div class="line"><span class="lineno"> 71</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="acomposite__simpson__rule_8cpp_html_a1b74d828b33760094906797042b89442"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">numerical_methods::simpson_method::k</a></div><div class="ttdeci">double k(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition:</b> composite_simpson_rule.cpp:117</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
@@ -412,7 +412,7 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >to get index of left child of node at index i </p>
|
||||
<div class="fragment"><div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span>{ <span class="keywordflow">return</span> (2 * i + 1); }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 31</span>{ <span class="keywordflow">return</span> (2 * i + 1); }</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -433,19 +433,19 @@ Here is the call graph for this function:</div>
|
||||
</div><div class="memdoc">
|
||||
<p >to heapify a subtree with the root at given index</p>
|
||||
<p >A recursive method to heapify a subtree with the root at given index This method assumes that the subtrees are already heapified </p>
|
||||
<div class="fragment"><div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> {</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a> = <a class="code hl_function" href="../../d2/d05/class_min_heap.html#aa8c6c141e3de664819686aa637e1afca">left</a>(i);</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="keywordtype">int</span> r = <a class="code hl_function" href="../../d2/d05/class_min_heap.html#ac760b85cf90265b8d674b942a43fb70e">right</a>(i);</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="keywordtype">int</span> smallest = i;</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keywordflow">if</span> (l < <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a> && <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[l] < <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[i])</div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> smallest = <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a>;</div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordflow">if</span> (r < <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a> && <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[r] < <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[smallest])</div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> smallest = r;</div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keywordflow">if</span> (smallest != i) {</div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/swap.html">std::swap</a>(<a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[i], <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[smallest]);</div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <a class="code hl_function" href="../../d2/d05/class_min_heap.html#aaef438c1056492cb62c4a4d9035b5cad">MinHeapify</a>(smallest);</div>
|
||||
<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>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 113</span> {</div>
|
||||
<div class="line"><span class="lineno"> 114</span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a> = <a class="code hl_function" href="../../d2/d05/class_min_heap.html#aa8c6c141e3de664819686aa637e1afca">left</a>(i);</div>
|
||||
<div class="line"><span class="lineno"> 115</span> <span class="keywordtype">int</span> r = <a class="code hl_function" href="../../d2/d05/class_min_heap.html#ac760b85cf90265b8d674b942a43fb70e">right</a>(i);</div>
|
||||
<div class="line"><span class="lineno"> 116</span> <span class="keywordtype">int</span> smallest = i;</div>
|
||||
<div class="line"><span class="lineno"> 117</span> <span class="keywordflow">if</span> (l < <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a> && <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[l] < <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[i])</div>
|
||||
<div class="line"><span class="lineno"> 118</span> smallest = <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a>;</div>
|
||||
<div class="line"><span class="lineno"> 119</span> <span class="keywordflow">if</span> (r < <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#ae4d358bf063bb196a1945b3fb99b4913">heap_size</a> && <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[r] < <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[smallest])</div>
|
||||
<div class="line"><span class="lineno"> 120</span> smallest = r;</div>
|
||||
<div class="line"><span class="lineno"> 121</span> <span class="keywordflow">if</span> (smallest != i) {</div>
|
||||
<div class="line"><span class="lineno"> 122</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/swap.html">std::swap</a>(<a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[i], <a class="code hl_variable" href="../../d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e">harr</a>[smallest]);</div>
|
||||
<div class="line"><span class="lineno"> 123</span> <a class="code hl_function" href="../../d2/d05/class_min_heap.html#aaef438c1056492cb62c4a4d9035b5cad">MinHeapify</a>(smallest);</div>
|
||||
<div class="line"><span class="lineno"> 124</span> }</div>
|
||||
<div class="line"><span class="lineno"> 125</span>}</div>
|
||||
<div class="ttc" id="aclass_min_heap_html_aa8c6c141e3de664819686aa637e1afca"><div class="ttname"><a href="../../d2/d05/class_min_heap.html#aa8c6c141e3de664819686aa637e1afca">MinHeap::left</a></div><div class="ttdeci">int left(int i)</div><div class="ttdef"><b>Definition:</b> binaryheap.cpp:31</div></div>
|
||||
<div class="ttc" id="aclass_min_heap_html_ac760b85cf90265b8d674b942a43fb70e"><div class="ttname"><a href="../../d2/d05/class_min_heap.html#ac760b85cf90265b8d674b942a43fb70e">MinHeap::right</a></div><div class="ttdeci">int right(int i)</div><div class="ttdef"><b>Definition:</b> binaryheap.cpp:34</div></div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a6d8df83a6f26ce24a75d3b358b7f5b8a"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">numerical_methods::simpson_method::l</a></div><div class="ttdeci">double l(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition:</b> composite_simpson_rule.cpp:119</div></div>
|
||||
@@ -481,7 +481,7 @@ Here is the call graph for this function:</div>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<div class="fragment"><div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span>{ <span class="keywordflow">return</span> (i - 1) / 2; }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 28</span>{ <span class="keywordflow">return</span> (i - 1) / 2; }</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -509,7 +509,7 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >to get index of right child of node at index i </p>
|
||||
<div class="fragment"><div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span>{ <span class="keywordflow">return</span> (2 * i + 2); }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 34</span>{ <span class="keywordflow">return</span> (2 * i + 2); }</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -522,7 +522,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="../../d2/d05/class_min_heap.html">MinHeap</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>
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,31,145,57"/>
|
||||
<area shape="rect" id="node2" href="$d2/d05/class_min_heap.html#aa7f726cc6327955d22871592227432f5" title=" " alt="" coords="193,5,352,32"/>
|
||||
<area shape="rect" id="node4" href="$d2/d05/class_min_heap.html#a4014f1edaed0bd7db0c0d2ca53228980" title=" " alt="" coords="201,56,344,83"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap.html#" title=" " alt="" coords="400,5,479,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap#" title=" " alt="" coords="400,5,479,32"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
9cc496d0db9da9a0b8afdfba482e75a3
|
||||
3dafab543ed370c3a6fa05d5494bbcfa
|
||||
@@ -51,7 +51,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/algorithm/swap.html#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="296,-38.5 296,-57.5 355,-57.5 355,-38.5 296,-38.5"/>
|
||||
<text text-anchor="middle" x="325.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
@@ -1,4 +1,4 @@
|
||||
<map id="MinHeap::decreaseKey" name="MinHeap::decreaseKey">
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,5,164,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap.html#" title=" " alt="" coords="212,5,291,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap#" title=" " alt="" coords="212,5,291,32"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
4d9d548823dda1c0b1c8da356a5b3cba
|
||||
6943f0900e6a0daa1ba4dd5dbc212a88
|
||||
@@ -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/algorithm/swap.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="155,-0.5 155,-19.5 214,-19.5 214,-0.5 155,-0.5"/>
|
||||
<text text-anchor="middle" x="184.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
@@ -2,5 +2,5 @@
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,56,153,83"/>
|
||||
<area shape="rect" id="node2" href="$d2/d05/class_min_heap.html#aa8c6c141e3de664819686aa637e1afca" title=" " alt="" coords="205,5,305,32"/>
|
||||
<area shape="rect" id="node3" href="$d2/d05/class_min_heap.html#ac760b85cf90265b8d674b942a43fb70e" title=" " alt="" coords="201,56,308,83"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap.html#" title=" " alt="" coords="215,107,294,133"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap#" title=" " alt="" coords="215,107,294,133"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
25765eea4d79d679be5807dcf00b4d8d
|
||||
77aeebab27d1e9b52385994da905121a
|
||||
@@ -57,7 +57,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/algorithm/swap.html#" xlink:title=" ">
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="157.5,-0.5 157.5,-19.5 216.5,-19.5 216.5,-0.5 157.5,-0.5"/>
|
||||
<text text-anchor="middle" x="187" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
@@ -1,4 +1,4 @@
|
||||
<map id="MinHeap::insertKey" name="MinHeap::insertKey">
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,5,143,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap.html#" title=" " alt="" coords="191,5,269,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap#" title=" " alt="" coords="191,5,269,32"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
42bf88032e870393449b6a25538ad01b
|
||||
b61f9d7c449eeb67fcd7722d82720e75
|
||||
@@ -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/algorithm/swap.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="139,-0.5 139,-19.5 198,-19.5 198,-0.5 139,-0.5"/>
|
||||
<text text-anchor="middle" x="168.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</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++: math/fast_power.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,20 +158,20 @@ template<typename T > </div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Same algorithm with little different formula. It still calculates in \(O(\log N)\) </p>
|
||||
<div class="fragment"><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="comment">// negative power. a^b = 1 / (a^-b)</span></div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordflow">if</span> (b < 0)</div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keywordflow">return</span> 1.0 / <a class="code hl_function" href="../../d2/d0b/fast__power_8cpp.html#a0d4e3f0099a6975b74a314a35bd0f94d">fast_power_linear</a>(a, -b);</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> </div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> = 1;</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keywordflow">while</span> (b) {</div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="keywordflow">if</span> (b & 1)</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> = <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> * a;</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> a = a * a;</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> b = b >> 1;</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> }</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</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="l00063" name="l00063"></a><span class="lineno"> 63</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 50</span> {</div>
|
||||
<div class="line"><span class="lineno"> 51</span> <span class="comment">// negative power. a^b = 1 / (a^-b)</span></div>
|
||||
<div class="line"><span class="lineno"> 52</span> <span class="keywordflow">if</span> (b < 0)</div>
|
||||
<div class="line"><span class="lineno"> 53</span> <span class="keywordflow">return</span> 1.0 / <a class="code hl_function" href="../../d2/d0b/fast__power_8cpp.html#a0d4e3f0099a6975b74a314a35bd0f94d">fast_power_linear</a>(a, -b);</div>
|
||||
<div class="line"><span class="lineno"> 54</span> </div>
|
||||
<div class="line"><span class="lineno"> 55</span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> = 1;</div>
|
||||
<div class="line"><span class="lineno"> 56</span> <span class="keywordflow">while</span> (b) {</div>
|
||||
<div class="line"><span class="lineno"> 57</span> <span class="keywordflow">if</span> (b & 1)</div>
|
||||
<div class="line"><span class="lineno"> 58</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> = <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> * a;</div>
|
||||
<div class="line"><span class="lineno"> 59</span> a = a * a;</div>
|
||||
<div class="line"><span class="lineno"> 60</span> b = b >> 1;</div>
|
||||
<div class="line"><span class="lineno"> 61</span> }</div>
|
||||
<div class="line"><span class="lineno"> 62</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"> 63</span>}</div>
|
||||
<div class="ttc" id="afast__power_8cpp_html_a0d4e3f0099a6975b74a314a35bd0f94d"><div class="ttname"><a href="../../d2/d0b/fast__power_8cpp.html#a0d4e3f0099a6975b74a314a35bd0f94d">fast_power_linear</a></div><div class="ttdeci">double fast_power_linear(T a, T b)</div><div class="ttdef"><b>Definition:</b> fast_power.cpp:50</div></div>
|
||||
<div class="ttc" id="afibonacci__sum_8cpp_html_aadb40ac4c74a7efc0680b83eeee138aa"><div class="ttname"><a href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">math::fibonacci_sum::result</a></div><div class="ttdeci">uint64_t result(uint64_t n)</div><div class="ttdef"><b>Definition:</b> fibonacci_sum.cpp:76</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
@@ -211,24 +211,24 @@ template<typename T > </div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >algorithm implementation for \(a^b\) </p>
|
||||
<div class="fragment"><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> <span class="comment">// negative power. a^b = 1 / (a^-b)</span></div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordflow">if</span> (b < 0)</div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keywordflow">return</span> 1.0 / <a class="code hl_function" href="../../d2/d0b/fast__power_8cpp.html#a8399b847626e5bba983cab7c7918b445">fast_power_recursive</a>(a, -b);</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">if</span> (b == 0)</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keywordflow">return</span> 1;</div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> T bottom = <a class="code hl_function" href="../../d2/d0b/fast__power_8cpp.html#a8399b847626e5bba983cab7c7918b445">fast_power_recursive</a>(a, b >> 1);</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="comment">// Since it is integer division b/2 = (b-1)/2 where b is odd.</span></div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="comment">// Therefore, case2 is easily solved by integer division.</span></div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> </div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keywordflow">if</span> ((b & 1) == 0) <span class="comment">// case1</span></div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> = bottom * bottom;</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keywordflow">else</span> <span class="comment">// case2</span></div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> = bottom * bottom * a;</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</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="l00043" name="l00043"></a><span class="lineno"> 43</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 26</span> {</div>
|
||||
<div class="line"><span class="lineno"> 27</span> <span class="comment">// negative power. a^b = 1 / (a^-b)</span></div>
|
||||
<div class="line"><span class="lineno"> 28</span> <span class="keywordflow">if</span> (b < 0)</div>
|
||||
<div class="line"><span class="lineno"> 29</span> <span class="keywordflow">return</span> 1.0 / <a class="code hl_function" href="../../d2/d0b/fast__power_8cpp.html#a8399b847626e5bba983cab7c7918b445">fast_power_recursive</a>(a, -b);</div>
|
||||
<div class="line"><span class="lineno"> 30</span> </div>
|
||||
<div class="line"><span class="lineno"> 31</span> <span class="keywordflow">if</span> (b == 0)</div>
|
||||
<div class="line"><span class="lineno"> 32</span> <span class="keywordflow">return</span> 1;</div>
|
||||
<div class="line"><span class="lineno"> 33</span> T bottom = <a class="code hl_function" href="../../d2/d0b/fast__power_8cpp.html#a8399b847626e5bba983cab7c7918b445">fast_power_recursive</a>(a, b >> 1);</div>
|
||||
<div class="line"><span class="lineno"> 34</span> <span class="comment">// Since it is integer division b/2 = (b-1)/2 where b is odd.</span></div>
|
||||
<div class="line"><span class="lineno"> 35</span> <span class="comment">// Therefore, case2 is easily solved by integer division.</span></div>
|
||||
<div class="line"><span class="lineno"> 36</span> </div>
|
||||
<div class="line"><span class="lineno"> 37</span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
|
||||
<div class="line"><span class="lineno"> 38</span> <span class="keywordflow">if</span> ((b & 1) == 0) <span class="comment">// case1</span></div>
|
||||
<div class="line"><span class="lineno"> 39</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> = bottom * bottom;</div>
|
||||
<div class="line"><span class="lineno"> 40</span> <span class="keywordflow">else</span> <span class="comment">// case2</span></div>
|
||||
<div class="line"><span class="lineno"> 41</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> = bottom * bottom * a;</div>
|
||||
<div class="line"><span class="lineno"> 42</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"> 43</span>}</div>
|
||||
<div class="ttc" id="afast__power_8cpp_html_a8399b847626e5bba983cab7c7918b445"><div class="ttname"><a href="../../d2/d0b/fast__power_8cpp.html#a8399b847626e5bba983cab7c7918b445">fast_power_recursive</a></div><div class="ttdeci">double fast_power_recursive(T a, T b)</div><div class="ttdef"><b>Definition:</b> fast_power.cpp:26</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -255,32 +255,32 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Main function </p>
|
||||
<div class="fragment"><div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> {</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/srand.html">std::srand</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">std::time</a>(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/ios_base/sync_with_stdio.html">std::ios_base::sync_with_stdio</a>(<span class="keyword">false</span>);</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> </div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</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..."</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="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < 20; i++) {</div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keywordtype">int</span> a = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/rand.html">std::rand</a>() % 20 - 10;</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keywordtype">int</span> b = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/rand.html">std::rand</a>() % 20 - 10;</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a> << <span class="stringliteral">"Calculating "</span> << a << <span class="stringliteral">"^"</span> << b << <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="l00077" name="l00077"></a><span class="lineno"> 77</span> assert(<a class="code hl_function" href="../../d2/d0b/fast__power_8cpp.html#a8399b847626e5bba983cab7c7918b445">fast_power_recursive</a>(a, b) == <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>(a, b));</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> assert(<a class="code hl_function" href="../../d2/d0b/fast__power_8cpp.html#a0d4e3f0099a6975b74a314a35bd0f94d">fast_power_linear</a>(a, b) == <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>(a, b));</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> </div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"------ "</span> << a << <span class="stringliteral">"^"</span> << b << <span class="stringliteral">" = "</span></div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> << <a class="code hl_function" href="../../d2/d0b/fast__power_8cpp.html#a8399b847626e5bba983cab7c7918b445">fast_power_recursive</a>(a, b) << <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="l00082" name="l00082"></a><span class="lineno"> 82</span> }</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> </div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> int64_t a, b;</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> a >> b;</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> </div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << a << <span class="stringliteral">"^"</span> << b << <span class="stringliteral">" = "</span> << <a class="code hl_function" href="../../d2/d0b/fast__power_8cpp.html#a8399b847626e5bba983cab7c7918b445">fast_power_recursive</a>(a, b)</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</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="l00089" name="l00089"></a><span class="lineno"> 89</span> </div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << a << <span class="stringliteral">"^"</span> << b << <span class="stringliteral">" = "</span> << <a class="code hl_function" href="../../d2/d0b/fast__power_8cpp.html#a0d4e3f0099a6975b74a314a35bd0f94d">fast_power_linear</a>(a, b) << <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="l00091" name="l00091"></a><span class="lineno"> 91</span> </div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 68</span> {</div>
|
||||
<div class="line"><span class="lineno"> 69</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/srand.html">std::srand</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">std::time</a>(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><span class="lineno"> 70</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/ios_base/sync_with_stdio.html">std::ios_base::sync_with_stdio</a>(<span class="keyword">false</span>);</div>
|
||||
<div class="line"><span class="lineno"> 71</span> </div>
|
||||
<div class="line"><span class="lineno"> 72</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..."</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"> 73</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < 20; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 74</span> <span class="keywordtype">int</span> a = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/rand.html">std::rand</a>() % 20 - 10;</div>
|
||||
<div class="line"><span class="lineno"> 75</span> <span class="keywordtype">int</span> b = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/rand.html">std::rand</a>() % 20 - 10;</div>
|
||||
<div class="line"><span class="lineno"> 76</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a> << <span class="stringliteral">"Calculating "</span> << a << <span class="stringliteral">"^"</span> << b << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 77</span> assert(<a class="code hl_function" href="../../d2/d0b/fast__power_8cpp.html#a8399b847626e5bba983cab7c7918b445">fast_power_recursive</a>(a, b) == <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>(a, b));</div>
|
||||
<div class="line"><span class="lineno"> 78</span> assert(<a class="code hl_function" href="../../d2/d0b/fast__power_8cpp.html#a0d4e3f0099a6975b74a314a35bd0f94d">fast_power_linear</a>(a, b) == <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>(a, b));</div>
|
||||
<div class="line"><span class="lineno"> 79</span> </div>
|
||||
<div class="line"><span class="lineno"> 80</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"------ "</span> << a << <span class="stringliteral">"^"</span> << b << <span class="stringliteral">" = "</span></div>
|
||||
<div class="line"><span class="lineno"> 81</span> << <a class="code hl_function" href="../../d2/d0b/fast__power_8cpp.html#a8399b847626e5bba983cab7c7918b445">fast_power_recursive</a>(a, b) << <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"> 82</span> }</div>
|
||||
<div class="line"><span class="lineno"> 83</span> </div>
|
||||
<div class="line"><span class="lineno"> 84</span> int64_t a, b;</div>
|
||||
<div class="line"><span class="lineno"> 85</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> a >> b;</div>
|
||||
<div class="line"><span class="lineno"> 86</span> </div>
|
||||
<div class="line"><span class="lineno"> 87</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << a << <span class="stringliteral">"^"</span> << b << <span class="stringliteral">" = "</span> << <a class="code hl_function" href="../../d2/d0b/fast__power_8cpp.html#a8399b847626e5bba983cab7c7918b445">fast_power_recursive</a>(a, b)</div>
|
||||
<div class="line"><span class="lineno"> 88</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"> 89</span> </div>
|
||||
<div class="line"><span class="lineno"> 90</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << a << <span class="stringliteral">"^"</span> << b << <span class="stringliteral">" = "</span> << <a class="code hl_function" href="../../d2/d0b/fast__power_8cpp.html#a0d4e3f0099a6975b74a314a35bd0f94d">fast_power_linear</a>(a, b) << <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"> 91</span> </div>
|
||||
<div class="line"><span class="lineno"> 92</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 93</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="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>
|
||||
@@ -304,7 +304,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_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d2/d0b/fast__power_8cpp.html">fast_power.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,11 +1,11 @@
|
||||
<map id="main" name="main">
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,231,56,257"/>
|
||||
<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="141,5,213,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="141,5,213,32"/>
|
||||
<area shape="rect" id="node3" href="$d2/d0b/fast__power_8cpp.html#a0d4e3f0099a6975b74a314a35bd0f94d" title=" " alt="" coords="115,80,239,107"/>
|
||||
<area shape="rect" id="node4" href="$d2/d0b/fast__power_8cpp.html#a8399b847626e5bba983cab7c7918b445" title=" " alt="" coords="104,155,251,181"/>
|
||||
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/pow.html#" title=" " alt="" coords="141,205,213,232"/>
|
||||
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/random/rand.html#" title=" " alt="" coords="141,256,214,283"/>
|
||||
<area shape="rect" id="node7" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/random/srand.html#" title=" " alt="" coords="137,307,217,333"/>
|
||||
<area shape="rect" id="node8" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/ios_base/sync_with_stdio.html#" title=" " alt="" coords="109,358,245,399"/>
|
||||
<area shape="rect" id="node9" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/chrono/c/time.html#" title=" " alt="" coords="141,424,214,451"/>
|
||||
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/pow#" title=" " alt="" coords="141,205,213,232"/>
|
||||
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/random/rand#" title=" " alt="" coords="141,256,214,283"/>
|
||||
<area shape="rect" id="node7" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/random/srand#" title=" " alt="" coords="137,307,217,333"/>
|
||||
<area shape="rect" id="node8" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/ios_base/sync_with_stdio#" title=" " alt="" coords="109,358,245,399"/>
|
||||
<area shape="rect" id="node9" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/chrono/c/time#" title=" " alt="" coords="141,424,214,451"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
bc301cb7031051dd2e6b1aeef86e41fd
|
||||
3539e6aedd279063e6f86ccbae1738cb
|
||||
@@ -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="102,-314.5 102,-333.5 156,-333.5 156,-314.5 102,-314.5"/>
|
||||
<text text-anchor="middle" x="129" y="-321.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
@@ -66,7 +66,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/pow.html#" xlink:title=" ">
|
||||
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/pow#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="102,-164.5 102,-183.5 156,-183.5 156,-164.5 102,-164.5"/>
|
||||
<text text-anchor="middle" x="129" y="-171.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::pow</text>
|
||||
</a>
|
||||
@@ -81,7 +81,7 @@
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/rand.html#" xlink:title=" ">
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/rand#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="101.5,-126.5 101.5,-145.5 156.5,-145.5 156.5,-126.5 101.5,-126.5"/>
|
||||
<text text-anchor="middle" x="129" y="-133.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::rand</text>
|
||||
</a>
|
||||
@@ -96,7 +96,7 @@
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/srand.html#" xlink:title=" ">
|
||||
<g id="a_node7"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/srand#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="99,-88.5 99,-107.5 159,-107.5 159,-88.5 99,-88.5"/>
|
||||
<text text-anchor="middle" x="129" y="-95.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::srand</text>
|
||||
</a>
|
||||
@@ -111,7 +111,7 @@
|
||||
<!-- Node8 -->
|
||||
<g id="node8" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_node8"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/ios_base/sync_with_stdio.html#" xlink:title=" ">
|
||||
<g id="a_node8"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/ios_base/sync_with_stdio#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="78,-39 78,-69 180,-69 180,-39 78,-39"/>
|
||||
<text text-anchor="start" x="86" y="-57" font-family="Helvetica,sans-Serif" font-size="10.00">std::ios_base::sync</text>
|
||||
<text text-anchor="middle" x="129" y="-46" font-family="Helvetica,sans-Serif" font-size="10.00">_with_stdio</text>
|
||||
@@ -127,7 +127,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/chrono/c/time.html#" xlink:title=" ">
|
||||
<g id="a_node9"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/chrono/c/time#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="101.5,-0.5 101.5,-19.5 156.5,-19.5 156.5,-0.5 101.5,-0.5"/>
|
||||
<text text-anchor="middle" x="129" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::time</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 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++: sorting/gnome_sort.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');
|
||||
@@ -153,10 +153,10 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Our main function with example of sort method. </p>
|
||||
<div class="fragment"><div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> {</div>
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <a class="code hl_function" href="../../d2/d21/gnome__sort_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>();</div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 130</span> {</div>
|
||||
<div class="line"><span class="lineno"> 131</span> <a class="code hl_function" href="../../d2/d21/gnome__sort_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>();</div>
|
||||
<div class="line"><span class="lineno"> 132</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 133</span>}</div>
|
||||
<div class="ttc" id="agnome__sort_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d2/d21/gnome__sort_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdef"><b>Definition:</b> gnome_sort.cpp:85</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -190,47 +190,47 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Test function </p>
|
||||
<div class="fragment"><div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> {</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="comment">// Example 1. Creating array of int,</span></div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 1 - as a C-array..."</span>;</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keyword">const</span> <span class="keywordtype">int</span> size = 6;</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array<int, size></a> arr = {-22, 100, 150, 35, -10, 99};</div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <a class="code hl_function" href="../../d5/d91/namespacesorting.html#a2f8bc626eb57acae24a94636a23af6a1">sorting::gnomeSort</a>(arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array/data.html">data</a>(),</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> size); <span class="comment">// pass array data as a C-style array pointer</span></div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> assert(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/is_sorted.html">std::is_sorted</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a>(arr), <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">std::end</a>(arr)));</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">" Passed\n"</span>;</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < size; i++) {</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << arr[i] << <span class="stringliteral">", "</span>;</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> }</div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <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="l00098" name="l00098"></a><span class="lineno"> 98</span> </div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="comment">// Example 2. Creating array of doubles.</span></div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"\nTest 2 - as a std::array..."</span>;</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array<double, size></a> double_arr = {-100.2, 10.2, 20.0, 9.0, 7.5, 7.2};</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array<double, size></a> sorted_arr = <a class="code hl_function" href="../../d5/d91/namespacesorting.html#a2f8bc626eb57acae24a94636a23af6a1">sorting::gnomeSort</a>(double_arr);</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> assert(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/is_sorted.html">std::is_sorted</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a>(sorted_arr), <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">std::end</a>(sorted_arr)));</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">" Passed\n"</span>;</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < size; i++) {</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << double_arr[i] << <span class="stringliteral">", "</span>;</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> }</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <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="l00109" name="l00109"></a><span class="lineno"> 109</span> </div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="comment">// Example 3. Creating random array of float.</span></div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"\nTest 3 - 200 random numbers as a std::array..."</span>;</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keyword">const</span> <span class="keywordtype">int</span> size2 = 200;</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array<float, size2></a> rand_arr{};</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> </div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> &a : rand_arr) {</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="comment">// generate random numbers between -5.0 and 4.99</span></div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> a = float(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/rand.html">std::rand</a>() % 1000 - 500) / 100.f;</div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> }</div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> </div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array<float, size2></a> float_arr = <a class="code hl_function" href="../../d5/d91/namespacesorting.html#a2f8bc626eb57acae24a94636a23af6a1">sorting::gnomeSort</a>(rand_arr);</div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> assert(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/is_sorted.html">std::is_sorted</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a>(float_arr), <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">std::end</a>(float_arr)));</div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">" Passed\n"</span>;</div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="comment">// for (int i = 0; i < size; i++) std::cout << double_arr[i] << ", ";</span></div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <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="l00125" name="l00125"></a><span class="lineno"> 125</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 85</span> {</div>
|
||||
<div class="line"><span class="lineno"> 86</span> <span class="comment">// Example 1. Creating array of int,</span></div>
|
||||
<div class="line"><span class="lineno"> 87</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 1 - as a C-array..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 88</span> <span class="keyword">const</span> <span class="keywordtype">int</span> size = 6;</div>
|
||||
<div class="line"><span class="lineno"> 89</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array<int, size></a> arr = {-22, 100, 150, 35, -10, 99};</div>
|
||||
<div class="line"><span class="lineno"> 90</span> <a class="code hl_function" href="../../d5/d91/namespacesorting.html#a2f8bc626eb57acae24a94636a23af6a1">sorting::gnomeSort</a>(arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array/data.html">data</a>(),</div>
|
||||
<div class="line"><span class="lineno"> 91</span> size); <span class="comment">// pass array data as a C-style array pointer</span></div>
|
||||
<div class="line"><span class="lineno"> 92</span> assert(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/is_sorted.html">std::is_sorted</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a>(arr), <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">std::end</a>(arr)));</div>
|
||||
<div class="line"><span class="lineno"> 93</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">" Passed\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 94</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < size; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 95</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << arr[i] << <span class="stringliteral">", "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 96</span> }</div>
|
||||
<div class="line"><span class="lineno"> 97</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/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"> 98</span> </div>
|
||||
<div class="line"><span class="lineno"> 99</span> <span class="comment">// Example 2. Creating array of doubles.</span></div>
|
||||
<div class="line"><span class="lineno"> 100</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"\nTest 2 - as a std::array..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 101</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array<double, size></a> double_arr = {-100.2, 10.2, 20.0, 9.0, 7.5, 7.2};</div>
|
||||
<div class="line"><span class="lineno"> 102</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array<double, size></a> sorted_arr = <a class="code hl_function" href="../../d5/d91/namespacesorting.html#a2f8bc626eb57acae24a94636a23af6a1">sorting::gnomeSort</a>(double_arr);</div>
|
||||
<div class="line"><span class="lineno"> 103</span> assert(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/is_sorted.html">std::is_sorted</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a>(sorted_arr), <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">std::end</a>(sorted_arr)));</div>
|
||||
<div class="line"><span class="lineno"> 104</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">" Passed\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 105</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < size; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 106</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << double_arr[i] << <span class="stringliteral">", "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 107</span> }</div>
|
||||
<div class="line"><span class="lineno"> 108</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 109</span> </div>
|
||||
<div class="line"><span class="lineno"> 110</span> <span class="comment">// Example 3. Creating random array of float.</span></div>
|
||||
<div class="line"><span class="lineno"> 111</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"\nTest 3 - 200 random numbers as a std::array..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 112</span> <span class="keyword">const</span> <span class="keywordtype">int</span> size2 = 200;</div>
|
||||
<div class="line"><span class="lineno"> 113</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array<float, size2></a> rand_arr{};</div>
|
||||
<div class="line"><span class="lineno"> 114</span> </div>
|
||||
<div class="line"><span class="lineno"> 115</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> &a : rand_arr) {</div>
|
||||
<div class="line"><span class="lineno"> 116</span> <span class="comment">// generate random numbers between -5.0 and 4.99</span></div>
|
||||
<div class="line"><span class="lineno"> 117</span> a = float(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/rand.html">std::rand</a>() % 1000 - 500) / 100.f;</div>
|
||||
<div class="line"><span class="lineno"> 118</span> }</div>
|
||||
<div class="line"><span class="lineno"> 119</span> </div>
|
||||
<div class="line"><span class="lineno"> 120</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array<float, size2></a> float_arr = <a class="code hl_function" href="../../d5/d91/namespacesorting.html#a2f8bc626eb57acae24a94636a23af6a1">sorting::gnomeSort</a>(rand_arr);</div>
|
||||
<div class="line"><span class="lineno"> 121</span> assert(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/is_sorted.html">std::is_sorted</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a>(float_arr), <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">std::end</a>(float_arr)));</div>
|
||||
<div class="line"><span class="lineno"> 122</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">" Passed\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 123</span> <span class="comment">// for (int i = 0; i < size; i++) std::cout << double_arr[i] << ", ";</span></div>
|
||||
<div class="line"><span class="lineno"> 124</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <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"> 125</span>}</div>
|
||||
<div class="ttc" id="aarray_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a></div></div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="abegin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a></div><div class="ttdeci">T begin(T... args)</div></div>
|
||||
@@ -249,7 +249,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_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><a class="el" href="../../d2/d21/gnome__sort_8cpp.html">gnome_sort.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>
|
||||
|
||||
@@ -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/jump_search.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');
|
||||
@@ -150,36 +150,36 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >jump search implementation </p>
|
||||
<div class="fragment"><div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> {</div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> <span class="comment">// Finding block size to be jumped</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="keywordtype">int</span> step = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>(n);</div>
|
||||
<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="comment">// Finding the block where element is</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="comment">// present (if it is present)</span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keywordtype">int</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a> = 0;</div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keywordflow">while</span> (arr[<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a>(step, n) - 1] < x) {</div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a> = step;</div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> step += <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>(n);</div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keywordflow">if</span> (prev >= n)</div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="keywordflow">return</span> -1;</div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> }</div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> </div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="comment">// Doing a linear search for x in block</span></div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="comment">// beginning with prev.</span></div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordflow">while</span> (arr[prev] < x) {</div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a>++;</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="comment">// If we reached next block or end of</span></div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="comment">// array, element is not present.</span></div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keywordflow">if</span> (prev == <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a>(step, n))</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keywordflow">return</span> -1;</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> }</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="comment">// If element is found</span></div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keywordflow">if</span> (arr[prev] == x)</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a>;</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> <span class="keywordflow">return</span> -1;</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 12</span> {</div>
|
||||
<div class="line"><span class="lineno"> 13</span> <span class="comment">// Finding block size to be jumped</span></div>
|
||||
<div class="line"><span class="lineno"> 14</span> <span class="keywordtype">int</span> step = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>(n);</div>
|
||||
<div class="line"><span class="lineno"> 15</span> </div>
|
||||
<div class="line"><span class="lineno"> 16</span> <span class="comment">// Finding the block where element is</span></div>
|
||||
<div class="line"><span class="lineno"> 17</span> <span class="comment">// present (if it is present)</span></div>
|
||||
<div class="line"><span class="lineno"> 18</span> <span class="keywordtype">int</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a> = 0;</div>
|
||||
<div class="line"><span class="lineno"> 19</span> <span class="keywordflow">while</span> (arr[<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a>(step, n) - 1] < x) {</div>
|
||||
<div class="line"><span class="lineno"> 20</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a> = step;</div>
|
||||
<div class="line"><span class="lineno"> 21</span> step += <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>(n);</div>
|
||||
<div class="line"><span class="lineno"> 22</span> <span class="keywordflow">if</span> (prev >= n)</div>
|
||||
<div class="line"><span class="lineno"> 23</span> <span class="keywordflow">return</span> -1;</div>
|
||||
<div class="line"><span class="lineno"> 24</span> }</div>
|
||||
<div class="line"><span class="lineno"> 25</span> </div>
|
||||
<div class="line"><span class="lineno"> 26</span> <span class="comment">// Doing a linear search for x in block</span></div>
|
||||
<div class="line"><span class="lineno"> 27</span> <span class="comment">// beginning with prev.</span></div>
|
||||
<div class="line"><span class="lineno"> 28</span> <span class="keywordflow">while</span> (arr[prev] < x) {</div>
|
||||
<div class="line"><span class="lineno"> 29</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a>++;</div>
|
||||
<div class="line"><span class="lineno"> 30</span> </div>
|
||||
<div class="line"><span class="lineno"> 31</span> <span class="comment">// If we reached next block or end of</span></div>
|
||||
<div class="line"><span class="lineno"> 32</span> <span class="comment">// array, element is not present.</span></div>
|
||||
<div class="line"><span class="lineno"> 33</span> <span class="keywordflow">if</span> (prev == <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a>(step, n))</div>
|
||||
<div class="line"><span class="lineno"> 34</span> <span class="keywordflow">return</span> -1;</div>
|
||||
<div class="line"><span class="lineno"> 35</span> }</div>
|
||||
<div class="line"><span class="lineno"> 36</span> <span class="comment">// If element is found</span></div>
|
||||
<div class="line"><span class="lineno"> 37</span> <span class="keywordflow">if</span> (arr[prev] == x)</div>
|
||||
<div class="line"><span class="lineno"> 38</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a>;</div>
|
||||
<div class="line"><span class="lineno"> 39</span> </div>
|
||||
<div class="line"><span class="lineno"> 40</span> <span class="keywordflow">return</span> -1;</div>
|
||||
<div class="line"><span class="lineno"> 41</span>}</div>
|
||||
<div class="ttc" id="amin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a></div><div class="ttdeci">T min(T... args)</div></div>
|
||||
<div class="ttc" id="aprev_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/iterator/prev.html">std::prev</a></div><div class="ttdeci">T prev(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>
|
||||
@@ -207,18 +207,18 @@ Here is the call graph for this function:</div>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<div class="fragment"><div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> {</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keywordtype">int</span> arr[] = {0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610};</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keywordtype">int</span> x = 55;</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordtype">int</span> n = <span class="keyword">sizeof</span>(arr) / <span class="keyword">sizeof</span>(arr[0]);</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> </div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="comment">// Find the index of 'x' using Jump Search</span></div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keywordtype">int</span> index = <a class="code hl_function" href="../../d2/d22/jump__search_8cpp.html#ab49fd8f401bfc71f63b74711390cccf0">jumpSearch</a>(arr, x, n);</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> </div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="comment">// Print the index where 'x' is located</span></div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"\nNumber "</span> << x << <span class="stringliteral">" is at index "</span> << index;</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"> 44</span> {</div>
|
||||
<div class="line"><span class="lineno"> 45</span> <span class="keywordtype">int</span> arr[] = {0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610};</div>
|
||||
<div class="line"><span class="lineno"> 46</span> <span class="keywordtype">int</span> x = 55;</div>
|
||||
<div class="line"><span class="lineno"> 47</span> <span class="keywordtype">int</span> n = <span class="keyword">sizeof</span>(arr) / <span class="keyword">sizeof</span>(arr[0]);</div>
|
||||
<div class="line"><span class="lineno"> 48</span> </div>
|
||||
<div class="line"><span class="lineno"> 49</span> <span class="comment">// Find the index of 'x' using Jump Search</span></div>
|
||||
<div class="line"><span class="lineno"> 50</span> <span class="keywordtype">int</span> index = <a class="code hl_function" href="../../d2/d22/jump__search_8cpp.html#ab49fd8f401bfc71f63b74711390cccf0">jumpSearch</a>(arr, x, n);</div>
|
||||
<div class="line"><span class="lineno"> 51</span> </div>
|
||||
<div class="line"><span class="lineno"> 52</span> <span class="comment">// Print the index where 'x' is located</span></div>
|
||||
<div class="line"><span class="lineno"> 53</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"\nNumber "</span> << x << <span class="stringliteral">" is at index "</span> << index;</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_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="ajump__search_8cpp_html_ab49fd8f401bfc71f63b74711390cccf0"><div class="ttname"><a href="../../d2/d22/jump__search_8cpp.html#ab49fd8f401bfc71f63b74711390cccf0">jumpSearch</a></div><div class="ttdeci">int jumpSearch(int arr[], int x, int n)</div><div class="ttdef"><b>Definition:</b> jump_search.cpp:12</div></div>
|
||||
</div><!-- fragment -->
|
||||
@@ -230,7 +230,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="../../d2/d22/jump__search_8cpp.html">jump_search.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="jumpSearch" name="jumpSearch">
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,31,96,57"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/min.html#" title=" " alt="" coords="145,5,214,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="144,56,215,83"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/min#" title=" " alt="" coords="145,5,214,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="144,56,215,83"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
0a1db6360f8ba13d991fa55ed52d002d
|
||||
869828f5ee919b8a6af667ac7e732a6c
|
||||
@@ -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/algorithm/min.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/min#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="104.5,-38.5 104.5,-57.5 156.5,-57.5 156.5,-38.5 104.5,-38.5"/>
|
||||
<text text-anchor="middle" x="130.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::min</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/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="104,-0.5 104,-19.5 157,-19.5 157,-0.5 104,-0.5"/>
|
||||
<text text-anchor="middle" x="130.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::sqrt</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -1,5 +1,5 @@
|
||||
<map id="machine_learning/neural_network.cpp" name="machine_learning/neural_network.cpp">
|
||||
<area shape="rect" id="node1" title="Implementation of Multilayer Perceptron." alt="" coords="379,5,541,47"/>
|
||||
<area shape="rect" id="node1" title="Implementation of [Multilayer Perceptron] (https://en.wikipedia.org/wiki/Multilayer_perceptron)." alt="" coords="379,5,541,47"/>
|
||||
<area shape="rect" id="node2" title=" " alt="" coords="5,169,80,196"/>
|
||||
<area shape="rect" id="node3" title=" " alt="" coords="498,95,563,121"/>
|
||||
<area shape="rect" id="node4" title=" " alt="" coords="104,169,165,196"/>
|
||||
@@ -10,6 +10,6 @@
|
||||
<area shape="rect" id="node9" title=" " alt="" coords="855,95,910,121"/>
|
||||
<area shape="rect" id="node10" title=" " alt="" coords="375,169,443,196"/>
|
||||
<area shape="rect" id="node11" title=" " alt="" coords="468,169,527,196"/>
|
||||
<area shape="rect" id="node12" href="$d8/d95/vector__ops_8hpp.html" title="Various functions for vectors associated with <a href="https://en.wikipedia.org/wiki/Multilayer_perce..." alt="" coords="261,95,371,121"/>
|
||||
<area shape="rect" id="node12" href="$d8/d95/vector__ops_8hpp.html" title="Various functions for vectors associated with [NeuralNetwork (aka Multilayer Perceptron)] (https://en..." alt="" coords="261,95,371,121"/>
|
||||
<area shape="rect" id="node13" title=" " alt="" coords="286,169,351,196"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
58c2e918b7b0e7944b10a1a20f853b59
|
||||
21ec0479c60c3d3d9741724e68cff007
|
||||
@@ -58,7 +58,7 @@ var sectionId = 'dynsection-0';
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Implementation of Multilayer Perceptron.">
|
||||
<g id="a_node1"><a xlink:title="Implementation of [Multilayer Perceptron] (https://en.wikipedia.org/wiki/Multilayer_perceptron).">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="280,-112.5 280,-142.5 402,-142.5 402,-112.5 280,-112.5"/>
|
||||
<text text-anchor="start" x="288" y="-130.5" font-family="Helvetica,sans-Serif" font-size="10.00">machine_learning/neural</text>
|
||||
<text text-anchor="middle" x="341" y="-119.5" font-family="Helvetica,sans-Serif" font-size="10.00">_network.cpp</text>
|
||||
@@ -218,7 +218,7 @@ var sectionId = 'dynsection-0';
|
||||
<!-- Node12 -->
|
||||
<g id="node12" class="node">
|
||||
<title>Node12</title>
|
||||
<g id="a_node12"><a xlink:href="../../d8/d95/vector__ops_8hpp.html" target="_top" xlink:title="Various functions for vectors associated with <a href="https://en.wikipedia.org/wiki/Multilayer_perce...">
|
||||
<g id="a_node12"><a xlink:href="../../d8/d95/vector__ops_8hpp.html" target="_top" xlink:title="Various functions for vectors associated with [NeuralNetwork (aka Multilayer Perceptron)] (https://en...">
|
||||
<polygon fill="white" stroke="black" points="191.5,-56.5 191.5,-75.5 274.5,-75.5 274.5,-56.5 191.5,-56.5"/>
|
||||
<text text-anchor="middle" x="233" y="-63.5" font-family="Helvetica,sans-Serif" font-size="10.00">vector_ops.hpp</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
@@ -12,7 +12,7 @@
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Implementation of Multilayer Perceptron.">
|
||||
<g id="a_node1"><a xlink:title="Implementation of [Multilayer Perceptron] (https://en.wikipedia.org/wiki/Multilayer_perceptron).">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="280,-112.5 280,-142.5 402,-142.5 402,-112.5 280,-112.5"/>
|
||||
<text text-anchor="start" x="288" y="-130.5" font-family="Helvetica,sans-Serif" font-size="10.00">machine_learning/neural</text>
|
||||
<text text-anchor="middle" x="341" y="-119.5" font-family="Helvetica,sans-Serif" font-size="10.00">_network.cpp</text>
|
||||
@@ -172,7 +172,7 @@
|
||||
<!-- Node12 -->
|
||||
<g id="node12" class="node">
|
||||
<title>Node12</title>
|
||||
<g id="a_node12"><a xlink:href="../../d8/d95/vector__ops_8hpp.html" target="_top" xlink:title="Various functions for vectors associated with <a href="https://en.wikipedia.org/wiki/Multilayer_perce...">
|
||||
<g id="a_node12"><a xlink:href="../../d8/d95/vector__ops_8hpp.html" target="_top" xlink:title="Various functions for vectors associated with [NeuralNetwork (aka Multilayer Perceptron)] (https://en...">
|
||||
<polygon fill="white" stroke="black" points="191.5,-56.5 191.5,-75.5 274.5,-75.5 274.5,-56.5 191.5,-56.5"/>
|
||||
<text text-anchor="middle" x="233" y="-63.5" font-family="Helvetica,sans-Serif" font-size="10.00">vector_ops.hpp</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 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++: sorting/count_inversions.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');
|
||||
@@ -200,12 +200,12 @@ template<class T > </div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>number of inversions in input array, sorts the array </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> {</div>
|
||||
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<T></a> temp;</div>
|
||||
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> temp.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/reserve.html">reserve</a>(size);</div>
|
||||
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> temp.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/assign.html">assign</a>(size, 0);</div>
|
||||
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d5/d4c/group__sorting.html#gab6b14fea48d9841e29b9fc26be6e05d7">mergeSort</a>(arr, temp.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/data.html">data</a>(), 0, size - 1);</div>
|
||||
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 164</span> {</div>
|
||||
<div class="line"><span class="lineno"> 165</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<T></a> temp;</div>
|
||||
<div class="line"><span class="lineno"> 166</span> temp.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/reserve.html">reserve</a>(size);</div>
|
||||
<div class="line"><span class="lineno"> 167</span> temp.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/assign.html">assign</a>(size, 0);</div>
|
||||
<div class="line"><span class="lineno"> 168</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d5/d4c/group__sorting.html#gab6b14fea48d9841e29b9fc26be6e05d7">mergeSort</a>(arr, temp.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/data.html">data</a>(), 0, size - 1);</div>
|
||||
<div class="line"><span class="lineno"> 169</span>}</div>
|
||||
<div class="ttc" id="aassign_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/assign.html">std::vector::assign</a></div><div class="ttdeci">T assign(T... args)</div></div>
|
||||
<div class="ttc" id="adata_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/data.html">std::vector::data</a></div><div class="ttdeci">T data(T... args)</div></div>
|
||||
<div class="ttc" id="agroup__sorting_html_gab6b14fea48d9841e29b9fc26be6e05d7"><div class="ttname"><a href="../../d5/d4c/group__sorting.html#gab6b14fea48d9841e29b9fc26be6e05d7">mergeSort</a></div><div class="ttdeci">void mergeSort(int *arr, int l, int r)</div><div class="ttdef"><b>Definition:</b> merge_sort.cpp:71</div></div>
|
||||
@@ -238,11 +238,11 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Main function. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> {</div>
|
||||
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> <a class="code hl_function" href="../../d2/d26/count__inversions_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// Run test implementations</span></div>
|
||||
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> <span class="comment">// body(); // test your own array</span></div>
|
||||
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 271</span> {</div>
|
||||
<div class="line"><span class="lineno"> 272</span> <a class="code hl_function" href="../../d2/d26/count__inversions_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// Run test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 273</span> <span class="comment">// body(); // test your own array</span></div>
|
||||
<div class="line"><span class="lineno"> 274</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 275</span>}</div>
|
||||
<div class="ttc" id="acount__inversions_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d2/d26/count__inversions_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Test implementations.</div><div class="ttdef"><b>Definition:</b> count_inversions.cpp:194</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -313,35 +313,35 @@ template<typename T > </div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>number of inversions found in merge step </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> {</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> uint32_t i = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">left</a>; <span class="comment">/* i --> index of left sub-array */</span></div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> uint32_t j = mid + 1; <span class="comment">/* j --> index for right sub-array */</span></div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> uint32_t <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a> = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">left</a>; <span class="comment">/* k --> index for resultant array temp */</span></div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> uint32_t inv_count = 0; <span class="comment">// inversion count</span></div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> </div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="keywordflow">while</span> ((i <= mid) && (j <= right)) {</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="keywordflow">if</span> (arr[i] <= arr[j]) {</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> temp[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>++] = arr[i++];</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> temp[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>++] = arr[j++];</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> inv_count +=</div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> (mid - i +</div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> 1); <span class="comment">// tricky; may vary depending on selection of sub-array</span></div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> }</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> }</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="comment">// Add remaining elements from the larger subarray to the end of temp</span></div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordflow">while</span> (i <= mid) {</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> temp[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>++] = arr[i++];</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> }</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="keywordflow">while</span> (j <= right) {</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> temp[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>++] = arr[j++];</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> }</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="comment">// Copy temp[] to arr[]</span></div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keywordflow">for</span> (k = left; <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a> <= <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">right</a>; <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>++) {</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> arr[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>] = temp[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>];</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> }</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keywordflow">return</span> inv_count;</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 85</span> {</div>
|
||||
<div class="line"><span class="lineno"> 86</span> uint32_t i = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">left</a>; <span class="comment">/* i --> index of left sub-array */</span></div>
|
||||
<div class="line"><span class="lineno"> 87</span> uint32_t j = mid + 1; <span class="comment">/* j --> index for right sub-array */</span></div>
|
||||
<div class="line"><span class="lineno"> 88</span> uint32_t <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a> = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">left</a>; <span class="comment">/* k --> index for resultant array temp */</span></div>
|
||||
<div class="line"><span class="lineno"> 89</span> uint32_t inv_count = 0; <span class="comment">// inversion count</span></div>
|
||||
<div class="line"><span class="lineno"> 90</span> </div>
|
||||
<div class="line"><span class="lineno"> 91</span> <span class="keywordflow">while</span> ((i <= mid) && (j <= right)) {</div>
|
||||
<div class="line"><span class="lineno"> 92</span> <span class="keywordflow">if</span> (arr[i] <= arr[j]) {</div>
|
||||
<div class="line"><span class="lineno"> 93</span> temp[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>++] = arr[i++];</div>
|
||||
<div class="line"><span class="lineno"> 94</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 95</span> temp[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>++] = arr[j++];</div>
|
||||
<div class="line"><span class="lineno"> 96</span> inv_count +=</div>
|
||||
<div class="line"><span class="lineno"> 97</span> (mid - i +</div>
|
||||
<div class="line"><span class="lineno"> 98</span> 1); <span class="comment">// tricky; may vary depending on selection of sub-array</span></div>
|
||||
<div class="line"><span class="lineno"> 99</span> }</div>
|
||||
<div class="line"><span class="lineno"> 100</span> }</div>
|
||||
<div class="line"><span class="lineno"> 101</span> <span class="comment">// Add remaining elements from the larger subarray to the end of temp</span></div>
|
||||
<div class="line"><span class="lineno"> 102</span> <span class="keywordflow">while</span> (i <= mid) {</div>
|
||||
<div class="line"><span class="lineno"> 103</span> temp[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>++] = arr[i++];</div>
|
||||
<div class="line"><span class="lineno"> 104</span> }</div>
|
||||
<div class="line"><span class="lineno"> 105</span> <span class="keywordflow">while</span> (j <= right) {</div>
|
||||
<div class="line"><span class="lineno"> 106</span> temp[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>++] = arr[j++];</div>
|
||||
<div class="line"><span class="lineno"> 107</span> }</div>
|
||||
<div class="line"><span class="lineno"> 108</span> <span class="comment">// Copy temp[] to arr[]</span></div>
|
||||
<div class="line"><span class="lineno"> 109</span> <span class="keywordflow">for</span> (k = left; <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a> <= <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">right</a>; <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>++) {</div>
|
||||
<div class="line"><span class="lineno"> 110</span> arr[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>] = temp[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>];</div>
|
||||
<div class="line"><span class="lineno"> 111</span> }</div>
|
||||
<div class="line"><span class="lineno"> 112</span> <span class="keywordflow">return</span> inv_count;</div>
|
||||
<div class="line"><span class="lineno"> 113</span>}</div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a1b74d828b33760094906797042b89442"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">numerical_methods::simpson_method::k</a></div><div class="ttdeci">double k(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition:</b> composite_simpson_rule.cpp:117</div></div>
|
||||
<div class="ttc" id="aleft_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/left.html">std::left</a></div><div class="ttdeci">T left(T... args)</div></div>
|
||||
</div><!-- fragment -->
|
||||
@@ -399,20 +399,20 @@ template<typename T > </div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>number of inversions in array </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> {</div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> uint32_t mid = 0, inv_count = 0;</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keywordflow">if</span> (right > left) {</div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="comment">// midpoint to split the array</span></div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> mid = (<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">right</a> + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">left</a>) / 2;</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="comment">// Add inversions in left and right sub-arrays</span></div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> inv_count += <a class="code hl_function" href="../../d5/d4c/group__sorting.html#gab6b14fea48d9841e29b9fc26be6e05d7">mergeSort</a>(arr, temp, left, mid); <span class="comment">// left sub-array</span></div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> inv_count += <a class="code hl_function" href="../../d5/d4c/group__sorting.html#gab6b14fea48d9841e29b9fc26be6e05d7">mergeSort</a>(arr, temp, mid + 1, right);</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="comment">// inversions in the merge step</span></div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> inv_count += <a class="code hl_function" href="../../d5/d4c/group__sorting.html#ga460c61cd948203b4816bef2accb3fc73">merge</a>(arr, temp, left, mid, right);</div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> }</div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keywordflow">return</span> inv_count;</div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 132</span> {</div>
|
||||
<div class="line"><span class="lineno"> 133</span> uint32_t mid = 0, inv_count = 0;</div>
|
||||
<div class="line"><span class="lineno"> 134</span> <span class="keywordflow">if</span> (right > left) {</div>
|
||||
<div class="line"><span class="lineno"> 135</span> <span class="comment">// midpoint to split the array</span></div>
|
||||
<div class="line"><span class="lineno"> 136</span> mid = (<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">right</a> + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">left</a>) / 2;</div>
|
||||
<div class="line"><span class="lineno"> 137</span> <span class="comment">// Add inversions in left and right sub-arrays</span></div>
|
||||
<div class="line"><span class="lineno"> 138</span> inv_count += <a class="code hl_function" href="../../d5/d4c/group__sorting.html#gab6b14fea48d9841e29b9fc26be6e05d7">mergeSort</a>(arr, temp, left, mid); <span class="comment">// left sub-array</span></div>
|
||||
<div class="line"><span class="lineno"> 139</span> inv_count += <a class="code hl_function" href="../../d5/d4c/group__sorting.html#gab6b14fea48d9841e29b9fc26be6e05d7">mergeSort</a>(arr, temp, mid + 1, right);</div>
|
||||
<div class="line"><span class="lineno"> 140</span> </div>
|
||||
<div class="line"><span class="lineno"> 141</span> <span class="comment">// inversions in the merge step</span></div>
|
||||
<div class="line"><span class="lineno"> 142</span> inv_count += <a class="code hl_function" href="../../d5/d4c/group__sorting.html#ga460c61cd948203b4816bef2accb3fc73">merge</a>(arr, temp, left, mid, right);</div>
|
||||
<div class="line"><span class="lineno"> 143</span> }</div>
|
||||
<div class="line"><span class="lineno"> 144</span> <span class="keywordflow">return</span> inv_count;</div>
|
||||
<div class="line"><span class="lineno"> 145</span>}</div>
|
||||
<div class="ttc" id="agroup__sorting_html_ga460c61cd948203b4816bef2accb3fc73"><div class="ttname"><a href="../../d5/d4c/group__sorting.html#ga460c61cd948203b4816bef2accb3fc73">merge</a></div><div class="ttdeci">void merge(int *arr, int l, int m, int r)</div><div class="ttdef"><b>Definition:</b> merge_sort.cpp:33</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -460,13 +460,13 @@ template<typename T > </div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> {</div>
|
||||
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</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">"Printing array: \n"</span>;</div>
|
||||
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> <span class="keywordflow">for</span> (uint32_t i = 0; i < array_size; i++) {</div>
|
||||
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</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">" "</span> << arr[i];</div>
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> }</div>
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</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">"\n"</span>;</div>
|
||||
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 179</span> {</div>
|
||||
<div class="line"><span class="lineno"> 180</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Printing array: \n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 181</span> <span class="keywordflow">for</span> (uint32_t i = 0; i < array_size; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 182</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">" "</span> << arr[i];</div>
|
||||
<div class="line"><span class="lineno"> 183</span> }</div>
|
||||
<div class="line"><span class="lineno"> 184</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">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 185</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><!-- fragment -->
|
||||
</div>
|
||||
@@ -496,39 +496,39 @@ template<typename T > </div>
|
||||
|
||||
<p>Test implementations. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> {</div>
|
||||
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> <span class="comment">// Test 1</span></div>
|
||||
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> arr1 = {</div>
|
||||
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84,</div>
|
||||
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67,</div>
|
||||
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50,</div>
|
||||
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33,</div>
|
||||
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16,</div>
|
||||
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1};</div>
|
||||
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> uint32_t size1 = arr1.<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="l00204" name="l00204"></a><span class="lineno"> 204</span> uint32_t inv_count1 = 4950;</div>
|
||||
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> uint32_t result1 = <a class="code hl_function" href="../../d2/d26/count__inversions_8cpp.html#a3332498eabf6579ef059c0d0e9f4ec80">sorting::inversion::countInversion</a>(arr1.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/data.html">data</a>(), size1);</div>
|
||||
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> assert(inv_count1 == result1);</div>
|
||||
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> <span class="comment">// Test 2</span></div>
|
||||
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int></a> arr2 = {22, 66, 75, 23, 11, 87, 2, 44, 98, 43};</div>
|
||||
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> uint32_t size2 = arr2.<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="l00210" name="l00210"></a><span class="lineno"> 210</span> uint32_t inv_count2 = 20;</div>
|
||||
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> uint32_t result2 = <a class="code hl_function" href="../../d2/d26/count__inversions_8cpp.html#a3332498eabf6579ef059c0d0e9f4ec80">sorting::inversion::countInversion</a>(arr2.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/data.html">data</a>(), size2);</div>
|
||||
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> assert(inv_count2 == result2);</div>
|
||||
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> <span class="comment">// Test 3</span></div>
|
||||
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<double></a> arr3 = {33.1, 45.2, 65.4, 76.5, 1.0,</div>
|
||||
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> 2.9, 5.4, 7.7, 88.9, 12.4};</div>
|
||||
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> uint32_t size3 = arr3.<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="l00217" name="l00217"></a><span class="lineno"> 217</span> uint32_t inv_count3 = 21;</div>
|
||||
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> uint32_t result3 = <a class="code hl_function" href="../../d2/d26/count__inversions_8cpp.html#a3332498eabf6579ef059c0d0e9f4ec80">sorting::inversion::countInversion</a>(arr3.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/data.html">data</a>(), size3);</div>
|
||||
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> assert(inv_count3 == result3);</div>
|
||||
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> <span class="comment">// Test 4</span></div>
|
||||
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<char></a> arr4 = {<span class="charliteral">'a'</span>, <span class="charliteral">'b'</span>, <span class="charliteral">'c'</span>, <span class="charliteral">'d'</span>, <span class="charliteral">'e'</span>};</div>
|
||||
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> uint32_t size4 = arr4.<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="l00223" name="l00223"></a><span class="lineno"> 223</span> uint32_t inv_count4 = 0;</div>
|
||||
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> uint32_t result4 = <a class="code hl_function" href="../../d2/d26/count__inversions_8cpp.html#a3332498eabf6579ef059c0d0e9f4ec80">sorting::inversion::countInversion</a>(arr4.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/data.html">data</a>(), size4);</div>
|
||||
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> assert(inv_count4 == result4);</div>
|
||||
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 194</span> {</div>
|
||||
<div class="line"><span class="lineno"> 195</span> <span class="comment">// Test 1</span></div>
|
||||
<div class="line"><span class="lineno"> 196</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> arr1 = {</div>
|
||||
<div class="line"><span class="lineno"> 197</span> 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84,</div>
|
||||
<div class="line"><span class="lineno"> 198</span> 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67,</div>
|
||||
<div class="line"><span class="lineno"> 199</span> 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50,</div>
|
||||
<div class="line"><span class="lineno"> 200</span> 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33,</div>
|
||||
<div class="line"><span class="lineno"> 201</span> 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16,</div>
|
||||
<div class="line"><span class="lineno"> 202</span> 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1};</div>
|
||||
<div class="line"><span class="lineno"> 203</span> uint32_t size1 = arr1.<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"> 204</span> uint32_t inv_count1 = 4950;</div>
|
||||
<div class="line"><span class="lineno"> 205</span> uint32_t result1 = <a class="code hl_function" href="../../d2/d26/count__inversions_8cpp.html#a3332498eabf6579ef059c0d0e9f4ec80">sorting::inversion::countInversion</a>(arr1.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/data.html">data</a>(), size1);</div>
|
||||
<div class="line"><span class="lineno"> 206</span> assert(inv_count1 == result1);</div>
|
||||
<div class="line"><span class="lineno"> 207</span> <span class="comment">// Test 2</span></div>
|
||||
<div class="line"><span class="lineno"> 208</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int></a> arr2 = {22, 66, 75, 23, 11, 87, 2, 44, 98, 43};</div>
|
||||
<div class="line"><span class="lineno"> 209</span> uint32_t size2 = arr2.<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"> 210</span> uint32_t inv_count2 = 20;</div>
|
||||
<div class="line"><span class="lineno"> 211</span> uint32_t result2 = <a class="code hl_function" href="../../d2/d26/count__inversions_8cpp.html#a3332498eabf6579ef059c0d0e9f4ec80">sorting::inversion::countInversion</a>(arr2.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/data.html">data</a>(), size2);</div>
|
||||
<div class="line"><span class="lineno"> 212</span> assert(inv_count2 == result2);</div>
|
||||
<div class="line"><span class="lineno"> 213</span> <span class="comment">// Test 3</span></div>
|
||||
<div class="line"><span class="lineno"> 214</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<double></a> arr3 = {33.1, 45.2, 65.4, 76.5, 1.0,</div>
|
||||
<div class="line"><span class="lineno"> 215</span> 2.9, 5.4, 7.7, 88.9, 12.4};</div>
|
||||
<div class="line"><span class="lineno"> 216</span> uint32_t size3 = arr3.<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"> 217</span> uint32_t inv_count3 = 21;</div>
|
||||
<div class="line"><span class="lineno"> 218</span> uint32_t result3 = <a class="code hl_function" href="../../d2/d26/count__inversions_8cpp.html#a3332498eabf6579ef059c0d0e9f4ec80">sorting::inversion::countInversion</a>(arr3.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/data.html">data</a>(), size3);</div>
|
||||
<div class="line"><span class="lineno"> 219</span> assert(inv_count3 == result3);</div>
|
||||
<div class="line"><span class="lineno"> 220</span> <span class="comment">// Test 4</span></div>
|
||||
<div class="line"><span class="lineno"> 221</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<char></a> arr4 = {<span class="charliteral">'a'</span>, <span class="charliteral">'b'</span>, <span class="charliteral">'c'</span>, <span class="charliteral">'d'</span>, <span class="charliteral">'e'</span>};</div>
|
||||
<div class="line"><span class="lineno"> 222</span> uint32_t size4 = arr4.<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"> 223</span> uint32_t inv_count4 = 0;</div>
|
||||
<div class="line"><span class="lineno"> 224</span> uint32_t result4 = <a class="code hl_function" href="../../d2/d26/count__inversions_8cpp.html#a3332498eabf6579ef059c0d0e9f4ec80">sorting::inversion::countInversion</a>(arr4.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/data.html">data</a>(), size4);</div>
|
||||
<div class="line"><span class="lineno"> 225</span> assert(inv_count4 == result4);</div>
|
||||
<div class="line"><span class="lineno"> 226</span>}</div>
|
||||
<div class="ttc" id="acount__inversions_8cpp_html_a3332498eabf6579ef059c0d0e9f4ec80"><div class="ttname"><a href="../../d2/d26/count__inversions_8cpp.html#a3332498eabf6579ef059c0d0e9f4ec80">sorting::inversion::countInversion</a></div><div class="ttdeci">uint32_t countInversion(T *arr, const uint32_t size)</div><div class="ttdoc">Function countInversion() returns the number of inversion present in the input array....</div><div class="ttdef"><b>Definition:</b> count_inversions.cpp:164</div></div>
|
||||
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/size.html">std::vector::size</a></div><div class="ttdeci">T size(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
@@ -546,7 +546,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_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><a class="el" href="../../d2/d26/count__inversions_8cpp.html">count_inversions.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="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/container/vector/data.html#" title=" " alt="" coords="97,5,215,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size.html#" title=" " alt="" coords="98,56,214,83"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/data#" title=" " alt="" coords="97,5,215,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size#" title=" " alt="" coords="98,56,214,83"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
ddb90a5a78f0e401d8b16fca105b6791
|
||||
f7fc7d14f66b8ebb3a74f67726d44b34
|
||||
@@ -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/container/vector/data.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/data#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="69,-38.5 69,-57.5 157,-57.5 157,-38.5 69,-38.5"/>
|
||||
<text text-anchor="middle" x="113" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::data</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/container/vector/size.html#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="69.5,-0.5 69.5,-19.5 156.5,-19.5 156.5,-0.5 69.5,-0.5"/>
|
||||
<text text-anchor="middle" x="113" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -1,6 +1,6 @@
|
||||
<map id="main" name="main">
|
||||
<area shape="rect" id="node1" title="Main function." alt="" coords="5,31,56,57"/>
|
||||
<area shape="rect" id="node2" href="$d2/d26/count__inversions_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" title="Test implementations." alt="" coords="104,31,148,57"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/data.html#" title=" " alt="" coords="196,5,313,32"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size.html#" title=" " alt="" coords="197,56,313,83"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/data#" title=" " alt="" coords="196,5,313,32"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size#" title=" " alt="" coords="197,56,313,83"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1d6a6f7982c8130893fe3e831c75fef8
|
||||
21b0a3045dfbab3b7ca15a381520d659
|
||||
@@ -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/container/vector/data.html#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/data#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="143,-38.5 143,-57.5 231,-57.5 231,-38.5 143,-38.5"/>
|
||||
<text text-anchor="middle" x="187" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::data</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/container/vector/size.html#" xlink:title=" ">
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="143.5,-0.5 143.5,-19.5 230.5,-19.5 230.5,-0.5 143.5,-0.5"/>
|
||||
<text text-anchor="middle" x="187" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
@@ -2,6 +2,6 @@
|
||||
<area shape="rect" id="node1" title="Implement merge Sort and count inverions while merging." alt="" coords="5,35,127,77"/>
|
||||
<area shape="rect" id="node2" href="$d5/d91/namespacesorting.html#aa26de383227859210f14dcf12201a079" title="merges 2 sorted adjacent segments into a larger sorted segment" alt="" coords="175,5,280,32"/>
|
||||
<area shape="rect" id="node4" href="$d5/d4c/group__sorting.html#gab6b14fea48d9841e29b9fc26be6e05d7" title=" " alt="" coords="186,80,269,107"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/utility/move.html#" title=" " alt="" coords="328,5,408,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/utility/move#" title=" " alt="" coords="328,5,408,32"/>
|
||||
<area shape="rect" id="node5" href="$d5/d4c/group__sorting.html#ga460c61cd948203b4816bef2accb3fc73" title=" " alt="" coords="339,80,397,107"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
63b0853ea5b2ae46e9a34f1d91b0c83b
|
||||
2c73ba8d634085878d659493ccc7662a
|
||||
@@ -52,7 +52,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/utility/move.html#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/utility/move#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="242,-56.5 242,-75.5 302,-75.5 302,-56.5 242,-56.5"/>
|
||||
<text text-anchor="middle" x="272" y="-63.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::move</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.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++: tower Struct 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');
|
||||
@@ -119,7 +119,7 @@ int </td><td class="memItemRight" valign="bottom"><b>top</b></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d2/d2c/structtower.html">tower</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');
|
||||
@@ -103,7 +103,7 @@ $(document).ready(function(){initNavTree('d9/d5a/structgeometry_1_1jarvis_1_1_po
|
||||
<!-- 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++: qr_algorithm 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');
|
||||
@@ -176,73 +176,73 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="fragment"><div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> {</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keywordtype">int</span> rows = A->size();</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keywordtype">int</span> columns = rows;</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordtype">int</span> counter = 0, num_eigs = rows - 1;</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="keywordtype">double</span> last_eig = 0;</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> </div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/valarray.html">std::valarray<std::valarray<double></a>> Q(rows);</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/valarray.html">std::valarray<std::valarray<double></a>> R(columns);</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> </div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="comment">/* number of eigen values = matrix size */</span></div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/valarray.html">std::valarray<double></a> eigen_vals(rows);</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < rows; i++) {</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> Q[i] = <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/valarray.html">std::valarray<double></a>(columns);</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> R[i] = <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/valarray.html">std::valarray<double></a>(columns);</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> }</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> </div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="comment">/* continue till all eigen values are found */</span></div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="keywordflow">while</span> (num_eigs > 0) {</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="comment">/* iterate with QR decomposition */</span></div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordflow">while</span> (std::abs(A[0][num_eigs][num_eigs - 1]) ></div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/numeric_limits.html">std::numeric_limits<double>::epsilon</a>()) {</div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="comment">// initial approximation = last diagonal element</span></div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> last_eig = A[0][num_eigs][num_eigs];</div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < rows; i++) {</div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> A[0][i][i] -= last_eig; <span class="comment">/* A - cI */</span></div>
|
||||
<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> </div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#a73ce637634fc49e1d10d190eb388ebf1">qr_decompose</a>(*A, &Q, &R);</div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> </div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <span class="keywordflow">if</span> (print_intermediates) {</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << *A << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << Q << <span class="stringliteral">"\n"</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> << R << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/c/fprintf.html">printf</a>(<span class="stringliteral">"-------------------- %d ---------------------\n"</span>,</div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> ++counter);</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> }</div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> </div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <span class="comment">// new approximation A' = R * Q</span></div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <a class="code hl_function" href="../../de/d75/qr__eigen__values_8cpp.html#abb8bf4c55e10685a5eb2ad3797fde1ae">mat_mul</a>(R, Q, A);</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> </div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < rows; i++) {</div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> A[0][i][i] += last_eig; <span class="comment">/* A + cI */</span></div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> }</div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> }</div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> </div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="comment">/* store the converged eigen value */</span></div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> eigen_vals[num_eigs] = last_eig;</div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="comment">// A[0][num_eigs][num_eigs];</span></div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keywordflow">if</span> (print_intermediates) {</div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"========================\n"</span>;</div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</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">"Eigen value: "</span> << last_eig << <span class="stringliteral">",\n"</span>;</div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"========================\n"</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> </div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> num_eigs--;</div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> rows--;</div>
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> columns--;</div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> }</div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> eigen_vals[0] = A[0][0][0];</div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> </div>
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="keywordflow">if</span> (print_intermediates) {</div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << Q << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << R << <span class="stringliteral">"\n"</span>;</div>
|
||||
<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> </div>
|
||||
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <span class="keywordflow">return</span> eigen_vals;</div>
|
||||
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 99</span> {</div>
|
||||
<div class="line"><span class="lineno"> 100</span> <span class="keywordtype">int</span> rows = A->size();</div>
|
||||
<div class="line"><span class="lineno"> 101</span> <span class="keywordtype">int</span> columns = rows;</div>
|
||||
<div class="line"><span class="lineno"> 102</span> <span class="keywordtype">int</span> counter = 0, num_eigs = rows - 1;</div>
|
||||
<div class="line"><span class="lineno"> 103</span> <span class="keywordtype">double</span> last_eig = 0;</div>
|
||||
<div class="line"><span class="lineno"> 104</span> </div>
|
||||
<div class="line"><span class="lineno"> 105</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/valarray.html">std::valarray<std::valarray<double></a>> Q(rows);</div>
|
||||
<div class="line"><span class="lineno"> 106</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/valarray.html">std::valarray<std::valarray<double></a>> R(columns);</div>
|
||||
<div class="line"><span class="lineno"> 107</span> </div>
|
||||
<div class="line"><span class="lineno"> 108</span> <span class="comment">/* number of eigen values = matrix size */</span></div>
|
||||
<div class="line"><span class="lineno"> 109</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/valarray.html">std::valarray<double></a> eigen_vals(rows);</div>
|
||||
<div class="line"><span class="lineno"> 110</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < rows; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 111</span> Q[i] = <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/valarray.html">std::valarray<double></a>(columns);</div>
|
||||
<div class="line"><span class="lineno"> 112</span> R[i] = <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/valarray.html">std::valarray<double></a>(columns);</div>
|
||||
<div class="line"><span class="lineno"> 113</span> }</div>
|
||||
<div class="line"><span class="lineno"> 114</span> </div>
|
||||
<div class="line"><span class="lineno"> 115</span> <span class="comment">/* continue till all eigen values are found */</span></div>
|
||||
<div class="line"><span class="lineno"> 116</span> <span class="keywordflow">while</span> (num_eigs > 0) {</div>
|
||||
<div class="line"><span class="lineno"> 117</span> <span class="comment">/* iterate with QR decomposition */</span></div>
|
||||
<div class="line"><span class="lineno"> 118</span> <span class="keywordflow">while</span> (std::abs(A[0][num_eigs][num_eigs - 1]) ></div>
|
||||
<div class="line"><span class="lineno"> 119</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/numeric_limits.html">std::numeric_limits<double>::epsilon</a>()) {</div>
|
||||
<div class="line"><span class="lineno"> 120</span> <span class="comment">// initial approximation = last diagonal element</span></div>
|
||||
<div class="line"><span class="lineno"> 121</span> last_eig = A[0][num_eigs][num_eigs];</div>
|
||||
<div class="line"><span class="lineno"> 122</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < rows; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 123</span> A[0][i][i] -= last_eig; <span class="comment">/* A - cI */</span></div>
|
||||
<div class="line"><span class="lineno"> 124</span> }</div>
|
||||
<div class="line"><span class="lineno"> 125</span> </div>
|
||||
<div class="line"><span class="lineno"> 126</span> <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#a73ce637634fc49e1d10d190eb388ebf1">qr_decompose</a>(*A, &Q, &R);</div>
|
||||
<div class="line"><span class="lineno"> 127</span> </div>
|
||||
<div class="line"><span class="lineno"> 128</span> <span class="keywordflow">if</span> (print_intermediates) {</div>
|
||||
<div class="line"><span class="lineno"> 129</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << *A << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 130</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << Q << <span class="stringliteral">"\n"</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> << R << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 132</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/c/fprintf.html">printf</a>(<span class="stringliteral">"-------------------- %d ---------------------\n"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 133</span> ++counter);</div>
|
||||
<div class="line"><span class="lineno"> 134</span> }</div>
|
||||
<div class="line"><span class="lineno"> 135</span> </div>
|
||||
<div class="line"><span class="lineno"> 136</span> <span class="comment">// new approximation A' = R * Q</span></div>
|
||||
<div class="line"><span class="lineno"> 137</span> <a class="code hl_function" href="../../de/d75/qr__eigen__values_8cpp.html#abb8bf4c55e10685a5eb2ad3797fde1ae">mat_mul</a>(R, Q, A);</div>
|
||||
<div class="line"><span class="lineno"> 138</span> </div>
|
||||
<div class="line"><span class="lineno"> 139</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < rows; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 140</span> A[0][i][i] += last_eig; <span class="comment">/* A + cI */</span></div>
|
||||
<div class="line"><span class="lineno"> 141</span> }</div>
|
||||
<div class="line"><span class="lineno"> 142</span> }</div>
|
||||
<div class="line"><span class="lineno"> 143</span> </div>
|
||||
<div class="line"><span class="lineno"> 144</span> <span class="comment">/* store the converged eigen value */</span></div>
|
||||
<div class="line"><span class="lineno"> 145</span> eigen_vals[num_eigs] = last_eig;</div>
|
||||
<div class="line"><span class="lineno"> 146</span> <span class="comment">// A[0][num_eigs][num_eigs];</span></div>
|
||||
<div class="line"><span class="lineno"> 147</span> <span class="keywordflow">if</span> (print_intermediates) {</div>
|
||||
<div class="line"><span class="lineno"> 148</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"========================\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 149</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">"Eigen value: "</span> << last_eig << <span class="stringliteral">",\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 150</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"========================\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 151</span> }</div>
|
||||
<div class="line"><span class="lineno"> 152</span> </div>
|
||||
<div class="line"><span class="lineno"> 153</span> num_eigs--;</div>
|
||||
<div class="line"><span class="lineno"> 154</span> rows--;</div>
|
||||
<div class="line"><span class="lineno"> 155</span> columns--;</div>
|
||||
<div class="line"><span class="lineno"> 156</span> }</div>
|
||||
<div class="line"><span class="lineno"> 157</span> eigen_vals[0] = A[0][0][0];</div>
|
||||
<div class="line"><span class="lineno"> 158</span> </div>
|
||||
<div class="line"><span class="lineno"> 159</span> <span class="keywordflow">if</span> (print_intermediates) {</div>
|
||||
<div class="line"><span class="lineno"> 160</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << Q << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 161</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << R << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 162</span> }</div>
|
||||
<div class="line"><span class="lineno"> 163</span> </div>
|
||||
<div class="line"><span class="lineno"> 164</span> <span class="keywordflow">return</span> eigen_vals;</div>
|
||||
<div class="line"><span class="lineno"> 165</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="afprintf_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/c/fprintf.html">std::printf</a></div><div class="ttdeci">T printf(T... args)</div></div>
|
||||
<div class="ttc" id="anamespaceqr__algorithm_html_a73ce637634fc49e1d10d190eb388ebf1"><div class="ttname"><a href="../../d2/d3b/namespaceqr__algorithm.html#a73ce637634fc49e1d10d190eb388ebf1">qr_algorithm::qr_decompose</a></div><div class="ttdeci">void qr_decompose(const std::valarray< std::valarray< T > > &A, std::valarray< std::valarray< T > > *Q, std::valarray< std::valarray< T > > *R)</div><div class="ttdef"><b>Definition:</b> qr_decompose.h:146</div></div>
|
||||
@@ -286,20 +286,20 @@ template<typename T > </div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >operator to print a matrix </p>
|
||||
<div class="fragment"><div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> {</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keyword">const</span> <span class="keywordtype">int</span> width = 12;</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keyword">const</span> <span class="keywordtype">char</span> separator = <span class="charliteral">' '</span>;</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> out.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/ios_base/precision.html">precision</a>(4);</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> row = 0; row < v.size(); row++) {</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> col = 0; col < v[row].size(); col++)</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> out << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">std::right</a> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a>(width) << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setfill.html">std::setfill</a>(separator)</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> << v[row][col];</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> out << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> }</div>
|
||||
<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">return</span> out;</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 34</span> {</div>
|
||||
<div class="line"><span class="lineno"> 35</span> <span class="keyword">const</span> <span class="keywordtype">int</span> width = 12;</div>
|
||||
<div class="line"><span class="lineno"> 36</span> <span class="keyword">const</span> <span class="keywordtype">char</span> separator = <span class="charliteral">' '</span>;</div>
|
||||
<div class="line"><span class="lineno"> 37</span> </div>
|
||||
<div class="line"><span class="lineno"> 38</span> out.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/ios_base/precision.html">precision</a>(4);</div>
|
||||
<div class="line"><span class="lineno"> 39</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> row = 0; row < v.size(); row++) {</div>
|
||||
<div class="line"><span class="lineno"> 40</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> col = 0; col < v[row].size(); col++)</div>
|
||||
<div class="line"><span class="lineno"> 41</span> out << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">std::right</a> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a>(width) << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setfill.html">std::setfill</a>(separator)</div>
|
||||
<div class="line"><span class="lineno"> 42</span> << v[row][col];</div>
|
||||
<div class="line"><span class="lineno"> 43</span> out << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 44</span> }</div>
|
||||
<div class="line"><span class="lineno"> 45</span> </div>
|
||||
<div class="line"><span class="lineno"> 46</span> <span class="keywordflow">return</span> out;</div>
|
||||
<div class="line"><span class="lineno"> 47</span>}</div>
|
||||
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
|
||||
<div class="ttc" id="aleft_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/left.html">std::right</a></div><div class="ttdeci">T right(T... args)</div></div>
|
||||
<div class="ttc" id="aprecision_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/ios_base/precision.html">std::ostream::precision</a></div><div class="ttdeci">T precision(T... args)</div></div>
|
||||
@@ -342,18 +342,18 @@ template<typename T > </div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >operator to print a vector </p>
|
||||
<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> <span class="keyword">const</span> <span class="keywordtype">int</span> width = 10;</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keyword">const</span> <span class="keywordtype">char</span> separator = <span class="charliteral">' '</span>;</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> </div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> out.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/ios_base/precision.html">precision</a>(4);</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> row = 0; row < v.size(); row++) {</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> out << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">std::right</a> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a>(width) << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setfill.html">std::setfill</a>(separator)</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> << v[row];</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> }</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> </div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordflow">return</span> out;</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 53</span> {</div>
|
||||
<div class="line"><span class="lineno"> 54</span> <span class="keyword">const</span> <span class="keywordtype">int</span> width = 10;</div>
|
||||
<div class="line"><span class="lineno"> 55</span> <span class="keyword">const</span> <span class="keywordtype">char</span> separator = <span class="charliteral">' '</span>;</div>
|
||||
<div class="line"><span class="lineno"> 56</span> </div>
|
||||
<div class="line"><span class="lineno"> 57</span> out.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/ios_base/precision.html">precision</a>(4);</div>
|
||||
<div class="line"><span class="lineno"> 58</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> row = 0; row < v.size(); row++) {</div>
|
||||
<div class="line"><span class="lineno"> 59</span> out << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">std::right</a> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a>(width) << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setfill.html">std::setfill</a>(separator)</div>
|
||||
<div class="line"><span class="lineno"> 60</span> << v[row];</div>
|
||||
<div class="line"><span class="lineno"> 61</span> }</div>
|
||||
<div class="line"><span class="lineno"> 62</span> </div>
|
||||
<div class="line"><span class="lineno"> 63</span> <span class="keywordflow">return</span> out;</div>
|
||||
<div class="line"><span class="lineno"> 64</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -408,64 +408,64 @@ template<typename T > </div>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="fragment"><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/types/size_t.html">std::size_t</a> ROWS = A.size(); <span class="comment">// number of rows of A</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/types/size_t.html">std::size_t</a> COLUMNS = A[0].size(); <span class="comment">// number of columns of A</span></div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/valarray.html">std::valarray<T></a> col_vector(ROWS);</div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/valarray.html">std::valarray<T></a> col_vector2(ROWS);</div>
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/valarray.html">std::valarray<T></a> tmp_vector(ROWS);</div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> </div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < COLUMNS; i++) {</div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <span class="comment">/* for each column => R is a square matrix of NxN */</span></div>
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="keywordtype">int</span> j;</div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> R[0][i] = 0.; <span class="comment">/* make R upper triangular */</span></div>
|
||||
<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="comment">/* get corresponding Q vector */</span></div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span><span class="preprocessor">#ifdef _OPENMP</span></div>
|
||||
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span><span class="comment">// parallelize on threads</span></div>
|
||||
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span><span class="preprocessor">#pragma omp for</span></div>
|
||||
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <span class="keywordflow">for</span> (j = 0; j < ROWS; j++) {</div>
|
||||
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> tmp_vector[j] = A[j][i]; <span class="comment">/* accumulator for uk */</span></div>
|
||||
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> col_vector[j] = A[j][i];</div>
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> }</div>
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <span class="keywordflow">for</span> (j = 0; j < i; j++) {</div>
|
||||
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k = 0; k < ROWS; k++) {</div>
|
||||
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> col_vector2[k] = Q[0][k][j];</div>
|
||||
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> }</div>
|
||||
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> col_vector2 = <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#a6d3c7dce1f142141f509d09f6c0e25dc">vector_proj</a>(col_vector, col_vector2);</div>
|
||||
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> tmp_vector -= col_vector2;</div>
|
||||
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> }</div>
|
||||
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> </div>
|
||||
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../df/d66/vector__cross__product_8cpp.html#a4b2a9757a87c18e1642d72410ecfaba8">mag</a> = <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#ad16da2183db22378435042f26af43d5f">vector_mag</a>(tmp_vector);</div>
|
||||
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> </div>
|
||||
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span><span class="preprocessor">#ifdef _OPENMP</span></div>
|
||||
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span><span class="comment">// parallelize on threads</span></div>
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span><span class="preprocessor">#pragma omp for</span></div>
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> <span class="keywordflow">for</span> (j = 0; j < ROWS; j++) Q[0][j][i] = tmp_vector[j] / mag;</div>
|
||||
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> </div>
|
||||
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> <span class="comment">/* compute upper triangular values of R */</span></div>
|
||||
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span><span class="preprocessor">#ifdef _OPENMP</span></div>
|
||||
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span><span class="comment">// parallelize on threads</span></div>
|
||||
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span><span class="preprocessor">#pragma omp for</span></div>
|
||||
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> kk = 0; kk < ROWS; kk++) {</div>
|
||||
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> col_vector[kk] = Q[0][kk][i];</div>
|
||||
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> }</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><span class="preprocessor">#ifdef _OPENMP</span></div>
|
||||
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span><span class="comment">// parallelize on threads</span></div>
|
||||
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span><span class="preprocessor">#pragma omp for</span></div>
|
||||
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k = i; <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a> < COLUMNS; <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>++) {</div>
|
||||
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> kk = 0; kk < ROWS; kk++) {</div>
|
||||
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> col_vector2[kk] = A[kk][<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>];</div>
|
||||
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> }</div>
|
||||
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> R[0][i][<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>] = (col_vector * col_vector2).<a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a>();</div>
|
||||
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> }</div>
|
||||
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> }</div>
|
||||
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span>}</div>
|
||||
<div class="fragment"><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/types/size_t.html">std::size_t</a> ROWS = A.size(); <span class="comment">// number of rows of A</span></div>
|
||||
<div class="line"><span class="lineno"> 152</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a> COLUMNS = A[0].size(); <span class="comment">// number of columns of A</span></div>
|
||||
<div class="line"><span class="lineno"> 153</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/valarray.html">std::valarray<T></a> col_vector(ROWS);</div>
|
||||
<div class="line"><span class="lineno"> 154</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/valarray.html">std::valarray<T></a> col_vector2(ROWS);</div>
|
||||
<div class="line"><span class="lineno"> 155</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/valarray.html">std::valarray<T></a> tmp_vector(ROWS);</div>
|
||||
<div class="line"><span class="lineno"> 156</span> </div>
|
||||
<div class="line"><span class="lineno"> 157</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < COLUMNS; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 158</span> <span class="comment">/* for each column => R is a square matrix of NxN */</span></div>
|
||||
<div class="line"><span class="lineno"> 159</span> <span class="keywordtype">int</span> j;</div>
|
||||
<div class="line"><span class="lineno"> 160</span> R[0][i] = 0.; <span class="comment">/* make R upper triangular */</span></div>
|
||||
<div class="line"><span class="lineno"> 161</span> </div>
|
||||
<div class="line"><span class="lineno"> 162</span> <span class="comment">/* get corresponding Q vector */</span></div>
|
||||
<div class="line"><span class="lineno"> 163</span><span class="preprocessor">#ifdef _OPENMP</span></div>
|
||||
<div class="line"><span class="lineno"> 164</span><span class="comment">// parallelize on threads</span></div>
|
||||
<div class="line"><span class="lineno"> 165</span><span class="preprocessor">#pragma omp for</span></div>
|
||||
<div class="line"><span class="lineno"> 166</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><span class="lineno"> 167</span> <span class="keywordflow">for</span> (j = 0; j < ROWS; j++) {</div>
|
||||
<div class="line"><span class="lineno"> 168</span> tmp_vector[j] = A[j][i]; <span class="comment">/* accumulator for uk */</span></div>
|
||||
<div class="line"><span class="lineno"> 169</span> col_vector[j] = A[j][i];</div>
|
||||
<div class="line"><span class="lineno"> 170</span> }</div>
|
||||
<div class="line"><span class="lineno"> 171</span> <span class="keywordflow">for</span> (j = 0; j < i; j++) {</div>
|
||||
<div class="line"><span class="lineno"> 172</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k = 0; k < ROWS; k++) {</div>
|
||||
<div class="line"><span class="lineno"> 173</span> col_vector2[k] = Q[0][k][j];</div>
|
||||
<div class="line"><span class="lineno"> 174</span> }</div>
|
||||
<div class="line"><span class="lineno"> 175</span> col_vector2 = <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#a6d3c7dce1f142141f509d09f6c0e25dc">vector_proj</a>(col_vector, col_vector2);</div>
|
||||
<div class="line"><span class="lineno"> 176</span> tmp_vector -= col_vector2;</div>
|
||||
<div class="line"><span class="lineno"> 177</span> }</div>
|
||||
<div class="line"><span class="lineno"> 178</span> </div>
|
||||
<div class="line"><span class="lineno"> 179</span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../df/d66/vector__cross__product_8cpp.html#a4b2a9757a87c18e1642d72410ecfaba8">mag</a> = <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#ad16da2183db22378435042f26af43d5f">vector_mag</a>(tmp_vector);</div>
|
||||
<div class="line"><span class="lineno"> 180</span> </div>
|
||||
<div class="line"><span class="lineno"> 181</span><span class="preprocessor">#ifdef _OPENMP</span></div>
|
||||
<div class="line"><span class="lineno"> 182</span><span class="comment">// parallelize on threads</span></div>
|
||||
<div class="line"><span class="lineno"> 183</span><span class="preprocessor">#pragma omp for</span></div>
|
||||
<div class="line"><span class="lineno"> 184</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><span class="lineno"> 185</span> <span class="keywordflow">for</span> (j = 0; j < ROWS; j++) Q[0][j][i] = tmp_vector[j] / mag;</div>
|
||||
<div class="line"><span class="lineno"> 186</span> </div>
|
||||
<div class="line"><span class="lineno"> 187</span> <span class="comment">/* compute upper triangular values of R */</span></div>
|
||||
<div class="line"><span class="lineno"> 188</span><span class="preprocessor">#ifdef _OPENMP</span></div>
|
||||
<div class="line"><span class="lineno"> 189</span><span class="comment">// parallelize on threads</span></div>
|
||||
<div class="line"><span class="lineno"> 190</span><span class="preprocessor">#pragma omp for</span></div>
|
||||
<div class="line"><span class="lineno"> 191</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><span class="lineno"> 192</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> kk = 0; kk < ROWS; kk++) {</div>
|
||||
<div class="line"><span class="lineno"> 193</span> col_vector[kk] = Q[0][kk][i];</div>
|
||||
<div class="line"><span class="lineno"> 194</span> }</div>
|
||||
<div class="line"><span class="lineno"> 195</span> </div>
|
||||
<div class="line"><span class="lineno"> 196</span><span class="preprocessor">#ifdef _OPENMP</span></div>
|
||||
<div class="line"><span class="lineno"> 197</span><span class="comment">// parallelize on threads</span></div>
|
||||
<div class="line"><span class="lineno"> 198</span><span class="preprocessor">#pragma omp for</span></div>
|
||||
<div class="line"><span class="lineno"> 199</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><span class="lineno"> 200</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k = i; <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a> < COLUMNS; <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>++) {</div>
|
||||
<div class="line"><span class="lineno"> 201</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> kk = 0; kk < ROWS; kk++) {</div>
|
||||
<div class="line"><span class="lineno"> 202</span> col_vector2[kk] = A[kk][<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>];</div>
|
||||
<div class="line"><span class="lineno"> 203</span> }</div>
|
||||
<div class="line"><span class="lineno"> 204</span> R[0][i][<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>] = (col_vector * col_vector2).<a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a>();</div>
|
||||
<div class="line"><span class="lineno"> 205</span> }</div>
|
||||
<div class="line"><span class="lineno"> 206</span> }</div>
|
||||
<div class="line"><span class="lineno"> 207</span>}</div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a1b74d828b33760094906797042b89442"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">numerical_methods::simpson_method::k</a></div><div class="ttdeci">double k(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition:</b> composite_simpson_rule.cpp:117</div></div>
|
||||
<div class="ttc" id="anamespacemachine__learning_html_a6f1c98c016ad34ff3d9f39372161bd35"><div class="ttname"><a href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">machine_learning::sum</a></div><div class="ttdeci">T sum(const std::vector< std::valarray< T > > &A)</div><div class="ttdef"><b>Definition:</b> vector_ops.hpp:232</div></div>
|
||||
<div class="ttc" id="anamespaceqr__algorithm_html_a6d3c7dce1f142141f509d09f6c0e25dc"><div class="ttname"><a href="../../d2/d3b/namespaceqr__algorithm.html#a6d3c7dce1f142141f509d09f6c0e25dc">qr_algorithm::vector_proj</a></div><div class="ttdeci">std::valarray< T > vector_proj(const std::valarray< T > &a, const std::valarray< T > &b)</div><div class="ttdef"><b>Definition:</b> qr_decompose.h:104</div></div>
|
||||
@@ -519,12 +519,12 @@ template<typename T > </div>
|
||||
<p >Compute dot product of two vectors of equal lengths</p>
|
||||
<p >If \(\vec{a}=\left[a_0,a_1,a_2,...,a_L\right]\) and \(\vec{b}=\left[b_0,b_1,b_1,...,b_L\right]\) then \(\vec{a}\cdot\vec{b}=\displaystyle\sum_{i=0}^L a_i\times b_i\)</p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>\(\vec{a}\cdot\vec{b}\) </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> {</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keywordflow">return</span> (a * b).sum();</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="comment">// could also use following</span></div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="comment">// return std::inner_product(std::begin(a), std::end(a), std::begin(b),</span></div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="comment">// 0.f);</span></div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 76</span> {</div>
|
||||
<div class="line"><span class="lineno"> 77</span> <span class="keywordflow">return</span> (a * b).sum();</div>
|
||||
<div class="line"><span class="lineno"> 78</span> <span class="comment">// could also use following</span></div>
|
||||
<div class="line"><span class="lineno"> 79</span> <span class="comment">// return std::inner_product(std::begin(a), std::end(a), std::begin(b),</span></div>
|
||||
<div class="line"><span class="lineno"> 80</span> <span class="comment">// 0.f);</span></div>
|
||||
<div class="line"><span class="lineno"> 81</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -556,10 +556,10 @@ template<typename T > </div>
|
||||
<p >Compute magnitude of vector.</p>
|
||||
<p >If \(\vec{a}=\left[a_0,a_1,a_2,...,a_L\right]\) then \(\left|\vec{a}\right|=\sqrt{\displaystyle\sum_{i=0}^L a_i^2}\)</p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>\(\left|\vec{a}\right|\) </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> {</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keywordtype">double</span> dot = <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#a8ea313a1a1b5f9d0e3e332c29c6446ec">vector_dot</a>(a, a);</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</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>(dot);</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 92</span> {</div>
|
||||
<div class="line"><span class="lineno"> 93</span> <span class="keywordtype">double</span> dot = <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#a8ea313a1a1b5f9d0e3e332c29c6446ec">vector_dot</a>(a, a);</div>
|
||||
<div class="line"><span class="lineno"> 94</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>(dot);</div>
|
||||
<div class="line"><span class="lineno"> 95</span>}</div>
|
||||
<div class="ttc" id="anamespaceqr__algorithm_html_a8ea313a1a1b5f9d0e3e332c29c6446ec"><div class="ttname"><a href="../../d2/d3b/namespaceqr__algorithm.html#a8ea313a1a1b5f9d0e3e332c29c6446ec">qr_algorithm::vector_dot</a></div><div class="ttdeci">double vector_dot(const std::valarray< T > &a, const std::valarray< T > &b)</div><div class="ttdef"><b>Definition:</b> qr_decompose.h:76</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">
|
||||
@@ -603,20 +603,20 @@ template<typename T > </div>
|
||||
</p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>NULL if error, otherwise pointer to output </dd></dl>
|
||||
<p >check for division by zero using machine epsilon</p>
|
||||
<div class="fragment"><div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> {</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keywordtype">double</span> num = <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#a8ea313a1a1b5f9d0e3e332c29c6446ec">vector_dot</a>(a, b);</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keywordtype">double</span> deno = <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#a8ea313a1a1b5f9d0e3e332c29c6446ec">vector_dot</a>(b, b);</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span><span class="comment"> /*! check for division by zero using machine epsilon */</span></div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="keywordflow">if</span> (deno <= <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/numeric_limits.html">std::numeric_limits<double>::epsilon</a>()) {</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cerr</a> << <span class="stringliteral">"["</span> << __func__ << <span class="stringliteral">"] Possible division by zero\n"</span>;</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keywordflow">return</span> a; <span class="comment">// return vector a back</span></div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> }</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> </div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="keywordtype">double</span> scalar = num / deno;</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> </div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keywordflow">return</span> b * scalar;</div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 105</span> {</div>
|
||||
<div class="line"><span class="lineno"> 106</span> <span class="keywordtype">double</span> num = <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#a8ea313a1a1b5f9d0e3e332c29c6446ec">vector_dot</a>(a, b);</div>
|
||||
<div class="line"><span class="lineno"> 107</span> <span class="keywordtype">double</span> deno = <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#a8ea313a1a1b5f9d0e3e332c29c6446ec">vector_dot</a>(b, b);</div>
|
||||
<div class="line"><span class="lineno"> 108</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 109</span><span class="comment"> /*! check for division by zero using machine epsilon */</span></div>
|
||||
<div class="line"><span class="lineno"> 110</span> <span class="keywordflow">if</span> (deno <= <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/numeric_limits.html">std::numeric_limits<double>::epsilon</a>()) {</div>
|
||||
<div class="line"><span class="lineno"> 111</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cerr</a> << <span class="stringliteral">"["</span> << __func__ << <span class="stringliteral">"] Possible division by zero\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 112</span> <span class="keywordflow">return</span> a; <span class="comment">// return vector a back</span></div>
|
||||
<div class="line"><span class="lineno"> 113</span> }</div>
|
||||
<div class="line"><span class="lineno"> 114</span> </div>
|
||||
<div class="line"><span class="lineno"> 115</span> <span class="keywordtype">double</span> scalar = num / deno;</div>
|
||||
<div class="line"><span class="lineno"> 116</span> </div>
|
||||
<div class="line"><span class="lineno"> 117</span> <span class="keywordflow">return</span> b * scalar;</div>
|
||||
<div class="line"><span class="lineno"> 118</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -632,7 +632,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="../../d2/d3b/namespaceqr__algorithm.html">qr_algorithm</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,7 +1,7 @@
|
||||
<map id="qr_algorithm::operator<<" name="qr_algorithm::operator<<">
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,81,169,108"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/ios_base/precision.html#" title=" " alt="" coords="217,5,372,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/left.html#" title=" " alt="" coords="258,56,331,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/setfill.html#" title=" " alt="" coords="255,107,334,133"/>
|
||||
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/setw.html#" title=" " alt="" coords="257,157,333,184"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/ios_base/precision#" title=" " alt="" coords="217,5,372,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/left#" title=" " alt="" coords="258,56,331,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/setfill#" title=" " alt="" coords="255,107,334,133"/>
|
||||
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/setw#" title=" " alt="" coords="257,157,333,184"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
09feedeb8d25f5b0983c29e5437ab707
|
||||
6517dad0b990a30b1b08e33986143891
|
||||
@@ -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/ios_base/precision.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/ios_base/precision#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="159,-114.5 159,-133.5 275,-133.5 275,-114.5 159,-114.5"/>
|
||||
<text text-anchor="middle" x="217" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::ostream::precision</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/io/manip/left.html#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/left#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="189.5,-76.5 189.5,-95.5 244.5,-95.5 244.5,-76.5 189.5,-76.5"/>
|
||||
<text text-anchor="middle" x="217" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::right</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/setfill.html#" xlink:title=" ">
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/setfill#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="187.5,-38.5 187.5,-57.5 246.5,-57.5 246.5,-38.5 187.5,-38.5"/>
|
||||
<text text-anchor="middle" x="217" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::setfill</text>
|
||||
</a>
|
||||
@@ -66,7 +66,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/io/manip/setw.html#" xlink:title=" ">
|
||||
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/setw#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="188.5,-0.5 188.5,-19.5 245.5,-19.5 245.5,-0.5 188.5,-0.5"/>
|
||||
<text text-anchor="middle" x="217" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::setw</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
@@ -5,6 +5,6 @@
|
||||
<area shape="rect" id="node4" href="$d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35" title=" " alt="" coords="427,5,583,32"/>
|
||||
<area shape="rect" id="node5" href="$d2/d3b/namespaceqr__algorithm.html#ad16da2183db22378435042f26af43d5f" title=" " alt="" coords="420,56,589,83"/>
|
||||
<area shape="rect" id="node8" href="$d2/d3b/namespaceqr__algorithm.html#a6d3c7dce1f142141f509d09f6c0e25dc" title=" " alt="" coords="422,107,587,133"/>
|
||||
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sqrt.html#" title=" " alt="" coords="683,56,754,83"/>
|
||||
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sqrt#" title=" " alt="" coords="683,56,754,83"/>
|
||||
<area shape="rect" id="node7" href="$d2/d3b/namespaceqr__algorithm.html#a8ea313a1a1b5f9d0e3e332c29c6446ec" title=" " alt="" coords="637,107,800,133"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
ff1ce491baef77cae98d3923cd25991e
|
||||
ed20b69444fc8bda8413b9f9ceb80b0e
|
||||
@@ -143,7 +143,7 @@ var sectionId = 'dynsection-0';
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html#" xlink:title=" ">
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="508.5,-38.5 508.5,-57.5 561.5,-57.5 561.5,-38.5 508.5,-38.5"/>
|
||||
<text text-anchor="middle" x="535" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::sqrt</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@@ -97,7 +97,7 @@
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html#" xlink:title=" ">
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="508.5,-38.5 508.5,-57.5 561.5,-57.5 561.5,-38.5 508.5,-38.5"/>
|
||||
<text text-anchor="middle" x="535" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::sqrt</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
@@ -3,6 +3,6 @@
|
||||
<area shape="rect" id="node2" href="$d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35" title=" " alt="" coords="247,5,403,32"/>
|
||||
<area shape="rect" id="node3" href="$d2/d3b/namespaceqr__algorithm.html#ad16da2183db22378435042f26af43d5f" title=" " alt="" coords="240,56,409,83"/>
|
||||
<area shape="rect" id="node6" href="$d2/d3b/namespaceqr__algorithm.html#a6d3c7dce1f142141f509d09f6c0e25dc" title=" " alt="" coords="242,107,407,133"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sqrt.html#" title=" " alt="" coords="503,56,574,83"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sqrt#" title=" " alt="" coords="503,56,574,83"/>
|
||||
<area shape="rect" id="node5" href="$d2/d3b/namespaceqr__algorithm.html#a8ea313a1a1b5f9d0e3e332c29c6446ec" title=" " alt="" coords="457,107,620,133"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
282e3bc80ac2f821dcf3616342fe3a0c
|
||||
f49e946ad7698ea8c23ee579b0503933
|
||||
@@ -66,7 +66,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/numeric/math/sqrt.html#" xlink:title=" ">
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="373.5,-38.5 373.5,-57.5 426.5,-57.5 426.5,-38.5 373.5,-38.5"/>
|
||||
<text text-anchor="middle" x="400" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::sqrt</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
@@ -1,5 +1,5 @@
|
||||
<map id="qr_algorithm::vector_mag" name="qr_algorithm::vector_mag">
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,31,175,57"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sqrt.html#" title=" " alt="" coords="269,5,339,32"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sqrt#" title=" " alt="" coords="269,5,339,32"/>
|
||||
<area shape="rect" id="node3" href="$d2/d3b/namespaceqr__algorithm.html#a8ea313a1a1b5f9d0e3e332c29c6446ec" title=" " alt="" coords="223,56,385,83"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
71a157148cef9f6be651d1594398695d
|
||||
4e10f1ef8e8045f9c43006a7b4c913f6
|
||||
@@ -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/numeric/math/sqrt.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="197.5,-38.5 197.5,-57.5 250.5,-57.5 250.5,-38.5 197.5,-38.5"/>
|
||||
<text text-anchor="middle" x="224" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::sqrt</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
@@ -1,8 +1,8 @@
|
||||
<map id="qr_algorithm::operator<<" name="qr_algorithm::operator<<">
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,107,169,133"/>
|
||||
<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="259,5,331,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/ios_base/precision.html#" title=" " alt="" coords="217,56,372,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/left.html#" title=" " alt="" coords="258,107,331,133"/>
|
||||
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/setfill.html#" title=" " alt="" coords="255,157,334,184"/>
|
||||
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/setw.html#" title=" " alt="" coords="257,208,333,235"/>
|
||||
<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="259,5,331,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/ios_base/precision#" title=" " alt="" coords="217,56,372,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/left#" title=" " alt="" coords="258,107,331,133"/>
|
||||
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/setfill#" title=" " alt="" coords="255,157,334,184"/>
|
||||
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/setw#" title=" " alt="" coords="257,208,333,235"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
3b313822c81cbeb41625f2ae7be6d9f5
|
||||
65ae4f8e17ba3f4f898afa1d5b336b32
|
||||
@@ -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="190,-152.5 190,-171.5 244,-171.5 244,-152.5 190,-152.5"/>
|
||||
<text text-anchor="middle" x="217" y="-159.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</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/io/ios_base/precision.html#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/ios_base/precision#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="159,-114.5 159,-133.5 275,-133.5 275,-114.5 159,-114.5"/>
|
||||
<text text-anchor="middle" x="217" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::ostream::precision</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/left.html#" xlink:title=" ">
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/left#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="189.5,-76.5 189.5,-95.5 244.5,-95.5 244.5,-76.5 189.5,-76.5"/>
|
||||
<text text-anchor="middle" x="217" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::right</text>
|
||||
</a>
|
||||
@@ -66,7 +66,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/io/manip/setfill.html#" xlink:title=" ">
|
||||
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/setfill#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="187.5,-38.5 187.5,-57.5 246.5,-57.5 246.5,-38.5 187.5,-38.5"/>
|
||||
<text text-anchor="middle" x="217" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::setfill</text>
|
||||
</a>
|
||||
@@ -81,7 +81,7 @@
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/setw.html#" xlink:title=" ">
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/setw#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="188.5,-0.5 188.5,-19.5 245.5,-19.5 245.5,-0.5 188.5,-0.5"/>
|
||||
<text text-anchor="middle" x="217" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::setw</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.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++: range_queries/segtree.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');
|
||||
@@ -96,7 +96,7 @@ $(document).ready(function(){initNavTree('d2/d45/segtree_8cpp.html','../../'); i
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p>Implementation of <a href="https://en.wikipedia.org/wiki/Segment_tree" target="_blank">Segment Tree</a> data structure.
|
||||
<p>Implementation of [Segment Tree] (<a href="https://en.wikipedia.org/wiki/Segment_tree">https://en.wikipedia.org/wiki/Segment_tree</a>) data structure.
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <cassert></code><br />
|
||||
<code>#include <cmath></code><br />
|
||||
@@ -128,7 +128,7 @@ Functions</h2></td></tr>
|
||||
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p >Implementation of <a href="https://en.wikipedia.org/wiki/Segment_tree" target="_blank">Segment Tree</a> data structure. </p>
|
||||
<div class="textblock"><p >Implementation of [Segment Tree] (<a href="https://en.wikipedia.org/wiki/Segment_tree">https://en.wikipedia.org/wiki/Segment_tree</a>) data structure. </p>
|
||||
<p >A segment tree, also known as a statistic tree, is a tree data structure used for storing information about intervals, or segments. Its classical version allows querying which of the stored segments contain a given point, but our modification allows us to perform (query) any binary operation on any range in the array in O(logN) time. Here, we have used addition (+). For range updates, we have used lazy propagation.</p>
|
||||
<ul>
|
||||
<li>Space Complexity : O(NlogN) <br />
|
||||
@@ -200,17 +200,17 @@ Functions</h2></td></tr>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> {</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keywordflow">if</span> (low == high) {</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> (*segtree)[pos] = arr[low];</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> }</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> </div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> uint64_t mid = (low + high) / 2;</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a>(arr, segtree, low, mid, 2 * pos + 1);</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a>(arr, segtree, mid + 1, high, 2 * pos + 2);</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> (*segtree)[pos] = (*segtree)[2 * pos + 1] + (*segtree)[2 * pos + 2];</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 38</span> {</div>
|
||||
<div class="line"><span class="lineno"> 39</span> <span class="keywordflow">if</span> (low == high) {</div>
|
||||
<div class="line"><span class="lineno"> 40</span> (*segtree)[pos] = arr[low];</div>
|
||||
<div class="line"><span class="lineno"> 41</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 42</span> }</div>
|
||||
<div class="line"><span class="lineno"> 43</span> </div>
|
||||
<div class="line"><span class="lineno"> 44</span> uint64_t mid = (low + high) / 2;</div>
|
||||
<div class="line"><span class="lineno"> 45</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a>(arr, segtree, low, mid, 2 * pos + 1);</div>
|
||||
<div class="line"><span class="lineno"> 46</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a>(arr, segtree, mid + 1, high, 2 * pos + 2);</div>
|
||||
<div class="line"><span class="lineno"> 47</span> (*segtree)[pos] = (*segtree)[2 * pos + 1] + (*segtree)[2 * pos + 2];</div>
|
||||
<div class="line"><span class="lineno"> 48</span>}</div>
|
||||
<div class="ttc" id="asegtree_8cpp_html_ae752659b7c1719d68fdb2ca538a93696"><div class="ttname"><a href="../../d2/d45/segtree_8cpp.html#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a></div><div class="ttdeci">void ConsTree(const std::vector< int64_t > &arr, std::vector< int64_t > *segtree, uint64_t low, uint64_t high, uint64_t pos)</div><div class="ttdoc">for std::vector</div><div class="ttdef"><b>Definition:</b> segtree.cpp:37</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -239,58 +239,58 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Main function. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> {</div>
|
||||
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</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> <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 number of elements: "</span>;</div>
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> </div>
|
||||
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> uint64_t n = 0;</div>
|
||||
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> n;</div>
|
||||
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> </div>
|
||||
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> <span class="keyword">auto</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/max.html">max</a> = <span class="keyword">static_cast<</span>uint64_t<span class="keyword">></span>(2 * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">pow</a>(2, <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/ceil.html">ceil</a>(log2(n))) - 1);</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/container/vector.html">std::vector<int64_t></a> arr(n), lazy(max), segtree(max);</div>
|
||||
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> </div>
|
||||
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> <span class="keywordtype">int</span> choice = 0;</div>
|
||||
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</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">"\nDo you wish to enter each number?:\n"</span></div>
|
||||
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> <span class="stringliteral">"1: Yes\n"</span></div>
|
||||
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> <span class="stringliteral">"0: No (default initialize them to 0)\n"</span>;</div>
|
||||
<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_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> choice;</div>
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <span class="keywordflow">if</span> (choice == 1) {</div>
|
||||
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</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 "</span> << n << <span class="stringliteral">" numbers:\n"</span>;</div>
|
||||
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i <= n; i++) {</div>
|
||||
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << i << <span class="stringliteral">": "</span>;</div>
|
||||
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> arr[i];</div>
|
||||
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> }</div>
|
||||
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> }</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> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a>(arr, &segtree, 0, n - 1, 0);</div>
|
||||
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> </div>
|
||||
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> <span class="keywordflow">do</span> {</div>
|
||||
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</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">"\nMake your choice:\n"</span></div>
|
||||
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <span class="stringliteral">"1: Range update (input)\n"</span></div>
|
||||
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> <span class="stringliteral">"2: Range query (output)\n"</span></div>
|
||||
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> <span class="stringliteral">"0: Exit\n"</span>;</div>
|
||||
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> choice;</div>
|
||||
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> </div>
|
||||
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> <span class="keywordflow">if</span> (choice == 1) {</div>
|
||||
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Enter 1-indexed lower bound, upper bound & value:\n"</span>;</div>
|
||||
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> </div>
|
||||
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> uint64_t p = 1, q = 1, v = 0;</div>
|
||||
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> p >> q >> v;</div>
|
||||
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(&segtree, &lazy, p - 1, q - 1, v, 0, n - 1, 0);</div>
|
||||
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (choice == 2) {</div>
|
||||
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</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 1-indexed lower bound & upper bound:\n"</span>;</div>
|
||||
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> </div>
|
||||
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> uint64_t p = 1, q = 1;</div>
|
||||
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> p >> q;</div>
|
||||
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</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_function" href="../../d2/d45/segtree_8cpp.html#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(&segtree, &lazy, p - 1, q - 1, 0, n - 1, 0);</div>
|
||||
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</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">"\n"</span>;</div>
|
||||
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> }</div>
|
||||
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> } <span class="keywordflow">while</span> (choice > 0);</div>
|
||||
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> </div>
|
||||
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 167</span> {</div>
|
||||
<div class="line"><span class="lineno"> 168</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 169</span> </div>
|
||||
<div class="line"><span class="lineno"> 170</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 number of elements: "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 171</span> </div>
|
||||
<div class="line"><span class="lineno"> 172</span> uint64_t n = 0;</div>
|
||||
<div class="line"><span class="lineno"> 173</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> n;</div>
|
||||
<div class="line"><span class="lineno"> 174</span> </div>
|
||||
<div class="line"><span class="lineno"> 175</span> <span class="keyword">auto</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/max.html">max</a> = <span class="keyword">static_cast<</span>uint64_t<span class="keyword">></span>(2 * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">pow</a>(2, <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/ceil.html">ceil</a>(log2(n))) - 1);</div>
|
||||
<div class="line"><span class="lineno"> 176</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> arr(n), lazy(max), segtree(max);</div>
|
||||
<div class="line"><span class="lineno"> 177</span> </div>
|
||||
<div class="line"><span class="lineno"> 178</span> <span class="keywordtype">int</span> choice = 0;</div>
|
||||
<div class="line"><span class="lineno"> 179</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">"\nDo you wish to enter each number?:\n"</span></div>
|
||||
<div class="line"><span class="lineno"> 180</span> <span class="stringliteral">"1: Yes\n"</span></div>
|
||||
<div class="line"><span class="lineno"> 181</span> <span class="stringliteral">"0: No (default initialize them to 0)\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 182</span> </div>
|
||||
<div class="line"><span class="lineno"> 183</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> choice;</div>
|
||||
<div class="line"><span class="lineno"> 184</span> <span class="keywordflow">if</span> (choice == 1) {</div>
|
||||
<div class="line"><span class="lineno"> 185</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 "</span> << n << <span class="stringliteral">" numbers:\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 186</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i <= n; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 187</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << i << <span class="stringliteral">": "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 188</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> arr[i];</div>
|
||||
<div class="line"><span class="lineno"> 189</span> }</div>
|
||||
<div class="line"><span class="lineno"> 190</span> }</div>
|
||||
<div class="line"><span class="lineno"> 191</span> </div>
|
||||
<div class="line"><span class="lineno"> 192</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a>(arr, &segtree, 0, n - 1, 0);</div>
|
||||
<div class="line"><span class="lineno"> 193</span> </div>
|
||||
<div class="line"><span class="lineno"> 194</span> <span class="keywordflow">do</span> {</div>
|
||||
<div class="line"><span class="lineno"> 195</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">"\nMake your choice:\n"</span></div>
|
||||
<div class="line"><span class="lineno"> 196</span> <span class="stringliteral">"1: Range update (input)\n"</span></div>
|
||||
<div class="line"><span class="lineno"> 197</span> <span class="stringliteral">"2: Range query (output)\n"</span></div>
|
||||
<div class="line"><span class="lineno"> 198</span> <span class="stringliteral">"0: Exit\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 199</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> choice;</div>
|
||||
<div class="line"><span class="lineno"> 200</span> </div>
|
||||
<div class="line"><span class="lineno"> 201</span> <span class="keywordflow">if</span> (choice == 1) {</div>
|
||||
<div class="line"><span class="lineno"> 202</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Enter 1-indexed lower bound, upper bound & value:\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 203</span> </div>
|
||||
<div class="line"><span class="lineno"> 204</span> uint64_t p = 1, q = 1, v = 0;</div>
|
||||
<div class="line"><span class="lineno"> 205</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> p >> q >> v;</div>
|
||||
<div class="line"><span class="lineno"> 206</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(&segtree, &lazy, p - 1, q - 1, v, 0, n - 1, 0);</div>
|
||||
<div class="line"><span class="lineno"> 207</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (choice == 2) {</div>
|
||||
<div class="line"><span class="lineno"> 208</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 1-indexed lower bound & upper bound:\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 209</span> </div>
|
||||
<div class="line"><span class="lineno"> 210</span> uint64_t p = 1, q = 1;</div>
|
||||
<div class="line"><span class="lineno"> 211</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> p >> q;</div>
|
||||
<div class="line"><span class="lineno"> 212</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_function" href="../../d2/d45/segtree_8cpp.html#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(&segtree, &lazy, p - 1, q - 1, 0, n - 1, 0);</div>
|
||||
<div class="line"><span class="lineno"> 213</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">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 214</span> }</div>
|
||||
<div class="line"><span class="lineno"> 215</span> } <span class="keywordflow">while</span> (choice > 0);</div>
|
||||
<div class="line"><span class="lineno"> 216</span> </div>
|
||||
<div class="line"><span class="lineno"> 217</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 218</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="aceil_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/ceil.html">std::ceil</a></div><div class="ttdeci">T ceil(T... args)</div></div>
|
||||
@@ -299,7 +299,7 @@ Here is the call graph for this function:</div>
|
||||
<div class="ttc" id="asegtree_8cpp_html_a423a97ea0c7ea6e33b5844a6858d902d"><div class="ttname"><a href="../../d2/d45/segtree_8cpp.html#a423a97ea0c7ea6e33b5844a6858d902d">query</a></div><div class="ttdeci">int64_t query(std::vector< int64_t > *segtree, std::vector< int64_t > *lazy, uint64_t qlow, uint64_t qhigh, uint64_t low, uint64_t high, uint64_t pos)</div><div class="ttdoc">Returns the sum of all elements in a range.</div><div class="ttdef"><b>Definition:</b> segtree.cpp:62</div></div>
|
||||
<div class="ttc" id="asegtree_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d2/d45/segtree_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementation.</div><div class="ttdef"><b>Definition:</b> segtree.cpp:146</div></div>
|
||||
<div class="ttc" id="asegtree_8cpp_html_abd3e818681fb2e29cf08f4f60f82c8e0"><div class="ttname"><a href="../../d2/d45/segtree_8cpp.html#abd3e818681fb2e29cf08f4f60f82c8e0">update</a></div><div class="ttdeci">void update(std::vector< int64_t > *segtree, std::vector< int64_t > *lazy, int64_t start, int64_t end, int64_t delta, uint64_t low, uint64_t high, uint64_t pos)</div><div class="ttdoc">Updates a range of the segment tree.</div><div class="ttdef"><b>Definition:</b> segtree.cpp:102</div></div>
|
||||
<div class="ttc" id="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< int64_t ></a></div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -379,30 +379,30 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>result of the range query for this function call </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> {</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">if</span> (low > high || qlow > high || low > qhigh) {</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordflow">return</span> 0;</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> </div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keywordflow">if</span> ((*lazy)[pos] != 0) {</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> (*segtree)[pos] += (*lazy)[pos] * (high - low + 1);</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> </div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordflow">if</span> (low != high) {</div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> (*lazy)[2 * pos + 1] += (*lazy)[pos];</div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> (*lazy)[2 * pos + 2] += (*lazy)[pos];</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> (*lazy)[pos] = 0;</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> }</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> </div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordflow">if</span> (qlow <= low && qhigh >= high) {</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keywordflow">return</span> (*segtree)[pos];</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</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> uint64_t mid = (low + high) / 2;</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> </div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(segtree, lazy, qlow, qhigh, low, mid, 2 * pos + 1) +</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(segtree, lazy, qlow, qhigh, mid + 1, high, 2 * pos + 2);</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 64</span> {</div>
|
||||
<div class="line"><span class="lineno"> 65</span> <span class="keywordflow">if</span> (low > high || qlow > high || low > qhigh) {</div>
|
||||
<div class="line"><span class="lineno"> 66</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 67</span> }</div>
|
||||
<div class="line"><span class="lineno"> 68</span> </div>
|
||||
<div class="line"><span class="lineno"> 69</span> <span class="keywordflow">if</span> ((*lazy)[pos] != 0) {</div>
|
||||
<div class="line"><span class="lineno"> 70</span> (*segtree)[pos] += (*lazy)[pos] * (high - low + 1);</div>
|
||||
<div class="line"><span class="lineno"> 71</span> </div>
|
||||
<div class="line"><span class="lineno"> 72</span> <span class="keywordflow">if</span> (low != high) {</div>
|
||||
<div class="line"><span class="lineno"> 73</span> (*lazy)[2 * pos + 1] += (*lazy)[pos];</div>
|
||||
<div class="line"><span class="lineno"> 74</span> (*lazy)[2 * pos + 2] += (*lazy)[pos];</div>
|
||||
<div class="line"><span class="lineno"> 75</span> }</div>
|
||||
<div class="line"><span class="lineno"> 76</span> (*lazy)[pos] = 0;</div>
|
||||
<div class="line"><span class="lineno"> 77</span> }</div>
|
||||
<div class="line"><span class="lineno"> 78</span> </div>
|
||||
<div class="line"><span class="lineno"> 79</span> <span class="keywordflow">if</span> (qlow <= low && qhigh >= high) {</div>
|
||||
<div class="line"><span class="lineno"> 80</span> <span class="keywordflow">return</span> (*segtree)[pos];</div>
|
||||
<div class="line"><span class="lineno"> 81</span> }</div>
|
||||
<div class="line"><span class="lineno"> 82</span> </div>
|
||||
<div class="line"><span class="lineno"> 83</span> uint64_t mid = (low + high) / 2;</div>
|
||||
<div class="line"><span class="lineno"> 84</span> </div>
|
||||
<div class="line"><span class="lineno"> 85</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(segtree, lazy, qlow, qhigh, low, mid, 2 * pos + 1) +</div>
|
||||
<div class="line"><span class="lineno"> 86</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(segtree, lazy, qlow, qhigh, mid + 1, high, 2 * pos + 2);</div>
|
||||
<div class="line"><span class="lineno"> 87</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -437,21 +437,21 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Self-test implementation. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> {</div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keyword">auto</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/max.html">max</a> = <span class="keyword">static_cast<</span>int64_t<span class="keyword">></span>(2 * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">pow</a>(2, <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/ceil.html">ceil</a>(log2(7))) - 1);</div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> assert(max == 15);</div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> </div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> arr{1, 2, 3, 4, 5, 6, 7}, lazy(max), segtree(max);</div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a>(arr, &segtree, 0, 7 - 1, 0);</div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> </div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> assert(<a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(&segtree, &lazy, 1, 5, 0, 7 - 1, 0) == 2 + 3 + 4 + 5 + 6);</div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> </div>
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(&segtree, &lazy, 2, 4, 1, 0, 7 - 1, 0);</div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> assert(<a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(&segtree, &lazy, 1, 5, 0, 7 - 1, 0) == 2 + 4 + 5 + 6 + 6);</div>
|
||||
<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> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(&segtree, &lazy, 0, 6, -2, 0, 7 - 1, 0);</div>
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> assert(<a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(&segtree, &lazy, 0, 4, 0, 7 - 1, 0) == -1 + 0 + 2 + 3 + 4);</div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 146</span> {</div>
|
||||
<div class="line"><span class="lineno"> 147</span> <span class="keyword">auto</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/max.html">max</a> = <span class="keyword">static_cast<</span>int64_t<span class="keyword">></span>(2 * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">pow</a>(2, <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/ceil.html">ceil</a>(log2(7))) - 1);</div>
|
||||
<div class="line"><span class="lineno"> 148</span> assert(max == 15);</div>
|
||||
<div class="line"><span class="lineno"> 149</span> </div>
|
||||
<div class="line"><span class="lineno"> 150</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> arr{1, 2, 3, 4, 5, 6, 7}, lazy(max), segtree(max);</div>
|
||||
<div class="line"><span class="lineno"> 151</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a>(arr, &segtree, 0, 7 - 1, 0);</div>
|
||||
<div class="line"><span class="lineno"> 152</span> </div>
|
||||
<div class="line"><span class="lineno"> 153</span> assert(<a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(&segtree, &lazy, 1, 5, 0, 7 - 1, 0) == 2 + 3 + 4 + 5 + 6);</div>
|
||||
<div class="line"><span class="lineno"> 154</span> </div>
|
||||
<div class="line"><span class="lineno"> 155</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(&segtree, &lazy, 2, 4, 1, 0, 7 - 1, 0);</div>
|
||||
<div class="line"><span class="lineno"> 156</span> assert(<a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(&segtree, &lazy, 1, 5, 0, 7 - 1, 0) == 2 + 4 + 5 + 6 + 6);</div>
|
||||
<div class="line"><span class="lineno"> 157</span> </div>
|
||||
<div class="line"><span class="lineno"> 158</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(&segtree, &lazy, 0, 6, -2, 0, 7 - 1, 0);</div>
|
||||
<div class="line"><span class="lineno"> 159</span> assert(<a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(&segtree, &lazy, 0, 4, 0, 7 - 1, 0) == -1 + 0 + 2 + 3 + 4);</div>
|
||||
<div class="line"><span class="lineno"> 160</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -538,42 +538,42 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> {</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="keywordflow">if</span> (low > high) {</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> }</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> </div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keywordflow">if</span> ((*lazy)[pos] != 0) {</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> (*segtree)[pos] += (*lazy)[pos] * (high - low + 1);</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> </div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keywordflow">if</span> (low != high) {</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> (*lazy)[2 * pos + 1] += (*lazy)[pos];</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> (*lazy)[2 * pos + 2] += (*lazy)[pos];</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> }</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> (*lazy)[pos] = 0;</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> }</div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> </div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordflow">if</span> (start > high || end < low) {</div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> }</div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> </div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keywordflow">if</span> (start <= low && end >= high) {</div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> (*segtree)[pos] += delta * (high - low + 1);</div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> </div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keywordflow">if</span> (low != high) {</div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> (*lazy)[2 * pos + 1] += delta;</div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> (*lazy)[2 * pos + 2] += delta;</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> }</div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> </div>
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> }</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> uint64_t mid = (low + high) / 2;</div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> </div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(segtree, lazy, start, end, delta, low, mid, 2 * pos + 1);</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(segtree, lazy, start, end, delta, mid + 1, high, 2 * pos + 2);</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> (*segtree)[pos] = (*segtree)[2 * pos + 1] + (*segtree)[2 * pos + 2];</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 104</span> {</div>
|
||||
<div class="line"><span class="lineno"> 105</span> <span class="keywordflow">if</span> (low > high) {</div>
|
||||
<div class="line"><span class="lineno"> 106</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 107</span> }</div>
|
||||
<div class="line"><span class="lineno"> 108</span> </div>
|
||||
<div class="line"><span class="lineno"> 109</span> <span class="keywordflow">if</span> ((*lazy)[pos] != 0) {</div>
|
||||
<div class="line"><span class="lineno"> 110</span> (*segtree)[pos] += (*lazy)[pos] * (high - low + 1);</div>
|
||||
<div class="line"><span class="lineno"> 111</span> </div>
|
||||
<div class="line"><span class="lineno"> 112</span> <span class="keywordflow">if</span> (low != high) {</div>
|
||||
<div class="line"><span class="lineno"> 113</span> (*lazy)[2 * pos + 1] += (*lazy)[pos];</div>
|
||||
<div class="line"><span class="lineno"> 114</span> (*lazy)[2 * pos + 2] += (*lazy)[pos];</div>
|
||||
<div class="line"><span class="lineno"> 115</span> }</div>
|
||||
<div class="line"><span class="lineno"> 116</span> (*lazy)[pos] = 0;</div>
|
||||
<div class="line"><span class="lineno"> 117</span> }</div>
|
||||
<div class="line"><span class="lineno"> 118</span> </div>
|
||||
<div class="line"><span class="lineno"> 119</span> <span class="keywordflow">if</span> (start > high || end < low) {</div>
|
||||
<div class="line"><span class="lineno"> 120</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 121</span> }</div>
|
||||
<div class="line"><span class="lineno"> 122</span> </div>
|
||||
<div class="line"><span class="lineno"> 123</span> <span class="keywordflow">if</span> (start <= low && end >= high) {</div>
|
||||
<div class="line"><span class="lineno"> 124</span> (*segtree)[pos] += delta * (high - low + 1);</div>
|
||||
<div class="line"><span class="lineno"> 125</span> </div>
|
||||
<div class="line"><span class="lineno"> 126</span> <span class="keywordflow">if</span> (low != high) {</div>
|
||||
<div class="line"><span class="lineno"> 127</span> (*lazy)[2 * pos + 1] += delta;</div>
|
||||
<div class="line"><span class="lineno"> 128</span> (*lazy)[2 * pos + 2] += delta;</div>
|
||||
<div class="line"><span class="lineno"> 129</span> }</div>
|
||||
<div class="line"><span class="lineno"> 130</span> </div>
|
||||
<div class="line"><span class="lineno"> 131</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 132</span> }</div>
|
||||
<div class="line"><span class="lineno"> 133</span> </div>
|
||||
<div class="line"><span class="lineno"> 134</span> uint64_t mid = (low + high) / 2;</div>
|
||||
<div class="line"><span class="lineno"> 135</span> </div>
|
||||
<div class="line"><span class="lineno"> 136</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(segtree, lazy, start, end, delta, low, mid, 2 * pos + 1);</div>
|
||||
<div class="line"><span class="lineno"> 137</span> <a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(segtree, lazy, start, end, delta, mid + 1, high, 2 * pos + 2);</div>
|
||||
<div class="line"><span class="lineno"> 138</span> (*segtree)[pos] = (*segtree)[2 * pos + 1] + (*segtree)[2 * pos + 2];</div>
|
||||
<div class="line"><span class="lineno"> 139</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -589,7 +589,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_074119ce3a874b57120c49a0cc4bb5ad.html">range_queries</a></li><li class="navelem"><a class="el" href="../../d2/d45/segtree_8cpp.html">segtree.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>
|
||||
|
||||
@@ -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++: sorting/heap_sort.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');
|
||||
@@ -146,10 +146,10 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Main function </p>
|
||||
<div class="fragment"><div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> {</div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <a class="code hl_function" href="../../d2/d52/heap__sort_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>();</div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 120</span> {</div>
|
||||
<div class="line"><span class="lineno"> 121</span> <a class="code hl_function" href="../../d2/d52/heap__sort_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>();</div>
|
||||
<div class="line"><span class="lineno"> 122</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 123</span>}</div>
|
||||
<div class="ttc" id="aheap__sort_8cpp_html_ae1a3968e7947464bee7714f6d43b7002"><div class="ttname"><a href="../../d2/d52/heap__sort_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a></div><div class="ttdeci">void test()</div><div class="ttdef"><b>Definition:</b> heap_sort.cpp:99</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -195,10 +195,10 @@ template<typename T > </div>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="fragment"><div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> {</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < sz; i++) <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << arr[i] << <span class="stringliteral">" "</span>;</div>
|
||||
<div class="line"><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">"\n"</span>;</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 37</span> {</div>
|
||||
<div class="line"><span class="lineno"> 38</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < sz; i++) <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << arr[i] << <span class="stringliteral">" "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 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">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 40</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><!-- fragment -->
|
||||
</div>
|
||||
@@ -218,25 +218,25 @@ template<typename T > </div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Test cases to test the program </p>
|
||||
<div class="fragment"><div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> {</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 1\n"</span>;</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keywordtype">int</span> arr[] = {-10, 78, -1, -6, 7, 4, 94, 5, 99, 0};</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordtype">int</span> sz = <span class="keyword">sizeof</span>(arr) / <span class="keyword">sizeof</span>(arr[0]); <span class="comment">// sz - size of array</span></div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <a class="code hl_function" href="../../d2/d52/heap__sort_8cpp.html#a9ed3e1510afdf3edd06cf2b68769a767">printArray</a>(arr, sz); <span class="comment">// displaying the array before sorting</span></div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <a class="code hl_function" href="../../d5/d4c/group__sorting.html#ga29d28b140174dbdde7c9f5157758435f">heapSort</a>(arr, sz); <span class="comment">// calling heapsort to sort the array</span></div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <a class="code hl_function" href="../../d2/d52/heap__sort_8cpp.html#a9ed3e1510afdf3edd06cf2b68769a767">printArray</a>(arr, sz); <span class="comment">// display array after sorting</span></div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> assert(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/is_sorted.html">std::is_sorted</a>(arr, arr + sz));</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 1 Passed\n========================\n"</span>;</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> </div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 2\n"</span>;</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="keywordtype">double</span> arr2[] = {4.5, -3.6, 7.6, 0, 12.9};</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> sz = <span class="keyword">sizeof</span>(arr2) / <span class="keyword">sizeof</span>(arr2[0]);</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <a class="code hl_function" href="../../d2/d52/heap__sort_8cpp.html#a9ed3e1510afdf3edd06cf2b68769a767">printArray</a>(arr2, sz);</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <a class="code hl_function" href="../../d5/d4c/group__sorting.html#ga29d28b140174dbdde7c9f5157758435f">heapSort</a>(arr2, sz);</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <a class="code hl_function" href="../../d2/d52/heap__sort_8cpp.html#a9ed3e1510afdf3edd06cf2b68769a767">printArray</a>(arr2, sz);</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> assert(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/is_sorted.html">std::is_sorted</a>(arr2, arr2 + sz));</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 2 passed\n"</span>;</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 99</span> {</div>
|
||||
<div class="line"><span class="lineno"> 100</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 1\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 101</span> <span class="keywordtype">int</span> arr[] = {-10, 78, -1, -6, 7, 4, 94, 5, 99, 0};</div>
|
||||
<div class="line"><span class="lineno"> 102</span> <span class="keywordtype">int</span> sz = <span class="keyword">sizeof</span>(arr) / <span class="keyword">sizeof</span>(arr[0]); <span class="comment">// sz - size of array</span></div>
|
||||
<div class="line"><span class="lineno"> 103</span> <a class="code hl_function" href="../../d2/d52/heap__sort_8cpp.html#a9ed3e1510afdf3edd06cf2b68769a767">printArray</a>(arr, sz); <span class="comment">// displaying the array before sorting</span></div>
|
||||
<div class="line"><span class="lineno"> 104</span> <a class="code hl_function" href="../../d5/d4c/group__sorting.html#ga29d28b140174dbdde7c9f5157758435f">heapSort</a>(arr, sz); <span class="comment">// calling heapsort to sort the array</span></div>
|
||||
<div class="line"><span class="lineno"> 105</span> <a class="code hl_function" href="../../d2/d52/heap__sort_8cpp.html#a9ed3e1510afdf3edd06cf2b68769a767">printArray</a>(arr, sz); <span class="comment">// display array after sorting</span></div>
|
||||
<div class="line"><span class="lineno"> 106</span> assert(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/is_sorted.html">std::is_sorted</a>(arr, arr + sz));</div>
|
||||
<div class="line"><span class="lineno"> 107</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 1 Passed\n========================\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 108</span> </div>
|
||||
<div class="line"><span class="lineno"> 109</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 2\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 110</span> <span class="keywordtype">double</span> arr2[] = {4.5, -3.6, 7.6, 0, 12.9};</div>
|
||||
<div class="line"><span class="lineno"> 111</span> sz = <span class="keyword">sizeof</span>(arr2) / <span class="keyword">sizeof</span>(arr2[0]);</div>
|
||||
<div class="line"><span class="lineno"> 112</span> <a class="code hl_function" href="../../d2/d52/heap__sort_8cpp.html#a9ed3e1510afdf3edd06cf2b68769a767">printArray</a>(arr2, sz);</div>
|
||||
<div class="line"><span class="lineno"> 113</span> <a class="code hl_function" href="../../d5/d4c/group__sorting.html#ga29d28b140174dbdde7c9f5157758435f">heapSort</a>(arr2, sz);</div>
|
||||
<div class="line"><span class="lineno"> 114</span> <a class="code hl_function" href="../../d2/d52/heap__sort_8cpp.html#a9ed3e1510afdf3edd06cf2b68769a767">printArray</a>(arr2, sz);</div>
|
||||
<div class="line"><span class="lineno"> 115</span> assert(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/is_sorted.html">std::is_sorted</a>(arr2, arr2 + sz));</div>
|
||||
<div class="line"><span class="lineno"> 116</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 2 passed\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 117</span>}</div>
|
||||
<div class="ttc" id="agroup__sorting_html_ga29d28b140174dbdde7c9f5157758435f"><div class="ttname"><a href="../../d5/d4c/group__sorting.html#ga29d28b140174dbdde7c9f5157758435f">heapSort</a></div><div class="ttdeci">void heapSort(T *arr, int n)</div><div class="ttdef"><b>Definition:</b> heap_sort.cpp:84</div></div>
|
||||
<div class="ttc" id="aheap__sort_8cpp_html_a9ed3e1510afdf3edd06cf2b68769a767"><div class="ttname"><a href="../../d2/d52/heap__sort_8cpp.html#a9ed3e1510afdf3edd06cf2b68769a767">printArray</a></div><div class="ttdeci">void printArray(T *arr, int sz)</div><div class="ttdef"><b>Definition:</b> heap_sort.cpp:37</div></div>
|
||||
<div class="ttc" id="ais_sorted_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/is_sorted.html">std::is_sorted</a></div><div class="ttdeci">T is_sorted(T... args)</div></div>
|
||||
@@ -255,7 +255,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_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><a class="el" href="../../d2/d52/heap__sort_8cpp.html">heap_sort.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=" " alt="" coords="5,56,49,83"/>
|
||||
<area shape="rect" id="node2" href="$d5/d4c/group__sorting.html#ga29d28b140174dbdde7c9f5157758435f" title=" " alt="" coords="111,5,185,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/is_sorted.html#" title=" " alt="" coords="97,56,199,83"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/is_sorted#" title=" " alt="" coords="97,56,199,83"/>
|
||||
<area shape="rect" id="node4" href="$d2/d52/heap__sort_8cpp.html#a9ed3e1510afdf3edd06cf2b68769a767" title=" " alt="" coords="109,107,187,133"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
7548e809a1872a8d311884595d70e2ba
|
||||
7653b5d46888cff45ddc92dcd776f67b
|
||||
@@ -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/algorithm/is_sorted.html#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/is_sorted#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="69,-38.5 69,-57.5 145,-57.5 145,-38.5 69,-38.5"/>
|
||||
<text text-anchor="middle" x="107" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::is_sorted</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
@@ -2,6 +2,6 @@
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,56,56,83"/>
|
||||
<area shape="rect" id="node2" href="$d2/d52/heap__sort_8cpp.html#ae1a3968e7947464bee7714f6d43b7002" title=" " alt="" coords="104,56,148,83"/>
|
||||
<area shape="rect" id="node3" href="$d5/d4c/group__sorting.html#ga29d28b140174dbdde7c9f5157758435f" title=" " alt="" coords="209,5,284,32"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/is_sorted.html#" title=" " alt="" coords="196,56,297,83"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/is_sorted#" title=" " alt="" coords="196,56,297,83"/>
|
||||
<area shape="rect" id="node5" href="$d2/d52/heap__sort_8cpp.html#a9ed3e1510afdf3edd06cf2b68769a767" title=" " alt="" coords="207,107,286,133"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
62db4212ad321d0840a87118c4ee38f5
|
||||
9761fdcfeeccd5d58b56bd4385d42ca2
|
||||
@@ -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/algorithm/is_sorted.html#" xlink:title=" ">
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/is_sorted#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="143,-38.5 143,-57.5 219,-57.5 219,-38.5 143,-38.5"/>
|
||||
<text text-anchor="middle" x="181" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::is_sorted</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 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++: machine_learning/neural_network.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');
|
||||
@@ -98,7 +98,7 @@ $(document).ready(function(){initNavTree('d2/d58/neural__network_8cpp.html','../
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p>Implementation of <a href="https://en.wikipedia.org/wiki/Multilayer_perceptron" target="_blank">Multilayer Perceptron</a>.
|
||||
<p>Implementation of [Multilayer Perceptron] (<a href="https://en.wikipedia.org/wiki/Multilayer_perceptron">https://en.wikipedia.org/wiki/Multilayer_perceptron</a>).
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <algorithm></code><br />
|
||||
<code>#include <cassert></code><br />
|
||||
@@ -168,7 +168,7 @@ Functions</h2></td></tr>
|
||||
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p >Implementation of <a href="https://en.wikipedia.org/wiki/Multilayer_perceptron" target="_blank">Multilayer Perceptron</a>. </p>
|
||||
<div class="textblock"><p >Implementation of [Multilayer Perceptron] (<a href="https://en.wikipedia.org/wiki/Multilayer_perceptron">https://en.wikipedia.org/wiki/Multilayer_perceptron</a>). </p>
|
||||
<dl class="section author"><dt>Author</dt><dd><a href="https://github.com/imdeep2905" target="_blank">Deep Raval</a></dd></dl>
|
||||
<p>A multilayer perceptron (MLP) is a class of feedforward artificial neural network (ANN). The term MLP is used ambiguously, sometimes loosely to any feedforward ANN, sometimes strictly to refer to networks composed of multiple layers of perceptrons (with threshold activation). Multilayer perceptrons are sometimes colloquially referred to as "vanilla" neural networks, especially when they have a single hidden layer.</p>
|
||||
<p >An MLP consists of at least three layers of nodes: an input layer, a hidden layer and an output layer. Except for the input nodes, each node is a neuron that uses a nonlinear activation function. MLP utilizes a supervised learning technique called backpropagation for training. Its multiple layers and non-linear activation distinguish MLP from a linear perceptron. It can distinguish data that is not linearly separable.</p>
|
||||
@@ -197,7 +197,7 @@ Functions</h2></td></tr>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>derivative of relu(x) </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span>{ <span class="keywordflow">return</span> x >= 0.0 ? 1.0 : 0.0; }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 81</span>{ <span class="keywordflow">return</span> x >= 0.0 ? 1.0 : 0.0; }</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -229,7 +229,7 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>Returns derivative of sigmoid(x) </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span>{ <span class="keywordflow">return</span> x * (1 - x); }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 67</span>{ <span class="keywordflow">return</span> x * (1 - x); }</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -261,7 +261,7 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>Returns derivative of tanh(x) </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span>{ <span class="keywordflow">return</span> 1 - x * x; }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 95</span>{ <span class="keywordflow">return</span> 1 - x * x; }</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -293,7 +293,7 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>Returns x </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span>{ <span class="keywordflow">return</span> x; }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 112</span>{ <span class="keywordflow">return</span> x; }</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -321,11 +321,11 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Main function. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00833" name="l00833"></a><span class="lineno"> 833</span> {</div>
|
||||
<div class="line"><a id="l00834" name="l00834"></a><span class="lineno"> 834</span> <span class="comment">// Testing</span></div>
|
||||
<div class="line"><a id="l00835" name="l00835"></a><span class="lineno"> 835</span> <a class="code hl_function" href="../../d2/d58/neural__network_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>();</div>
|
||||
<div class="line"><a id="l00836" name="l00836"></a><span class="lineno"> 836</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00837" name="l00837"></a><span class="lineno"> 837</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 833</span> {</div>
|
||||
<div class="line"><span class="lineno"> 834</span> <span class="comment">// Testing</span></div>
|
||||
<div class="line"><span class="lineno"> 835</span> <a class="code hl_function" href="../../d2/d58/neural__network_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>();</div>
|
||||
<div class="line"><span class="lineno"> 836</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 837</span>}</div>
|
||||
<div class="ttc" id="aneural__network_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d2/d58/neural__network_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdef"><b>Definition:</b> neural_network.cpp:805</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -358,7 +358,7 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>relu(x) </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span>{ <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/max.html">std::max</a>(0.0, x); }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 74</span>{ <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/max.html">std::max</a>(0.0, x); }</div>
|
||||
<div class="ttc" id="amax_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/max.html">std::max</a></div><div class="ttdeci">T max(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -391,7 +391,7 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>Returns sigmoid(x) </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span>{ <span class="keywordflow">return</span> 1.0 / (1.0 + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/exp.html">std::exp</a>(-x)); }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 60</span>{ <span class="keywordflow">return</span> 1.0 / (1.0 + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/exp.html">std::exp</a>(-x)); }</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><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -424,7 +424,7 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>Returns x * x </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span>{ <span class="keywordflow">return</span> x * x; }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 106</span>{ <span class="keywordflow">return</span> x * x; }</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -456,7 +456,7 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>Returns tanh(x) </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span>{ <span class="keywordflow">return</span> 2 / (1 + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/exp.html">std::exp</a>(-2 * x)) - 1; }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 88</span>{ <span class="keywordflow">return</span> 2 / (1 + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/exp.html">std::exp</a>(-2 * x)) - 1; }</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -489,29 +489,29 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Function to test neural network </p><dl class="section return"><dt>Returns</dt><dd>none </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00805" name="l00805"></a><span class="lineno"> 805</span> {</div>
|
||||
<div class="line"><a id="l00806" name="l00806"></a><span class="lineno"> 806</span> <span class="comment">// Creating network with 3 layers for "iris.csv"</span></div>
|
||||
<div class="line"><a id="l00807" name="l00807"></a><span class="lineno"> 807</span> <a class="code hl_class" href="../../d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html">machine_learning::neural_network::NeuralNetwork</a> myNN =</div>
|
||||
<div class="line"><a id="l00808" name="l00808"></a><span class="lineno"> 808</span> <a class="code hl_class" href="../../d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html">machine_learning::neural_network::NeuralNetwork</a>({</div>
|
||||
<div class="line"><a id="l00809" name="l00809"></a><span class="lineno"> 809</span> {4, <span class="stringliteral">"none"</span>}, <span class="comment">// First layer with 3 neurons and "none" as activation</span></div>
|
||||
<div class="line"><a id="l00810" name="l00810"></a><span class="lineno"> 810</span> {6,</div>
|
||||
<div class="line"><a id="l00811" name="l00811"></a><span class="lineno"> 811</span> <span class="stringliteral">"relu"</span>}, <span class="comment">// Second layer with 6 neurons and "relu" as activation</span></div>
|
||||
<div class="line"><a id="l00812" name="l00812"></a><span class="lineno"> 812</span> {3, <span class="stringliteral">"sigmoid"</span>} <span class="comment">// Third layer with 3 neurons and "sigmoid" as</span></div>
|
||||
<div class="line"><a id="l00813" name="l00813"></a><span class="lineno"> 813</span> <span class="comment">// activation</span></div>
|
||||
<div class="line"><a id="l00814" name="l00814"></a><span class="lineno"> 814</span> });</div>
|
||||
<div class="line"><a id="l00815" name="l00815"></a><span class="lineno"> 815</span> <span class="comment">// Printing summary of model</span></div>
|
||||
<div class="line"><a id="l00816" name="l00816"></a><span class="lineno"> 816</span> myNN.<a class="code hl_function" href="../../d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a61d30113d13304c664057118b92a5931">summary</a>();</div>
|
||||
<div class="line"><a id="l00817" name="l00817"></a><span class="lineno"> 817</span> <span class="comment">// Training Model</span></div>
|
||||
<div class="line"><a id="l00818" name="l00818"></a><span class="lineno"> 818</span> myNN.<a class="code hl_function" href="../../d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a5172a6791b9bd24f4232bab8d6b81fff">fit_from_csv</a>(<span class="stringliteral">"iris.csv"</span>, <span class="keyword">true</span>, 100, 0.3, <span class="keyword">false</span>, 2, 32, <span class="keyword">true</span>);</div>
|
||||
<div class="line"><a id="l00819" name="l00819"></a><span class="lineno"> 819</span> <span class="comment">// Testing predictions of model</span></div>
|
||||
<div class="line"><a id="l00820" name="l00820"></a><span class="lineno"> 820</span> assert(<a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a50480fccfb39de20ca47f1bf51ecb6ec">machine_learning::argmax</a>(</div>
|
||||
<div class="line"><a id="l00821" name="l00821"></a><span class="lineno"> 821</span> myNN.<a class="code hl_function" href="../../d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a3b9eac1824d365dce715fb17c33cb96f">single_predict</a>({{5, 3.4, 1.6, 0.4}})) == 0);</div>
|
||||
<div class="line"><a id="l00822" name="l00822"></a><span class="lineno"> 822</span> assert(<a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a50480fccfb39de20ca47f1bf51ecb6ec">machine_learning::argmax</a>(</div>
|
||||
<div class="line"><a id="l00823" name="l00823"></a><span class="lineno"> 823</span> myNN.<a class="code hl_function" href="../../d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a3b9eac1824d365dce715fb17c33cb96f">single_predict</a>({{6.4, 2.9, 4.3, 1.3}})) == 1);</div>
|
||||
<div class="line"><a id="l00824" name="l00824"></a><span class="lineno"> 824</span> assert(<a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a50480fccfb39de20ca47f1bf51ecb6ec">machine_learning::argmax</a>(</div>
|
||||
<div class="line"><a id="l00825" name="l00825"></a><span class="lineno"> 825</span> myNN.<a class="code hl_function" href="../../d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a3b9eac1824d365dce715fb17c33cb96f">single_predict</a>({{6.2, 3.4, 5.4, 2.3}})) == 2);</div>
|
||||
<div class="line"><a id="l00826" name="l00826"></a><span class="lineno"> 826</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><a id="l00827" name="l00827"></a><span class="lineno"> 827</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 805</span> {</div>
|
||||
<div class="line"><span class="lineno"> 806</span> <span class="comment">// Creating network with 3 layers for "iris.csv"</span></div>
|
||||
<div class="line"><span class="lineno"> 807</span> <a class="code hl_class" href="../../d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html">machine_learning::neural_network::NeuralNetwork</a> myNN =</div>
|
||||
<div class="line"><span class="lineno"> 808</span> <a class="code hl_class" href="../../d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html">machine_learning::neural_network::NeuralNetwork</a>({</div>
|
||||
<div class="line"><span class="lineno"> 809</span> {4, <span class="stringliteral">"none"</span>}, <span class="comment">// First layer with 3 neurons and "none" as activation</span></div>
|
||||
<div class="line"><span class="lineno"> 810</span> {6,</div>
|
||||
<div class="line"><span class="lineno"> 811</span> <span class="stringliteral">"relu"</span>}, <span class="comment">// Second layer with 6 neurons and "relu" as activation</span></div>
|
||||
<div class="line"><span class="lineno"> 812</span> {3, <span class="stringliteral">"sigmoid"</span>} <span class="comment">// Third layer with 3 neurons and "sigmoid" as</span></div>
|
||||
<div class="line"><span class="lineno"> 813</span> <span class="comment">// activation</span></div>
|
||||
<div class="line"><span class="lineno"> 814</span> });</div>
|
||||
<div class="line"><span class="lineno"> 815</span> <span class="comment">// Printing summary of model</span></div>
|
||||
<div class="line"><span class="lineno"> 816</span> myNN.<a class="code hl_function" href="../../d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a61d30113d13304c664057118b92a5931">summary</a>();</div>
|
||||
<div class="line"><span class="lineno"> 817</span> <span class="comment">// Training Model</span></div>
|
||||
<div class="line"><span class="lineno"> 818</span> myNN.<a class="code hl_function" href="../../d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a5172a6791b9bd24f4232bab8d6b81fff">fit_from_csv</a>(<span class="stringliteral">"iris.csv"</span>, <span class="keyword">true</span>, 100, 0.3, <span class="keyword">false</span>, 2, 32, <span class="keyword">true</span>);</div>
|
||||
<div class="line"><span class="lineno"> 819</span> <span class="comment">// Testing predictions of model</span></div>
|
||||
<div class="line"><span class="lineno"> 820</span> assert(<a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a50480fccfb39de20ca47f1bf51ecb6ec">machine_learning::argmax</a>(</div>
|
||||
<div class="line"><span class="lineno"> 821</span> myNN.<a class="code hl_function" href="../../d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a3b9eac1824d365dce715fb17c33cb96f">single_predict</a>({{5, 3.4, 1.6, 0.4}})) == 0);</div>
|
||||
<div class="line"><span class="lineno"> 822</span> assert(<a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a50480fccfb39de20ca47f1bf51ecb6ec">machine_learning::argmax</a>(</div>
|
||||
<div class="line"><span class="lineno"> 823</span> myNN.<a class="code hl_function" href="../../d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a3b9eac1824d365dce715fb17c33cb96f">single_predict</a>({{6.4, 2.9, 4.3, 1.3}})) == 1);</div>
|
||||
<div class="line"><span class="lineno"> 824</span> assert(<a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a50480fccfb39de20ca47f1bf51ecb6ec">machine_learning::argmax</a>(</div>
|
||||
<div class="line"><span class="lineno"> 825</span> myNN.<a class="code hl_function" href="../../d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a3b9eac1824d365dce715fb17c33cb96f">single_predict</a>({{6.2, 3.4, 5.4, 2.3}})) == 2);</div>
|
||||
<div class="line"><span class="lineno"> 826</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 827</span>}</div>
|
||||
<div class="ttc" id="aclassmachine__learning_1_1neural__network_1_1_neural_network_html"><div class="ttname"><a href="../../d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html">machine_learning::neural_network::NeuralNetwork</a></div><div class="ttdef"><b>Definition:</b> neural_network.cpp:247</div></div>
|
||||
<div class="ttc" id="aclassmachine__learning_1_1neural__network_1_1_neural_network_html_a3b9eac1824d365dce715fb17c33cb96f"><div class="ttname"><a href="../../d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a3b9eac1824d365dce715fb17c33cb96f">machine_learning::neural_network::NeuralNetwork::single_predict</a></div><div class="ttdeci">std::vector< std::valarray< double > > single_predict(const std::vector< std::valarray< double > > &X)</div><div class="ttdef"><b>Definition:</b> neural_network.cpp:451</div></div>
|
||||
<div class="ttc" id="aclassmachine__learning_1_1neural__network_1_1_neural_network_html_a5172a6791b9bd24f4232bab8d6b81fff"><div class="ttname"><a href="../../d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a5172a6791b9bd24f4232bab8d6b81fff">machine_learning::neural_network::NeuralNetwork::fit_from_csv</a></div><div class="ttdeci">void fit_from_csv(const std::string &file_name, const bool &last_label, const int &epochs, const double &learning_rate, const bool &normalize, const int &slip_lines=1, const size_t &batch_size=32, const bool &shuffle=true)</div><div class="ttdef"><b>Definition:</b> neural_network.cpp:587</div></div>
|
||||
@@ -532,7 +532,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_3343723ae086de42ee4ca9774da3a13f.html">machine_learning</a></li><li class="navelem"><a class="el" href="../../d2/d58/neural__network_8cpp.html">neural_network.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="machine_learning::neural_network::activations::sigmoid" name="machine_learning::neural_network::activations::sigmoid">
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,29,172,85"/>
|
||||
<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="220,44,289,71"/>
|
||||
<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="220,44,289,71"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
51f3e30d6fed122d19cdfd54a3395090
|
||||
1fcd38f2b4136a5445aba4ca7b0105b9
|
||||
@@ -29,7 +29,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="161,-11.5 161,-30.5 213,-30.5 213,-11.5 161,-11.5"/>
|
||||
<text text-anchor="middle" x="187" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::exp</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -1,4 +1,4 @@
|
||||
<map id="machine_learning::neural_network::activations::tanh" name="machine_learning::neural_network::activations::tanh">
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,5,184,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/exp.html#" title=" " alt="" coords="232,13,301,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/exp#" title=" " alt="" coords="232,13,301,39"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
289be41de7435d154edc337a83f10ddb
|
||||
9ba65e2bf7cbfe994597b708e890b3fd
|
||||
@@ -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="170,-6 170,-25 222,-25 222,-6 170,-6"/>
|
||||
<text text-anchor="middle" x="196" y="-13" font-family="Helvetica,sans-Serif" font-size="10.00">std::exp</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -4,13 +4,13 @@
|
||||
<area shape="rect" id="node10" href="$d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a5172a6791b9bd24f4232bab8d6b81fff" title=" " alt="" coords="97,637,268,693"/>
|
||||
<area shape="rect" id="node45" href="$d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a3b9eac1824d365dce715fb17c33cb96f" title=" " alt="" coords="325,233,496,289"/>
|
||||
<area shape="rect" id="node46" href="$d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a61d30113d13304c664057118b92a5931" title=" " alt="" coords="803,183,974,239"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/begin.html#" title=" " alt="" coords="1069,56,1147,83"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/distance.html#" title=" " alt="" coords="1059,107,1157,133"/>
|
||||
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/end.html#" title=" " alt="" coords="1073,157,1143,184"/>
|
||||
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="1072,489,1144,516"/>
|
||||
<area shape="rect" id="node7" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/utility/program/exit.html#" title=" " alt="" coords="1073,767,1143,793"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/begin#" title=" " alt="" coords="1069,56,1147,83"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/distance#" title=" " alt="" coords="1059,107,1157,133"/>
|
||||
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/end#" title=" " alt="" coords="1073,157,1143,184"/>
|
||||
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="1072,489,1144,516"/>
|
||||
<area shape="rect" id="node7" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/utility/program/exit#" title=" " alt="" coords="1073,767,1143,793"/>
|
||||
<area shape="rect" id="node8" href="$d8/d77/namespacemachine__learning.html#aa4bbf61e65f8cd297255fa94b983d078" title=" " alt="" coords="1033,423,1183,465"/>
|
||||
<area shape="rect" id="node9" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/max_element.html#" title=" " alt="" coords="1045,5,1171,32"/>
|
||||
<area shape="rect" id="node9" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/max_element#" title=" " alt="" coords="1045,5,1171,32"/>
|
||||
<area shape="rect" id="node11" href="$d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a2be1b52bb9f57486f9a436f35c9089c0" title=" " alt="" coords="316,615,505,657"/>
|
||||
<area shape="rect" id="node26" href="$d5/d91/namespacesorting.html#a7bfe11bd4703eacd1dab93f25ec639c5" title=" " alt="" coords="596,796,704,823"/>
|
||||
<area shape="rect" id="node31" href="$d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a650c677fd6512665741ddd9b7983275d" title=" " alt="" coords="565,1413,735,1469"/>
|
||||
@@ -19,30 +19,30 @@
|
||||
<area shape="rect" id="node15" href="$d8/d77/namespacemachine__learning.html#a5342906d42b80fc6b6b3ad17bf00fcb9" title=" " alt="" coords="801,481,977,508"/>
|
||||
<area shape="rect" id="node17" href="$d8/d77/namespacemachine__learning.html#af801bf30591ca6b2c38ff4fed0ded23f" title=" " alt="" coords="569,709,731,750"/>
|
||||
<area shape="rect" id="node22" href="$d8/d77/namespacemachine__learning.html#acafa3e62b686aebdbad81c4f89913f43" title=" " alt="" coords="795,533,983,574"/>
|
||||
<area shape="rect" id="node23" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/min.html#" title=" " alt="" coords="1073,1184,1143,1211"/>
|
||||
<area shape="rect" id="node24" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/chrono/high_resolution_clock/now.html#" title=" " alt="" coords="559,970,741,1011"/>
|
||||
<area shape="rect" id="node25" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/resize.html#" title=" " alt="" coords="587,1036,713,1063"/>
|
||||
<area shape="rect" id="node27" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size.html#" title=" " alt="" coords="1050,1235,1166,1261"/>
|
||||
<area shape="rect" id="node23" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/min#" title=" " alt="" coords="1073,1184,1143,1211"/>
|
||||
<area shape="rect" id="node24" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/chrono/high_resolution_clock/now#" title=" " alt="" coords="559,970,741,1011"/>
|
||||
<area shape="rect" id="node25" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/resize#" title=" " alt="" coords="587,1036,713,1063"/>
|
||||
<area shape="rect" id="node27" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size#" title=" " alt="" coords="1050,1235,1166,1261"/>
|
||||
<area shape="rect" id="node28" href="$d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35" title=" " alt="" coords="572,328,728,355"/>
|
||||
<area shape="rect" id="node29" href="$d8/d77/namespacemachine__learning.html#a89fde571b38f9483576594f66572958a" title=" " alt="" coords="795,431,983,457"/>
|
||||
<area shape="rect" id="node30" href="$d8/d77/namespacemachine__learning.html#ac1bdaa2a724b4ce6a6bb371a5dbe2e7e" title=" " alt="" coords="565,379,735,421"/>
|
||||
<area shape="rect" id="node14" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/emplace_back.html#" title=" " alt="" coords="801,263,977,289"/>
|
||||
<area shape="rect" id="node16" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/push_back.html#" title=" " alt="" coords="1031,540,1185,567"/>
|
||||
<area shape="rect" id="node18" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/chrono/system_clock/now.html#" title=" " alt="" coords="819,650,958,691"/>
|
||||
<area shape="rect" id="node19" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/random/rand.html#" title=" " alt="" coords="852,868,925,895"/>
|
||||
<area shape="rect" id="node20" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/random/srand.html#" title=" " alt="" coords="849,716,929,743"/>
|
||||
<area shape="rect" id="node21" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap.html#" title=" " alt="" coords="849,817,928,844"/>
|
||||
<area shape="rect" id="node32" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/back.html#" title=" " alt="" coords="829,1727,949,1753"/>
|
||||
<area shape="rect" id="node33" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/c_str.html#" title=" " alt="" coords="830,1777,947,1804"/>
|
||||
<area shape="rect" id="node34" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/basic_ifstream/close.html#" title=" " alt="" coords="821,1828,956,1855"/>
|
||||
<area shape="rect" id="node35" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/basic_ios/eof.html#" title=" " alt="" coords="828,1289,949,1316"/>
|
||||
<area shape="rect" id="node36" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/getline.html#" title=" " alt="" coords="845,1340,932,1367"/>
|
||||
<area shape="rect" id="node14" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/emplace_back#" title=" " alt="" coords="801,263,977,289"/>
|
||||
<area shape="rect" id="node16" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/push_back#" title=" " alt="" coords="1031,540,1185,567"/>
|
||||
<area shape="rect" id="node18" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/chrono/system_clock/now#" title=" " alt="" coords="819,650,958,691"/>
|
||||
<area shape="rect" id="node19" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/random/rand#" title=" " alt="" coords="852,868,925,895"/>
|
||||
<area shape="rect" id="node20" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/random/srand#" title=" " alt="" coords="849,716,929,743"/>
|
||||
<area shape="rect" id="node21" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap#" title=" " alt="" coords="849,817,928,844"/>
|
||||
<area shape="rect" id="node32" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/back#" title=" " alt="" coords="829,1727,949,1753"/>
|
||||
<area shape="rect" id="node33" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/c_str#" title=" " alt="" coords="830,1777,947,1804"/>
|
||||
<area shape="rect" id="node34" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/basic_ifstream/close#" title=" " alt="" coords="821,1828,956,1855"/>
|
||||
<area shape="rect" id="node35" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/basic_ios/eof#" title=" " alt="" coords="828,1289,949,1316"/>
|
||||
<area shape="rect" id="node36" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/getline#" title=" " alt="" coords="845,1340,932,1367"/>
|
||||
<area shape="rect" id="node37" href="$d8/d77/namespacemachine__learning.html#a496302e3371aa7b478cb7d5917904bdd" title=" " alt="" coords="807,1391,970,1433"/>
|
||||
<area shape="rect" id="node38" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/basic_ifstream/is_open.html#" title=" " alt="" coords="815,1457,963,1484"/>
|
||||
<area shape="rect" id="node38" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/basic_ifstream/is_open#" title=" " alt="" coords="815,1457,963,1484"/>
|
||||
<area shape="rect" id="node39" href="$d8/d77/namespacemachine__learning.html#ac332d152078e96311e43ac5e7183ea26" title=" " alt="" coords="800,1122,977,1163"/>
|
||||
<area shape="rect" id="node41" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/basic_ifstream/open.html#" title=" " alt="" coords="823,1508,954,1535"/>
|
||||
<area shape="rect" id="node41" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/basic_ifstream/open#" title=" " alt="" coords="823,1508,954,1535"/>
|
||||
<area shape="rect" id="node42" href="$d8/d77/namespacemachine__learning.html#ae10178b082f0205c326550877d998e5d" title=" " alt="" coords="795,1559,982,1585"/>
|
||||
<area shape="rect" id="node43" href="$d8/d77/namespacemachine__learning.html#a912cf68863063a38d6e63545be5eb093" title=" " alt="" coords="813,1610,965,1651"/>
|
||||
<area shape="rect" id="node44" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/stof.html#" title=" " alt="" coords="852,1676,925,1703"/>
|
||||
<area shape="rect" id="node40" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/max.html#" title=" " alt="" coords="1071,1129,1145,1156"/>
|
||||
<area shape="rect" id="node44" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/stof#" title=" " alt="" coords="852,1676,925,1703"/>
|
||||
<area shape="rect" id="node40" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/max#" title=" " alt="" coords="1071,1129,1145,1156"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
ef804c4531cdcd77cdd696ab6dbd49a6
|
||||
bd2456962961ff4a726c2cb1ed2d00da
|
||||
@@ -133,7 +133,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/begin.html#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/begin#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="797.5,-1329.5 797.5,-1348.5 856.5,-1348.5 856.5,-1329.5 797.5,-1329.5"/>
|
||||
<text text-anchor="middle" x="827" y="-1336.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::begin</text>
|
||||
</a>
|
||||
@@ -148,7 +148,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/distance.html#" xlink:title=" ">
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/distance#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="790.5,-1291.5 790.5,-1310.5 863.5,-1310.5 863.5,-1291.5 790.5,-1291.5"/>
|
||||
<text text-anchor="middle" x="827" y="-1298.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::distance</text>
|
||||
</a>
|
||||
@@ -163,7 +163,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/end.html#" xlink:title=" ">
|
||||
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/end#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="801,-1253.5 801,-1272.5 853,-1272.5 853,-1253.5 801,-1253.5"/>
|
||||
<text text-anchor="middle" x="827" y="-1260.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::end</text>
|
||||
</a>
|
||||
@@ -178,7 +178,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="800,-1004.5 800,-1023.5 854,-1023.5 854,-1004.5 800,-1004.5"/>
|
||||
<text text-anchor="middle" x="827" y="-1011.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
@@ -193,7 +193,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/utility/program/exit.html#" xlink:title=" ">
|
||||
<g id="a_node7"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/utility/program/exit#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="801,-796.5 801,-815.5 853,-815.5 853,-796.5 801,-796.5"/>
|
||||
<text text-anchor="middle" x="827" y="-803.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::exit</text>
|
||||
</a>
|
||||
@@ -224,7 +224,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- 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/max_element.html#" xlink:title=" ">
|
||||
<g id="a_node9"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/max_element#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="779.5,-1367.5 779.5,-1386.5 874.5,-1386.5 874.5,-1367.5 779.5,-1367.5"/>
|
||||
<text text-anchor="middle" x="827" y="-1374.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::max_element</text>
|
||||
</a>
|
||||
@@ -391,7 +391,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node23 -->
|
||||
<g id="node23" class="node">
|
||||
<title>Node23</title>
|
||||
<g id="a_node23"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/min.html#" xlink:title=" ">
|
||||
<g id="a_node23"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/min#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="801,-483.5 801,-502.5 853,-502.5 853,-483.5 801,-483.5"/>
|
||||
<text text-anchor="middle" x="827" y="-490.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::min</text>
|
||||
</a>
|
||||
@@ -406,7 +406,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node24 -->
|
||||
<g id="node24" class="node">
|
||||
<title>Node24</title>
|
||||
<g id="a_node24"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/chrono/high_resolution_clock/now.html#" xlink:title=" ">
|
||||
<g id="a_node24"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/chrono/high_resolution_clock/now#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="415,-633 415,-663 552,-663 552,-633 415,-633"/>
|
||||
<text text-anchor="start" x="423" y="-651" font-family="Helvetica,sans-Serif" font-size="10.00">std::chrono::high_resolution</text>
|
||||
<text text-anchor="middle" x="483.5" y="-640" font-family="Helvetica,sans-Serif" font-size="10.00">_clock::now</text>
|
||||
@@ -422,7 +422,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node25 -->
|
||||
<g id="node25" class="node">
|
||||
<title>Node25</title>
|
||||
<g id="a_node25"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/resize.html#" xlink:title=" ">
|
||||
<g id="a_node25"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/resize#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="436,-594.5 436,-613.5 531,-613.5 531,-594.5 436,-594.5"/>
|
||||
<text text-anchor="middle" x="483.5" y="-601.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::resize</text>
|
||||
</a>
|
||||
@@ -443,7 +443,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node27 -->
|
||||
<g id="node27" class="node">
|
||||
<title>Node27</title>
|
||||
<g id="a_node27"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size.html#" xlink:title=" ">
|
||||
<g id="a_node27"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="783.5,-445.5 783.5,-464.5 870.5,-464.5 870.5,-445.5 783.5,-445.5"/>
|
||||
<text text-anchor="middle" x="827" y="-452.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
|
||||
</a>
|
||||
@@ -510,7 +510,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node14 -->
|
||||
<g id="node14" class="node">
|
||||
<title>Node14</title>
|
||||
<g id="a_node14"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/emplace_back.html#" xlink:title=" ">
|
||||
<g id="a_node14"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/emplace_back#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="596.5,-1174.5 596.5,-1193.5 728.5,-1193.5 728.5,-1174.5 596.5,-1174.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-1181.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::emplace_back</text>
|
||||
</a>
|
||||
@@ -549,7 +549,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node16 -->
|
||||
<g id="node16" class="node">
|
||||
<title>Node16</title>
|
||||
<g id="a_node16"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back.html#" xlink:title=" ">
|
||||
<g id="a_node16"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="769,-966.5 769,-985.5 885,-985.5 885,-966.5 769,-966.5"/>
|
||||
<text text-anchor="middle" x="827" y="-973.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::push_back</text>
|
||||
</a>
|
||||
@@ -576,7 +576,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node18 -->
|
||||
<g id="node18" class="node">
|
||||
<title>Node18</title>
|
||||
<g id="a_node18"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/chrono/system_clock/now.html#" xlink:title=" ">
|
||||
<g id="a_node18"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/chrono/system_clock/now#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="610.5,-873 610.5,-903 714.5,-903 714.5,-873 610.5,-873"/>
|
||||
<text text-anchor="start" x="618.5" y="-891" font-family="Helvetica,sans-Serif" font-size="10.00">std::chrono::system</text>
|
||||
<text text-anchor="middle" x="662.5" y="-880" font-family="Helvetica,sans-Serif" font-size="10.00">_clock::now</text>
|
||||
@@ -592,7 +592,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node19 -->
|
||||
<g id="node19" class="node">
|
||||
<title>Node19</title>
|
||||
<g id="a_node19"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/rand.html#" xlink:title=" ">
|
||||
<g id="a_node19"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/rand#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="635,-720.5 635,-739.5 690,-739.5 690,-720.5 635,-720.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-727.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::rand</text>
|
||||
</a>
|
||||
@@ -607,7 +607,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node20 -->
|
||||
<g id="node20" class="node">
|
||||
<title>Node20</title>
|
||||
<g id="a_node20"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/srand.html#" xlink:title=" ">
|
||||
<g id="a_node20"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/srand#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="632.5,-834.5 632.5,-853.5 692.5,-853.5 692.5,-834.5 632.5,-834.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-841.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::srand</text>
|
||||
</a>
|
||||
@@ -622,7 +622,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node21 -->
|
||||
<g id="node21" class="node">
|
||||
<title>Node21</title>
|
||||
<g id="a_node21"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
|
||||
<g id="a_node21"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="633,-758.5 633,-777.5 692,-777.5 692,-758.5 633,-758.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-765.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
|
||||
</a>
|
||||
@@ -703,7 +703,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node32 -->
|
||||
<g id="node32" class="node">
|
||||
<title>Node32</title>
|
||||
<g id="a_node32"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/back.html#" xlink:title=" ">
|
||||
<g id="a_node32"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/back#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="617.5,-76.5 617.5,-95.5 707.5,-95.5 707.5,-76.5 617.5,-76.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::back</text>
|
||||
</a>
|
||||
@@ -718,7 +718,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node33 -->
|
||||
<g id="node33" class="node">
|
||||
<title>Node33</title>
|
||||
<g id="a_node33"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/c_str.html#" xlink:title=" ">
|
||||
<g id="a_node33"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/c_str#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="618.5,-38.5 618.5,-57.5 706.5,-57.5 706.5,-38.5 618.5,-38.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::string::c_str</text>
|
||||
</a>
|
||||
@@ -733,7 +733,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node34 -->
|
||||
<g id="node34" class="node">
|
||||
<title>Node34</title>
|
||||
<g id="a_node34"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/close.html#" xlink:title=" ">
|
||||
<g id="a_node34"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/close#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="612,-0.5 612,-19.5 713,-19.5 713,-0.5 612,-0.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::ifstream::close</text>
|
||||
</a>
|
||||
@@ -748,7 +748,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node35 -->
|
||||
<g id="node35" class="node">
|
||||
<title>Node35</title>
|
||||
<g id="a_node35"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ios/eof.html#" xlink:title=" ">
|
||||
<g id="a_node35"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ios/eof#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="617,-404.5 617,-423.5 708,-423.5 708,-404.5 617,-404.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-411.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::ifstream::eof</text>
|
||||
</a>
|
||||
@@ -763,7 +763,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node36 -->
|
||||
<g id="node36" class="node">
|
||||
<title>Node36</title>
|
||||
<g id="a_node36"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/getline.html#" xlink:title=" ">
|
||||
<g id="a_node36"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/getline#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="630,-366.5 630,-385.5 695,-385.5 695,-366.5 630,-366.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-373.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::getline</text>
|
||||
</a>
|
||||
@@ -794,7 +794,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node38 -->
|
||||
<g id="node38" class="node">
|
||||
<title>Node38</title>
|
||||
<g id="a_node38"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/is_open.html#" xlink:title=" ">
|
||||
<g id="a_node38"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/is_open#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="607,-278.5 607,-297.5 718,-297.5 718,-278.5 607,-278.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-285.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::ifstream::is_open</text>
|
||||
</a>
|
||||
@@ -825,7 +825,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node41 -->
|
||||
<g id="node41" class="node">
|
||||
<title>Node41</title>
|
||||
<g id="a_node41"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/open.html#" xlink:title=" ">
|
||||
<g id="a_node41"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/open#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="613.5,-240.5 613.5,-259.5 711.5,-259.5 711.5,-240.5 613.5,-240.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-247.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::ifstream::open</text>
|
||||
</a>
|
||||
@@ -871,7 +871,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node44 -->
|
||||
<g id="node44" class="node">
|
||||
<title>Node44</title>
|
||||
<g id="a_node44"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/stof.html#" xlink:title=" ">
|
||||
<g id="a_node44"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/stof#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="635,-114.5 635,-133.5 690,-133.5 690,-114.5 635,-114.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::stod</text>
|
||||
</a>
|
||||
@@ -916,7 +916,7 @@ var sectionId = 'dynsection-10';
|
||||
<!-- Node40 -->
|
||||
<g id="node40" class="node">
|
||||
<title>Node40</title>
|
||||
<g id="a_node40"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/max.html#" xlink:title=" ">
|
||||
<g id="a_node40"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/max#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="799.5,-524.5 799.5,-543.5 854.5,-543.5 854.5,-524.5 799.5,-524.5"/>
|
||||
<text text-anchor="middle" x="827" y="-531.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::max</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
@@ -87,7 +87,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/iterator/begin.html#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/begin#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="797.5,-1329.5 797.5,-1348.5 856.5,-1348.5 856.5,-1329.5 797.5,-1329.5"/>
|
||||
<text text-anchor="middle" x="827" y="-1336.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::begin</text>
|
||||
</a>
|
||||
@@ -102,7 +102,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/iterator/distance.html#" xlink:title=" ">
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/distance#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="790.5,-1291.5 790.5,-1310.5 863.5,-1310.5 863.5,-1291.5 790.5,-1291.5"/>
|
||||
<text text-anchor="middle" x="827" y="-1298.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::distance</text>
|
||||
</a>
|
||||
@@ -117,7 +117,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/iterator/end.html#" xlink:title=" ">
|
||||
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/end#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="801,-1253.5 801,-1272.5 853,-1272.5 853,-1253.5 801,-1253.5"/>
|
||||
<text text-anchor="middle" x="827" y="-1260.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::end</text>
|
||||
</a>
|
||||
@@ -132,7 +132,7 @@
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="800,-1004.5 800,-1023.5 854,-1023.5 854,-1004.5 800,-1004.5"/>
|
||||
<text text-anchor="middle" x="827" y="-1011.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
@@ -147,7 +147,7 @@
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/utility/program/exit.html#" xlink:title=" ">
|
||||
<g id="a_node7"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/utility/program/exit#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="801,-796.5 801,-815.5 853,-815.5 853,-796.5 801,-796.5"/>
|
||||
<text text-anchor="middle" x="827" y="-803.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::exit</text>
|
||||
</a>
|
||||
@@ -178,7 +178,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/max_element.html#" xlink:title=" ">
|
||||
<g id="a_node9"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/max_element#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="779.5,-1367.5 779.5,-1386.5 874.5,-1386.5 874.5,-1367.5 779.5,-1367.5"/>
|
||||
<text text-anchor="middle" x="827" y="-1374.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::max_element</text>
|
||||
</a>
|
||||
@@ -345,7 +345,7 @@
|
||||
<!-- Node23 -->
|
||||
<g id="node23" class="node">
|
||||
<title>Node23</title>
|
||||
<g id="a_node23"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/min.html#" xlink:title=" ">
|
||||
<g id="a_node23"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/min#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="801,-483.5 801,-502.5 853,-502.5 853,-483.5 801,-483.5"/>
|
||||
<text text-anchor="middle" x="827" y="-490.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::min</text>
|
||||
</a>
|
||||
@@ -360,7 +360,7 @@
|
||||
<!-- Node24 -->
|
||||
<g id="node24" class="node">
|
||||
<title>Node24</title>
|
||||
<g id="a_node24"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/chrono/high_resolution_clock/now.html#" xlink:title=" ">
|
||||
<g id="a_node24"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/chrono/high_resolution_clock/now#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="415,-633 415,-663 552,-663 552,-633 415,-633"/>
|
||||
<text text-anchor="start" x="423" y="-651" font-family="Helvetica,sans-Serif" font-size="10.00">std::chrono::high_resolution</text>
|
||||
<text text-anchor="middle" x="483.5" y="-640" font-family="Helvetica,sans-Serif" font-size="10.00">_clock::now</text>
|
||||
@@ -376,7 +376,7 @@
|
||||
<!-- Node25 -->
|
||||
<g id="node25" class="node">
|
||||
<title>Node25</title>
|
||||
<g id="a_node25"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/resize.html#" xlink:title=" ">
|
||||
<g id="a_node25"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/resize#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="436,-594.5 436,-613.5 531,-613.5 531,-594.5 436,-594.5"/>
|
||||
<text text-anchor="middle" x="483.5" y="-601.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::resize</text>
|
||||
</a>
|
||||
@@ -397,7 +397,7 @@
|
||||
<!-- Node27 -->
|
||||
<g id="node27" class="node">
|
||||
<title>Node27</title>
|
||||
<g id="a_node27"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size.html#" xlink:title=" ">
|
||||
<g id="a_node27"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="783.5,-445.5 783.5,-464.5 870.5,-464.5 870.5,-445.5 783.5,-445.5"/>
|
||||
<text text-anchor="middle" x="827" y="-452.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
|
||||
</a>
|
||||
@@ -464,7 +464,7 @@
|
||||
<!-- Node14 -->
|
||||
<g id="node14" class="node">
|
||||
<title>Node14</title>
|
||||
<g id="a_node14"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/emplace_back.html#" xlink:title=" ">
|
||||
<g id="a_node14"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/emplace_back#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="596.5,-1174.5 596.5,-1193.5 728.5,-1193.5 728.5,-1174.5 596.5,-1174.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-1181.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::emplace_back</text>
|
||||
</a>
|
||||
@@ -503,7 +503,7 @@
|
||||
<!-- Node16 -->
|
||||
<g id="node16" class="node">
|
||||
<title>Node16</title>
|
||||
<g id="a_node16"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back.html#" xlink:title=" ">
|
||||
<g id="a_node16"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="769,-966.5 769,-985.5 885,-985.5 885,-966.5 769,-966.5"/>
|
||||
<text text-anchor="middle" x="827" y="-973.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::push_back</text>
|
||||
</a>
|
||||
@@ -530,7 +530,7 @@
|
||||
<!-- Node18 -->
|
||||
<g id="node18" class="node">
|
||||
<title>Node18</title>
|
||||
<g id="a_node18"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/chrono/system_clock/now.html#" xlink:title=" ">
|
||||
<g id="a_node18"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/chrono/system_clock/now#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="610.5,-873 610.5,-903 714.5,-903 714.5,-873 610.5,-873"/>
|
||||
<text text-anchor="start" x="618.5" y="-891" font-family="Helvetica,sans-Serif" font-size="10.00">std::chrono::system</text>
|
||||
<text text-anchor="middle" x="662.5" y="-880" font-family="Helvetica,sans-Serif" font-size="10.00">_clock::now</text>
|
||||
@@ -546,7 +546,7 @@
|
||||
<!-- Node19 -->
|
||||
<g id="node19" class="node">
|
||||
<title>Node19</title>
|
||||
<g id="a_node19"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/rand.html#" xlink:title=" ">
|
||||
<g id="a_node19"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/rand#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="635,-720.5 635,-739.5 690,-739.5 690,-720.5 635,-720.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-727.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::rand</text>
|
||||
</a>
|
||||
@@ -561,7 +561,7 @@
|
||||
<!-- Node20 -->
|
||||
<g id="node20" class="node">
|
||||
<title>Node20</title>
|
||||
<g id="a_node20"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/srand.html#" xlink:title=" ">
|
||||
<g id="a_node20"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/srand#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="632.5,-834.5 632.5,-853.5 692.5,-853.5 692.5,-834.5 632.5,-834.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-841.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::srand</text>
|
||||
</a>
|
||||
@@ -576,7 +576,7 @@
|
||||
<!-- Node21 -->
|
||||
<g id="node21" class="node">
|
||||
<title>Node21</title>
|
||||
<g id="a_node21"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
|
||||
<g id="a_node21"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="633,-758.5 633,-777.5 692,-777.5 692,-758.5 633,-758.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-765.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
|
||||
</a>
|
||||
@@ -657,7 +657,7 @@
|
||||
<!-- Node32 -->
|
||||
<g id="node32" class="node">
|
||||
<title>Node32</title>
|
||||
<g id="a_node32"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/back.html#" xlink:title=" ">
|
||||
<g id="a_node32"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/back#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="617.5,-76.5 617.5,-95.5 707.5,-95.5 707.5,-76.5 617.5,-76.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::back</text>
|
||||
</a>
|
||||
@@ -672,7 +672,7 @@
|
||||
<!-- Node33 -->
|
||||
<g id="node33" class="node">
|
||||
<title>Node33</title>
|
||||
<g id="a_node33"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/c_str.html#" xlink:title=" ">
|
||||
<g id="a_node33"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/c_str#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="618.5,-38.5 618.5,-57.5 706.5,-57.5 706.5,-38.5 618.5,-38.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::string::c_str</text>
|
||||
</a>
|
||||
@@ -687,7 +687,7 @@
|
||||
<!-- Node34 -->
|
||||
<g id="node34" class="node">
|
||||
<title>Node34</title>
|
||||
<g id="a_node34"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/close.html#" xlink:title=" ">
|
||||
<g id="a_node34"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/close#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="612,-0.5 612,-19.5 713,-19.5 713,-0.5 612,-0.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::ifstream::close</text>
|
||||
</a>
|
||||
@@ -702,7 +702,7 @@
|
||||
<!-- Node35 -->
|
||||
<g id="node35" class="node">
|
||||
<title>Node35</title>
|
||||
<g id="a_node35"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ios/eof.html#" xlink:title=" ">
|
||||
<g id="a_node35"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ios/eof#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="617,-404.5 617,-423.5 708,-423.5 708,-404.5 617,-404.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-411.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::ifstream::eof</text>
|
||||
</a>
|
||||
@@ -717,7 +717,7 @@
|
||||
<!-- Node36 -->
|
||||
<g id="node36" class="node">
|
||||
<title>Node36</title>
|
||||
<g id="a_node36"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/getline.html#" xlink:title=" ">
|
||||
<g id="a_node36"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/getline#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="630,-366.5 630,-385.5 695,-385.5 695,-366.5 630,-366.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-373.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::getline</text>
|
||||
</a>
|
||||
@@ -748,7 +748,7 @@
|
||||
<!-- Node38 -->
|
||||
<g id="node38" class="node">
|
||||
<title>Node38</title>
|
||||
<g id="a_node38"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/is_open.html#" xlink:title=" ">
|
||||
<g id="a_node38"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/is_open#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="607,-278.5 607,-297.5 718,-297.5 718,-278.5 607,-278.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-285.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::ifstream::is_open</text>
|
||||
</a>
|
||||
@@ -779,7 +779,7 @@
|
||||
<!-- Node41 -->
|
||||
<g id="node41" class="node">
|
||||
<title>Node41</title>
|
||||
<g id="a_node41"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/open.html#" xlink:title=" ">
|
||||
<g id="a_node41"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/open#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="613.5,-240.5 613.5,-259.5 711.5,-259.5 711.5,-240.5 613.5,-240.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-247.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::ifstream::open</text>
|
||||
</a>
|
||||
@@ -825,7 +825,7 @@
|
||||
<!-- Node44 -->
|
||||
<g id="node44" class="node">
|
||||
<title>Node44</title>
|
||||
<g id="a_node44"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/stof.html#" xlink:title=" ">
|
||||
<g id="a_node44"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/stof#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="635,-114.5 635,-133.5 690,-133.5 690,-114.5 635,-114.5"/>
|
||||
<text text-anchor="middle" x="662.5" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::stod</text>
|
||||
</a>
|
||||
@@ -870,7 +870,7 @@
|
||||
<!-- Node40 -->
|
||||
<g id="node40" class="node">
|
||||
<title>Node40</title>
|
||||
<g id="a_node40"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/max.html#" xlink:title=" ">
|
||||
<g id="a_node40"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/max#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="799.5,-524.5 799.5,-543.5 854.5,-543.5 854.5,-524.5 799.5,-524.5"/>
|
||||
<text text-anchor="middle" x="827" y="-531.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::max</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
@@ -5,13 +5,13 @@
|
||||
<area shape="rect" id="node11" href="$d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a5172a6791b9bd24f4232bab8d6b81fff" title=" " alt="" coords="196,637,367,693"/>
|
||||
<area shape="rect" id="node46" href="$d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a3b9eac1824d365dce715fb17c33cb96f" title=" " alt="" coords="424,233,595,289"/>
|
||||
<area shape="rect" id="node47" href="$d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a61d30113d13304c664057118b92a5931" title=" " alt="" coords="902,183,1073,239"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/begin.html#" title=" " alt="" coords="1167,56,1246,83"/>
|
||||
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/distance.html#" title=" " alt="" coords="1158,107,1255,133"/>
|
||||
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/end.html#" title=" " alt="" coords="1172,157,1241,184"/>
|
||||
<area shape="rect" id="node7" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="1171,489,1243,516"/>
|
||||
<area shape="rect" id="node8" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/utility/program/exit.html#" title=" " alt="" coords="1172,767,1241,793"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/begin#" title=" " alt="" coords="1167,56,1246,83"/>
|
||||
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/distance#" title=" " alt="" coords="1158,107,1255,133"/>
|
||||
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/end#" title=" " alt="" coords="1172,157,1241,184"/>
|
||||
<area shape="rect" id="node7" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="1171,489,1243,516"/>
|
||||
<area shape="rect" id="node8" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/utility/program/exit#" title=" " alt="" coords="1172,767,1241,793"/>
|
||||
<area shape="rect" id="node9" href="$d8/d77/namespacemachine__learning.html#aa4bbf61e65f8cd297255fa94b983d078" title=" " alt="" coords="1132,423,1281,465"/>
|
||||
<area shape="rect" id="node10" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/max_element.html#" title=" " alt="" coords="1143,5,1270,32"/>
|
||||
<area shape="rect" id="node10" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/max_element#" title=" " alt="" coords="1143,5,1270,32"/>
|
||||
<area shape="rect" id="node12" href="$d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a2be1b52bb9f57486f9a436f35c9089c0" title=" " alt="" coords="415,615,604,657"/>
|
||||
<area shape="rect" id="node27" href="$d5/d91/namespacesorting.html#a7bfe11bd4703eacd1dab93f25ec639c5" title=" " alt="" coords="695,796,803,823"/>
|
||||
<area shape="rect" id="node32" href="$d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a650c677fd6512665741ddd9b7983275d" title=" " alt="" coords="663,1413,834,1469"/>
|
||||
@@ -20,30 +20,30 @@
|
||||
<area shape="rect" id="node16" href="$d8/d77/namespacemachine__learning.html#a5342906d42b80fc6b6b3ad17bf00fcb9" title=" " alt="" coords="899,481,1075,508"/>
|
||||
<area shape="rect" id="node18" href="$d8/d77/namespacemachine__learning.html#af801bf30591ca6b2c38ff4fed0ded23f" title=" " alt="" coords="667,709,830,750"/>
|
||||
<area shape="rect" id="node23" href="$d8/d77/namespacemachine__learning.html#acafa3e62b686aebdbad81c4f89913f43" title=" " alt="" coords="893,533,1081,574"/>
|
||||
<area shape="rect" id="node24" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/min.html#" title=" " alt="" coords="1172,1184,1241,1211"/>
|
||||
<area shape="rect" id="node25" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/chrono/high_resolution_clock/now.html#" title=" " alt="" coords="657,970,840,1011"/>
|
||||
<area shape="rect" id="node26" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/resize.html#" title=" " alt="" coords="685,1036,812,1063"/>
|
||||
<area shape="rect" id="node28" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size.html#" title=" " alt="" coords="1149,1235,1265,1261"/>
|
||||
<area shape="rect" id="node24" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/min#" title=" " alt="" coords="1172,1184,1241,1211"/>
|
||||
<area shape="rect" id="node25" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/chrono/high_resolution_clock/now#" title=" " alt="" coords="657,970,840,1011"/>
|
||||
<area shape="rect" id="node26" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/resize#" title=" " alt="" coords="685,1036,812,1063"/>
|
||||
<area shape="rect" id="node28" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size#" title=" " alt="" coords="1149,1235,1265,1261"/>
|
||||
<area shape="rect" id="node29" href="$d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35" title=" " alt="" coords="671,328,827,355"/>
|
||||
<area shape="rect" id="node30" href="$d8/d77/namespacemachine__learning.html#a89fde571b38f9483576594f66572958a" title=" " alt="" coords="893,431,1081,457"/>
|
||||
<area shape="rect" id="node31" href="$d8/d77/namespacemachine__learning.html#ac1bdaa2a724b4ce6a6bb371a5dbe2e7e" title=" " alt="" coords="663,379,834,421"/>
|
||||
<area shape="rect" id="node15" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/emplace_back.html#" title=" " alt="" coords="899,263,1075,289"/>
|
||||
<area shape="rect" id="node17" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/push_back.html#" title=" " alt="" coords="1129,540,1284,567"/>
|
||||
<area shape="rect" id="node19" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/chrono/system_clock/now.html#" title=" " alt="" coords="918,650,1057,691"/>
|
||||
<area shape="rect" id="node20" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/random/rand.html#" title=" " alt="" coords="951,868,1024,895"/>
|
||||
<area shape="rect" id="node21" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/random/srand.html#" title=" " alt="" coords="947,716,1027,743"/>
|
||||
<area shape="rect" id="node22" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap.html#" title=" " alt="" coords="948,817,1027,844"/>
|
||||
<area shape="rect" id="node33" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/back.html#" title=" " alt="" coords="927,1727,1047,1753"/>
|
||||
<area shape="rect" id="node34" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/c_str.html#" title=" " alt="" coords="929,1777,1046,1804"/>
|
||||
<area shape="rect" id="node35" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/basic_ifstream/close.html#" title=" " alt="" coords="920,1828,1055,1855"/>
|
||||
<area shape="rect" id="node36" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/basic_ios/eof.html#" title=" " alt="" coords="927,1289,1048,1316"/>
|
||||
<area shape="rect" id="node37" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/getline.html#" title=" " alt="" coords="944,1340,1031,1367"/>
|
||||
<area shape="rect" id="node15" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/emplace_back#" title=" " alt="" coords="899,263,1075,289"/>
|
||||
<area shape="rect" id="node17" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/push_back#" title=" " alt="" coords="1129,540,1284,567"/>
|
||||
<area shape="rect" id="node19" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/chrono/system_clock/now#" title=" " alt="" coords="918,650,1057,691"/>
|
||||
<area shape="rect" id="node20" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/random/rand#" title=" " alt="" coords="951,868,1024,895"/>
|
||||
<area shape="rect" id="node21" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/random/srand#" title=" " alt="" coords="947,716,1027,743"/>
|
||||
<area shape="rect" id="node22" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap#" title=" " alt="" coords="948,817,1027,844"/>
|
||||
<area shape="rect" id="node33" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/back#" title=" " alt="" coords="927,1727,1047,1753"/>
|
||||
<area shape="rect" id="node34" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/c_str#" title=" " alt="" coords="929,1777,1046,1804"/>
|
||||
<area shape="rect" id="node35" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/basic_ifstream/close#" title=" " alt="" coords="920,1828,1055,1855"/>
|
||||
<area shape="rect" id="node36" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/basic_ios/eof#" title=" " alt="" coords="927,1289,1048,1316"/>
|
||||
<area shape="rect" id="node37" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/getline#" title=" " alt="" coords="944,1340,1031,1367"/>
|
||||
<area shape="rect" id="node38" href="$d8/d77/namespacemachine__learning.html#a496302e3371aa7b478cb7d5917904bdd" title=" " alt="" coords="906,1391,1069,1433"/>
|
||||
<area shape="rect" id="node39" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/basic_ifstream/is_open.html#" title=" " alt="" coords="913,1457,1061,1484"/>
|
||||
<area shape="rect" id="node39" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/basic_ifstream/is_open#" title=" " alt="" coords="913,1457,1061,1484"/>
|
||||
<area shape="rect" id="node40" href="$d8/d77/namespacemachine__learning.html#ac332d152078e96311e43ac5e7183ea26" title=" " alt="" coords="899,1122,1076,1163"/>
|
||||
<area shape="rect" id="node42" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/basic_ifstream/open.html#" title=" " alt="" coords="922,1508,1053,1535"/>
|
||||
<area shape="rect" id="node42" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/basic_ifstream/open#" title=" " alt="" coords="922,1508,1053,1535"/>
|
||||
<area shape="rect" id="node43" href="$d8/d77/namespacemachine__learning.html#ae10178b082f0205c326550877d998e5d" title=" " alt="" coords="894,1559,1081,1585"/>
|
||||
<area shape="rect" id="node44" href="$d8/d77/namespacemachine__learning.html#a912cf68863063a38d6e63545be5eb093" title=" " alt="" coords="911,1610,1063,1651"/>
|
||||
<area shape="rect" id="node45" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/stof.html#" title=" " alt="" coords="951,1676,1024,1703"/>
|
||||
<area shape="rect" id="node41" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/max.html#" title=" " alt="" coords="1170,1129,1243,1156"/>
|
||||
<area shape="rect" id="node45" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/stof#" title=" " alt="" coords="951,1676,1024,1703"/>
|
||||
<area shape="rect" id="node41" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/max#" title=" " alt="" coords="1170,1129,1243,1156"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
baefa18d0e1f19a5d103539f42ced42b
|
||||
8993d2ed2e1cb04975c6dd718bb7ba5e
|
||||
@@ -148,7 +148,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/begin.html#" xlink:title=" ">
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/begin#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="871.5,-1329.5 871.5,-1348.5 930.5,-1348.5 930.5,-1329.5 871.5,-1329.5"/>
|
||||
<text text-anchor="middle" x="901" y="-1336.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::begin</text>
|
||||
</a>
|
||||
@@ -163,7 +163,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/distance.html#" xlink:title=" ">
|
||||
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/distance#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="864.5,-1291.5 864.5,-1310.5 937.5,-1310.5 937.5,-1291.5 864.5,-1291.5"/>
|
||||
<text text-anchor="middle" x="901" y="-1298.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::distance</text>
|
||||
</a>
|
||||
@@ -178,7 +178,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/end.html#" xlink:title=" ">
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/end#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="875,-1253.5 875,-1272.5 927,-1272.5 927,-1253.5 875,-1253.5"/>
|
||||
<text text-anchor="middle" x="901" y="-1260.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::end</text>
|
||||
</a>
|
||||
@@ -193,7 +193,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node7"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="874,-1004.5 874,-1023.5 928,-1023.5 928,-1004.5 874,-1004.5"/>
|
||||
<text text-anchor="middle" x="901" y="-1011.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
@@ -208,7 +208,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node8 -->
|
||||
<g id="node8" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_node8"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/utility/program/exit.html#" xlink:title=" ">
|
||||
<g id="a_node8"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/utility/program/exit#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="875,-796.5 875,-815.5 927,-815.5 927,-796.5 875,-796.5"/>
|
||||
<text text-anchor="middle" x="901" y="-803.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::exit</text>
|
||||
</a>
|
||||
@@ -239,7 +239,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node10 -->
|
||||
<g id="node10" class="node">
|
||||
<title>Node10</title>
|
||||
<g id="a_node10"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/max_element.html#" xlink:title=" ">
|
||||
<g id="a_node10"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/max_element#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="853.5,-1367.5 853.5,-1386.5 948.5,-1386.5 948.5,-1367.5 853.5,-1367.5"/>
|
||||
<text text-anchor="middle" x="901" y="-1374.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::max_element</text>
|
||||
</a>
|
||||
@@ -406,7 +406,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node24 -->
|
||||
<g id="node24" class="node">
|
||||
<title>Node24</title>
|
||||
<g id="a_node24"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/min.html#" xlink:title=" ">
|
||||
<g id="a_node24"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/min#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="875,-483.5 875,-502.5 927,-502.5 927,-483.5 875,-483.5"/>
|
||||
<text text-anchor="middle" x="901" y="-490.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::min</text>
|
||||
</a>
|
||||
@@ -421,7 +421,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node25 -->
|
||||
<g id="node25" class="node">
|
||||
<title>Node25</title>
|
||||
<g id="a_node25"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/chrono/high_resolution_clock/now.html#" xlink:title=" ">
|
||||
<g id="a_node25"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/chrono/high_resolution_clock/now#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="489,-633 489,-663 626,-663 626,-633 489,-633"/>
|
||||
<text text-anchor="start" x="497" y="-651" font-family="Helvetica,sans-Serif" font-size="10.00">std::chrono::high_resolution</text>
|
||||
<text text-anchor="middle" x="557.5" y="-640" font-family="Helvetica,sans-Serif" font-size="10.00">_clock::now</text>
|
||||
@@ -437,7 +437,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node26 -->
|
||||
<g id="node26" class="node">
|
||||
<title>Node26</title>
|
||||
<g id="a_node26"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/resize.html#" xlink:title=" ">
|
||||
<g id="a_node26"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/resize#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="510,-594.5 510,-613.5 605,-613.5 605,-594.5 510,-594.5"/>
|
||||
<text text-anchor="middle" x="557.5" y="-601.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::resize</text>
|
||||
</a>
|
||||
@@ -458,7 +458,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node28 -->
|
||||
<g id="node28" class="node">
|
||||
<title>Node28</title>
|
||||
<g id="a_node28"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size.html#" xlink:title=" ">
|
||||
<g id="a_node28"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="857.5,-445.5 857.5,-464.5 944.5,-464.5 944.5,-445.5 857.5,-445.5"/>
|
||||
<text text-anchor="middle" x="901" y="-452.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
|
||||
</a>
|
||||
@@ -525,7 +525,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node15 -->
|
||||
<g id="node15" class="node">
|
||||
<title>Node15</title>
|
||||
<g id="a_node15"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/emplace_back.html#" xlink:title=" ">
|
||||
<g id="a_node15"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/emplace_back#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="670.5,-1174.5 670.5,-1193.5 802.5,-1193.5 802.5,-1174.5 670.5,-1174.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-1181.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::emplace_back</text>
|
||||
</a>
|
||||
@@ -564,7 +564,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node17 -->
|
||||
<g id="node17" class="node">
|
||||
<title>Node17</title>
|
||||
<g id="a_node17"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back.html#" xlink:title=" ">
|
||||
<g id="a_node17"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="843,-966.5 843,-985.5 959,-985.5 959,-966.5 843,-966.5"/>
|
||||
<text text-anchor="middle" x="901" y="-973.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::push_back</text>
|
||||
</a>
|
||||
@@ -591,7 +591,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node19 -->
|
||||
<g id="node19" class="node">
|
||||
<title>Node19</title>
|
||||
<g id="a_node19"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/chrono/system_clock/now.html#" xlink:title=" ">
|
||||
<g id="a_node19"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/chrono/system_clock/now#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="684.5,-873 684.5,-903 788.5,-903 788.5,-873 684.5,-873"/>
|
||||
<text text-anchor="start" x="692.5" y="-891" font-family="Helvetica,sans-Serif" font-size="10.00">std::chrono::system</text>
|
||||
<text text-anchor="middle" x="736.5" y="-880" font-family="Helvetica,sans-Serif" font-size="10.00">_clock::now</text>
|
||||
@@ -607,7 +607,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node20 -->
|
||||
<g id="node20" class="node">
|
||||
<title>Node20</title>
|
||||
<g id="a_node20"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/rand.html#" xlink:title=" ">
|
||||
<g id="a_node20"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/rand#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="709,-720.5 709,-739.5 764,-739.5 764,-720.5 709,-720.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-727.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::rand</text>
|
||||
</a>
|
||||
@@ -622,7 +622,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node21 -->
|
||||
<g id="node21" class="node">
|
||||
<title>Node21</title>
|
||||
<g id="a_node21"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/srand.html#" xlink:title=" ">
|
||||
<g id="a_node21"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/srand#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="706.5,-834.5 706.5,-853.5 766.5,-853.5 766.5,-834.5 706.5,-834.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-841.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::srand</text>
|
||||
</a>
|
||||
@@ -637,7 +637,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node22 -->
|
||||
<g id="node22" class="node">
|
||||
<title>Node22</title>
|
||||
<g id="a_node22"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
|
||||
<g id="a_node22"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="707,-758.5 707,-777.5 766,-777.5 766,-758.5 707,-758.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-765.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
|
||||
</a>
|
||||
@@ -718,7 +718,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node33 -->
|
||||
<g id="node33" class="node">
|
||||
<title>Node33</title>
|
||||
<g id="a_node33"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/back.html#" xlink:title=" ">
|
||||
<g id="a_node33"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/back#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="691.5,-76.5 691.5,-95.5 781.5,-95.5 781.5,-76.5 691.5,-76.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::back</text>
|
||||
</a>
|
||||
@@ -733,7 +733,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node34 -->
|
||||
<g id="node34" class="node">
|
||||
<title>Node34</title>
|
||||
<g id="a_node34"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/c_str.html#" xlink:title=" ">
|
||||
<g id="a_node34"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/c_str#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="692.5,-38.5 692.5,-57.5 780.5,-57.5 780.5,-38.5 692.5,-38.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::string::c_str</text>
|
||||
</a>
|
||||
@@ -748,7 +748,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node35 -->
|
||||
<g id="node35" class="node">
|
||||
<title>Node35</title>
|
||||
<g id="a_node35"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/close.html#" xlink:title=" ">
|
||||
<g id="a_node35"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/close#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="686,-0.5 686,-19.5 787,-19.5 787,-0.5 686,-0.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::ifstream::close</text>
|
||||
</a>
|
||||
@@ -763,7 +763,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node36 -->
|
||||
<g id="node36" class="node">
|
||||
<title>Node36</title>
|
||||
<g id="a_node36"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ios/eof.html#" xlink:title=" ">
|
||||
<g id="a_node36"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ios/eof#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="691,-404.5 691,-423.5 782,-423.5 782,-404.5 691,-404.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-411.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::ifstream::eof</text>
|
||||
</a>
|
||||
@@ -778,7 +778,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node37 -->
|
||||
<g id="node37" class="node">
|
||||
<title>Node37</title>
|
||||
<g id="a_node37"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/getline.html#" xlink:title=" ">
|
||||
<g id="a_node37"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/getline#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="704,-366.5 704,-385.5 769,-385.5 769,-366.5 704,-366.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-373.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::getline</text>
|
||||
</a>
|
||||
@@ -809,7 +809,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node39 -->
|
||||
<g id="node39" class="node">
|
||||
<title>Node39</title>
|
||||
<g id="a_node39"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/is_open.html#" xlink:title=" ">
|
||||
<g id="a_node39"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/is_open#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="681,-278.5 681,-297.5 792,-297.5 792,-278.5 681,-278.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-285.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::ifstream::is_open</text>
|
||||
</a>
|
||||
@@ -840,7 +840,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node42 -->
|
||||
<g id="node42" class="node">
|
||||
<title>Node42</title>
|
||||
<g id="a_node42"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/open.html#" xlink:title=" ">
|
||||
<g id="a_node42"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/open#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="687.5,-240.5 687.5,-259.5 785.5,-259.5 785.5,-240.5 687.5,-240.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-247.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::ifstream::open</text>
|
||||
</a>
|
||||
@@ -886,7 +886,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node45 -->
|
||||
<g id="node45" class="node">
|
||||
<title>Node45</title>
|
||||
<g id="a_node45"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/stof.html#" xlink:title=" ">
|
||||
<g id="a_node45"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/stof#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="709,-114.5 709,-133.5 764,-133.5 764,-114.5 709,-114.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::stod</text>
|
||||
</a>
|
||||
@@ -931,7 +931,7 @@ var sectionId = 'dynsection-5';
|
||||
<!-- Node41 -->
|
||||
<g id="node41" class="node">
|
||||
<title>Node41</title>
|
||||
<g id="a_node41"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/max.html#" xlink:title=" ">
|
||||
<g id="a_node41"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/max#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="873.5,-524.5 873.5,-543.5 928.5,-543.5 928.5,-524.5 873.5,-524.5"/>
|
||||
<text text-anchor="middle" x="901" y="-531.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::max</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
@@ -102,7 +102,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/iterator/begin.html#" xlink:title=" ">
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/begin#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="871.5,-1329.5 871.5,-1348.5 930.5,-1348.5 930.5,-1329.5 871.5,-1329.5"/>
|
||||
<text text-anchor="middle" x="901" y="-1336.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::begin</text>
|
||||
</a>
|
||||
@@ -117,7 +117,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/iterator/distance.html#" xlink:title=" ">
|
||||
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/distance#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="864.5,-1291.5 864.5,-1310.5 937.5,-1310.5 937.5,-1291.5 864.5,-1291.5"/>
|
||||
<text text-anchor="middle" x="901" y="-1298.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::distance</text>
|
||||
</a>
|
||||
@@ -132,7 +132,7 @@
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/end.html#" xlink:title=" ">
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/end#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="875,-1253.5 875,-1272.5 927,-1272.5 927,-1253.5 875,-1253.5"/>
|
||||
<text text-anchor="middle" x="901" y="-1260.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::end</text>
|
||||
</a>
|
||||
@@ -147,7 +147,7 @@
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node7"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="874,-1004.5 874,-1023.5 928,-1023.5 928,-1004.5 874,-1004.5"/>
|
||||
<text text-anchor="middle" x="901" y="-1011.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
@@ -162,7 +162,7 @@
|
||||
<!-- Node8 -->
|
||||
<g id="node8" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_node8"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/utility/program/exit.html#" xlink:title=" ">
|
||||
<g id="a_node8"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/utility/program/exit#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="875,-796.5 875,-815.5 927,-815.5 927,-796.5 875,-796.5"/>
|
||||
<text text-anchor="middle" x="901" y="-803.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::exit</text>
|
||||
</a>
|
||||
@@ -193,7 +193,7 @@
|
||||
<!-- Node10 -->
|
||||
<g id="node10" class="node">
|
||||
<title>Node10</title>
|
||||
<g id="a_node10"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/max_element.html#" xlink:title=" ">
|
||||
<g id="a_node10"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/max_element#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="853.5,-1367.5 853.5,-1386.5 948.5,-1386.5 948.5,-1367.5 853.5,-1367.5"/>
|
||||
<text text-anchor="middle" x="901" y="-1374.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::max_element</text>
|
||||
</a>
|
||||
@@ -360,7 +360,7 @@
|
||||
<!-- Node24 -->
|
||||
<g id="node24" class="node">
|
||||
<title>Node24</title>
|
||||
<g id="a_node24"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/min.html#" xlink:title=" ">
|
||||
<g id="a_node24"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/min#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="875,-483.5 875,-502.5 927,-502.5 927,-483.5 875,-483.5"/>
|
||||
<text text-anchor="middle" x="901" y="-490.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::min</text>
|
||||
</a>
|
||||
@@ -375,7 +375,7 @@
|
||||
<!-- Node25 -->
|
||||
<g id="node25" class="node">
|
||||
<title>Node25</title>
|
||||
<g id="a_node25"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/chrono/high_resolution_clock/now.html#" xlink:title=" ">
|
||||
<g id="a_node25"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/chrono/high_resolution_clock/now#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="489,-633 489,-663 626,-663 626,-633 489,-633"/>
|
||||
<text text-anchor="start" x="497" y="-651" font-family="Helvetica,sans-Serif" font-size="10.00">std::chrono::high_resolution</text>
|
||||
<text text-anchor="middle" x="557.5" y="-640" font-family="Helvetica,sans-Serif" font-size="10.00">_clock::now</text>
|
||||
@@ -391,7 +391,7 @@
|
||||
<!-- Node26 -->
|
||||
<g id="node26" class="node">
|
||||
<title>Node26</title>
|
||||
<g id="a_node26"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/resize.html#" xlink:title=" ">
|
||||
<g id="a_node26"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/resize#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="510,-594.5 510,-613.5 605,-613.5 605,-594.5 510,-594.5"/>
|
||||
<text text-anchor="middle" x="557.5" y="-601.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::resize</text>
|
||||
</a>
|
||||
@@ -412,7 +412,7 @@
|
||||
<!-- Node28 -->
|
||||
<g id="node28" class="node">
|
||||
<title>Node28</title>
|
||||
<g id="a_node28"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size.html#" xlink:title=" ">
|
||||
<g id="a_node28"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="857.5,-445.5 857.5,-464.5 944.5,-464.5 944.5,-445.5 857.5,-445.5"/>
|
||||
<text text-anchor="middle" x="901" y="-452.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
|
||||
</a>
|
||||
@@ -479,7 +479,7 @@
|
||||
<!-- Node15 -->
|
||||
<g id="node15" class="node">
|
||||
<title>Node15</title>
|
||||
<g id="a_node15"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/emplace_back.html#" xlink:title=" ">
|
||||
<g id="a_node15"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/emplace_back#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="670.5,-1174.5 670.5,-1193.5 802.5,-1193.5 802.5,-1174.5 670.5,-1174.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-1181.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::emplace_back</text>
|
||||
</a>
|
||||
@@ -518,7 +518,7 @@
|
||||
<!-- Node17 -->
|
||||
<g id="node17" class="node">
|
||||
<title>Node17</title>
|
||||
<g id="a_node17"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back.html#" xlink:title=" ">
|
||||
<g id="a_node17"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="843,-966.5 843,-985.5 959,-985.5 959,-966.5 843,-966.5"/>
|
||||
<text text-anchor="middle" x="901" y="-973.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::push_back</text>
|
||||
</a>
|
||||
@@ -545,7 +545,7 @@
|
||||
<!-- Node19 -->
|
||||
<g id="node19" class="node">
|
||||
<title>Node19</title>
|
||||
<g id="a_node19"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/chrono/system_clock/now.html#" xlink:title=" ">
|
||||
<g id="a_node19"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/chrono/system_clock/now#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="684.5,-873 684.5,-903 788.5,-903 788.5,-873 684.5,-873"/>
|
||||
<text text-anchor="start" x="692.5" y="-891" font-family="Helvetica,sans-Serif" font-size="10.00">std::chrono::system</text>
|
||||
<text text-anchor="middle" x="736.5" y="-880" font-family="Helvetica,sans-Serif" font-size="10.00">_clock::now</text>
|
||||
@@ -561,7 +561,7 @@
|
||||
<!-- Node20 -->
|
||||
<g id="node20" class="node">
|
||||
<title>Node20</title>
|
||||
<g id="a_node20"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/rand.html#" xlink:title=" ">
|
||||
<g id="a_node20"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/rand#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="709,-720.5 709,-739.5 764,-739.5 764,-720.5 709,-720.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-727.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::rand</text>
|
||||
</a>
|
||||
@@ -576,7 +576,7 @@
|
||||
<!-- Node21 -->
|
||||
<g id="node21" class="node">
|
||||
<title>Node21</title>
|
||||
<g id="a_node21"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/srand.html#" xlink:title=" ">
|
||||
<g id="a_node21"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/random/srand#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="706.5,-834.5 706.5,-853.5 766.5,-853.5 766.5,-834.5 706.5,-834.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-841.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::srand</text>
|
||||
</a>
|
||||
@@ -591,7 +591,7 @@
|
||||
<!-- Node22 -->
|
||||
<g id="node22" class="node">
|
||||
<title>Node22</title>
|
||||
<g id="a_node22"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
|
||||
<g id="a_node22"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="707,-758.5 707,-777.5 766,-777.5 766,-758.5 707,-758.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-765.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
|
||||
</a>
|
||||
@@ -672,7 +672,7 @@
|
||||
<!-- Node33 -->
|
||||
<g id="node33" class="node">
|
||||
<title>Node33</title>
|
||||
<g id="a_node33"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/back.html#" xlink:title=" ">
|
||||
<g id="a_node33"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/back#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="691.5,-76.5 691.5,-95.5 781.5,-95.5 781.5,-76.5 691.5,-76.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::back</text>
|
||||
</a>
|
||||
@@ -687,7 +687,7 @@
|
||||
<!-- Node34 -->
|
||||
<g id="node34" class="node">
|
||||
<title>Node34</title>
|
||||
<g id="a_node34"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/c_str.html#" xlink:title=" ">
|
||||
<g id="a_node34"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/c_str#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="692.5,-38.5 692.5,-57.5 780.5,-57.5 780.5,-38.5 692.5,-38.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::string::c_str</text>
|
||||
</a>
|
||||
@@ -702,7 +702,7 @@
|
||||
<!-- Node35 -->
|
||||
<g id="node35" class="node">
|
||||
<title>Node35</title>
|
||||
<g id="a_node35"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/close.html#" xlink:title=" ">
|
||||
<g id="a_node35"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/close#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="686,-0.5 686,-19.5 787,-19.5 787,-0.5 686,-0.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::ifstream::close</text>
|
||||
</a>
|
||||
@@ -717,7 +717,7 @@
|
||||
<!-- Node36 -->
|
||||
<g id="node36" class="node">
|
||||
<title>Node36</title>
|
||||
<g id="a_node36"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ios/eof.html#" xlink:title=" ">
|
||||
<g id="a_node36"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ios/eof#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="691,-404.5 691,-423.5 782,-423.5 782,-404.5 691,-404.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-411.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::ifstream::eof</text>
|
||||
</a>
|
||||
@@ -732,7 +732,7 @@
|
||||
<!-- Node37 -->
|
||||
<g id="node37" class="node">
|
||||
<title>Node37</title>
|
||||
<g id="a_node37"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/getline.html#" xlink:title=" ">
|
||||
<g id="a_node37"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/getline#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="704,-366.5 704,-385.5 769,-385.5 769,-366.5 704,-366.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-373.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::getline</text>
|
||||
</a>
|
||||
@@ -763,7 +763,7 @@
|
||||
<!-- Node39 -->
|
||||
<g id="node39" class="node">
|
||||
<title>Node39</title>
|
||||
<g id="a_node39"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/is_open.html#" xlink:title=" ">
|
||||
<g id="a_node39"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/is_open#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="681,-278.5 681,-297.5 792,-297.5 792,-278.5 681,-278.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-285.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::ifstream::is_open</text>
|
||||
</a>
|
||||
@@ -794,7 +794,7 @@
|
||||
<!-- Node42 -->
|
||||
<g id="node42" class="node">
|
||||
<title>Node42</title>
|
||||
<g id="a_node42"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/open.html#" xlink:title=" ">
|
||||
<g id="a_node42"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/basic_ifstream/open#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="687.5,-240.5 687.5,-259.5 785.5,-259.5 785.5,-240.5 687.5,-240.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-247.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::ifstream::open</text>
|
||||
</a>
|
||||
@@ -840,7 +840,7 @@
|
||||
<!-- Node45 -->
|
||||
<g id="node45" class="node">
|
||||
<title>Node45</title>
|
||||
<g id="a_node45"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/stof.html#" xlink:title=" ">
|
||||
<g id="a_node45"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/stof#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="709,-114.5 709,-133.5 764,-133.5 764,-114.5 709,-114.5"/>
|
||||
<text text-anchor="middle" x="736.5" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::stod</text>
|
||||
</a>
|
||||
@@ -885,7 +885,7 @@
|
||||
<!-- Node41 -->
|
||||
<g id="node41" class="node">
|
||||
<title>Node41</title>
|
||||
<g id="a_node41"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/max.html#" xlink:title=" ">
|
||||
<g id="a_node41"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/max#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="873.5,-524.5 873.5,-543.5 928.5,-543.5 928.5,-524.5 873.5,-524.5"/>
|
||||
<text text-anchor="middle" x="901" y="-531.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::max</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
@@ -1,4 +1,4 @@
|
||||
<map id="machine_learning::neural_network::activations::relu" name="machine_learning::neural_network::activations::relu">
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,29,180,71"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/max.html#" title=" " alt="" coords="228,37,301,63"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/max#" title=" " alt="" coords="228,37,301,63"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
af3d9adcbe3cd7a6f63f9b25826c103a
|
||||
93244f731f0f0498c721b31057ff3773
|
||||
@@ -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/algorithm/max.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/max#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="167,-6 167,-25 222,-25 222,-6 167,-6"/>
|
||||
<text text-anchor="middle" x="194.5" y="-13" font-family="Helvetica,sans-Serif" font-size="10.00">std::max</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 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++: backtracking/subset_sum.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');
|
||||
@@ -152,10 +152,10 @@ 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="l00103" name="l00103"></a><span class="lineno"> 103</span> {</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <a class="code hl_function" href="../../d2/d5a/subset__sum_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 103</span> {</div>
|
||||
<div class="line"><span class="lineno"> 104</span> <a class="code hl_function" href="../../d2/d5a/subset__sum_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 105</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 106</span>}</div>
|
||||
<div class="ttc" id="asubset__sum_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d2/d5a/subset__sum_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Test implementations.</div><div class="ttdef"><b>Definition:</b> subset_sum.cpp:57</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -201,23 +201,23 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>count of the number of subsets with required sum </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> {</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> int32_t nelement = in_arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>();</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> uint64_t count_of_subset = 0;</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> </div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keywordflow">for</span> (int32_t i = 0; i < (1 << (nelement)); i++) {</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> int32_t <a class="code hl_function" href="../../d3/d84/word__break_8cpp.html#a272b0f5cdb4e41fd6dee4538b808c06a">check</a> = 0;</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keywordflow">for</span> (int32_t j = 0; j < nelement; j++) {</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keywordflow">if</span> (i & (1 << j)) {</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <a class="code hl_function" href="../../d3/d84/word__break_8cpp.html#a272b0f5cdb4e41fd6dee4538b808c06a">check</a> += (in_arr[j]);</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> }</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> }</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordflow">if</span> (check == <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a>) {</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> count_of_subset++;</div>
|
||||
<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> }</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordflow">return</span> count_of_subset;</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 33</span> {</div>
|
||||
<div class="line"><span class="lineno"> 34</span> int32_t nelement = in_arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>();</div>
|
||||
<div class="line"><span class="lineno"> 35</span> uint64_t count_of_subset = 0;</div>
|
||||
<div class="line"><span class="lineno"> 36</span> </div>
|
||||
<div class="line"><span class="lineno"> 37</span> <span class="keywordflow">for</span> (int32_t i = 0; i < (1 << (nelement)); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 38</span> int32_t <a class="code hl_function" href="../../d3/d84/word__break_8cpp.html#a272b0f5cdb4e41fd6dee4538b808c06a">check</a> = 0;</div>
|
||||
<div class="line"><span class="lineno"> 39</span> <span class="keywordflow">for</span> (int32_t j = 0; j < nelement; j++) {</div>
|
||||
<div class="line"><span class="lineno"> 40</span> <span class="keywordflow">if</span> (i & (1 << j)) {</div>
|
||||
<div class="line"><span class="lineno"> 41</span> <a class="code hl_function" href="../../d3/d84/word__break_8cpp.html#a272b0f5cdb4e41fd6dee4538b808c06a">check</a> += (in_arr[j]);</div>
|
||||
<div class="line"><span class="lineno"> 42</span> }</div>
|
||||
<div class="line"><span class="lineno"> 43</span> }</div>
|
||||
<div class="line"><span class="lineno"> 44</span> <span class="keywordflow">if</span> (check == <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a>) {</div>
|
||||
<div class="line"><span class="lineno"> 45</span> count_of_subset++;</div>
|
||||
<div class="line"><span class="lineno"> 46</span> }</div>
|
||||
<div class="line"><span class="lineno"> 47</span> }</div>
|
||||
<div class="line"><span class="lineno"> 48</span> <span class="keywordflow">return</span> count_of_subset;</div>
|
||||
<div class="line"><span class="lineno"> 49</span>}</div>
|
||||
<div class="ttc" id="anamespacemachine__learning_html_a6f1c98c016ad34ff3d9f39372161bd35"><div class="ttname"><a href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">machine_learning::sum</a></div><div class="ttdeci">T sum(const std::vector< std::valarray< T > > &A)</div><div class="ttdef"><b>Definition:</b> vector_ops.hpp:232</div></div>
|
||||
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/size.html">std::vector::size</a></div><div class="ttdeci">T size(T... args)</div></div>
|
||||
<div class="ttc" id="aword__break_8cpp_html_a272b0f5cdb4e41fd6dee4538b808c06a"><div class="ttname"><a href="../../d3/d84/word__break_8cpp.html#a272b0f5cdb4e41fd6dee4538b808c06a">dynamic_programming::word_break::check</a></div><div class="ttdeci">bool check(const std::string &s, const std::unordered_set< std::string > &strSet, int pos, std::vector< int > *dp)</div><div class="ttdoc">Function that checks if the string passed in param can be segmented from position 'pos',...</div><div class="ttdef"><b>Definition:</b> word_break.cpp:80</div></div>
|
||||
@@ -255,47 +255,47 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Test implementations. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><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">// 1st test</span></div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"1st test "</span>;</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int32_t></a> array1 = {-7, -3, -2, 5, 8}; <span class="comment">// input array</span></div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> assert(backtracking::subset_sum::number_of_subsets(0, array1) ==</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> 2); <span class="comment">// first argument in subset_sum function is the required sum and</span></div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="comment">// second is the input array</span></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/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="comment">// 2nd test</span></div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"2nd test "</span>;</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int32_t></a> array2 = {1, 2, 3, 3};</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> assert(backtracking::subset_sum::number_of_subsets(6, array2) ==</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> 3); <span class="comment">// here we are expecting 3 subsets which sum up to 6 i.e.</span></div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="comment">// {(1,2,3),(1,2,3),(3,3)}</span></div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> </div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="comment">// 3rd test</span></div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"3rd test "</span>;</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int32_t></a> array3 = {1, 1, 1, 1};</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> assert(backtracking::subset_sum::number_of_subsets(1, array3) ==</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> 4); <span class="comment">// here we are expecting 4 subsets which sum up to 1 i.e.</span></div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="comment">// {(1),(1),(1),(1)}</span></div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> </div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="comment">// 4th test</span></div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"4th test "</span>;</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int32_t></a> array4 = {3, 3, 3, 3};</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> assert(backtracking::subset_sum::number_of_subsets(6, array4) ==</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> 6); <span class="comment">// here we are expecting 6 subsets which sum up to 6 i.e.</span></div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="comment">// {(3,3),(3,3),(3,3),(3,3),(3,3),(3,3)}</span></div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> </div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="comment">// Test 5</span></div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"5th test "</span>;</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int32_t></a> array5 = {};</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> assert(backtracking::subset_sum::number_of_subsets(6, array5) ==</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> 0); <span class="comment">// here we are expecting 0 subsets which sum up to 6 i.e. we</span></div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="comment">// cannot select anything from an empty array</span></div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 57</span> {</div>
|
||||
<div class="line"><span class="lineno"> 58</span> <span class="comment">// 1st test</span></div>
|
||||
<div class="line"><span class="lineno"> 59</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"1st test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 60</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int32_t></a> array1 = {-7, -3, -2, 5, 8}; <span class="comment">// input array</span></div>
|
||||
<div class="line"><span class="lineno"> 61</span> assert(backtracking::subset_sum::number_of_subsets(0, array1) ==</div>
|
||||
<div class="line"><span class="lineno"> 62</span> 2); <span class="comment">// first argument in subset_sum function is the required sum and</span></div>
|
||||
<div class="line"><span class="lineno"> 63</span> <span class="comment">// second is the input array</span></div>
|
||||
<div class="line"><span class="lineno"> 64</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 65</span> </div>
|
||||
<div class="line"><span class="lineno"> 66</span> <span class="comment">// 2nd test</span></div>
|
||||
<div class="line"><span class="lineno"> 67</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"2nd test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 68</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int32_t></a> array2 = {1, 2, 3, 3};</div>
|
||||
<div class="line"><span class="lineno"> 69</span> assert(backtracking::subset_sum::number_of_subsets(6, array2) ==</div>
|
||||
<div class="line"><span class="lineno"> 70</span> 3); <span class="comment">// here we are expecting 3 subsets which sum up to 6 i.e.</span></div>
|
||||
<div class="line"><span class="lineno"> 71</span> <span class="comment">// {(1,2,3),(1,2,3),(3,3)}</span></div>
|
||||
<div class="line"><span class="lineno"> 72</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 73</span> </div>
|
||||
<div class="line"><span class="lineno"> 74</span> <span class="comment">// 3rd test</span></div>
|
||||
<div class="line"><span class="lineno"> 75</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"3rd test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 76</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int32_t></a> array3 = {1, 1, 1, 1};</div>
|
||||
<div class="line"><span class="lineno"> 77</span> assert(backtracking::subset_sum::number_of_subsets(1, array3) ==</div>
|
||||
<div class="line"><span class="lineno"> 78</span> 4); <span class="comment">// here we are expecting 4 subsets which sum up to 1 i.e.</span></div>
|
||||
<div class="line"><span class="lineno"> 79</span> <span class="comment">// {(1),(1),(1),(1)}</span></div>
|
||||
<div class="line"><span class="lineno"> 80</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 81</span> </div>
|
||||
<div class="line"><span class="lineno"> 82</span> <span class="comment">// 4th test</span></div>
|
||||
<div class="line"><span class="lineno"> 83</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"4th test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 84</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int32_t></a> array4 = {3, 3, 3, 3};</div>
|
||||
<div class="line"><span class="lineno"> 85</span> assert(backtracking::subset_sum::number_of_subsets(6, array4) ==</div>
|
||||
<div class="line"><span class="lineno"> 86</span> 6); <span class="comment">// here we are expecting 6 subsets which sum up to 6 i.e.</span></div>
|
||||
<div class="line"><span class="lineno"> 87</span> <span class="comment">// {(3,3),(3,3),(3,3),(3,3),(3,3),(3,3)}</span></div>
|
||||
<div class="line"><span class="lineno"> 88</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 89</span> </div>
|
||||
<div class="line"><span class="lineno"> 90</span> <span class="comment">// Test 5</span></div>
|
||||
<div class="line"><span class="lineno"> 91</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"5th test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 92</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int32_t></a> array5 = {};</div>
|
||||
<div class="line"><span class="lineno"> 93</span> assert(backtracking::subset_sum::number_of_subsets(6, array5) ==</div>
|
||||
<div class="line"><span class="lineno"> 94</span> 0); <span class="comment">// here we are expecting 0 subsets which sum up to 6 i.e. we</span></div>
|
||||
<div class="line"><span class="lineno"> 95</span> <span class="comment">// cannot select anything from an empty array</span></div>
|
||||
<div class="line"><span class="lineno"> 96</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 97</span>}</div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
|
||||
@@ -314,7 +314,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_c11585dfcef32a26e29098facab6c144.html">backtracking</a></li><li class="navelem"><a class="el" href="../../d2/d5a/subset__sum_8cpp.html">subset_sum.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="backtracking::subset_sum::number_of_subsets" name="backtracking::subset_sum::number_of_subsets">
|
||||
<area shape="rect" id="node1" title="The main function implements count of subsets." alt="" coords="5,29,181,71"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size.html#" title=" " alt="" coords="249,11,365,38"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size#" title=" " alt="" coords="249,11,365,38"/>
|
||||
<area shape="rect" id="node3" href="$d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35" title=" " alt="" coords="229,62,385,89"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
acd8218375b484f9843c7f692b97092f
|
||||
dbfdc033393ab04ec603a6cb0a9c123f
|
||||
@@ -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/vector/size.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="183,-38.5 183,-57.5 270,-57.5 270,-38.5 183,-38.5"/>
|
||||
<text text-anchor="middle" x="226.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
@@ -1,4 +1,4 @@
|
||||
<map id="test" name="test">
|
||||
<area shape="rect" id="node1" title="Test implementations." alt="" coords="5,5,49,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="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"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
8d359d70fd10f0a4031702eb4edbf468
|
||||
5290b7ba340ef189b369dbb2cae26c45
|
||||
@@ -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,-0.5 69,-19.5 123,-19.5 123,-0.5 69,-0.5"/>
|
||||
<text text-anchor="middle" x="96" 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,5 +1,5 @@
|
||||
<map id="main" name="main">
|
||||
<area shape="rect" id="node1" title="Main function." alt="" coords="5,5,56,32"/>
|
||||
<area shape="rect" id="node2" href="$d2/d5a/subset__sum_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" title="Test implementations." alt="" coords="104,5,148,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.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/io/manip/endl#" title=" " alt="" coords="196,5,268,32"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
f4de6e33a8f301a921c646f80a22761c
|
||||
28ca7d8f36a6d61ed0b3d680666ab56c
|
||||
@@ -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/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="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::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++: 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');
|
||||
@@ -111,7 +111,7 @@ $(document).ready(function(){initNavTree('da/d19/classprobability_1_1geometric__
|
||||
<!-- 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++: range_queries::heavy_light_decomposition::HLD< X > Class Template 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');
|
||||
@@ -110,7 +110,7 @@ Inheritance diagram for range_queries::heavy_light_decomposition::HLD< X >
|
||||
<div class="dynheader">
|
||||
Collaboration diagram for range_queries::heavy_light_decomposition::HLD< X >:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph.svg" width="352" height="147"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph.svg" width="100%" height="526"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
<center><span class="legend">[<a target="top" href="../../graph_legend.html">legend</a>]</span></center></div>
|
||||
<table class="memberdecls">
|
||||
@@ -210,7 +210,7 @@ template<typename X > </div>
|
||||
<td class="mlabels-left">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname"><a class="el" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html">range_queries::heavy_light_decomposition::HLD</a>< X >::<a class="el" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html">HLD</a> </td>
|
||||
<td class="memname"><a class="el" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html">range_queries::heavy_light_decomposition::HLD</a>< X >::HLD </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>nodes</em></td><td>)</td>
|
||||
@@ -231,20 +231,24 @@ template<typename X > </div>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="fragment"><div class="line"><a id="l00435" name="l00435"></a><span class="lineno"> 435</span> : Tree<X>(nodes), SG<X>(nodes) {</div>
|
||||
<div class="line"><a id="l00436" name="l00436"></a><span class="lineno"> 436</span> <span class="comment">/* Initialization and resize vectors */</span></div>
|
||||
<div class="line"><a id="l00437" name="l00437"></a><span class="lineno"> 437</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a722cc7cf2c3e4d15583601a48b09776f">label</a> = 0;</div>
|
||||
<div class="line"><a id="l00438" name="l00438"></a><span class="lineno"> 438</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>.assign(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">Tree<X>::t_nodes</a>, -1);</div>
|
||||
<div class="line"><a id="l00439" name="l00439"></a><span class="lineno"> 439</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>.assign(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">Tree<X>::t_nodes</a>, -1);</div>
|
||||
<div class="line"><a id="l00440" name="l00440"></a><span class="lineno"> 440</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>.resize(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">Tree<X>::t_nodes</a>);</div>
|
||||
<div class="line"><a id="l00441" name="l00441"></a><span class="lineno"> 441</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/iota.html">iota</a>(<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>.begin(), <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>.end(), 0);</div>
|
||||
<div class="line"><a id="l00442" name="l00442"></a><span class="lineno"> 442</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 435</span> : Tree<X>(nodes), SG<X>(nodes) {</div>
|
||||
<div class="line"><span class="lineno"> 436</span> <span class="comment">/* Initialization and resize vectors */</span></div>
|
||||
<div class="line"><span class="lineno"> 437</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a722cc7cf2c3e4d15583601a48b09776f">label</a> = 0;</div>
|
||||
<div class="line"><span class="lineno"> 438</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/assign.html">assign</a>(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">Tree<X>::t_nodes</a>, -1);</div>
|
||||
<div class="line"><span class="lineno"> 439</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/assign.html">assign</a>(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">Tree<X>::t_nodes</a>, -1);</div>
|
||||
<div class="line"><span class="lineno"> 440</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/resize.html">resize</a>(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">Tree<X>::t_nodes</a>);</div>
|
||||
<div class="line"><span class="lineno"> 441</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/iota.html">iota</a>(<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/begin.html">begin</a>(), <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/end.html">end</a>(), 0);</div>
|
||||
<div class="line"><span class="lineno"> 442</span> }</div>
|
||||
<div class="ttc" id="aassign_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/assign.html">std::vector::assign</a></div><div class="ttdeci">T assign(T... args)</div></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="aclassrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_html_a1b336474d17eff1aa4be73d4068dc725"><div class="ttname"><a href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">range_queries::heavy_light_decomposition::HLD::h_parent</a></div><div class="ttdeci">std::vector< int > h_parent</div><div class="ttdoc">stores the top of the heavy chain from a node</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:341</div></div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_html_a722cc7cf2c3e4d15583601a48b09776f"><div class="ttname"><a href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a722cc7cf2c3e4d15583601a48b09776f">range_queries::heavy_light_decomposition::HLD::label</a></div><div class="ttdeci">int label</div><div class="ttdoc">utility member to assign labels in dfs_labels()</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:338</div></div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_html_a84424f180f12b514eaab57a6aa20b104"><div class="ttname"><a href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">range_queries::heavy_light_decomposition::HLD::h_heavychlid</a></div><div class="ttdeci">std::vector< int > h_heavychlid</div><div class="ttdoc">stores the heavy child of a node</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:340</div></div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_html_aa86a91ae0cd7898990a8170a2f2c9cda"><div class="ttname"><a href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">range_queries::heavy_light_decomposition::HLD::h_label</a></div><div class="ttdeci">std::vector< int > h_label</div><div class="ttdoc">stores the label of a node</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:339</div></div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_tree_html_ae4630fa70a80a1dc65a875488a67178a"><div class="ttname"><a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">range_queries::heavy_light_decomposition::Tree::t_nodes</a></div><div class="ttdeci">const int t_nodes</div><div class="ttdoc">number of nodes</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:84</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="aiota_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/iota.html">std::iota</a></div><div class="ttdeci">T iota(T... args)</div></div>
|
||||
<div class="ttc" id="aresize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/resize.html">std::vector::resize</a></div><div class="ttdeci">T resize(T... args)</div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -294,25 +298,25 @@ template<typename X > </div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>the sum of ndoe values in the simple path from a to b </dd></dl>
|
||||
<div class="fragment"><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> X ret = <a class="code hl_variable" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#aa7f93971a9f891e0bbb7023081f379d5">SG<X>::sret_init</a>;</div>
|
||||
<div class="line"><a id="l00411" name="l00411"></a><span class="lineno"> 411</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree<X>::t_depth</a>[a] < <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree<X>::t_depth</a>[b]) {</div>
|
||||
<div class="line"><a id="l00412" name="l00412"></a><span class="lineno"> 412</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/swap.html">std::swap</a>(a, b);</div>
|
||||
<div class="line"><a id="l00413" name="l00413"></a><span class="lineno"> 413</span> }</div>
|
||||
<div class="line"><a id="l00414" name="l00414"></a><span class="lineno"> 414</span> <span class="keywordflow">while</span> (<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree<X>::t_depth</a>[a] >= <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree<X>::t_depth</a>[b]) {</div>
|
||||
<div class="line"><a id="l00415" name="l00415"></a><span class="lineno"> 415</span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a> = <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[a]];</div>
|
||||
<div class="line"><a id="l00416" name="l00416"></a><span class="lineno"> 416</span> <span class="keywordtype">int</span> r = <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[a];</div>
|
||||
<div class="line"><a id="l00417" name="l00417"></a><span class="lineno"> 417</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree<X>::t_depth</a>[<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[a]] < <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree<X>::t_depth</a>[b]) {</div>
|
||||
<div class="line"><a id="l00418" name="l00418"></a><span class="lineno"> 418</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a> += <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree<X>::t_depth</a>[b] - <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree<X>::t_depth</a>[<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[a]];</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> ret = <a class="code hl_function" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a41c733f5f5e262b308f7cb95c88c1e74">SG<X>::combine</a>(ret, <a class="code hl_function" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a1fda852e6e522707fd97f61cdb0a2591">SG<X>::query</a>(l, r));</div>
|
||||
<div class="line"><a id="l00421" name="l00421"></a><span class="lineno"> 421</span> a = <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">Tree<X>::t_par</a>[<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[a]][0];</div>
|
||||
<div class="line"><a id="l00422" name="l00422"></a><span class="lineno"> 422</span> <span class="keywordflow">if</span> (a == -1) {</div>
|
||||
<div class="line"><a id="l00423" name="l00423"></a><span class="lineno"> 423</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><a id="l00424" name="l00424"></a><span class="lineno"> 424</span> }</div>
|
||||
<div class="line"><a id="l00425" name="l00425"></a><span class="lineno"> 425</span> }</div>
|
||||
<div class="line"><a id="l00426" name="l00426"></a><span class="lineno"> 426</span> <span class="keywordflow">return</span> ret;</div>
|
||||
<div class="line"><a id="l00427" name="l00427"></a><span class="lineno"> 427</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 409</span> {</div>
|
||||
<div class="line"><span class="lineno"> 410</span> X ret = <a class="code hl_variable" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#aa7f93971a9f891e0bbb7023081f379d5">SG<X>::sret_init</a>;</div>
|
||||
<div class="line"><span class="lineno"> 411</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree<X>::t_depth</a>[a] < <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree<X>::t_depth</a>[b]) {</div>
|
||||
<div class="line"><span class="lineno"> 412</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/swap.html">std::swap</a>(a, b);</div>
|
||||
<div class="line"><span class="lineno"> 413</span> }</div>
|
||||
<div class="line"><span class="lineno"> 414</span> <span class="keywordflow">while</span> (<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree<X>::t_depth</a>[a] >= <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree<X>::t_depth</a>[b]) {</div>
|
||||
<div class="line"><span class="lineno"> 415</span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a> = <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[a]];</div>
|
||||
<div class="line"><span class="lineno"> 416</span> <span class="keywordtype">int</span> r = <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[a];</div>
|
||||
<div class="line"><span class="lineno"> 417</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree<X>::t_depth</a>[<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[a]] < <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree<X>::t_depth</a>[b]) {</div>
|
||||
<div class="line"><span class="lineno"> 418</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a> += <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree<X>::t_depth</a>[b] - <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1">Tree<X>::t_depth</a>[<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[a]];</div>
|
||||
<div class="line"><span class="lineno"> 419</span> }</div>
|
||||
<div class="line"><span class="lineno"> 420</span> ret = <a class="code hl_function" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a41c733f5f5e262b308f7cb95c88c1e74">SG<X>::combine</a>(ret, <a class="code hl_function" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a1fda852e6e522707fd97f61cdb0a2591">SG<X>::query</a>(l, r));</div>
|
||||
<div class="line"><span class="lineno"> 421</span> a = <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a350157a5fb79f76fceae33fc84171203">Tree<X>::t_par</a>[<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[a]][0];</div>
|
||||
<div class="line"><span class="lineno"> 422</span> <span class="keywordflow">if</span> (a == -1) {</div>
|
||||
<div class="line"><span class="lineno"> 423</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><span class="lineno"> 424</span> }</div>
|
||||
<div class="line"><span class="lineno"> 425</span> }</div>
|
||||
<div class="line"><span class="lineno"> 426</span> <span class="keywordflow">return</span> ret;</div>
|
||||
<div class="line"><span class="lineno"> 427</span> }</div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_s_g_html_a1fda852e6e522707fd97f61cdb0a2591"><div class="ttname"><a href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a1fda852e6e522707fd97f61cdb0a2591">range_queries::heavy_light_decomposition::SG::query</a></div><div class="ttdeci">X query(int l, int r)</div><div class="ttdoc">Make a range query from node label l to node label r.</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:305</div></div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_s_g_html_a41c733f5f5e262b308f7cb95c88c1e74"><div class="ttname"><a href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a41c733f5f5e262b308f7cb95c88c1e74">range_queries::heavy_light_decomposition::SG::combine</a></div><div class="ttdeci">X combine(X lhs, X rhs)</div><div class="ttdoc">Function that specifies the type of operation involved when segments are combined.</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:274</div></div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_s_g_html_aa7f93971a9f891e0bbb7023081f379d5"><div class="ttname"><a href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#aa7f93971a9f891e0bbb7023081f379d5">range_queries::heavy_light_decomposition::SG::sret_init</a></div><div class="ttdeci">X sret_init</div><div class="ttdoc">inital query return value</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:264</div></div>
|
||||
@@ -374,19 +378,19 @@ template<typename X > </div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00350" name="l00350"></a><span class="lineno"> 350</span> {</div>
|
||||
<div class="line"><a id="l00351" name="l00351"></a><span class="lineno"> 351</span> <span class="keywordtype">int</span> hc_size = -1, hc_id = -1;</div>
|
||||
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno"> 352</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keywordtype">int</span> &v : <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43">Tree<X>::t_adj</a>[u]) {</div>
|
||||
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno"> 353</span> <span class="keywordflow">if</span> (v ^ p) {</div>
|
||||
<div class="line"><a id="l00354" name="l00354"></a><span class="lineno"> 354</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#af64848d6630c39d0f09ce2359cc7c4f8">dfs_hc</a>(v, u);</div>
|
||||
<div class="line"><a id="l00355" name="l00355"></a><span class="lineno"> 355</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ada1494fccbc7f1f07b2f9be9f7e07ad5">Tree<X>::t_size</a>[v] > hc_size) {</div>
|
||||
<div class="line"><a id="l00356" name="l00356"></a><span class="lineno"> 356</span> hc_size = <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ada1494fccbc7f1f07b2f9be9f7e07ad5">Tree<X>::t_size</a>[v];</div>
|
||||
<div class="line"><a id="l00357" name="l00357"></a><span class="lineno"> 357</span> hc_id = v;</div>
|
||||
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno"> 358</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> }</div>
|
||||
<div class="line"><a id="l00361" name="l00361"></a><span class="lineno"> 361</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u] = hc_id;</div>
|
||||
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno"> 362</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 350</span> {</div>
|
||||
<div class="line"><span class="lineno"> 351</span> <span class="keywordtype">int</span> hc_size = -1, hc_id = -1;</div>
|
||||
<div class="line"><span class="lineno"> 352</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keywordtype">int</span> &v : <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43">Tree<X>::t_adj</a>[u]) {</div>
|
||||
<div class="line"><span class="lineno"> 353</span> <span class="keywordflow">if</span> (v ^ p) {</div>
|
||||
<div class="line"><span class="lineno"> 354</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#af64848d6630c39d0f09ce2359cc7c4f8">dfs_hc</a>(v, u);</div>
|
||||
<div class="line"><span class="lineno"> 355</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ada1494fccbc7f1f07b2f9be9f7e07ad5">Tree<X>::t_size</a>[v] > hc_size) {</div>
|
||||
<div class="line"><span class="lineno"> 356</span> hc_size = <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ada1494fccbc7f1f07b2f9be9f7e07ad5">Tree<X>::t_size</a>[v];</div>
|
||||
<div class="line"><span class="lineno"> 357</span> hc_id = v;</div>
|
||||
<div class="line"><span class="lineno"> 358</span> }</div>
|
||||
<div class="line"><span class="lineno"> 359</span> }</div>
|
||||
<div class="line"><span class="lineno"> 360</span> }</div>
|
||||
<div class="line"><span class="lineno"> 361</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u] = hc_id;</div>
|
||||
<div class="line"><span class="lineno"> 362</span> }</div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_html_af64848d6630c39d0f09ce2359cc7c4f8"><div class="ttname"><a href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#af64848d6630c39d0f09ce2359cc7c4f8">range_queries::heavy_light_decomposition::HLD::dfs_hc</a></div><div class="ttdeci">void dfs_hc(int u, int p=-1)</div><div class="ttdoc">Utility function to assign heavy child to each node (-1 for a leaf node)</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:350</div></div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_tree_html_ab1aeaefa1bd97b867c652ba916fbdb43"><div class="ttname"><a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43">range_queries::heavy_light_decomposition::Tree::t_adj</a></div><div class="ttdeci">std::vector< std::list< int > > t_adj</div><div class="ttdoc">an adjacency list to stores the tree edges</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:83</div></div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_tree_html_ada1494fccbc7f1f07b2f9be9f7e07ad5"><div class="ttname"><a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ada1494fccbc7f1f07b2f9be9f7e07ad5">range_queries::heavy_light_decomposition::Tree::t_size</a></div><div class="ttdeci">std::vector< int > t_size</div><div class="ttdoc">a vector to store the subtree size rooted at node</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:89</div></div>
|
||||
@@ -444,17 +448,17 @@ template<typename X > </div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00390" name="l00390"></a><span class="lineno"> 390</span> {</div>
|
||||
<div class="line"><a id="l00391" name="l00391"></a><span class="lineno"> 391</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[u] = <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a722cc7cf2c3e4d15583601a48b09776f">label</a>++;</div>
|
||||
<div class="line"><a id="l00392" name="l00392"></a><span class="lineno"> 392</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u] != -1) {</div>
|
||||
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno"> 393</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a0579062b384e54b611b80c6337c7f2c8">dfs_labels</a>(<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u], u);</div>
|
||||
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno"> 394</span> }</div>
|
||||
<div class="line"><a id="l00395" name="l00395"></a><span class="lineno"> 395</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keywordtype">int</span> &v : <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43">Tree<X>::t_adj</a>[u]) {</div>
|
||||
<div class="line"><a id="l00396" name="l00396"></a><span class="lineno"> 396</span> <span class="keywordflow">if</span> (v ^ p and v ^ <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u]) {</div>
|
||||
<div class="line"><a id="l00397" name="l00397"></a><span class="lineno"> 397</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a0579062b384e54b611b80c6337c7f2c8">dfs_labels</a>(v, u);</div>
|
||||
<div class="line"><a id="l00398" name="l00398"></a><span class="lineno"> 398</span> }</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> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 390</span> {</div>
|
||||
<div class="line"><span class="lineno"> 391</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[u] = <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a722cc7cf2c3e4d15583601a48b09776f">label</a>++;</div>
|
||||
<div class="line"><span class="lineno"> 392</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u] != -1) {</div>
|
||||
<div class="line"><span class="lineno"> 393</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a0579062b384e54b611b80c6337c7f2c8">dfs_labels</a>(<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u], u);</div>
|
||||
<div class="line"><span class="lineno"> 394</span> }</div>
|
||||
<div class="line"><span class="lineno"> 395</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keywordtype">int</span> &v : <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43">Tree<X>::t_adj</a>[u]) {</div>
|
||||
<div class="line"><span class="lineno"> 396</span> <span class="keywordflow">if</span> (v ^ p and v ^ <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u]) {</div>
|
||||
<div class="line"><span class="lineno"> 397</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a0579062b384e54b611b80c6337c7f2c8">dfs_labels</a>(v, u);</div>
|
||||
<div class="line"><span class="lineno"> 398</span> }</div>
|
||||
<div class="line"><span class="lineno"> 399</span> }</div>
|
||||
<div class="line"><span class="lineno"> 400</span> }</div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_html_a0579062b384e54b611b80c6337c7f2c8"><div class="ttname"><a href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a0579062b384e54b611b80c6337c7f2c8">range_queries::heavy_light_decomposition::HLD::dfs_labels</a></div><div class="ttdeci">void dfs_labels(int u, int p=-1)</div><div class="ttdoc">Utility function to lable the nodes so that heavy chains have a contigous lable.</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:390</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -510,17 +514,17 @@ template<typename X > </div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00371" name="l00371"></a><span class="lineno"> 371</span> {</div>
|
||||
<div class="line"><a id="l00372" name="l00372"></a><span class="lineno"> 372</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u] != -1) {</div>
|
||||
<div class="line"><a id="l00373" name="l00373"></a><span class="lineno"> 373</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u]] = <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[u];</div>
|
||||
<div class="line"><a id="l00374" name="l00374"></a><span class="lineno"> 374</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a2dfbda148aad0bfaba2ebfda9ebc915a">dfs_par</a>(<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u], u);</div>
|
||||
<div class="line"><a id="l00375" name="l00375"></a><span class="lineno"> 375</span> }</div>
|
||||
<div class="line"><a id="l00376" name="l00376"></a><span class="lineno"> 376</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keywordtype">int</span> &v : <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43">Tree<X>::t_adj</a>[u]) {</div>
|
||||
<div class="line"><a id="l00377" name="l00377"></a><span class="lineno"> 377</span> <span class="keywordflow">if</span> (v ^ p and v ^ <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u]) {</div>
|
||||
<div class="line"><a id="l00378" name="l00378"></a><span class="lineno"> 378</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a2dfbda148aad0bfaba2ebfda9ebc915a">dfs_par</a>(v, u);</div>
|
||||
<div class="line"><a id="l00379" name="l00379"></a><span class="lineno"> 379</span> }</div>
|
||||
<div class="line"><a id="l00380" name="l00380"></a><span class="lineno"> 380</span> }</div>
|
||||
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno"> 381</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 371</span> {</div>
|
||||
<div class="line"><span class="lineno"> 372</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u] != -1) {</div>
|
||||
<div class="line"><span class="lineno"> 373</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u]] = <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a1b336474d17eff1aa4be73d4068dc725">h_parent</a>[u];</div>
|
||||
<div class="line"><span class="lineno"> 374</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a2dfbda148aad0bfaba2ebfda9ebc915a">dfs_par</a>(<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u], u);</div>
|
||||
<div class="line"><span class="lineno"> 375</span> }</div>
|
||||
<div class="line"><span class="lineno"> 376</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keywordtype">int</span> &v : <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43">Tree<X>::t_adj</a>[u]) {</div>
|
||||
<div class="line"><span class="lineno"> 377</span> <span class="keywordflow">if</span> (v ^ p and v ^ <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a84424f180f12b514eaab57a6aa20b104">h_heavychlid</a>[u]) {</div>
|
||||
<div class="line"><span class="lineno"> 378</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a2dfbda148aad0bfaba2ebfda9ebc915a">dfs_par</a>(v, u);</div>
|
||||
<div class="line"><span class="lineno"> 379</span> }</div>
|
||||
<div class="line"><span class="lineno"> 380</span> }</div>
|
||||
<div class="line"><span class="lineno"> 381</span> }</div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_html_a2dfbda148aad0bfaba2ebfda9ebc915a"><div class="ttname"><a href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a2dfbda148aad0bfaba2ebfda9ebc915a">range_queries::heavy_light_decomposition::HLD::dfs_par</a></div><div class="ttdeci">void dfs_par(int u, int p=-1)</div><div class="ttdoc">Utility function to assign highest parent that can be reached though heavy chains.</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:371</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -558,24 +562,24 @@ template<typename X > </div>
|
||||
|
||||
<p>This function must be called after the tree adjacency list and node values are populated The function initializes the required parametes, and populates the segment tree. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00450" name="l00450"></a><span class="lineno"> 450</span> {</div>
|
||||
<div class="line"><a id="l00451" name="l00451"></a><span class="lineno"> 451</span> <a class="code hl_function" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ad22d760a5a33545a70e7ea5e1786c8dc">Tree<X>::init</a>();</div>
|
||||
<div class="line"><a id="l00452" name="l00452"></a><span class="lineno"> 452</span> </div>
|
||||
<div class="line"><a id="l00453" name="l00453"></a><span class="lineno"> 453</span> <span class="comment">// Fill the heavy child, greatest parent, and labels</span></div>
|
||||
<div class="line"><a id="l00454" name="l00454"></a><span class="lineno"> 454</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a722cc7cf2c3e4d15583601a48b09776f">label</a> = 0;</div>
|
||||
<div class="line"><a id="l00455" name="l00455"></a><span class="lineno"> 455</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#af64848d6630c39d0f09ce2359cc7c4f8">dfs_hc</a>(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">Tree<X>::t_root</a>);</div>
|
||||
<div class="line"><a id="l00456" name="l00456"></a><span class="lineno"> 456</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a2dfbda148aad0bfaba2ebfda9ebc915a">dfs_par</a>(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">Tree<X>::t_root</a>);</div>
|
||||
<div class="line"><a id="l00457" name="l00457"></a><span class="lineno"> 457</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a0579062b384e54b611b80c6337c7f2c8">dfs_labels</a>(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">Tree<X>::t_root</a>);</div>
|
||||
<div class="line"><a id="l00458" name="l00458"></a><span class="lineno"> 458</span> </div>
|
||||
<div class="line"><a id="l00459" name="l00459"></a><span class="lineno"> 459</span> <span class="comment">// Segment Tree Initialization</span></div>
|
||||
<div class="line"><a id="l00460" name="l00460"></a><span class="lineno"> 460</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < Tree<X>::t_nodes; i++) {</div>
|
||||
<div class="line"><a id="l00461" name="l00461"></a><span class="lineno"> 461</span> <a class="code hl_variable" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#afbf8a9cb9449d5ca844f4e141a801e6a">SG<X>::s_tree</a>[<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[i] + <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">Tree<X>::t_nodes</a>] = <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">Tree<X>::t_val</a>[i];</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> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">Tree<X>::t_nodes</a> - 1; i > 0; i--) {</div>
|
||||
<div class="line"><a id="l00464" name="l00464"></a><span class="lineno"> 464</span> <a class="code hl_variable" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#afbf8a9cb9449d5ca844f4e141a801e6a">SG<X>::s_tree</a>[i] =</div>
|
||||
<div class="line"><a id="l00465" name="l00465"></a><span class="lineno"> 465</span> <a class="code hl_function" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a41c733f5f5e262b308f7cb95c88c1e74">SG<X>::combine</a>(<a class="code hl_variable" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#afbf8a9cb9449d5ca844f4e141a801e6a">SG<X>::s_tree</a>[i << 1], <a class="code hl_variable" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#afbf8a9cb9449d5ca844f4e141a801e6a">SG<X>::s_tree</a>[i << 1 | 1]);</div>
|
||||
<div class="line"><a id="l00466" name="l00466"></a><span class="lineno"> 466</span> }</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"> 450</span> {</div>
|
||||
<div class="line"><span class="lineno"> 451</span> <a class="code hl_function" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ad22d760a5a33545a70e7ea5e1786c8dc">Tree<X>::init</a>();</div>
|
||||
<div class="line"><span class="lineno"> 452</span> </div>
|
||||
<div class="line"><span class="lineno"> 453</span> <span class="comment">// Fill the heavy child, greatest parent, and labels</span></div>
|
||||
<div class="line"><span class="lineno"> 454</span> <a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a722cc7cf2c3e4d15583601a48b09776f">label</a> = 0;</div>
|
||||
<div class="line"><span class="lineno"> 455</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#af64848d6630c39d0f09ce2359cc7c4f8">dfs_hc</a>(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">Tree<X>::t_root</a>);</div>
|
||||
<div class="line"><span class="lineno"> 456</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a2dfbda148aad0bfaba2ebfda9ebc915a">dfs_par</a>(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">Tree<X>::t_root</a>);</div>
|
||||
<div class="line"><span class="lineno"> 457</span> <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a0579062b384e54b611b80c6337c7f2c8">dfs_labels</a>(<a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">Tree<X>::t_root</a>);</div>
|
||||
<div class="line"><span class="lineno"> 458</span> </div>
|
||||
<div class="line"><span class="lineno"> 459</span> <span class="comment">// Segment Tree Initialization</span></div>
|
||||
<div class="line"><span class="lineno"> 460</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < Tree<X>::t_nodes; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 461</span> <a class="code hl_variable" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#afbf8a9cb9449d5ca844f4e141a801e6a">SG<X>::s_tree</a>[<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[i] + <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">Tree<X>::t_nodes</a>] = <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">Tree<X>::t_val</a>[i];</div>
|
||||
<div class="line"><span class="lineno"> 462</span> }</div>
|
||||
<div class="line"><span class="lineno"> 463</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae4630fa70a80a1dc65a875488a67178a">Tree<X>::t_nodes</a> - 1; i > 0; i--) {</div>
|
||||
<div class="line"><span class="lineno"> 464</span> <a class="code hl_variable" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#afbf8a9cb9449d5ca844f4e141a801e6a">SG<X>::s_tree</a>[i] =</div>
|
||||
<div class="line"><span class="lineno"> 465</span> <a class="code hl_function" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a41c733f5f5e262b308f7cb95c88c1e74">SG<X>::combine</a>(<a class="code hl_variable" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#afbf8a9cb9449d5ca844f4e141a801e6a">SG<X>::s_tree</a>[i << 1], <a class="code hl_variable" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#afbf8a9cb9449d5ca844f4e141a801e6a">SG<X>::s_tree</a>[i << 1 | 1]);</div>
|
||||
<div class="line"><span class="lineno"> 466</span> }</div>
|
||||
<div class="line"><span class="lineno"> 467</span> }</div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_s_g_html_afbf8a9cb9449d5ca844f4e141a801e6a"><div class="ttname"><a href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#afbf8a9cb9449d5ca844f4e141a801e6a">range_queries::heavy_light_decomposition::SG::s_tree</a></div><div class="ttdeci">std::vector< X > s_tree</div><div class="ttdoc">Everything here is private, and can only be accessed through the methods, in the derived class (HLD)</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:262</div></div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_tree_html_a135b7952593c9b1aae38fcaf1cc1abf7"><div class="ttname"><a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">range_queries::heavy_light_decomposition::Tree::t_val</a></div><div class="ttdeci">std::vector< X > t_val</div><div class="ttdoc">values of nodes</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:92</div></div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_tree_html_aa6c37e840355b9fb2105181c578694e8"><div class="ttname"><a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#aa6c37e840355b9fb2105181c578694e8">range_queries::heavy_light_decomposition::Tree::t_root</a></div><div class="ttdeci">int t_root</div><div class="ttdoc">the root of the tree</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:91</div></div>
|
||||
@@ -601,7 +605,7 @@ template<typename X > </div>
|
||||
<td class="mlabels-left">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">X <a class="el" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html">range_queries::heavy_light_decomposition::HLD</a>< X >::<a class="el" href="../../dd/d1b/structquery.html">query</a> </td>
|
||||
<td class="memname">X <a class="el" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html">range_queries::heavy_light_decomposition::HLD</a>< X ><a class="el" href="../../dd/d1b/structquery.html">::query</a> </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>a</em>, </td>
|
||||
@@ -634,14 +638,14 @@ template<typename X > </div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>the sum of node values in the simple path from a to b </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00489" name="l00489"></a><span class="lineno"> 489</span> {</div>
|
||||
<div class="line"><a id="l00490" name="l00490"></a><span class="lineno"> 490</span> <span class="keywordtype">int</span> lc = <a class="code hl_function" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae2b407e64aaf9878fbee7ee6efe9c7d4">Tree<X>::lca</a>(a, b);</div>
|
||||
<div class="line"><a id="l00491" name="l00491"></a><span class="lineno"> 491</span> X ret = <a class="code hl_variable" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#aa7f93971a9f891e0bbb7023081f379d5">SG<X>::sret_init</a>;</div>
|
||||
<div class="line"><a id="l00492" name="l00492"></a><span class="lineno"> 492</span> assert(lc != -1);</div>
|
||||
<div class="line"><a id="l00493" name="l00493"></a><span class="lineno"> 493</span> ret += <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a7d5b40c076347a6aabfb37a0590f2f24">chain_query</a>(a, lc);</div>
|
||||
<div class="line"><a id="l00494" name="l00494"></a><span class="lineno"> 494</span> ret += <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a7d5b40c076347a6aabfb37a0590f2f24">chain_query</a>(b, lc);</div>
|
||||
<div class="line"><a id="l00495" name="l00495"></a><span class="lineno"> 495</span> <span class="keywordflow">return</span> ret - <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">Tree<X>::t_val</a>[lc];</div>
|
||||
<div class="line"><a id="l00496" name="l00496"></a><span class="lineno"> 496</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 489</span> {</div>
|
||||
<div class="line"><span class="lineno"> 490</span> <span class="keywordtype">int</span> lc = <a class="code hl_function" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae2b407e64aaf9878fbee7ee6efe9c7d4">Tree<X>::lca</a>(a, b);</div>
|
||||
<div class="line"><span class="lineno"> 491</span> X ret = <a class="code hl_variable" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#aa7f93971a9f891e0bbb7023081f379d5">SG<X>::sret_init</a>;</div>
|
||||
<div class="line"><span class="lineno"> 492</span> assert(lc != -1);</div>
|
||||
<div class="line"><span class="lineno"> 493</span> ret += <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a7d5b40c076347a6aabfb37a0590f2f24">chain_query</a>(a, lc);</div>
|
||||
<div class="line"><span class="lineno"> 494</span> ret += <a class="code hl_function" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a7d5b40c076347a6aabfb37a0590f2f24">chain_query</a>(b, lc);</div>
|
||||
<div class="line"><span class="lineno"> 495</span> <span class="keywordflow">return</span> ret - <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">Tree<X>::t_val</a>[lc];</div>
|
||||
<div class="line"><span class="lineno"> 496</span> }</div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_html_a7d5b40c076347a6aabfb37a0590f2f24"><div class="ttname"><a href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a7d5b40c076347a6aabfb37a0590f2f24">range_queries::heavy_light_decomposition::HLD::chain_query</a></div><div class="ttdeci">X chain_query(int a, int b)</div><div class="ttdoc">Utility function to break down a path query into two chain queries.</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:409</div></div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_tree_html_ae2b407e64aaf9878fbee7ee6efe9c7d4"><div class="ttname"><a href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae2b407e64aaf9878fbee7ee6efe9c7d4">range_queries::heavy_light_decomposition::Tree::lca</a></div><div class="ttdeci">int lca(int a, int b)</div><div class="ttdoc">The function returns the least common ancestor of two nodes.</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:229</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
@@ -698,11 +702,11 @@ template<typename X > </div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00475" name="l00475"></a><span class="lineno"> 475</span> {</div>
|
||||
<div class="line"><a id="l00476" name="l00476"></a><span class="lineno"> 476</span> X diff = val - <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">Tree<X>::t_val</a>[<a class="code hl_typedef" href="../../d1/df3/hash__search_8cpp.html#a8ca8dcb494104d273679e219e53d0555">node</a>];</div>
|
||||
<div class="line"><a id="l00477" name="l00477"></a><span class="lineno"> 477</span> <a class="code hl_function" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a3c75bf5770790f8eba8cc92227b5400c">SG<X>::update</a>(<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>], diff);</div>
|
||||
<div class="line"><a id="l00478" name="l00478"></a><span class="lineno"> 478</span> <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">Tree<X>::t_val</a>[<a class="code hl_typedef" href="../../d1/df3/hash__search_8cpp.html#a8ca8dcb494104d273679e219e53d0555">node</a>] = val;</div>
|
||||
<div class="line"><a id="l00479" name="l00479"></a><span class="lineno"> 479</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 475</span> {</div>
|
||||
<div class="line"><span class="lineno"> 476</span> X diff = val - <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">Tree<X>::t_val</a>[<a class="code hl_typedef" href="../../d1/df3/hash__search_8cpp.html#a8ca8dcb494104d273679e219e53d0555">node</a>];</div>
|
||||
<div class="line"><span class="lineno"> 477</span> <a class="code hl_function" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a3c75bf5770790f8eba8cc92227b5400c">SG<X>::update</a>(<a class="code hl_variable" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#aa86a91ae0cd7898990a8170a2f2c9cda">h_label</a>[<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>], diff);</div>
|
||||
<div class="line"><span class="lineno"> 478</span> <a class="code hl_variable" href="../../d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a135b7952593c9b1aae38fcaf1cc1abf7">Tree<X>::t_val</a>[<a class="code hl_typedef" href="../../d1/df3/hash__search_8cpp.html#a8ca8dcb494104d273679e219e53d0555">node</a>] = val;</div>
|
||||
<div class="line"><span class="lineno"> 479</span> }</div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_s_g_html_a3c75bf5770790f8eba8cc92227b5400c"><div class="ttname"><a href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a3c75bf5770790f8eba8cc92227b5400c">range_queries::heavy_light_decomposition::SG::update</a></div><div class="ttdeci">void update(int p, X v)</div><div class="ttdoc">Update the value at a node.</div><div class="ttdef"><b>Definition:</b> heavy_light_decomposition.cpp:293</div></div>
|
||||
<div class="ttc" id="ahash__search_8cpp_html_a8ca8dcb494104d273679e219e53d0555"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a8ca8dcb494104d273679e219e53d0555">node</a></div><div class="ttdeci">struct list node</div></div>
|
||||
<div class="ttc" id="astructnode_html"><div class="ttname"><a href="../../d5/da1/structnode.html">node</a></div><div class="ttdef"><b>Definition:</b> avltree.cpp:13</div></div>
|
||||
@@ -724,7 +728,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="../../dd/d69/namespacerange__queries.html">range_queries</a></li><li class="navelem"><b>heavy_light_decomposition</b></li><li class="navelem"><a class="el" href="../../d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html">HLD</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,6 +3,6 @@
|
||||
<area shape="rect" id="node2" href="$d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html#a7d5b40c076347a6aabfb37a0590f2f24" title="Utility function to break down a path query into two chain queries." alt="" coords="200,63,347,119"/>
|
||||
<area shape="rect" id="node5" href="$d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae2b407e64aaf9878fbee7ee6efe9c7d4" title="The function returns the least common ancestor of two nodes." alt="" coords="200,143,347,199"/>
|
||||
<area shape="rect" id="node3" href="$d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a41c733f5f5e262b308f7cb95c88c1e74" title="Function that specifies the type of operation involved when segments are combined." alt="" coords="395,5,541,61"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap.html#" title=" " alt="" coords="429,85,507,112"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap#" title=" " alt="" coords="429,85,507,112"/>
|
||||
<area shape="rect" id="node6" href="$d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ac7761255f2ba06b398b9aae5e4dce5f3" title="The function lifts a node, k units up the tree. The lifting is done in place, and the result is store..." alt="" coords="395,143,541,199"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
9eb1b8f566ba7296adde69481e80634e
|
||||
bf48e762037931ebccb6a0b33e80d640
|
||||
@@ -74,7 +74,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/algorithm/swap.html#" xlink:title=" ">
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="317.5,-65.5 317.5,-84.5 376.5,-84.5 376.5,-65.5 317.5,-65.5"/>
|
||||
<text text-anchor="middle" x="347" y="-72.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
@@ -1,5 +1,5 @@
|
||||
<map id="range_queries::heavy_light_decomposition::HLD::chain_query" name="range_queries::heavy_light_decomposition::HLD::chain_query">
|
||||
<area shape="rect" id="node1" title="Utility function to break down a path query into two chain queries." alt="" coords="5,39,152,95"/>
|
||||
<area shape="rect" id="node2" href="$d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html#a41c733f5f5e262b308f7cb95c88c1e74" title="Function that specifies the type of operation involved when segments are combined." alt="" coords="200,5,347,61"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap.html#" title=" " alt="" coords="234,85,313,112"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap#" title=" " alt="" coords="234,85,313,112"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
54cc5e12cc180e9cff3739e3cfb42a20
|
||||
4ba45c564a92dca15a1b43b03e1364a9
|
||||
@@ -40,7 +40,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/algorithm/swap.html#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="171.5,-0.5 171.5,-19.5 230.5,-19.5 230.5,-0.5 171.5,-0.5"/>
|
||||
<text text-anchor="middle" x="201" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
@@ -1,4 +1,5 @@
|
||||
<map id="probability::windowed_median::WindowedMedian" name="probability::windowed_median::WindowedMedian">
|
||||
<area shape="rect" id="node1" title="A class to calculate the median of a leading sliding window at the back of a stream of integer values..." alt="" coords="5,95,188,136"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/list.html" title=" " alt="" coords="45,5,148,32"/>
|
||||
<area shape="rect" id="node1" title="A class to calculate the median of a leading sliding window at the back of a stream of integer values..." alt="" coords="36,109,219,151"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/list" title=" " alt="" coords="5,5,108,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" title=" " alt="" coords="132,5,264,32"/>
|
||||
</map>
|
||||
|
||||