Documentation for c26eea874d
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/factorial.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -215,7 +215,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -242,7 +242,7 @@ Functions</h2></td></tr>
|
||||
<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="../../d9/d00/factorial_8cpp.html">factorial.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var factorial_8cpp =
|
||||
[
|
||||
[ "factorial", "d9/d00/factorial_8cpp.html#a7e78996673df791014cfe540b183456a", null ],
|
||||
[ "math::factorial", "dd/d47/namespacemath.html#a7e78996673df791014cfe540b183456a", null ],
|
||||
[ "main", "d9/d00/factorial_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "tests", "d9/d00/factorial_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/factorial.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,12 +124,13 @@ $(function(){initNavTree('d9/d00/factorial_8cpp_source.html','../../'); initResi
|
||||
<div class="headertitle"><div class="title">factorial.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d9/d00/factorial_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d9/d00/factorial_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <cstdint></span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../dd/d47/namespacemath.html">math</a> {</div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span></div>
|
||||
<div class="foldopen" id="foldopen00029" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="../../dd/d47/namespacemath.html#a7e78996673df791014cfe540b183456a"> 29</a></span>uint64_t <a class="code hl_function" href="../../dd/d47/namespacemath.html#a7e78996673df791014cfe540b183456a">factorial</a>(uint8_t n) {</div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keywordflow">if</span> (n > 20) {</div>
|
||||
@@ -142,7 +143,7 @@ $(function(){initNavTree('d9/d00/factorial_8cpp_source.html','../../'); initResi
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span>} <span class="comment">// namespace math</span></div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span></div>
|
||||
<div class="foldopen" id="foldopen00044" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="../../d9/d00/factorial_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e"> 44</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d00/factorial_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>() {</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> assert(<a class="code hl_function" href="../../dd/d47/namespacemath.html#a7e78996673df791014cfe540b183456a">math::factorial</a>(1) == 1);</div>
|
||||
@@ -153,7 +154,7 @@ $(function(){initNavTree('d9/d00/factorial_8cpp_source.html','../../'); initResi
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> std::cout << <span class="stringliteral">"All tests have passed successfully!\n"</span>;</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span></div>
|
||||
<div class="foldopen" id="foldopen00057" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="../../d9/d00/factorial_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 57</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d00/factorial_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <a class="code hl_function" href="../../d9/d00/factorial_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -170,7 +171,7 @@ $(function(){initNavTree('d9/d00/factorial_8cpp_source.html','../../'); initResi
|
||||
<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="../../d9/d00/factorial_8cpp.html">factorial.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: search/linear_search.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -296,7 +296,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -337,7 +337,7 @@ Functions</h2></td></tr>
|
||||
<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="../../d9/d02/linear__search_8cpp.html">linear_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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: search/linear_search.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,10 +124,11 @@ $(function(){initNavTree('d9/d02/linear__search_8cpp_source.html','../../'); ini
|
||||
<div class="headertitle"><div class="title">linear_search.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d9/d02/linear__search_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d9/d02/linear__search_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> </div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span></div>
|
||||
<div class="foldopen" id="foldopen00021" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="../../d9/d02/linear__search_8cpp.html#a84ac3988a534eb60ca351ed6caf56d84"> 21</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d02/linear__search_8cpp.html#a84ac3988a534eb60ca351ed6caf56d84">LinearSearch</a>(<span class="keywordtype">int</span> *array, <span class="keywordtype">int</span> size, <span class="keywordtype">int</span> key) {</div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < size; ++i) {</div>
|
||||
@@ -141,7 +142,7 @@ $(function(){initNavTree('d9/d02/linear__search_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keywordflow">return</span> -1;</div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span></div>
|
||||
<div class="foldopen" id="foldopen00037" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="../../d9/d02/linear__search_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e"> 37</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d02/linear__search_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>() {</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keywordtype">int</span> size = 4;</div>
|
||||
@@ -167,7 +168,7 @@ $(function(){initNavTree('d9/d02/linear__search_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keyword">delete</span>[] array; <span class="comment">// free memory up</span></div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> </div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span></div>
|
||||
<div class="foldopen" id="foldopen00065" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="../../d9/d02/linear__search_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 65</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d02/linear__search_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordtype">int</span> mode = 0;</div>
|
||||
@@ -221,7 +222,7 @@ $(function(){initNavTree('d9/d02/linear__search_8cpp_source.html','../../'); ini
|
||||
<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="../../d9/d02/linear__search_8cpp.html">linear_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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: string_search Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -386,7 +386,7 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 54</span> <span class="keywordflow">if</span> (pattern.empty()) {</div>
|
||||
<div class="line"><span class="lineno"> 55</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 56</span> }</div>
|
||||
<div class="line"><span class="lineno"> 57</span> std::vector<size_t> failure = getFailureArray(pattern);</div>
|
||||
<div class="line"><span class="lineno"> 57</span> std::vector<size_t> failure = <a class="code hl_function" href="#a83c72ff237cdf623e42d4295e0029bf9">getFailureArray</a>(pattern);</div>
|
||||
<div class="line"><span class="lineno"> 58</span> <span class="keywordtype">size_t</span> text_length = text.size();</div>
|
||||
<div class="line"><span class="lineno"> 59</span> <span class="keywordtype">size_t</span> pattern_length = pattern.size();</div>
|
||||
<div class="line"><span class="lineno"> 60</span> <span class="keywordtype">size_t</span> k = 0;</div>
|
||||
@@ -401,6 +401,7 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 69</span> <span class="keywordflow">return</span> std::string::npos;</div>
|
||||
<div class="line"><span class="lineno"> 70</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> <a href="../../d4/d18/composite__simpson__rule_8cpp_source.html#l00117">composite_simpson_rule.cpp:117</a></div></div>
|
||||
<div class="ttc" id="anamespacestring__search_html_a83c72ff237cdf623e42d4295e0029bf9"><div class="ttname"><a href="#a83c72ff237cdf623e42d4295e0029bf9">string_search::getFailureArray</a></div><div class="ttdeci">std::vector< size_t > getFailureArray(const std::string &pattern)</div><div class="ttdoc">Generate the partial match table aka failure function for a pattern to search.</div><div class="ttdef"><b>Definition</b> <a href="../../de/d6a/knuth__morris__pratt_8cpp_source.html#l00032">knuth_morris_pratt.cpp:32</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -445,13 +446,14 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 91</span> }</div>
|
||||
<div class="line"><span class="lineno"> 92</span> <span class="keywordflow">if</span> (i < str.size() - pat.size()) {</div>
|
||||
<div class="line"><span class="lineno"> 93</span> str_hash =</div>
|
||||
<div class="line"><span class="lineno"> 94</span> recalculate_hash(str, i, i + pat.size(), str_hash, pat.size());</div>
|
||||
<div class="line"><span class="lineno"> 94</span> <a class="code hl_function" href="#aed769d565b705a9b3e0eb1ec74088893">recalculate_hash</a>(str, i, i + pat.size(), str_hash, pat.size());</div>
|
||||
<div class="line"><span class="lineno"> 95</span> }</div>
|
||||
<div class="line"><span class="lineno"> 96</span> }</div>
|
||||
<div class="line"><span class="lineno"> 97</span> <span class="keywordflow">return</span> -1; <span class="comment">// return -1 if given pattern not found</span></div>
|
||||
<div class="line"><span class="lineno"> 98</span>}</div>
|
||||
<div class="ttc" id="anamespacestring__search_html_a8fb0bc932ba8b582c9f4c71338d050f8"><div class="ttname"><a href="#a8fb0bc932ba8b582c9f4c71338d050f8">string_search::create_hash</a></div><div class="ttdeci">int64_t create_hash(const std::string &s, int n)</div><div class="ttdef"><b>Definition</b> <a href="../../d6/dce/rabin__karp_8cpp_source.html#l00025">rabin_karp.cpp:25</a></div></div>
|
||||
<div class="ttc" id="anamespacestring__search_html_aebe07cea289a13142503d98be7df11fd"><div class="ttname"><a href="#aebe07cea289a13142503d98be7df11fd">string_search::check_if_equal</a></div><div class="ttdeci">bool check_if_equal(const std::string &str1, const std::string &str2, int start1, int end1, int start2, int end2)</div><div class="ttdef"><b>Definition</b> <a href="../../d6/dce/rabin__karp_8cpp_source.html#l00060">rabin_karp.cpp:60</a></div></div>
|
||||
<div class="ttc" id="anamespacestring__search_html_aed769d565b705a9b3e0eb1ec74088893"><div class="ttname"><a href="#aed769d565b705a9b3e0eb1ec74088893">string_search::recalculate_hash</a></div><div class="ttdeci">int64_t recalculate_hash(const std::string &s, int old_index, int new_index, int64_t old_hash, int patLength)</div><div class="ttdef"><b>Definition</b> <a href="../../d6/dce/rabin__karp_8cpp_source.html#l00042">rabin_karp.cpp:42</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -516,7 +518,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d9/d03/namespacestring__search.html">string_search</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: numerical_methods/brent_method_extrema.cpp Pages: 1 -->
|
||||
<svg width="386pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: numerical_methods/brent_method_extrema.cpp Pages: 1 -->
|
||||
<svg width="386pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: backtracking/n_queens_all_solution_optimised.cpp Pages: 1 -->
|
||||
<svg width="144pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: backtracking/n_queens_all_solution_optimised.cpp Pages: 1 -->
|
||||
<svg width="144pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: others::iterative_tree_traversals::BinaryTree Class Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -178,15 +178,13 @@ Public Member Functions</h2></td></tr>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d8/d90/iterative__tree__traversals_8cpp_source.html#l00088">88</a> of file <a class="el" href="../../d8/d90/iterative__tree__traversals_8cpp_source.html">iterative_tree_traversals.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 88</span> {</div>
|
||||
<div class="line"><span class="lineno"> 89</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *<a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = <span class="keyword">new</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a>();</div>
|
||||
<div class="line"><span class="lineno"> 90</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->data = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>;</div>
|
||||
<div class="line"><span class="lineno"> 91</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->left = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->right = <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><span class="lineno"> 89</span> Node *<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> = <span class="keyword">new</span> Node();</div>
|
||||
<div class="line"><span class="lineno"> 90</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->data = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>;</div>
|
||||
<div class="line"><span class="lineno"> 91</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->left = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->right = <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><span class="lineno"> 92</span> <span class="keywordflow">return</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
|
||||
<div class="line"><span class="lineno"> 93</span>}</div>
|
||||
<div class="ttc" id="aavltree_8cpp_html_a74f0cf18a0e5b832d9994e2f2d022287"><div class="ttname"><a href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a></div><div class="ttdeci">struct node { int data; int height; struct node *left; struct node *right;} node</div><div class="ttdoc">for std::queue</div><div class="ttdef"><b>Definition</b> <a href="../../d8/dee/avltree_8cpp_source.html#l00013">avltree.cpp:13</a></div></div>
|
||||
<div class="ttc" id="ahash__search_8cpp_html_a6e1a77282bc65ad359d753d25df23243"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a></div><div class="ttdeci">int data[MAX]</div><div class="ttdoc">test data</div><div class="ttdef"><b>Definition</b> <a href="../../d1/df3/hash__search_8cpp_source.html#l00024">hash_search.cpp:24</a></div></div>
|
||||
<div class="ttc" id="astruct_node_html"><div class="ttname"><a href="../../db/d8b/struct_node.html">Node</a></div><div class="ttdef"><b>Definition</b> <a href="../../d3/dce/linkedlist__implentation__usingarray_8cpp_source.html#l00014">linkedlist_implentation_usingarray.cpp:14</a></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> <a href="../../d3/d26/binary__search__tree_8cpp_source.html#l00011">binary_search_tree.cpp:11</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -223,24 +221,20 @@ Public Member Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 166</span> <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>; </div>
|
||||
<div class="line"><span class="lineno"> 167</span> std::vector<int64_t> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>; </div>
|
||||
<div class="line"><span class="lineno"> 168</span> </div>
|
||||
<div class="line"><span class="lineno"> 169</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *current = root;</div>
|
||||
<div class="line"><span class="lineno"> 169</span> Node *current = root;</div>
|
||||
<div class="line"><span class="lineno"> 170</span> </div>
|
||||
<div class="line"><span class="lineno"> 171</span> <span class="keywordflow">while</span> (!<a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.empty() || current) {</div>
|
||||
<div class="line"><span class="lineno"> 171</span> <span class="keywordflow">while</span> (!<a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.empty() || current) {</div>
|
||||
<div class="line"><span class="lineno"> 172</span> <span class="keywordflow">while</span> (current) {</div>
|
||||
<div class="line"><span class="lineno"> 173</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d">push</a>(current);</div>
|
||||
<div class="line"><span class="lineno"> 173</span> <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.push(current);</div>
|
||||
<div class="line"><span class="lineno"> 174</span> current = current->left;</div>
|
||||
<div class="line"><span class="lineno"> 175</span> }</div>
|
||||
<div class="line"><span class="lineno"> 176</span> current = <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>();</div>
|
||||
<div class="line"><span class="lineno"> 177</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">pop</a>();</div>
|
||||
<div class="line"><span class="lineno"> 176</span> current = <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.top();</div>
|
||||
<div class="line"><span class="lineno"> 177</span> <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.pop();</div>
|
||||
<div class="line"><span class="lineno"> 178</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>.push_back(current->data);</div>
|
||||
<div class="line"><span class="lineno"> 179</span> current = current->right;</div>
|
||||
<div class="line"><span class="lineno"> 180</span> }</div>
|
||||
<div class="line"><span class="lineno"> 181</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"> 182</span>}</div>
|
||||
<div class="ttc" id="aclassstack_html"><div class="ttname"><a href="../../d1/dc2/classstack.html">stack</a></div><div class="ttdoc">for std::invalid_argument</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/stack_8hpp_source.html#l00019">stack.hpp:19</a></div></div>
|
||||
<div class="ttc" id="aclassstack_html_a3647fb4418890f19e0dc414b8092b8b0"><div class="ttname"><a href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">stack::pop</a></div><div class="ttdeci">void pop()</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/stack_8hpp_source.html#l00062">stack.hpp:62</a></div></div>
|
||||
<div class="ttc" id="aclassstack_html_a90df277532c23519aa7ac3c08ed90a1d"><div class="ttname"><a href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d">stack::push</a></div><div class="ttdeci">void push(const value_type &item)</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/stack_8hpp_source.html#l00047">stack.hpp:47</a></div></div>
|
||||
<div class="ttc" id="aclassstack_html_ae09630c4384903d187801921b2ddc709"><div class="ttname"><a href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">stack::top</a></div><div class="ttdeci">value_type top() const</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/stack_8hpp_source.html#l00056">stack.hpp:56</a></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> <a href="../../de/dc3/fibonacci__sum_8cpp_source.html#l00077">fibonacci_sum.cpp:77</a></div></div>
|
||||
<div class="ttc" id="aparanthesis__matching_8cpp_html_aa37d24a036d239b3b528f13b9de880c7"><div class="ttname"><a href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a></div><div class="ttdeci">char stack[MAX]</div><div class="ttdef"><b>Definition</b> <a href="../../dc/dc5/paranthesis__matching_8cpp_source.html#l00020">paranthesis_matching.cpp:20</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
@@ -279,18 +273,18 @@ Public Member Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 134</span> <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>; </div>
|
||||
<div class="line"><span class="lineno"> 135</span> std::vector<int64_t> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>; </div>
|
||||
<div class="line"><span class="lineno"> 136</span> </div>
|
||||
<div class="line"><span class="lineno"> 137</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d">push</a>(root);</div>
|
||||
<div class="line"><span class="lineno"> 137</span> <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.push(root);</div>
|
||||
<div class="line"><span class="lineno"> 138</span> </div>
|
||||
<div class="line"><span class="lineno"> 139</span> <span class="keywordflow">while</span> (!<a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.empty()) {</div>
|
||||
<div class="line"><span class="lineno"> 140</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>.push_back(<a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>()->data);</div>
|
||||
<div class="line"><span class="lineno"> 141</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *current = <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>();</div>
|
||||
<div class="line"><span class="lineno"> 142</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">pop</a>();</div>
|
||||
<div class="line"><span class="lineno"> 139</span> <span class="keywordflow">while</span> (!<a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.empty()) {</div>
|
||||
<div class="line"><span class="lineno"> 140</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>.push_back(<a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.top()->data);</div>
|
||||
<div class="line"><span class="lineno"> 141</span> Node *current = <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.top();</div>
|
||||
<div class="line"><span class="lineno"> 142</span> <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.pop();</div>
|
||||
<div class="line"><span class="lineno"> 143</span> </div>
|
||||
<div class="line"><span class="lineno"> 144</span> <span class="keywordflow">if</span> (current->left) {</div>
|
||||
<div class="line"><span class="lineno"> 145</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d">push</a>(current->left);</div>
|
||||
<div class="line"><span class="lineno"> 145</span> <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.push(current->left);</div>
|
||||
<div class="line"><span class="lineno"> 146</span> }</div>
|
||||
<div class="line"><span class="lineno"> 147</span> <span class="keywordflow">if</span> (current->right) {</div>
|
||||
<div class="line"><span class="lineno"> 148</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d">push</a>(current->right);</div>
|
||||
<div class="line"><span class="lineno"> 148</span> <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.push(current->right);</div>
|
||||
<div class="line"><span class="lineno"> 149</span> }</div>
|
||||
<div class="line"><span class="lineno"> 150</span> }</div>
|
||||
<div class="line"><span class="lineno"> 151</span> </div>
|
||||
@@ -334,18 +328,18 @@ Public Member Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 104</span> <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>; </div>
|
||||
<div class="line"><span class="lineno"> 105</span> std::vector<int64_t> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>; </div>
|
||||
<div class="line"><span class="lineno"> 106</span> </div>
|
||||
<div class="line"><span class="lineno"> 107</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d">push</a>(root);</div>
|
||||
<div class="line"><span class="lineno"> 107</span> <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.push(root);</div>
|
||||
<div class="line"><span class="lineno"> 108</span> </div>
|
||||
<div class="line"><span class="lineno"> 109</span> <span class="keywordflow">while</span> (!<a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.empty()) {</div>
|
||||
<div class="line"><span class="lineno"> 110</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>.push_back(<a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>()->data);</div>
|
||||
<div class="line"><span class="lineno"> 111</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *current = <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>();</div>
|
||||
<div class="line"><span class="lineno"> 112</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">pop</a>();</div>
|
||||
<div class="line"><span class="lineno"> 109</span> <span class="keywordflow">while</span> (!<a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.empty()) {</div>
|
||||
<div class="line"><span class="lineno"> 110</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>.push_back(<a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.top()->data);</div>
|
||||
<div class="line"><span class="lineno"> 111</span> Node *current = <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.top();</div>
|
||||
<div class="line"><span class="lineno"> 112</span> <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.pop();</div>
|
||||
<div class="line"><span class="lineno"> 113</span> </div>
|
||||
<div class="line"><span class="lineno"> 114</span> <span class="keywordflow">if</span> (current->right) {</div>
|
||||
<div class="line"><span class="lineno"> 115</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d">push</a>(current->right);</div>
|
||||
<div class="line"><span class="lineno"> 115</span> <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.push(current->right);</div>
|
||||
<div class="line"><span class="lineno"> 116</span> }</div>
|
||||
<div class="line"><span class="lineno"> 117</span> <span class="keywordflow">if</span> (current->left) {</div>
|
||||
<div class="line"><span class="lineno"> 118</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d">push</a>(current->left);</div>
|
||||
<div class="line"><span class="lineno"> 118</span> <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.push(current->left);</div>
|
||||
<div class="line"><span class="lineno"> 119</span> }</div>
|
||||
<div class="line"><span class="lineno"> 120</span> }</div>
|
||||
<div class="line"><span class="lineno"> 121</span> </div>
|
||||
@@ -363,7 +357,7 @@ Public Member Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d0/d6f/namespaceothers.html">others</a></li><li class="navelem"><b>iterative_tree_traversals</b></li><li class="navelem"><a class="el" href="../../d9/d12/classothers_1_1iterative__tree__traversals_1_1_binary_tree.html">BinaryTree</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: inversion Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d9/d13/namespaceinversion.html','../../'); initResizab
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d9/d13/namespaceinversion.html">inversion</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: operations_on_datastructures/array_left_rotation.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -179,6 +179,12 @@ Functions</h2></td></tr>
|
||||
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4" id="r_ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
|
||||
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft"> </td><td class="mdescRight">main function <br /></td></tr>
|
||||
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a6109193567a5b7e36a27f2b4865fce20" id="r_a6109193567a5b7e36a27f2b4865fce20"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/df4/namespacetests.html#a6109193567a5b7e36a27f2b4865fce20">tests::print</a> (const std::vector< int32_t > &array)</td></tr>
|
||||
<tr class="memdesc:a6109193567a5b7e36a27f2b4865fce20"><td class="mdescLeft"> </td><td class="mdescRight">Prints the values of a vector sequentially, ending with a newline character. <br /></td></tr>
|
||||
<tr class="separator:a6109193567a5b7e36a27f2b4865fce20"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:afce39cf843989a39811a49ebe29dd6d8" id="r_afce39cf843989a39811a49ebe29dd6d8"><td class="memItemLeft" align="right" valign="top">std::vector< int32_t > </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/df4/namespacetests.html#afce39cf843989a39811a49ebe29dd6d8">tests::shift_left</a> (const std::vector< int32_t > &array, size_t shift)</td></tr>
|
||||
<tr class="memdesc:afce39cf843989a39811a49ebe29dd6d8"><td class="mdescLeft"> </td><td class="mdescRight">Shifts the given vector to the left by the shift amount and returns a new vector with the result. The original vector is not mutated. <br /></td></tr>
|
||||
<tr class="separator:afce39cf843989a39811a49ebe29dd6d8"><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 for the <a href="https://www.javatpoint.com/program-to-left-rotate-the-elements-of-an-array" target="_blank">Array Left Rotation</a> algorithm. </p>
|
||||
@@ -231,7 +237,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -261,7 +267,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_35422be6552f1b3672c1b6c4aba2da64.html">operations_on_datastructures</a></li><li class="navelem"><a class="el" href="../../d9/d14/array__left__rotation_8cpp.html">array_left_rotation.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
var array__left__rotation_8cpp =
|
||||
[
|
||||
[ "main", "d9/d14/array__left__rotation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "print", "d9/d14/array__left__rotation_8cpp.html#a6109193567a5b7e36a27f2b4865fce20", null ],
|
||||
[ "shift_left", "d9/d14/array__left__rotation_8cpp.html#afce39cf843989a39811a49ebe29dd6d8", null ],
|
||||
[ "operations_on_datastructures::print", "da/d6d/namespaceoperations__on__datastructures.html#a6109193567a5b7e36a27f2b4865fce20", null ],
|
||||
[ "tests::print", "d9/df4/namespacetests.html#a6109193567a5b7e36a27f2b4865fce20", null ],
|
||||
[ "operations_on_datastructures::shift_left", "da/d6d/namespaceoperations__on__datastructures.html#afce39cf843989a39811a49ebe29dd6d8", null ],
|
||||
[ "tests::shift_left", "d9/df4/namespacetests.html#afce39cf843989a39811a49ebe29dd6d8", null ],
|
||||
[ "test", "d9/d14/array__left__rotation_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ],
|
||||
[ "test1", "d9/d14/array__left__rotation_8cpp.html#a167c24bd817469ae47358d12e034f2d5", null ],
|
||||
[ "test2", "d9/d14/array__left__rotation_8cpp.html#abdd77344d4af8fd56d14a5cabbf2f669", null ],
|
||||
[ "test3", "d9/d14/array__left__rotation_8cpp.html#aa515639572647508b94986489aab6d76", null ],
|
||||
[ "test4", "d9/d14/array__left__rotation_8cpp.html#a2b9769e44683dcb67fe1083ad91e134d", null ],
|
||||
[ "test5", "d9/d14/array__left__rotation_8cpp.html#af7b81d7a1534216af6a36a80135beb86", null ]
|
||||
[ "tests::test1", "d9/df4/namespacetests.html#a167c24bd817469ae47358d12e034f2d5", null ],
|
||||
[ "tests::test2", "d9/df4/namespacetests.html#abdd77344d4af8fd56d14a5cabbf2f669", null ],
|
||||
[ "tests::test3", "d9/df4/namespacetests.html#aa515639572647508b94986489aab6d76", null ],
|
||||
[ "tests::test4", "d9/df4/namespacetests.html#a2b9769e44683dcb67fe1083ad91e134d", null ],
|
||||
[ "tests::test5", "d9/df4/namespacetests.html#af7b81d7a1534216af6a36a80135beb86", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: operations_on_datastructures/array_left_rotation.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,13 +124,14 @@ $(function(){initNavTree('d9/d14/array__left__rotation_8cpp_source.html','../../
|
||||
<div class="headertitle"><div class="title">array_left_rotation.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d9/d14/array__left__rotation_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d9/d14/array__left__rotation_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<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="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <vector></span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../da/d6d/namespaceoperations__on__datastructures.html">operations_on_datastructures</a> {</div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span></div>
|
||||
<div class="foldopen" id="foldopen00029" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="../../da/d6d/namespaceoperations__on__datastructures.html#a6109193567a5b7e36a27f2b4865fce20"> 29</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../da/d6d/namespaceoperations__on__datastructures.html#a6109193567a5b7e36a27f2b4865fce20">print</a>(<span class="keyword">const</span> std::vector<int32_t> &array) {</div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keywordflow">for</span> (int32_t i : array) {</div>
|
||||
@@ -139,7 +140,7 @@ $(function(){initNavTree('d9/d14/array__left__rotation_8cpp_source.html','../../
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> std::cout << <span class="stringliteral">"\n"</span>; </div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span></div>
|
||||
<div class="foldopen" id="foldopen00046" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="../../da/d6d/namespaceoperations__on__datastructures.html#afce39cf843989a39811a49ebe29dd6d8"> 46</a></span>std::vector<int32_t> <a class="code hl_function" href="../../da/d6d/namespaceoperations__on__datastructures.html#afce39cf843989a39811a49ebe29dd6d8">shift_left</a>(<span class="keyword">const</span> std::vector<int32_t> &array,</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordtype">size_t</span> shift) {</div>
|
||||
@@ -159,7 +160,7 @@ $(function(){initNavTree('d9/d14/array__left__rotation_8cpp_source.html','../../
|
||||
</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="comment">// namespace operations_on_datastructures</span></div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> </div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span></div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d9/df4/namespacetests.html">tests</a> {</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span><span class="keyword">using </span><a class="code hl_function" href="../../da/d6d/namespaceoperations__on__datastructures.html#a6109193567a5b7e36a27f2b4865fce20">operations_on_datastructures::print</a>;</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span><span class="keyword">using </span><a class="code hl_function" href="../../da/d6d/namespaceoperations__on__datastructures.html#afce39cf843989a39811a49ebe29dd6d8">operations_on_datastructures::shift_left</a>;</div>
|
||||
@@ -169,39 +170,42 @@ $(function(){initNavTree('d9/d14/array__left__rotation_8cpp_source.html','../../
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> std::cout << <span class="stringliteral">"Initialized arr = {1, 2, 3, 4, 5}\n"</span>;</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> std::cout << <span class="stringliteral">"Expected result: {3, 4, 5, 1, 2}\n"</span>;</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> std::vector<int32_t> arr = {1, 2, 3, 4, 5};</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> std::vector<int32_t> res = shift_left(arr, 2);</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> std::vector<int32_t> res = <a class="code hl_function" href="../../d9/df4/namespacetests.html#afce39cf843989a39811a49ebe29dd6d8">shift_left</a>(arr, 2);</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> std::vector<int32_t> expected = {3, 4, 5, 1, 2};</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> assert(res == expected);</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> print(res); </div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#a6109193567a5b7e36a27f2b4865fce20">print</a>(res); </div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> std::cout << <span class="stringliteral">"TEST PASSED!\n\n"</span>;</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span></div>
|
||||
<div class="foldopen" id="foldopen00090" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"><a class="line" href="../../d9/df4/namespacetests.html#abdd77344d4af8fd56d14a5cabbf2f669"> 90</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#abdd77344d4af8fd56d14a5cabbf2f669">test2</a>() {</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> std::cout << <span class="stringliteral">"TEST CASE 2\n"</span>;</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> std::cout << <span class="stringliteral">"Initialized arr = {}\n"</span>;</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> std::cout << <span class="stringliteral">"Expected result: {}\n"</span>;</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> std::vector<int32_t> arr = {};</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> std::vector<int32_t> res = shift_left(arr, 2);</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> std::vector<int32_t> res = <a class="code hl_function" href="../../d9/df4/namespacetests.html#afce39cf843989a39811a49ebe29dd6d8">shift_left</a>(arr, 2);</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> std::vector<int32_t> expected = {};</div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> assert(res == expected);</div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> print(res); </div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#a6109193567a5b7e36a27f2b4865fce20">print</a>(res); </div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> std::cout << <span class="stringliteral">"TEST PASSED!\n\n"</span>;</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span></div>
|
||||
<div class="foldopen" id="foldopen00105" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"><a class="line" href="../../d9/df4/namespacetests.html#aa515639572647508b94986489aab6d76"> 105</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#aa515639572647508b94986489aab6d76">test3</a>() {</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> std::cout << <span class="stringliteral">"TEST CASE 3\n"</span>;</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> std::cout << <span class="stringliteral">"Initialized arr = {1, 2, 3, 4, 5}\n"</span>;</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> std::cout << <span class="stringliteral">"Expected result: {}\n"</span>;</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> std::vector<int32_t> arr = {1, 2, 3, 4, 5};</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> std::vector<int32_t> res = shift_left(arr, 7); </div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> std::vector<int32_t> res = <a class="code hl_function" href="../../d9/df4/namespacetests.html#afce39cf843989a39811a49ebe29dd6d8">shift_left</a>(arr, 7); </div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> std::vector<int32_t> expected = {};</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> assert(res == expected);</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> print(res); </div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#a6109193567a5b7e36a27f2b4865fce20">print</a>(res); </div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> std::cout << <span class="stringliteral">"TEST PASSED!\n\n"</span>;</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span></div>
|
||||
<div class="foldopen" id="foldopen00120" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"><a class="line" href="../../d9/df4/namespacetests.html#a2b9769e44683dcb67fe1083ad91e134d"> 120</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#a2b9769e44683dcb67fe1083ad91e134d">test4</a>() {</div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> std::cout << <span class="stringliteral">"TEST CASE 4\n"</span>;</div>
|
||||
@@ -211,32 +215,33 @@ $(function(){initNavTree('d9/d14/array__left__rotation_8cpp_source.html','../../
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i <= 210; i++) {</div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> arr.push_back(i * 2);</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> print(arr);</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> std::vector<int32_t> res = shift_left(arr, 1);</div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#a6109193567a5b7e36a27f2b4865fce20">print</a>(arr);</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> std::vector<int32_t> res = <a class="code hl_function" href="../../d9/df4/namespacetests.html#afce39cf843989a39811a49ebe29dd6d8">shift_left</a>(arr, 1);</div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> std::vector<int32_t> expected;</div>
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i < 210; i++) {</div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> expected.push_back(arr[i]);</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> expected.push_back(2);</div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> assert(res == expected);</div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> print(res); </div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#a6109193567a5b7e36a27f2b4865fce20">print</a>(res); </div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> std::cout << <span class="stringliteral">"TEST PASSED!\n\n"</span>;</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span></div>
|
||||
<div class="foldopen" id="foldopen00143" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"><a class="line" href="../../d9/df4/namespacetests.html#af7b81d7a1534216af6a36a80135beb86"> 143</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#af7b81d7a1534216af6a36a80135beb86">test5</a>() {</div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> std::cout << <span class="stringliteral">"TEST CASE 5\n"</span>;</div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> std::cout << <span class="stringliteral">"Initialized arr = {1, 2, 3, 4, 5}\n"</span>;</div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> std::cout << <span class="stringliteral">"Expected result: {1, 2, 3, 4, 5}\n"</span>;</div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> std::vector<int32_t> arr = {1, 2, 3, 4, 5};</div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> std::vector<int32_t> res = shift_left(arr, 0);</div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> std::vector<int32_t> res = <a class="code hl_function" href="../../d9/df4/namespacetests.html#afce39cf843989a39811a49ebe29dd6d8">shift_left</a>(arr, 0);</div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> assert(res == arr);</div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> print(res); </div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#a6109193567a5b7e36a27f2b4865fce20">print</a>(res); </div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> std::cout << <span class="stringliteral">"TEST PASSED!\n\n"</span>;</div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span>} <span class="comment">// namespace tests</span></div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> </div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span></div>
|
||||
<div class="foldopen" id="foldopen00159" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"><a class="line" href="../../d9/d14/array__left__rotation_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 159</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d14/array__left__rotation_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#a167c24bd817469ae47358d12e034f2d5">tests::test1</a>();</div>
|
||||
@@ -246,7 +251,7 @@ $(function(){initNavTree('d9/d14/array__left__rotation_8cpp_source.html','../../
|
||||
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#af7b81d7a1534216af6a36a80135beb86">tests::test5</a>();</div>
|
||||
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> </div>
|
||||
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span></div>
|
||||
<div class="foldopen" id="foldopen00171" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"><a class="line" href="../../d9/d14/array__left__rotation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 171</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d14/array__left__rotation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <a class="code hl_function" href="../../d9/d14/array__left__rotation_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -261,16 +266,18 @@ $(function(){initNavTree('d9/d14/array__left__rotation_8cpp_source.html','../../
|
||||
<div class="ttc" id="anamespacetests_html"><div class="ttname"><a href="../../d9/df4/namespacetests.html">tests</a></div><div class="ttdoc">Testcases to check Union of Two Arrays.</div></div>
|
||||
<div class="ttc" id="anamespacetests_html_a167c24bd817469ae47358d12e034f2d5"><div class="ttname"><a href="../../d9/df4/namespacetests.html#a167c24bd817469ae47358d12e034f2d5">tests::test1</a></div><div class="ttdeci">void test1()</div><div class="ttdoc">A Test to check an simple case.</div><div class="ttdef"><b>Definition</b> <a href="#l00075">array_left_rotation.cpp:75</a></div></div>
|
||||
<div class="ttc" id="anamespacetests_html_a2b9769e44683dcb67fe1083ad91e134d"><div class="ttname"><a href="../../d9/df4/namespacetests.html#a2b9769e44683dcb67fe1083ad91e134d">tests::test4</a></div><div class="ttdeci">void test4()</div><div class="ttdoc">A Test to check a very large input.</div><div class="ttdef"><b>Definition</b> <a href="#l00120">array_left_rotation.cpp:120</a></div></div>
|
||||
<div class="ttc" id="anamespacetests_html_a6109193567a5b7e36a27f2b4865fce20"><div class="ttname"><a href="../../d9/df4/namespacetests.html#a6109193567a5b7e36a27f2b4865fce20">tests::print</a></div><div class="ttdeci">void print(const std::vector< int32_t > &array)</div><div class="ttdoc">Prints the values of a vector sequentially, ending with a newline character.</div><div class="ttdef"><b>Definition</b> <a href="#l00029">array_left_rotation.cpp:29</a></div></div>
|
||||
<div class="ttc" id="anamespacetests_html_aa515639572647508b94986489aab6d76"><div class="ttname"><a href="../../d9/df4/namespacetests.html#aa515639572647508b94986489aab6d76">tests::test3</a></div><div class="ttdeci">void test3()</div><div class="ttdoc">A Test to check an invalid shift value.</div><div class="ttdef"><b>Definition</b> <a href="#l00105">array_left_rotation.cpp:105</a></div></div>
|
||||
<div class="ttc" id="anamespacetests_html_abdd77344d4af8fd56d14a5cabbf2f669"><div class="ttname"><a href="../../d9/df4/namespacetests.html#abdd77344d4af8fd56d14a5cabbf2f669">tests::test2</a></div><div class="ttdeci">void test2()</div><div class="ttdoc">A Test to check an empty vector.</div><div class="ttdef"><b>Definition</b> <a href="#l00090">array_left_rotation.cpp:90</a></div></div>
|
||||
<div class="ttc" id="anamespacetests_html_af7b81d7a1534216af6a36a80135beb86"><div class="ttname"><a href="../../d9/df4/namespacetests.html#af7b81d7a1534216af6a36a80135beb86">tests::test5</a></div><div class="ttdeci">void test5()</div><div class="ttdoc">A Test to check a shift of zero.</div><div class="ttdef"><b>Definition</b> <a href="#l00143">array_left_rotation.cpp:143</a></div></div>
|
||||
<div class="ttc" id="anamespacetests_html_afce39cf843989a39811a49ebe29dd6d8"><div class="ttname"><a href="../../d9/df4/namespacetests.html#afce39cf843989a39811a49ebe29dd6d8">tests::shift_left</a></div><div class="ttdeci">std::vector< int32_t > shift_left(const std::vector< int32_t > &array, size_t shift)</div><div class="ttdoc">Shifts the given vector to the left by the shift amount and returns a new vector with the result....</div><div class="ttdef"><b>Definition</b> <a href="#l00046">array_left_rotation.cpp:46</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_35422be6552f1b3672c1b6c4aba2da64.html">operations_on_datastructures</a></li><li class="navelem"><a class="el" href="../../d9/d14/array__left__rotation_8cpp.html">array_left_rotation.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: graph/kruskal.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -131,10 +131,10 @@ $(function(){initNavTree('d9/d1c/kruskal_8cpp_source.html','../../'); initResiza
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">//#include <boost/multiprecision/cpp_int.hpp></span></div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">// using namespace boost::multiprecision;</span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="keyword">const</span> <span class="keywordtype">int</span> mx = 1e6 + 5;</div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="keyword">using </span>ll = int64_t;</div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="keyword">using </span><a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#ae1d1ec9482079231e898236e2b23c9ba">ll</a> = int64_t;</div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> </div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span>std::array<ll, mx> parent;</div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span>ll <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>, edge;</div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#ae1d1ec9482079231e898236e2b23c9ba">ll</a> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>, edge;</div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span>std::vector<std::pair<ll, std::pair<ll, ll>>> edges;</div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="keywordtype">void</span> initial() {</div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> + edge; ++i) {</div>
|
||||
@@ -156,11 +156,11 @@ $(function(){initNavTree('d9/d1c/kruskal_8cpp_source.html','../../'); initResiza
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> parent[root_x] = root_y;</div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span>}</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span>ll kruskal() {</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> ll mincost = 0;</div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#ae1d1ec9482079231e898236e2b23c9ba">ll</a> kruskal() {</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#ae1d1ec9482079231e898236e2b23c9ba">ll</a> mincost = 0;</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < edge; ++i) {</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> ll x = edges[i].second.first;</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> ll y = edges[i].second.second;</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#ae1d1ec9482079231e898236e2b23c9ba">ll</a> x = edges[i].second.first;</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#ae1d1ec9482079231e898236e2b23c9ba">ll</a> y = edges[i].second.second;</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keywordflow">if</span> (root(x) != root(y)) {</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> mincost += edges[i].first;</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> join(x, y);</div>
|
||||
@@ -189,6 +189,7 @@ $(function(){initNavTree('d9/d1c/kruskal_8cpp_source.html','../../'); initResiza
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span>}</div>
|
||||
<div class="ttc" id="agenerate__parentheses_8cpp_html_gae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">Main function.</div><div class="ttdef"><b>Definition</b> <a href="../../dd/d1e/generate__parentheses_8cpp_source.html#l00110">generate_parentheses.cpp:110</a></div></div>
|
||||
<div class="ttc" id="amatrix__exponentiation_8cpp_html_ae1d1ec9482079231e898236e2b23c9ba"><div class="ttname"><a href="../../d7/d35/matrix__exponentiation_8cpp.html#ae1d1ec9482079231e898236e2b23c9ba">ll</a></div><div class="ttdeci">#define ll</div><div class="ttdef"><b>Definition</b> <a href="../../d7/d35/matrix__exponentiation_8cpp_source.html#l00033">matrix_exponentiation.cpp:33</a></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> <a href="../../d3/d26/binary__search__tree_8cpp_source.html#l00011">binary_search_tree.cpp:11</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
@@ -196,7 +197,7 @@ $(function(){initNavTree('d9/d1c/kruskal_8cpp_source.html','../../'); initResiza
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_12552d7fa429bf94a2e32e5cf39f7e69.html">graph</a></li><li class="navelem"><b>kruskal.cpp</b></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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: greedy_algorithms/binary_addition.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -216,7 +216,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -261,7 +261,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_0eaa691bd54ab0922ca7f50599de6d22.html">greedy_algorithms</a></li><li class="navelem"><a class="el" href="../../d9/d1f/binary__addition_8cpp.html">binary_addition.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: greedy_algorithms/binary_addition.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,12 +124,13 @@ $(function(){initNavTree('d9/d1f/binary__addition_8cpp_source.html','../../'); i
|
||||
<div class="headertitle"><div class="title">binary_addition.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d9/d1f/binary__addition_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d9/d1f/binary__addition_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include <algorithm></span> </div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include <string></span> </div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span></div>
|
||||
<div class="foldopen" id="foldopen00027" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"><a class="line" href="../../d2/d90/namespacegreedy__algorithms.html"> 27</a></span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d2/d90/namespacegreedy__algorithms.html">greedy_algorithms</a> {</div>
|
||||
<div class="foldopen" id="foldopen00031" data-start="{" data-end="};">
|
||||
@@ -177,7 +178,7 @@ $(function(){initNavTree('d9/d1f/binary__addition_8cpp_source.html','../../'); i
|
||||
</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span>} <span class="comment">// namespace greedy_algorithms</span></div>
|
||||
</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> </div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span></div>
|
||||
<div class="foldopen" id="foldopen00086" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"><a class="line" href="../../d9/d1f/binary__addition_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e"> 86</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d1f/binary__addition_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>() {</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <a class="code hl_class" href="../../de/df6/classgreedy__algorithms_1_1_binary_addition.html">greedy_algorithms::BinaryAddition</a> binaryAddition;</div>
|
||||
@@ -205,7 +206,7 @@ $(function(){initNavTree('d9/d1f/binary__addition_8cpp_source.html','../../'); i
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> assert(binaryAddition.<a class="code hl_function" href="../../de/df6/classgreedy__algorithms_1_1_binary_addition.html#a801fd1ec5cda76b0bb82cbf23ed4d527">addBinary</a>(<span class="stringliteral">"1234"</span>, <span class="stringliteral">"1101"</span>) == <span class="stringliteral">""</span>);</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> </div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span></div>
|
||||
<div class="foldopen" id="foldopen00116" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"><a class="line" href="../../d9/d1f/binary__addition_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 116</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d1f/binary__addition_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <a class="code hl_function" href="../../d9/d1f/binary__addition_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>(); </div>
|
||||
@@ -224,7 +225,7 @@ $(function(){initNavTree('d9/d1f/binary__addition_8cpp_source.html','../../'); i
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_0eaa691bd54ab0922ca7f50599de6d22.html">greedy_algorithms</a></li><li class="navelem"><a class="el" href="../../d9/d1f/binary__addition_8cpp.html">binary_addition.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Member List</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -142,7 +142,7 @@ $(function(){initNavTree('d6/d30/classmachine__learning_1_1adaline.html','../../
|
||||
<!-- 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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: wave_sort Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d9/d21/namespacewave__sort.html','../../'); initResiza
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d9/d21/namespacewave__sort.html">wave_sort</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: graph::LowestCommonAncestor Class Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -180,7 +180,7 @@ Protected Member Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel explicit">explicit</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -224,7 +224,7 @@ Protected Member Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -242,18 +242,18 @@ Protected Member Functions</h2></td></tr>
|
||||
<p class="definition">Definition at line <a class="el" href="../../de/dde/lowest__common__ancestor_8cpp_source.html#l00164">164</a> of file <a class="el" href="../../de/dde/lowest__common__ancestor_8cpp_source.html">lowest_common_ancestor.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 164</span> {</div>
|
||||
<div class="line"><span class="lineno"> 165</span> <span class="comment">// Ensure u is the deeper (higher level) of the two vertices</span></div>
|
||||
<div class="line"><span class="lineno"> 166</span> <span class="keywordflow">if</span> (tree.<a class="code hl_variable" href="../../d0/d58/classgraph_1_1_rooted_tree.html#a2ee3ad1161ac2532da30c3e22c265ad3">level</a>[v] > tree.<a class="code hl_variable" href="../../d0/d58/classgraph_1_1_rooted_tree.html#a2ee3ad1161ac2532da30c3e22c265ad3">level</a>[u]) {</div>
|
||||
<div class="line"><span class="lineno"> 166</span> <span class="keywordflow">if</span> (tree.level[v] > tree.level[u]) {</div>
|
||||
<div class="line"><span class="lineno"> 167</span> std::swap(u, v);</div>
|
||||
<div class="line"><span class="lineno"> 168</span> }</div>
|
||||
<div class="line"><span class="lineno"> 169</span> </div>
|
||||
<div class="line"><span class="lineno"> 170</span> <span class="comment">// "Lift" u to the same level as v.</span></div>
|
||||
<div class="line"><span class="lineno"> 171</span> <span class="keywordtype">int</span> level_diff = tree.<a class="code hl_variable" href="../../d0/d58/classgraph_1_1_rooted_tree.html#a2ee3ad1161ac2532da30c3e22c265ad3">level</a>[u] - tree.<a class="code hl_variable" href="../../d0/d58/classgraph_1_1_rooted_tree.html#a2ee3ad1161ac2532da30c3e22c265ad3">level</a>[v];</div>
|
||||
<div class="line"><span class="lineno"> 171</span> <span class="keywordtype">int</span> level_diff = tree.level[u] - tree.level[v];</div>
|
||||
<div class="line"><span class="lineno"> 172</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; (1 << i) <= level_diff; ++i) {</div>
|
||||
<div class="line"><span class="lineno"> 173</span> <span class="keywordflow">if</span> (level_diff & (1 << i)) {</div>
|
||||
<div class="line"><span class="lineno"> 174</span> u = <a class="code hl_variable" href="#a46d10f669791e3da9a4809bd8ff8d3ad">up</a>[u][i];</div>
|
||||
<div class="line"><span class="lineno"> 175</span> }</div>
|
||||
<div class="line"><span class="lineno"> 176</span> }</div>
|
||||
<div class="line"><span class="lineno"> 177</span> assert(tree.<a class="code hl_variable" href="../../d0/d58/classgraph_1_1_rooted_tree.html#a2ee3ad1161ac2532da30c3e22c265ad3">level</a>[u] == tree.<a class="code hl_variable" href="../../d0/d58/classgraph_1_1_rooted_tree.html#a2ee3ad1161ac2532da30c3e22c265ad3">level</a>[v]);</div>
|
||||
<div class="line"><span class="lineno"> 177</span> assert(tree.level[u] == tree.level[v]);</div>
|
||||
<div class="line"><span class="lineno"> 178</span> </div>
|
||||
<div class="line"><span class="lineno"> 179</span> <span class="keywordflow">if</span> (u == v) {</div>
|
||||
<div class="line"><span class="lineno"> 180</span> <span class="keywordflow">return</span> u;</div>
|
||||
@@ -274,7 +274,6 @@ Protected Member Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 195</span> <span class="keywordflow">return</span> <a class="code hl_variable" href="#a46d10f669791e3da9a4809bd8ff8d3ad">up</a>[u][0];</div>
|
||||
<div class="line"><span class="lineno"> 196</span> }</div>
|
||||
<div class="ttc" id="aclassgraph_1_1_lowest_common_ancestor_html_a46d10f669791e3da9a4809bd8ff8d3ad"><div class="ttname"><a href="#a46d10f669791e3da9a4809bd8ff8d3ad">graph::LowestCommonAncestor::up</a></div><div class="ttdeci">std::vector< std::vector< int > > up</div><div class="ttdoc">for every vertex stores a list of its ancestors by powers of two For each vertex, the first element o...</div><div class="ttdef"><b>Definition</b> <a href="../../de/dde/lowest__common__ancestor_8cpp_source.html#l00206">lowest_common_ancestor.cpp:206</a></div></div>
|
||||
<div class="ttc" id="aclassgraph_1_1_rooted_tree_html_a2ee3ad1161ac2532da30c3e22c265ad3"><div class="ttname"><a href="../../d0/d58/classgraph_1_1_rooted_tree.html#a2ee3ad1161ac2532da30c3e22c265ad3">graph::RootedTree::level</a></div><div class="ttdeci">std::vector< int > level</div><div class="ttdoc">Stores the distance from the root.</div><div class="ttdef"><b>Definition</b> <a href="../../de/dde/lowest__common__ancestor_8cpp_source.html#l00106">lowest_common_ancestor.cpp:106</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -296,7 +295,7 @@ Protected Member Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">protected</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel protected">protected</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -304,12 +303,12 @@ Protected Member Functions</h2></td></tr>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../de/dde/lowest__common__ancestor_8cpp_source.html#l00212">212</a> of file <a class="el" href="../../de/dde/lowest__common__ancestor_8cpp_source.html">lowest_common_ancestor.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 212</span> {</div>
|
||||
<div class="line"><span class="lineno"> 213</span> <a class="code hl_variable" href="#a46d10f669791e3da9a4809bd8ff8d3ad">up</a>.resize(tree.<a class="code hl_function" href="../../dc/d61/classgraph_1_1_graph.html#a8930d1470d132b19e430d1c71f94c904">number_of_vertices</a>());</div>
|
||||
<div class="line"><span class="lineno"> 214</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> vertex = 0; vertex < tree.<a class="code hl_function" href="../../dc/d61/classgraph_1_1_graph.html#a8930d1470d132b19e430d1c71f94c904">number_of_vertices</a>(); ++vertex) {</div>
|
||||
<div class="line"><span class="lineno"> 215</span> <a class="code hl_variable" href="#a46d10f669791e3da9a4809bd8ff8d3ad">up</a>[vertex].push_back(tree.<a class="code hl_variable" href="../../d0/d58/classgraph_1_1_rooted_tree.html#a3831583a91914988897a4cc8748fda43">parent</a>[vertex]);</div>
|
||||
<div class="line"><span class="lineno"> 213</span> <a class="code hl_variable" href="#a46d10f669791e3da9a4809bd8ff8d3ad">up</a>.resize(tree.number_of_vertices());</div>
|
||||
<div class="line"><span class="lineno"> 214</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> vertex = 0; vertex < tree.number_of_vertices(); ++vertex) {</div>
|
||||
<div class="line"><span class="lineno"> 215</span> <a class="code hl_variable" href="#a46d10f669791e3da9a4809bd8ff8d3ad">up</a>[vertex].push_back(tree.parent[vertex]);</div>
|
||||
<div class="line"><span class="lineno"> 216</span> }</div>
|
||||
<div class="line"><span class="lineno"> 217</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> level = 0; (1 << level) < tree.<a class="code hl_function" href="../../dc/d61/classgraph_1_1_graph.html#a8930d1470d132b19e430d1c71f94c904">number_of_vertices</a>(); ++level) {</div>
|
||||
<div class="line"><span class="lineno"> 218</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> vertex = 0; vertex < tree.<a class="code hl_function" href="../../dc/d61/classgraph_1_1_graph.html#a8930d1470d132b19e430d1c71f94c904">number_of_vertices</a>(); ++vertex) {</div>
|
||||
<div class="line"><span class="lineno"> 217</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> level = 0; (1 << level) < tree.number_of_vertices(); ++level) {</div>
|
||||
<div class="line"><span class="lineno"> 218</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> vertex = 0; vertex < tree.number_of_vertices(); ++vertex) {</div>
|
||||
<div class="line"><span class="lineno"> 219</span> <span class="comment">// up[vertex][level + 1] = 2^(level + 1) th ancestor of vertex =</span></div>
|
||||
<div class="line"><span class="lineno"> 220</span> <span class="comment">// = 2^level th ancestor of 2^level th ancestor of vertex =</span></div>
|
||||
<div class="line"><span class="lineno"> 221</span> <span class="comment">// = 2^level th ancestor of up[vertex][level]</span></div>
|
||||
@@ -317,8 +316,6 @@ Protected Member Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 223</span> }</div>
|
||||
<div class="line"><span class="lineno"> 224</span> }</div>
|
||||
<div class="line"><span class="lineno"> 225</span> }</div>
|
||||
<div class="ttc" id="aclassgraph_1_1_graph_html_a8930d1470d132b19e430d1c71f94c904"><div class="ttname"><a href="../../dc/d61/classgraph_1_1_graph.html#a8930d1470d132b19e430d1c71f94c904">graph::Graph::number_of_vertices</a></div><div class="ttdeci">int number_of_vertices() const</div><div class="ttdef"><b>Definition</b> <a href="../../de/dde/lowest__common__ancestor_8cpp_source.html#l00074">lowest_common_ancestor.cpp:74</a></div></div>
|
||||
<div class="ttc" id="aclassgraph_1_1_rooted_tree_html_a3831583a91914988897a4cc8748fda43"><div class="ttname"><a href="../../d0/d58/classgraph_1_1_rooted_tree.html#a3831583a91914988897a4cc8748fda43">graph::RootedTree::parent</a></div><div class="ttdeci">std::vector< int > parent</div><div class="ttdoc">Stores parent of every vertex and for root its own index. The root is technically not its own parent,...</div><div class="ttdef"><b>Definition</b> <a href="../../de/dde/lowest__common__ancestor_8cpp_source.html#l00104">lowest_common_ancestor.cpp:104</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -366,7 +363,7 @@ Protected Member Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../df/dce/namespacegraph.html">graph</a></li><li class="navelem"><a class="el" href="../../d9/d23/classgraph_1_1_lowest_common_ancestor.html">LowestCommonAncestor</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: probability/poisson_dist.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -360,7 +360,7 @@ e.g 5 dollars every 2 mins = 5 / 2 = 2.5 </p>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_82e494173a87936756866de2fa774307.html">probability</a></li><li class="navelem"><a class="el" href="../../d9/d24/poisson__dist_8cpp.html">poisson_dist.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: probability/poisson_dist.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,18 +124,18 @@ $(function(){initNavTree('d9/d24/poisson__dist_8cpp_source.html','../../'); init
|
||||
<div class="headertitle"><div class="title">poisson_dist.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d9/d24/poisson__dist_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d9/d24/poisson__dist_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include <cmath></span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span></div>
|
||||
<div class="foldopen" id="foldopen00017" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="../../d9/d24/poisson__dist_8cpp.html#ac217ab9a06291f360d816700a6958ca8"> 17</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d9/d24/poisson__dist_8cpp.html#ac217ab9a06291f360d816700a6958ca8">poisson_rate</a>(<span class="keywordtype">double</span> events, <span class="keywordtype">double</span> timeframe) {</div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keywordflow">return</span> events / timeframe;</div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="../../d9/d24/poisson__dist_8cpp.html#ad0aa718023ce802dd5899f0e03a7ac71"> 25</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d9/d24/poisson__dist_8cpp.html#ad0aa718023ce802dd5899f0e03a7ac71">poisson_expected</a>(<span class="keywordtype">double</span> rate, <span class="keywordtype">double</span> time) { <span class="keywordflow">return</span> rate * time; }</div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> </div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span></div>
|
||||
<div class="foldopen" id="foldopen00030" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="../../d9/d24/poisson__dist_8cpp.html#a63ffd347e75d5ed7a518cbcfbfeec71a"> 30</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d9/d24/poisson__dist_8cpp.html#a63ffd347e75d5ed7a518cbcfbfeec71a">fact</a>(<span class="keywordtype">double</span> x) {</div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keywordtype">double</span> x_fact = x;</div>
|
||||
@@ -149,13 +149,13 @@ $(function(){initNavTree('d9/d24/poisson__dist_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keywordflow">return</span> x_fact;</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span></div>
|
||||
<div class="foldopen" id="foldopen00046" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="../../d9/d24/poisson__dist_8cpp.html#a69a136b32707bdc7950fb9057b5fa1e1"> 46</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d9/d24/poisson__dist_8cpp.html#a69a136b32707bdc7950fb9057b5fa1e1">poisson_x_successes</a>(<span class="keywordtype">double</span> expected, <span class="keywordtype">double</span> x) {</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordflow">return</span> (std::pow(expected, x) * std::exp(-expected)) / <a class="code hl_function" href="../../d9/d24/poisson__dist_8cpp.html#a63ffd347e75d5ed7a518cbcfbfeec71a">fact</a>(x);</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> </div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span></div>
|
||||
<div class="foldopen" id="foldopen00054" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"><a class="line" href="../../d9/d24/poisson__dist_8cpp.html#ad9c9e74079278ca10e3b97a8d5391c9a"> 54</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d9/d24/poisson__dist_8cpp.html#ad9c9e74079278ca10e3b97a8d5391c9a">poisson_range_successes</a>(<span class="keywordtype">double</span> expected, <span class="keywordtype">double</span> <a class="code hl_function" href="../../dc/db5/text__search_8cpp.html#a3f8975d227cd0e58f298b380c5dac0d9">lower</a>, <span class="keywordtype">double</span> upper) {</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordtype">double</span> <a class="code hl_namespace" href="../../d4/ded/namespaceprobability.html">probability</a> = 0;</div>
|
||||
@@ -165,7 +165,7 @@ $(function(){initNavTree('d9/d24/poisson__dist_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keywordflow">return</span> <a class="code hl_namespace" href="../../d4/ded/namespaceprobability.html">probability</a>;</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> </div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span></div>
|
||||
<div class="foldopen" id="foldopen00065" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="../../d9/d24/poisson__dist_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 65</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d24/poisson__dist_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordtype">double</span> rate, expected;</div>
|
||||
@@ -197,7 +197,7 @@ $(function(){initNavTree('d9/d24/poisson__dist_8cpp_source.html','../../'); init
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_82e494173a87936756866de2fa774307.html">probability</a></li><li class="navelem"><a class="el" href="../../d9/d24/poisson__dist_8cpp.html">poisson_dist.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: list_array Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d9/d27/namespacelist__array.html','../../'); initResiz
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d9/d27/namespacelist__array.html">list_array</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: physics/ground_to_ground_projectile_motion.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -162,15 +162,15 @@ Functions</h2></td></tr>
|
||||
<tr class="memitem:ab00e9785fb2670f7af99d6f3d636f87c" id="r_ab00e9785fb2670f7af99d6f3d636f87c"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="#ab00e9785fb2670f7af99d6f3d636f87c">physics::ground_to_ground_projectile_motion::degrees_to_radians</a> (double degrees)</td></tr>
|
||||
<tr class="memdesc:ab00e9785fb2670f7af99d6f3d636f87c"><td class="mdescLeft"> </td><td class="mdescRight">Convert radians to degrees. <br /></td></tr>
|
||||
<tr class="separator:ab00e9785fb2670f7af99d6f3d636f87c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a563e066975fed1b84750a0a47c3cbb37" id="r_a563e066975fed1b84750a0a47c3cbb37"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:a563e066975fed1b84750a0a47c3cbb37" id="r_a563e066975fed1b84750a0a47c3cbb37"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a563e066975fed1b84750a0a47c3cbb37"><td class="memTemplItemLeft" align="right" valign="top">T </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a563e066975fed1b84750a0a47c3cbb37">physics::ground_to_ground_projectile_motion::time_of_flight</a> (T initial_velocity, T angle, double gravity=9.81)</td></tr>
|
||||
<tr class="memdesc:a563e066975fed1b84750a0a47c3cbb37"><td class="mdescLeft"> </td><td class="mdescRight">Calculate the time of flight. <br /></td></tr>
|
||||
<tr class="separator:a563e066975fed1b84750a0a47c3cbb37"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a10362eb607d7882bac3a0688504b00ff" id="r_a10362eb607d7882bac3a0688504b00ff"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:a10362eb607d7882bac3a0688504b00ff" id="r_a10362eb607d7882bac3a0688504b00ff"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a10362eb607d7882bac3a0688504b00ff"><td class="memTemplItemLeft" align="right" valign="top">T </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a10362eb607d7882bac3a0688504b00ff">physics::ground_to_ground_projectile_motion::horizontal_range</a> (T initial_velocity, T angle, T time)</td></tr>
|
||||
<tr class="memdesc:a10362eb607d7882bac3a0688504b00ff"><td class="mdescLeft"> </td><td class="mdescRight">Calculate the horizontal distance that the projectile travels. <br /></td></tr>
|
||||
<tr class="separator:a10362eb607d7882bac3a0688504b00ff"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:aa554429def63077ab7a550c0affbfefa" id="r_aa554429def63077ab7a550c0affbfefa"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:aa554429def63077ab7a550c0affbfefa" id="r_aa554429def63077ab7a550c0affbfefa"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:aa554429def63077ab7a550c0affbfefa"><td class="memTemplItemLeft" align="right" valign="top">T </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#aa554429def63077ab7a550c0affbfefa">physics::ground_to_ground_projectile_motion::max_height</a> (T initial_velocity, T angle, double gravity=9.81)</td></tr>
|
||||
<tr class="memdesc:aa554429def63077ab7a550c0affbfefa"><td class="mdescLeft"> </td><td class="mdescRight">Calculate the max height of the projectile. <br /></td></tr>
|
||||
<tr class="separator:aa554429def63077ab7a550c0affbfefa"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -245,7 +245,7 @@ Functions</h2></td></tr>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T > </div>
|
||||
template<typename T> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">T physics::ground_to_ground_projectile_motion::horizontal_range </td>
|
||||
@@ -317,7 +317,7 @@ template<typename T > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T > </div>
|
||||
template<typename T> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">T physics::ground_to_ground_projectile_motion::max_height </td>
|
||||
@@ -374,7 +374,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -391,7 +391,7 @@ template<typename T > </div>
|
||||
<div class="line"><span class="lineno"> 88</span> <span class="comment">// 1st test</span></div>
|
||||
<div class="line"><span class="lineno"> 89</span> <span class="keywordtype">double</span> expected_time_of_flight = 0.655; <span class="comment">// expected time output</span></div>
|
||||
<div class="line"><span class="lineno"> 90</span> <span class="keywordtype">double</span> flight_time_output =</div>
|
||||
<div class="line"><span class="lineno"> 91</span> std::round(physics::ground_to_ground_projectile_motion::time_of_flight(initial_velocity, angle) * 1000.0) /</div>
|
||||
<div class="line"><span class="lineno"> 91</span> std::round(<a class="code hl_function" href="#a563e066975fed1b84750a0a47c3cbb37">physics::ground_to_ground_projectile_motion::time_of_flight</a>(initial_velocity, angle) * 1000.0) /</div>
|
||||
<div class="line"><span class="lineno"> 92</span> 1000.0; <span class="comment">// round output to 3 decimal places</span></div>
|
||||
<div class="line"><span class="lineno"> 93</span> </div>
|
||||
<div class="line"><span class="lineno"> 94</span> std::cout << <span class="stringliteral">"Projectile Flight Time (double)"</span> << std::endl;</div>
|
||||
@@ -405,7 +405,7 @@ template<typename T > </div>
|
||||
<div class="line"><span class="lineno"> 102</span> <span class="comment">// 2nd test</span></div>
|
||||
<div class="line"><span class="lineno"> 103</span> <span class="keywordtype">double</span> expected_horizontal_range = 2.51; <span class="comment">// expected range output</span></div>
|
||||
<div class="line"><span class="lineno"> 104</span> <span class="keywordtype">double</span> horizontal_range_output =</div>
|
||||
<div class="line"><span class="lineno"> 105</span> std::round(physics::ground_to_ground_projectile_motion::horizontal_range(initial_velocity, angle,</div>
|
||||
<div class="line"><span class="lineno"> 105</span> std::round(<a class="code hl_function" href="#a10362eb607d7882bac3a0688504b00ff">physics::ground_to_ground_projectile_motion::horizontal_range</a>(initial_velocity, angle,</div>
|
||||
<div class="line"><span class="lineno"> 106</span> flight_time_output) *</div>
|
||||
<div class="line"><span class="lineno"> 107</span> 100.0) /</div>
|
||||
<div class="line"><span class="lineno"> 108</span> 100.0; <span class="comment">// round output to 2 decimal places</span></div>
|
||||
@@ -422,7 +422,7 @@ template<typename T > </div>
|
||||
<div class="line"><span class="lineno"> 119</span> <span class="comment">// 3rd test</span></div>
|
||||
<div class="line"><span class="lineno"> 120</span> <span class="keywordtype">double</span> expected_max_height = 0.526; <span class="comment">// expected height output</span></div>
|
||||
<div class="line"><span class="lineno"> 121</span> <span class="keywordtype">double</span> max_height_output =</div>
|
||||
<div class="line"><span class="lineno"> 122</span> std::round(physics::ground_to_ground_projectile_motion::max_height(initial_velocity, angle) * 1000.0) /</div>
|
||||
<div class="line"><span class="lineno"> 122</span> std::round(<a class="code hl_function" href="#aa554429def63077ab7a550c0affbfefa">physics::ground_to_ground_projectile_motion::max_height</a>(initial_velocity, angle) * 1000.0) /</div>
|
||||
<div class="line"><span class="lineno"> 123</span> 1000.0; <span class="comment">// round output to 3 decimal places</span></div>
|
||||
<div class="line"><span class="lineno"> 124</span> </div>
|
||||
<div class="line"><span class="lineno"> 125</span> std::cout << <span class="stringliteral">"Projectile Max Height (double)"</span> << std::endl;</div>
|
||||
@@ -433,6 +433,9 @@ template<typename T > </div>
|
||||
<div class="line"><span class="lineno"> 130</span> assert(max_height_output == expected_max_height);</div>
|
||||
<div class="line"><span class="lineno"> 131</span> std::cout << <span class="stringliteral">"TEST PASSED"</span> << std::endl << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 132</span>}</div>
|
||||
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_a10362eb607d7882bac3a0688504b00ff"><div class="ttname"><a href="#a10362eb607d7882bac3a0688504b00ff">physics::ground_to_ground_projectile_motion::horizontal_range</a></div><div class="ttdeci">T horizontal_range(T initial_velocity, T angle, T time)</div><div class="ttdoc">Calculate the horizontal distance that the projectile travels.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00059">ground_to_ground_projectile_motion.cpp:59</a></div></div>
|
||||
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_a563e066975fed1b84750a0a47c3cbb37"><div class="ttname"><a href="#a563e066975fed1b84750a0a47c3cbb37">physics::ground_to_ground_projectile_motion::time_of_flight</a></div><div class="ttdeci">T time_of_flight(T initial_velocity, T angle, double gravity=9.81)</div><div class="ttdoc">Calculate the time of flight.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00047">ground_to_ground_projectile_motion.cpp:47</a></div></div>
|
||||
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_aa554429def63077ab7a550c0affbfefa"><div class="ttname"><a href="#aa554429def63077ab7a550c0affbfefa">physics::ground_to_ground_projectile_motion::max_height</a></div><div class="ttdeci">T max_height(T initial_velocity, T angle, double gravity=9.81)</div><div class="ttdoc">Calculate the max height of the projectile.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00072">ground_to_ground_projectile_motion.cpp:72</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -442,7 +445,7 @@ template<typename T > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T > </div>
|
||||
template<typename T> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">T physics::ground_to_ground_projectile_motion::time_of_flight </td>
|
||||
@@ -487,7 +490,7 @@ template<typename T > </div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_59dc24c326e2a72d1164f014b22de83d.html">physics</a></li><li class="navelem"><a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html">ground_to_ground_projectile_motion.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
var ground__to__ground__projectile__motion_8cpp =
|
||||
[
|
||||
[ "_USE_MATH_DEFINES", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#a525335710b53cb064ca56b936120431e", null ],
|
||||
[ "degrees_to_radians", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#ab00e9785fb2670f7af99d6f3d636f87c", null ],
|
||||
[ "horizontal_range", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#a10362eb607d7882bac3a0688504b00ff", null ],
|
||||
[ "physics::ground_to_ground_projectile_motion::degrees_to_radians", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#ab00e9785fb2670f7af99d6f3d636f87c", null ],
|
||||
[ "physics::ground_to_ground_projectile_motion::horizontal_range", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#a10362eb607d7882bac3a0688504b00ff", null ],
|
||||
[ "main", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "max_height", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa554429def63077ab7a550c0affbfefa", null ],
|
||||
[ "physics::ground_to_ground_projectile_motion::max_height", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa554429def63077ab7a550c0affbfefa", null ],
|
||||
[ "test", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ],
|
||||
[ "time_of_flight", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#a563e066975fed1b84750a0a47c3cbb37", null ]
|
||||
[ "physics::ground_to_ground_projectile_motion::time_of_flight", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#a563e066975fed1b84750a0a47c3cbb37", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: physics/ground_to_ground_projectile_motion.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,21 +124,23 @@ $(function(){initNavTree('d9/d29/ground__to__ground__projectile__motion_8cpp_sou
|
||||
<div class="headertitle"><div class="title">ground_to_ground_projectile_motion.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"><a class="line" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a525335710b53cb064ca56b936120431e"> 13</a></span><span class="preprocessor">#define _USE_MATH_DEFINES</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <cmath></span> </div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d5/dd0/namespacephysics.html">physics</a> {</div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d0/d20/namespaceground__to__ground__projectile__motion.html">ground_to_ground_projectile_motion</a> {</div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> </div>
|
||||
<div class="foldopen" id="foldopen00034" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ab00e9785fb2670f7af99d6f3d636f87c"> 34</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ab00e9785fb2670f7af99d6f3d636f87c">degrees_to_radians</a>(<span class="keywordtype">double</span> degrees){</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keywordtype">double</span> radians = degrees * (M_PI / 180);</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keywordflow">return</span> radians;</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span></div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00047" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a563e066975fed1b84750a0a47c3cbb37"> 47</a></span>T <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a563e066975fed1b84750a0a47c3cbb37">time_of_flight</a>(T initial_velocity, T angle, <span class="keywordtype">double</span> gravity = 9.81) {</div>
|
||||
@@ -146,7 +148,7 @@ $(function(){initNavTree('d9/d29/ground__to__ground__projectile__motion_8cpp_sou
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordflow">return</span> 2.0 * Viy / gravity;</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> </div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span></div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00059" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a10362eb607d7882bac3a0688504b00ff"> 59</a></span>T <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a10362eb607d7882bac3a0688504b00ff">horizontal_range</a>(T initial_velocity, T angle, T time) {</div>
|
||||
@@ -154,7 +156,7 @@ $(function(){initNavTree('d9/d29/ground__to__ground__projectile__motion_8cpp_sou
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordflow">return</span> Vix * time;</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> </div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span></div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00072" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa554429def63077ab7a550c0affbfefa"> 72</a></span>T <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa554429def63077ab7a550c0affbfefa">max_height</a>(T initial_velocity, T angle, <span class="keywordtype">double</span> gravity = 9.81) {</div>
|
||||
@@ -164,7 +166,7 @@ $(function(){initNavTree('d9/d29/ground__to__ground__projectile__motion_8cpp_sou
|
||||
</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span>} <span class="comment">// namespace ground_to_ground_projectile_motion</span></div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span>} <span class="comment">// namespace physics</span></div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> </div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span></div>
|
||||
<div class="foldopen" id="foldopen00083" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"><a class="line" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 83</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="comment">// initial input variables</span></div>
|
||||
@@ -174,7 +176,7 @@ $(function(){initNavTree('d9/d29/ground__to__ground__projectile__motion_8cpp_sou
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="comment">// 1st test</span></div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="keywordtype">double</span> expected_time_of_flight = 0.655; <span class="comment">// expected time output</span></div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordtype">double</span> flight_time_output =</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> std::round(physics::ground_to_ground_projectile_motion::time_of_flight(initial_velocity, angle) * 1000.0) /</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> std::round(<a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a563e066975fed1b84750a0a47c3cbb37">physics::ground_to_ground_projectile_motion::time_of_flight</a>(initial_velocity, angle) * 1000.0) /</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> 1000.0; <span class="comment">// round output to 3 decimal places</span></div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> </div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> std::cout << <span class="stringliteral">"Projectile Flight Time (double)"</span> << std::endl;</div>
|
||||
@@ -188,7 +190,7 @@ $(function(){initNavTree('d9/d29/ground__to__ground__projectile__motion_8cpp_sou
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="comment">// 2nd test</span></div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="keywordtype">double</span> expected_horizontal_range = 2.51; <span class="comment">// expected range output</span></div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keywordtype">double</span> horizontal_range_output =</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> std::round(physics::ground_to_ground_projectile_motion::horizontal_range(initial_velocity, angle,</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> std::round(<a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a10362eb607d7882bac3a0688504b00ff">physics::ground_to_ground_projectile_motion::horizontal_range</a>(initial_velocity, angle,</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> flight_time_output) *</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> 100.0) /</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> 100.0; <span class="comment">// round output to 2 decimal places</span></div>
|
||||
@@ -205,7 +207,7 @@ $(function(){initNavTree('d9/d29/ground__to__ground__projectile__motion_8cpp_sou
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="comment">// 3rd test</span></div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keywordtype">double</span> expected_max_height = 0.526; <span class="comment">// expected height output</span></div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keywordtype">double</span> max_height_output =</div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> std::round(physics::ground_to_ground_projectile_motion::max_height(initial_velocity, angle) * 1000.0) /</div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> std::round(<a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa554429def63077ab7a550c0affbfefa">physics::ground_to_ground_projectile_motion::max_height</a>(initial_velocity, angle) * 1000.0) /</div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> 1000.0; <span class="comment">// round output to 3 decimal places</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> std::cout << <span class="stringliteral">"Projectile Max Height (double)"</span> << std::endl;</div>
|
||||
@@ -217,7 +219,7 @@ $(function(){initNavTree('d9/d29/ground__to__ground__projectile__motion_8cpp_sou
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> std::cout << <span class="stringliteral">"TEST PASSED"</span> << std::endl << std::endl;</div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> </div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span></div>
|
||||
<div class="foldopen" id="foldopen00138" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"><a class="line" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 138</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -238,7 +240,7 @@ $(function(){initNavTree('d9/d29/ground__to__ground__projectile__motion_8cpp_sou
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_59dc24c326e2a72d1164f014b22de83d.html">physics</a></li><li class="navelem"><a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html">ground_to_ground_projectile_motion.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Member List</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -147,7 +147,7 @@ $(function(){initNavTree('d5/d58/class_test_cases.html','../../'); initResizable
|
||||
<!-- 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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: dynamic_programming/coin_change_topdown.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -153,7 +153,7 @@ Namespaces</h2></td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:ac816a4ae8a29c156b90377041000929a" id="r_ac816a4ae8a29c156b90377041000929a"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:ac816a4ae8a29c156b90377041000929a" id="r_ac816a4ae8a29c156b90377041000929a"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:ac816a4ae8a29c156b90377041000929a"><td class="memTemplItemLeft" align="right" valign="top">int64_t </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#ac816a4ae8a29c156b90377041000929a">dynamic_programming::mincoins_topdown::mincoins</a> (const T &n, const std::vector< T > &coins, const int16_t &t, std::vector< T > dp)</td></tr>
|
||||
<tr class="memdesc:ac816a4ae8a29c156b90377041000929a"><td class="mdescLeft"> </td><td class="mdescRight">This implementation is for finding minimum number of coins . <br /></td></tr>
|
||||
<tr class="separator:ac816a4ae8a29c156b90377041000929a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -207,7 +207,7 @@ Functions</h2></td></tr>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T > </div>
|
||||
template<typename T> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">int64_t dynamic_programming::mincoins_topdown::mincoins </td>
|
||||
@@ -257,14 +257,13 @@ template<typename T > </div>
|
||||
<div class="line"><span class="lineno"> 56</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < t; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 57</span> <span class="keywordflow">if</span> (n - coins[i] >= 0) { <span class="comment">// if after subtracting the current</span></div>
|
||||
<div class="line"><span class="lineno"> 58</span> <span class="comment">// denomination is it greater than 0 or not</span></div>
|
||||
<div class="line"><span class="lineno"> 59</span> <span class="keywordtype">int</span> sub = <a class="code hl_function" href="#ac816a4ae8a29c156b90377041000929a">mincoins</a>(n - coins[i], coins, t, <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>);</div>
|
||||
<div class="line"><span class="lineno"> 59</span> <span class="keywordtype">int</span> sub = mincoins(n - coins[i], coins, t, <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>);</div>
|
||||
<div class="line"><span class="lineno"> 60</span> ans = std::min(ans, sub + 1);</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> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[n] = ans;</div>
|
||||
<div class="line"><span class="lineno"> 64</span> <span class="keywordflow">return</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[n]; <span class="comment">// returns minimum number of coins</span></div>
|
||||
<div class="line"><span class="lineno"> 63</span> dp[n] = ans;</div>
|
||||
<div class="line"><span class="lineno"> 64</span> <span class="keywordflow">return</span> dp[n]; <span class="comment">// returns minimum number of coins</span></div>
|
||||
<div class="line"><span class="lineno"> 65</span>}</div>
|
||||
<div class="ttc" id="acoin__change__topdown_8cpp_html_ac816a4ae8a29c156b90377041000929a"><div class="ttname"><a href="#ac816a4ae8a29c156b90377041000929a">dynamic_programming::mincoins_topdown::mincoins</a></div><div class="ttdeci">int64_t mincoins(const T &n, const std::vector< T > &coins, const int16_t &t, std::vector< T > dp)</div><div class="ttdoc">This implementation is for finding minimum number of coins .</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d31/coin__change__topdown_8cpp_source.html#l00047">coin_change_topdown.cpp:47</a></div></div>
|
||||
<div class="ttc" id="anamespacedp_html"><div class="ttname"><a href="../../df/d88/namespacedp.html">dp</a></div><div class="ttdoc">for std::vector</div><div class="ttdef"><b>Definition</b> <a href="../../de/d8c/partition__problem_8cpp_source.html#l00039">partition_problem.cpp:39</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -287,7 +286,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -304,10 +303,11 @@ template<typename T > </div>
|
||||
<div class="line"><span class="lineno"> 79</span> std::vector<int64_t> arr1{1, 7, 10};</div>
|
||||
<div class="line"><span class="lineno"> 80</span> std::vector<int64_t> dp1(n1 + 1);</div>
|
||||
<div class="line"><span class="lineno"> 81</span> <a class="code hl_function" href="../../de/d85/decimal__to__roman__numeral_8cpp.html#a88203bd297e8405160c132faa1187780">fill</a>(dp1.begin(), dp1.end(), a1);</div>
|
||||
<div class="line"><span class="lineno"> 82</span> assert(dynamic_programming::mincoins_topdown::mincoins(n1, arr1, t1, dp1) ==</div>
|
||||
<div class="line"><span class="lineno"> 82</span> assert(<a class="code hl_function" href="#ac816a4ae8a29c156b90377041000929a">dynamic_programming::mincoins_topdown::mincoins</a>(n1, arr1, t1, dp1) ==</div>
|
||||
<div class="line"><span class="lineno"> 83</span> 3);</div>
|
||||
<div class="line"><span class="lineno"> 84</span> std::cout << <span class="stringliteral">"Passed\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 85</span>}</div>
|
||||
<div class="ttc" id="acoin__change__topdown_8cpp_html_ac816a4ae8a29c156b90377041000929a"><div class="ttname"><a href="#ac816a4ae8a29c156b90377041000929a">dynamic_programming::mincoins_topdown::mincoins</a></div><div class="ttdeci">int64_t mincoins(const T &n, const std::vector< T > &coins, const int16_t &t, std::vector< T > dp)</div><div class="ttdoc">This implementation is for finding minimum number of coins .</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d31/coin__change__topdown_8cpp_source.html#l00047">coin_change_topdown.cpp:47</a></div></div>
|
||||
<div class="ttc" id="adecimal__to__roman__numeral_8cpp_html_a88203bd297e8405160c132faa1187780"><div class="ttname"><a href="../../de/d85/decimal__to__roman__numeral_8cpp.html#a88203bd297e8405160c132faa1187780">fill</a></div><div class="ttdeci">std::string fill(char c, int n)</div><div class="ttdef"><b>Definition</b> <a href="../../de/d85/decimal__to__roman__numeral_8cpp_source.html#l00015">decimal_to_roman_numeral.cpp:15</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -318,7 +318,7 @@ template<typename T > </div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_8a20dd5bfd5341a725342bf72b6b686f.html">dynamic_programming</a></li><li class="navelem"><a class="el" href="../../d9/d31/coin__change__topdown_8cpp.html">coin_change_topdown.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
2
d9/d31/coin__change__topdown_8cpp.js
vendored
@@ -1,6 +1,6 @@
|
||||
var coin__change__topdown_8cpp =
|
||||
[
|
||||
[ "main", "d9/d31/coin__change__topdown_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "mincoins", "d9/d31/coin__change__topdown_8cpp.html#ac816a4ae8a29c156b90377041000929a", null ],
|
||||
[ "dynamic_programming::mincoins_topdown::mincoins", "d9/d31/coin__change__topdown_8cpp.html#ac816a4ae8a29c156b90377041000929a", null ],
|
||||
[ "test", "d9/d31/coin__change__topdown_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: dynamic_programming/coin_change_topdown.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,12 +124,13 @@ $(function(){initNavTree('d9/d31/coin__change__topdown_8cpp_source.html','../../
|
||||
<div class="headertitle"><div class="title">coin_change_topdown.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d9/d31/coin__change__topdown_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d9/d31/coin__change__topdown_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include <cassert></span> <span class="comment">// for assert</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include <climits></span> <span class="comment">// for INT_MAX</span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#include <iostream></span> <span class="comment">// for io operations</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="preprocessor">#include <vector></span> <span class="comment">// for std::vector</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> </div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span></div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../dd/d24/namespacedynamic__programming.html">dynamic_programming</a> {</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d5/db8/namespacemincoins__topdown.html">mincoins_topdown</a> {</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
@@ -157,7 +158,7 @@ $(function(){initNavTree('d9/d31/coin__change__topdown_8cpp_source.html','../../
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> </div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span>} <span class="comment">// namespace mincoins_topdown</span></div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span>} <span class="comment">// namespace dynamic_programming</span></div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span></div>
|
||||
<div class="foldopen" id="foldopen00074" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"><a class="line" href="../../d9/d31/coin__change__topdown_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 74</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d31/coin__change__topdown_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="comment">// example 1: number of coins=3 and minimum coins required=3(7,7,1)</span></div>
|
||||
@@ -167,12 +168,12 @@ $(function(){initNavTree('d9/d31/coin__change__topdown_8cpp_source.html','../../
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> std::vector<int64_t> arr1{1, 7, 10};</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> std::vector<int64_t> dp1(n1 + 1);</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <a class="code hl_function" href="../../de/d85/decimal__to__roman__numeral_8cpp.html#a88203bd297e8405160c132faa1187780">fill</a>(dp1.begin(), dp1.end(), a1);</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> assert(dynamic_programming::mincoins_topdown::mincoins(n1, arr1, t1, dp1) ==</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> assert(<a class="code hl_function" href="../../d9/d31/coin__change__topdown_8cpp.html#ac816a4ae8a29c156b90377041000929a">dynamic_programming::mincoins_topdown::mincoins</a>(n1, arr1, t1, dp1) ==</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> 3);</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> std::cout << <span class="stringliteral">"Passed\n"</span>;</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> </div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span></div>
|
||||
<div class="foldopen" id="foldopen00091" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"><a class="line" href="../../d9/d31/coin__change__topdown_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 91</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d31/coin__change__topdown_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <a class="code hl_function" href="../../d9/d31/coin__change__topdown_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// execute the test</span></div>
|
||||
@@ -192,7 +193,7 @@ $(function(){initNavTree('d9/d31/coin__change__topdown_8cpp_source.html','../../
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_8a20dd5bfd5341a725342bf72b6b686f.html">dynamic_programming</a></li><li class="navelem"><a class="el" href="../../d9/d31/coin__change__topdown_8cpp.html">coin_change_topdown.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: sorting/recursive_bubble_sort.cpp Pages: 1 -->
|
||||
<svg width="381pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: sorting/recursive_bubble_sort.cpp Pages: 1 -->
|
||||
<svg width="381pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: sorting/quick_sort_iterative.cpp Pages: 1 -->
|
||||
<svg width="321pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: sorting/quick_sort_iterative.cpp Pages: 1 -->
|
||||
<svg width="321pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: range_queries::heavy_light_decomposition::SG< X > Class Template Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -175,7 +175,7 @@ Private Attributes</h2></td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="friends" name="friends"></a>
|
||||
Friends</h2></td></tr>
|
||||
<tr class="memitem:afcdadbdea1e2391cebbb17d2c1ae2f0b" id="r_afcdadbdea1e2391cebbb17d2c1ae2f0b"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:afcdadbdea1e2391cebbb17d2c1ae2f0b" id="r_afcdadbdea1e2391cebbb17d2c1ae2f0b"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:afcdadbdea1e2391cebbb17d2c1ae2f0b"><td class="memTemplItemLeft" align="right" valign="top">class </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#afcdadbdea1e2391cebbb17d2c1ae2f0b">HLD</a></td></tr>
|
||||
<tr class="separator:afcdadbdea1e2391cebbb17d2c1ae2f0b"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
@@ -197,7 +197,7 @@ class range_queries::heavy_light_decomposition::SG< X ></div><p>Segment <a
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename X > </div>
|
||||
template<typename X> </div>
|
||||
<table class="mlabels">
|
||||
<tr>
|
||||
<td class="mlabels-left">
|
||||
@@ -211,7 +211,7 @@ template<typename X > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel explicit">explicit</span><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -227,9 +227,10 @@ template<typename X > </div>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d2/de9/heavy__light__decomposition_8cpp_source.html#l00282">282</a> of file <a class="el" href="../../d2/de9/heavy__light__decomposition_8cpp_source.html">heavy_light_decomposition.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 282</span> {</div>
|
||||
<div class="line"><span class="lineno"> 283</span> <a class="code hl_variable" href="#ac6d912bbfafa3a7509f66bbc1729ca25">s_size</a> = size;</div>
|
||||
<div class="line"><span class="lineno"> 284</span> <a class="code hl_variable" href="#afbf8a9cb9449d5ca844f4e141a801e6a">s_tree</a>.assign(2 * <a class="code hl_variable" href="#ac6d912bbfafa3a7509f66bbc1729ca25">s_size</a>, 0ll);</div>
|
||||
<div class="line"><span class="lineno"> 283</span> <a class="code hl_variable" href="#ac6d912bbfafa3a7509f66bbc1729ca25">s_size</a> = <a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">size</a>;</div>
|
||||
<div class="line"><span class="lineno"> 284</span> <a class="code hl_variable" href="#afbf8a9cb9449d5ca844f4e141a801e6a">s_tree</a>.assign(2 * <a class="code hl_variable" href="#ac6d912bbfafa3a7509f66bbc1729ca25">s_size</a>, 0<a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">ll</a>);</div>
|
||||
<div class="line"><span class="lineno"> 285</span> }</div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_s_g_html"><div class="ttname"><a href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">range_queries::heavy_light_decomposition::SG</a></div><div class="ttdoc">Segment Tree, to store heavy chains.</div><div class="ttdef"><b>Definition</b> <a href="../../d2/de9/heavy__light__decomposition_8cpp_source.html#l00254">heavy_light_decomposition.cpp:254</a></div></div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_s_g_html_ac6d912bbfafa3a7509f66bbc1729ca25"><div class="ttname"><a href="#ac6d912bbfafa3a7509f66bbc1729ca25">range_queries::heavy_light_decomposition::SG::s_size</a></div><div class="ttdeci">int s_size</div><div class="ttdoc">number of leaves in the segment tree</div><div class="ttdef"><b>Definition</b> <a href="../../d2/de9/heavy__light__decomposition_8cpp_source.html#l00263">heavy_light_decomposition.cpp:263</a></div></div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_s_g_html_afbf8a9cb9449d5ca844f4e141a801e6a"><div class="ttname"><a href="#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> <a href="../../d2/de9/heavy__light__decomposition_8cpp_source.html#l00262">heavy_light_decomposition.cpp:262</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
@@ -242,7 +243,7 @@ template<typename X > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename X > </div>
|
||||
template<typename X> </div>
|
||||
<table class="mlabels">
|
||||
<tr>
|
||||
<td class="mlabels-left">
|
||||
@@ -260,7 +261,7 @@ template<typename X > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -276,7 +277,7 @@ template<typename X > </div>
|
||||
<dl class="section return"><dt>Returns</dt><dd>the combined result </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d2/de9/heavy__light__decomposition_8cpp_source.html#l00274">274</a> of file <a class="el" href="../../d2/de9/heavy__light__decomposition_8cpp_source.html">heavy_light_decomposition.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 274</span>{ <span class="keywordflow">return</span> lhs + rhs; }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 274</span>{ <span class="keywordflow">return</span> <a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">lhs</a> + <a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">rhs</a>; }</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -286,7 +287,7 @@ template<typename X > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename X > </div>
|
||||
template<typename X> </div>
|
||||
<table class="mlabels">
|
||||
<tr>
|
||||
<td class="mlabels-left">
|
||||
@@ -304,7 +305,7 @@ template<typename X > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -321,16 +322,16 @@ template<typename X > </div>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d2/de9/heavy__light__decomposition_8cpp_source.html#l00305">305</a> of file <a class="el" href="../../d2/de9/heavy__light__decomposition_8cpp_source.html">heavy_light_decomposition.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 305</span> {</div>
|
||||
<div class="line"><span class="lineno"> 306</span> X lhs = <a class="code hl_variable" href="#aa7f93971a9f891e0bbb7023081f379d5">sret_init</a>, rhs = <a class="code hl_variable" href="#aa7f93971a9f891e0bbb7023081f379d5">sret_init</a>;</div>
|
||||
<div class="line"><span class="lineno"> 307</span> <span class="keywordflow">for</span> (l += <a class="code hl_variable" href="#ac6d912bbfafa3a7509f66bbc1729ca25">s_size</a>, r += <a class="code hl_variable" href="#ac6d912bbfafa3a7509f66bbc1729ca25">s_size</a> + 1; l < r; l >>= 1, r >>= 1) {</div>
|
||||
<div class="line"><span class="lineno"> 308</span> <span class="keywordflow">if</span> (l & 1) {</div>
|
||||
<div class="line"><span class="lineno"> 309</span> lhs = <a class="code hl_function" href="#a41c733f5f5e262b308f7cb95c88c1e74">combine</a>(lhs, <a class="code hl_variable" href="#afbf8a9cb9449d5ca844f4e141a801e6a">s_tree</a>[l++]);</div>
|
||||
<div class="line"><span class="lineno"> 306</span> <a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">X</a> <a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">lhs</a> = <a class="code hl_variable" href="#aa7f93971a9f891e0bbb7023081f379d5">sret_init</a>, <a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">rhs</a> = <a class="code hl_variable" href="#aa7f93971a9f891e0bbb7023081f379d5">sret_init</a>;</div>
|
||||
<div class="line"><span class="lineno"> 307</span> <span class="keywordflow">for</span> (<a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">l</a> += <a class="code hl_variable" href="#ac6d912bbfafa3a7509f66bbc1729ca25">s_size</a>, <a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">r</a> += <a class="code hl_variable" href="#ac6d912bbfafa3a7509f66bbc1729ca25">s_size</a> + 1; <a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">l < r; l ></a>>= 1, <a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">r</a> >>= 1) {</div>
|
||||
<div class="line"><span class="lineno"> 308</span> <span class="keywordflow">if</span> (<a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">l</a> & 1) {</div>
|
||||
<div class="line"><span class="lineno"> 309</span> <a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">lhs</a> = <a class="code hl_function" href="#a41c733f5f5e262b308f7cb95c88c1e74">combine</a>(<a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">lhs</a>, <a class="code hl_variable" href="#afbf8a9cb9449d5ca844f4e141a801e6a">s_tree</a>[<a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">l</a>++]);</div>
|
||||
<div class="line"><span class="lineno"> 310</span> }</div>
|
||||
<div class="line"><span class="lineno"> 311</span> <span class="keywordflow">if</span> (r & 1) {</div>
|
||||
<div class="line"><span class="lineno"> 312</span> rhs = <a class="code hl_function" href="#a41c733f5f5e262b308f7cb95c88c1e74">combine</a>(<a class="code hl_variable" href="#afbf8a9cb9449d5ca844f4e141a801e6a">s_tree</a>[--r], rhs);</div>
|
||||
<div class="line"><span class="lineno"> 311</span> <span class="keywordflow">if</span> (<a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">r</a> & 1) {</div>
|
||||
<div class="line"><span class="lineno"> 312</span> <a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">rhs</a> = <a class="code hl_function" href="#a41c733f5f5e262b308f7cb95c88c1e74">combine</a>(<a class="code hl_variable" href="#afbf8a9cb9449d5ca844f4e141a801e6a">s_tree</a>[--<a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">r</a>], <a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">rhs</a>);</div>
|
||||
<div class="line"><span class="lineno"> 313</span> }</div>
|
||||
<div class="line"><span class="lineno"> 314</span> }</div>
|
||||
<div class="line"><span class="lineno"> 315</span> <span class="keywordflow">return</span> <a class="code hl_function" href="#a41c733f5f5e262b308f7cb95c88c1e74">combine</a>(lhs, rhs);</div>
|
||||
<div class="line"><span class="lineno"> 315</span> <span class="keywordflow">return</span> <a class="code hl_function" href="#a41c733f5f5e262b308f7cb95c88c1e74">combine</a>(<a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">lhs</a>, <a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">rhs</a>);</div>
|
||||
<div class="line"><span class="lineno"> 316</span> }</div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_s_g_html_a41c733f5f5e262b308f7cb95c88c1e74"><div class="ttname"><a href="#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> <a href="../../d2/de9/heavy__light__decomposition_8cpp_source.html#l00274">heavy_light_decomposition.cpp:274</a></div></div>
|
||||
<div class="ttc" id="aclassrange__queries_1_1heavy__light__decomposition_1_1_s_g_html_aa7f93971a9f891e0bbb7023081f379d5"><div class="ttname"><a href="#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> <a href="../../d2/de9/heavy__light__decomposition_8cpp_source.html#l00264">heavy_light_decomposition.cpp:264</a></div></div>
|
||||
@@ -343,7 +344,7 @@ template<typename X > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename X > </div>
|
||||
template<typename X> </div>
|
||||
<table class="mlabels">
|
||||
<tr>
|
||||
<td class="mlabels-left">
|
||||
@@ -357,7 +358,7 @@ template<typename X > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -377,7 +378,7 @@ template<typename X > </div>
|
||||
</ul>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d2/de9/heavy__light__decomposition_8cpp_source.html#l00329">329</a> of file <a class="el" href="../../d2/de9/heavy__light__decomposition_8cpp_source.html">heavy_light_decomposition.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 329</span>{ <a class="code hl_variable" href="#aa7f93971a9f891e0bbb7023081f379d5">sret_init</a> = new_sret_init; }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 329</span>{ <a class="code hl_variable" href="#aa7f93971a9f891e0bbb7023081f379d5">sret_init</a> = <a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">new_sret_init</a>; }</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -387,7 +388,7 @@ template<typename X > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename X > </div>
|
||||
template<typename X> </div>
|
||||
<table class="mlabels">
|
||||
<tr>
|
||||
<td class="mlabels-left">
|
||||
@@ -405,7 +406,7 @@ template<typename X > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -422,8 +423,8 @@ template<typename X > </div>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d2/de9/heavy__light__decomposition_8cpp_source.html#l00293">293</a> of file <a class="el" href="../../d2/de9/heavy__light__decomposition_8cpp_source.html">heavy_light_decomposition.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 293</span> {</div>
|
||||
<div class="line"><span class="lineno"> 294</span> <span class="keywordflow">for</span> (p += <a class="code hl_variable" href="#ac6d912bbfafa3a7509f66bbc1729ca25">s_size</a>; p > 0; p >>= 1) {</div>
|
||||
<div class="line"><span class="lineno"> 295</span> <a class="code hl_variable" href="#afbf8a9cb9449d5ca844f4e141a801e6a">s_tree</a>[p] += v;</div>
|
||||
<div class="line"><span class="lineno"> 294</span> <span class="keywordflow">for</span> (<a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">p</a> += <a class="code hl_variable" href="#ac6d912bbfafa3a7509f66bbc1729ca25">s_size</a>; <a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">p</a> > 0; <a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">p</a> >>= 1) {</div>
|
||||
<div class="line"><span class="lineno"> 295</span> <a class="code hl_variable" href="#afbf8a9cb9449d5ca844f4e141a801e6a">s_tree</a>[<a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">p</a>] += <a class="code hl_class" href="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">v</a>;</div>
|
||||
<div class="line"><span class="lineno"> 296</span> }</div>
|
||||
<div class="line"><span class="lineno"> 297</span> }</div>
|
||||
</div><!-- fragment -->
|
||||
@@ -436,9 +437,9 @@ template<typename X > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename X > </div>
|
||||
template<typename X> </div>
|
||||
<div class="memtemplate">
|
||||
template<typename T > </div>
|
||||
template<typename T> </div>
|
||||
<table class="mlabels">
|
||||
<tr>
|
||||
<td class="mlabels-left">
|
||||
@@ -449,7 +450,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">friend</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel friend">friend</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -465,7 +466,7 @@ template<typename T > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename X > </div>
|
||||
template<typename X> </div>
|
||||
<table class="mlabels">
|
||||
<tr>
|
||||
<td class="mlabels-left">
|
||||
@@ -476,7 +477,7 @@ template<typename X > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -493,7 +494,7 @@ template<typename X > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename X > </div>
|
||||
template<typename X> </div>
|
||||
<table class="mlabels">
|
||||
<tr>
|
||||
<td class="mlabels-left">
|
||||
@@ -504,7 +505,7 @@ template<typename X > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -522,7 +523,7 @@ template<typename X > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename X > </div>
|
||||
template<typename X> </div>
|
||||
<table class="mlabels">
|
||||
<tr>
|
||||
<td class="mlabels-left">
|
||||
@@ -533,7 +534,7 @@ template<typename X > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -553,7 +554,7 @@ template<typename X > </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="../../d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html">SG</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: numerical_methods/inverse_fast_fourier_transform.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -225,7 +225,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -295,7 +295,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../d9/d37/inverse__fast__fourier__transform_8cpp.html">inverse_fast_fourier_transform.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var inverse__fast__fourier__transform_8cpp =
|
||||
[
|
||||
[ "InverseFastFourierTransform", "d9/d37/inverse__fast__fourier__transform_8cpp.html#aee56dc85997b8cd42bad71a5d6bd2d93", null ],
|
||||
[ "numerical_methods::InverseFastFourierTransform", "d1/de0/namespacenumerical__methods.html#aee56dc85997b8cd42bad71a5d6bd2d93", null ],
|
||||
[ "main", "d9/d37/inverse__fast__fourier__transform_8cpp.html#abf9e6b7e6f15df4b525a2e7705ba3089", null ],
|
||||
[ "test", "d9/d37/inverse__fast__fourier__transform_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: numerical_methods/inverse_fast_fourier_transform.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,14 +124,15 @@ $(function(){initNavTree('d9/d37/inverse__fast__fourier__transform_8cpp_source.h
|
||||
<div class="headertitle"><div class="title">inverse_fast_fourier_transform.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d9/d37/inverse__fast__fourier__transform_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d9/d37/inverse__fast__fourier__transform_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <cmath></span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <complex></span> </div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include <cstdint></span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include <vector></span> </div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d1/de0/namespacenumerical__methods.html">numerical_methods</a> {</div>
|
||||
<div class="foldopen" id="foldopen00034" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="../../d1/de0/namespacenumerical__methods.html#aee56dc85997b8cd42bad71a5d6bd2d93"> 34</a></span>std::complex<double> *<a class="code hl_function" href="../../d1/de0/namespacenumerical__methods.html#aee56dc85997b8cd42bad71a5d6bd2d93">InverseFastFourierTransform</a>(std::complex<double> *p,</div>
|
||||
@@ -194,7 +195,7 @@ $(function(){initNavTree('d9/d37/inverse__fast__fourier__transform_8cpp_source.h
|
||||
</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="comment">// namespace numerical_methods</span></div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> </div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span></div>
|
||||
<div class="foldopen" id="foldopen00101" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"><a class="line" href="../../d9/d37/inverse__fast__fourier__transform_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 101</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d37/inverse__fast__fourier__transform_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="comment">/* descriptions of the following test */</span></div>
|
||||
@@ -242,7 +243,8 @@ $(function(){initNavTree('d9/d37/inverse__fast__fourier__transform_8cpp_source.h
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> std::cout << <span class="stringliteral">"All tests have successfully passed!\n"</span>;</div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span></div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> </div>
|
||||
<div class="foldopen" id="foldopen00157" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"><a class="line" href="../../d9/d37/inverse__fast__fourier__transform_8cpp.html#abf9e6b7e6f15df4b525a2e7705ba3089"> 157</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> <span class="keyword">const</span> *argv[]) {</div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <a class="code hl_function" href="../../d9/d37/inverse__fast__fourier__transform_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -260,7 +262,7 @@ $(function(){initNavTree('d9/d37/inverse__fast__fourier__transform_8cpp_source.h
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../d9/d37/inverse__fast__fourier__transform_8cpp.html">inverse_fast_fourier_transform.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: graph/hopcroft_karp.cpp Pages: 1 -->
|
||||
<svg width="430pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: graph/hopcroft_karp.cpp Pages: 1 -->
|
||||
<svg width="430pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: bit_manipulation/set_kth_bit.cpp Pages: 1 -->
|
||||
<svg width="191pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: bit_manipulation/set_kth_bit.cpp Pages: 1 -->
|
||||
<svg width="191pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/magic_number.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -209,7 +209,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -249,7 +249,7 @@ Functions</h2></td></tr>
|
||||
<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="../../d9/d44/magic__number_8cpp.html">magic_number.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var magic__number_8cpp =
|
||||
[
|
||||
[ "magic_number", "d9/d44/magic__number_8cpp.html#a8d8e81a7cd59644b311ef9adb268f5f0", null ],
|
||||
[ "math::magic_number", "dd/d47/namespacemath.html#a8d8e81a7cd59644b311ef9adb268f5f0", null ],
|
||||
[ "main", "d9/d44/magic__number_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "tests", "d9/d44/magic__number_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/magic_number.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,11 +124,11 @@ $(function(){initNavTree('d9/d44/magic__number_8cpp_source.html','../../'); init
|
||||
<div class="headertitle"><div class="title">magic_number.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d9/d44/magic__number_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d9/d44/magic__number_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include <cstdint></span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span></div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../dd/d47/namespacemath.html">math</a> {</div>
|
||||
<div class="foldopen" id="foldopen00033" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="../../dd/d47/namespacemath.html#a8d8e81a7cd59644b311ef9adb268f5f0"> 33</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../dd/d47/namespacemath.html#a8d8e81a7cd59644b311ef9adb268f5f0">magic_number</a>(<span class="keyword">const</span> uint64_t &n) {</div>
|
||||
@@ -146,7 +146,7 @@ $(function(){initNavTree('d9/d44/magic__number_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span>} <span class="comment">// namespace math</span></div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> </div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span></div>
|
||||
<div class="foldopen" id="foldopen00052" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"><a class="line" href="../../d9/d44/magic__number_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e"> 52</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d44/magic__number_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>() {</div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> std::cout << <span class="stringliteral">"Test 1:\t n=60\n"</span>;</div>
|
||||
@@ -170,7 +170,7 @@ $(function(){initNavTree('d9/d44/magic__number_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> std::cout << <span class="stringliteral">"passed\n"</span>;</div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> </div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span></div>
|
||||
<div class="foldopen" id="foldopen00078" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="../../d9/d44/magic__number_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 78</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d44/magic__number_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <a class="code hl_function" href="../../d9/d44/magic__number_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>(); <span class="comment">// execute the tests</span></div>
|
||||
@@ -187,7 +187,7 @@ $(function(){initNavTree('d9/d44/magic__number_8cpp_source.html','../../'); init
|
||||
<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="../../d9/d44/magic__number_8cpp.html">magic_number.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: greedy_algorithms/digit_separation.cpp Pages: 1 -->
|
||||
<svg width="386pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: greedy_algorithms/digit_separation.cpp Pages: 1 -->
|
||||
<svg width="386pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: machine_learning/kohonen_som_trace.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -180,6 +180,8 @@ Functions</h2></td></tr>
|
||||
<tr class="separator:a2256c10b16edba377b64a44b6c656908"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a3c04138a5bfe5d72780bb7e82a18e627" id="r_a3c04138a5bfe5d72780bb7e82a18e627"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#a3c04138a5bfe5d72780bb7e82a18e627">main</a> (int argc, char **argv)</td></tr>
|
||||
<tr class="separator:a3c04138a5bfe5d72780bb7e82a18e627"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a042f435bca0839e721fc1574a61e8da3" id="r_a042f435bca0839e721fc1574a61e8da3"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a042f435bca0839e721fc1574a61e8da3">kohonen_som_tracer</a> (const std::vector< std::valarray< double > > &X, std::vector< std::valarray< double > > *W, double alpha_min)</td></tr>
|
||||
<tr class="separator:a042f435bca0839e721fc1574a61e8da3"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p><a href="https://en.wikipedia.org/wiki/Self-organizing_map" target="_blank">Kohonen self organizing map</a> (data tracing) </p>
|
||||
@@ -227,6 +229,70 @@ The compiled code is much slower when compiled with MS Visual C++ 2019 than with
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="a042f435bca0839e721fc1574a61e8da3" name="a042f435bca0839e721fc1574a61e8da3"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a042f435bca0839e721fc1574a61e8da3">◆ </a></span>kohonen_som_tracer()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">void machine_learning::kohonen_som_tracer </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">const std::vector< std::valarray< double > > &</td> <td class="paramname"><span class="paramname"><em>X</em></span>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">std::vector< std::valarray< double > > *</td> <td class="paramname"><span class="paramname"><em>W</em></span>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>alpha_min</em></span> )</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Apply incremental algorithm with updating neighborhood and learning rates on all samples in the given datset.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramdir">[in]</td><td class="paramname">X</td><td>data set </td></tr>
|
||||
<tr><td class="paramdir">[in,out]</td><td class="paramname">W</td><td>weights matrix </td></tr>
|
||||
<tr><td class="paramdir">[in]</td><td class="paramname">alpha_min</td><td>terminal value of alpha </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d9/d49/kohonen__som__trace_8cpp_source.html#l00149">149</a> of file <a class="el" href="../../d9/d49/kohonen__som__trace_8cpp_source.html">kohonen_som_trace.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 151</span> {</div>
|
||||
<div class="line"><span class="lineno"> 152</span> <span class="keywordtype">int</span> num_samples = X.size(); <span class="comment">// number of rows</span></div>
|
||||
<div class="line"><span class="lineno"> 153</span> <span class="comment">// int num_features = X[0].size(); // number of columns</span></div>
|
||||
<div class="line"><span class="lineno"> 154</span> <span class="keywordtype">int</span> num_out = W->size(); <span class="comment">// number of rows</span></div>
|
||||
<div class="line"><span class="lineno"> 155</span> <span class="keywordtype">int</span> R = num_out >> 2, iter = 0;</div>
|
||||
<div class="line"><span class="lineno"> 156</span> <span class="keywordtype">double</span> alpha = 1.f;</div>
|
||||
<div class="line"><span class="lineno"> 157</span> </div>
|
||||
<div class="line"><span class="lineno"> 158</span> std::valarray<double> D(num_out);</div>
|
||||
<div class="line"><span class="lineno"> 159</span> </div>
|
||||
<div class="line"><span class="lineno"> 160</span> <span class="comment">// Loop alpha from 1 to slpha_min</span></div>
|
||||
<div class="line"><span class="lineno"> 161</span> <span class="keywordflow">do</span> {</div>
|
||||
<div class="line"><span class="lineno"> 162</span> <span class="comment">// Loop for each sample pattern in the data set</span></div>
|
||||
<div class="line"><span class="lineno"> 163</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> sample = 0; sample < num_samples; sample++) {</div>
|
||||
<div class="line"><span class="lineno"> 164</span> <span class="comment">// update weights for the current input pattern sample</span></div>
|
||||
<div class="line"><span class="lineno"> 165</span> <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#ae868ad43698a1d69ba46ea3827d7d2c3">update_weights</a>(X[sample], W, &D, alpha, R);</div>
|
||||
<div class="line"><span class="lineno"> 166</span> }</div>
|
||||
<div class="line"><span class="lineno"> 167</span> </div>
|
||||
<div class="line"><span class="lineno"> 168</span> <span class="comment">// every 10th iteration, reduce the neighborhood range</span></div>
|
||||
<div class="line"><span class="lineno"> 169</span> <span class="keywordflow">if</span> (iter % 10 == 0 && R > 1) {</div>
|
||||
<div class="line"><span class="lineno"> 170</span> R--;</div>
|
||||
<div class="line"><span class="lineno"> 171</span> }</div>
|
||||
<div class="line"><span class="lineno"> 172</span> </div>
|
||||
<div class="line"><span class="lineno"> 173</span> alpha -= 0.01;</div>
|
||||
<div class="line"><span class="lineno"> 174</span> iter++;</div>
|
||||
<div class="line"><span class="lineno"> 175</span> } <span class="keywordflow">while</span> (alpha > alpha_min);</div>
|
||||
<div class="line"><span class="lineno"> 176</span>}</div>
|
||||
<div class="ttc" id="anamespacemachine__learning_html_ae868ad43698a1d69ba46ea3827d7d2c3"><div class="ttname"><a href="../../d8/d77/namespacemachine__learning.html#ae868ad43698a1d69ba46ea3827d7d2c3">machine_learning::update_weights</a></div><div class="ttdeci">double update_weights(const std::valarray< double > &X, std::vector< std::vector< std::valarray< double > > > *W, std::vector< std::valarray< double > > *D, double alpha, int R)</div><div class="ttdef"><b>Definition</b> <a href="../../d4/def/kohonen__som__topology_8cpp_source.html#l00200">kohonen_som_topology.cpp:200</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="a3c04138a5bfe5d72780bb7e82a18e627" name="a3c04138a5bfe5d72780bb7e82a18e627"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a3c04138a5bfe5d72780bb7e82a18e627">◆ </a></span>main()</h2>
|
||||
|
||||
@@ -315,7 +381,7 @@ The compiled code is much slower when compiled with MS Visual C++ 2019 than with
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d9/d49/kohonen__som__trace_8cpp_source.html#l00233">233</a> of file <a class="el" href="../../d9/d49/kohonen__som__trace_8cpp_source.html">kohonen_som_trace.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 233</span> {</div>
|
||||
<div class="line"><span class="lineno"> 234</span> <span class="keywordtype">int</span> j = 0, <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 500;</div>
|
||||
<div class="line"><span class="lineno"> 234</span> <span class="keywordtype">int</span> j = 0, N = 500;</div>
|
||||
<div class="line"><span class="lineno"> 235</span> <span class="keywordtype">int</span> features = 2;</div>
|
||||
<div class="line"><span class="lineno"> 236</span> <span class="keywordtype">int</span> num_out = 50;</div>
|
||||
<div class="line"><span class="lineno"> 237</span> std::vector<std::valarray<double>> X(N);</div>
|
||||
@@ -341,13 +407,13 @@ The compiled code is much slower when compiled with MS Visual C++ 2019 than with
|
||||
<div class="line"><span class="lineno"> 257</span> <a class="code hl_function" href="#ae571600aa42a81bc14a4a602ea5ff00d">test_circle</a>(&X); <span class="comment">// create test data around circumference of a circle</span></div>
|
||||
<div class="line"><span class="lineno"> 258</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a>(<span class="stringliteral">"test1.csv"</span>, X); <span class="comment">// save test data points</span></div>
|
||||
<div class="line"><span class="lineno"> 259</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a>(<span class="stringliteral">"w11.csv"</span>, W); <span class="comment">// save initial random weights</span></div>
|
||||
<div class="line"><span class="lineno"> 260</span> kohonen_som_tracer(X, &W, 0.1); <span class="comment">// train the SOM</span></div>
|
||||
<div class="line"><span class="lineno"> 260</span> <a class="code hl_function" href="#a042f435bca0839e721fc1574a61e8da3">kohonen_som_tracer</a>(X, &W, 0.1); <span class="comment">// train the SOM</span></div>
|
||||
<div class="line"><span class="lineno"> 261</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a>(<span class="stringliteral">"w12.csv"</span>, W); <span class="comment">// save the resultant weights</span></div>
|
||||
<div class="line"><span class="lineno"> 262</span>}</div>
|
||||
<div class="ttc" id="agroup__machine__learning_html_gae0208548f8b393528e5db01717e88e67"><div class="ttname"><a href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a></div><div class="ttdeci">int save_nd_data(const char *fname, const std::vector< std::valarray< double > > &X)</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d49/kohonen__som__trace_8cpp_source.html#l00058">kohonen_som_trace.cpp:58</a></div></div>
|
||||
<div class="ttc" id="agroup__machine__learning_html_gaf5ce14f026d6d231bef29161bac2b485"><div class="ttname"><a href="../../d9/d66/group__machine__learning.html#gaf5ce14f026d6d231bef29161bac2b485">_random</a></div><div class="ttdeci">double _random(double a, double b)</div><div class="ttdef"><b>Definition</b> <a href="../../d4/def/kohonen__som__topology_8cpp_source.html#l00053">kohonen_som_topology.cpp:53</a></div></div>
|
||||
<div class="ttc" id="akohonen__som__trace_8cpp_html_a042f435bca0839e721fc1574a61e8da3"><div class="ttname"><a href="#a042f435bca0839e721fc1574a61e8da3">kohonen_som_tracer</a></div><div class="ttdeci">void kohonen_som_tracer(const std::vector< std::valarray< double > > &X, std::vector< std::valarray< double > > *W, double alpha_min)</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d49/kohonen__som__trace_8cpp_source.html#l00149">kohonen_som_trace.cpp:149</a></div></div>
|
||||
<div class="ttc" id="akohonen__som__trace_8cpp_html_ae571600aa42a81bc14a4a602ea5ff00d"><div class="ttname"><a href="#ae571600aa42a81bc14a4a602ea5ff00d">test_circle</a></div><div class="ttdeci">void test_circle(std::vector< std::valarray< double > > *data)</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d49/kohonen__som__trace_8cpp_source.html#l00196">kohonen_som_trace.cpp:196</a></div></div>
|
||||
<div class="ttc" id="asparse__table_8cpp_html_a10f3ffb3f6f7e1b83d556b9c8de89a5d"><div class="ttname"><a href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">data_structures::sparse_table::N</a></div><div class="ttdeci">constexpr uint32_t N</div><div class="ttdoc">A struct to represent sparse table for min() as their invariant function, for the given array A....</div><div class="ttdef"><b>Definition</b> <a href="../../d8/dab/sparse__table_8cpp_source.html#l00048">sparse_table.cpp:48</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -379,7 +445,7 @@ The compiled code is much slower when compiled with MS Visual C++ 2019 than with
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d9/d49/kohonen__som__trace_8cpp_source.html#l00315">315</a> of file <a class="el" href="../../d9/d49/kohonen__som__trace_8cpp_source.html">kohonen_som_trace.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 315</span> {</div>
|
||||
<div class="line"><span class="lineno"> 316</span> <span class="keywordtype">int</span> j = 0, <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 500;</div>
|
||||
<div class="line"><span class="lineno"> 316</span> <span class="keywordtype">int</span> j = 0, N = 500;</div>
|
||||
<div class="line"><span class="lineno"> 317</span> <span class="keywordtype">int</span> features = 2;</div>
|
||||
<div class="line"><span class="lineno"> 318</span> <span class="keywordtype">int</span> num_out = 20;</div>
|
||||
<div class="line"><span class="lineno"> 319</span> std::vector<std::valarray<double>> X(N);</div>
|
||||
@@ -405,7 +471,7 @@ The compiled code is much slower when compiled with MS Visual C++ 2019 than with
|
||||
<div class="line"><span class="lineno"> 339</span> <a class="code hl_function" href="#a53082f2e5bacec40266499da4547309a">test_lamniscate</a>(&X); <span class="comment">// create test data around the lamniscate</span></div>
|
||||
<div class="line"><span class="lineno"> 340</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a>(<span class="stringliteral">"test2.csv"</span>, X); <span class="comment">// save test data points</span></div>
|
||||
<div class="line"><span class="lineno"> 341</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a>(<span class="stringliteral">"w21.csv"</span>, W); <span class="comment">// save initial random weights</span></div>
|
||||
<div class="line"><span class="lineno"> 342</span> kohonen_som_tracer(X, &W, 0.01); <span class="comment">// train the SOM</span></div>
|
||||
<div class="line"><span class="lineno"> 342</span> <a class="code hl_function" href="#a042f435bca0839e721fc1574a61e8da3">kohonen_som_tracer</a>(X, &W, 0.01); <span class="comment">// train the SOM</span></div>
|
||||
<div class="line"><span class="lineno"> 343</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a>(<span class="stringliteral">"w22.csv"</span>, W); <span class="comment">// save the resultant weights</span></div>
|
||||
<div class="line"><span class="lineno"> 344</span>}</div>
|
||||
<div class="ttc" id="akohonen__som__trace_8cpp_html_a53082f2e5bacec40266499da4547309a"><div class="ttname"><a href="#a53082f2e5bacec40266499da4547309a">test_lamniscate</a></div><div class="ttdeci">void test_lamniscate(std::vector< std::valarray< double > > *data)</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d49/kohonen__som__trace_8cpp_source.html#l00277">kohonen_som_trace.cpp:277</a></div></div>
|
||||
@@ -440,7 +506,7 @@ The compiled code is much slower when compiled with MS Visual C++ 2019 than with
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d9/d49/kohonen__som__trace_8cpp_source.html#l00414">414</a> of file <a class="el" href="../../d9/d49/kohonen__som__trace_8cpp_source.html">kohonen_som_trace.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 414</span> {</div>
|
||||
<div class="line"><span class="lineno"> 415</span> <span class="keywordtype">int</span> j = 0, <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 200;</div>
|
||||
<div class="line"><span class="lineno"> 415</span> <span class="keywordtype">int</span> j = 0, N = 200;</div>
|
||||
<div class="line"><span class="lineno"> 416</span> <span class="keywordtype">int</span> features = 3;</div>
|
||||
<div class="line"><span class="lineno"> 417</span> <span class="keywordtype">int</span> num_out = 20;</div>
|
||||
<div class="line"><span class="lineno"> 418</span> std::vector<std::valarray<double>> X(N);</div>
|
||||
@@ -466,7 +532,7 @@ The compiled code is much slower when compiled with MS Visual C++ 2019 than with
|
||||
<div class="line"><span class="lineno"> 438</span> <a class="code hl_function" href="#a7154fe319e6033485a8a6cd6f0d8932d">test_3d_classes</a>(&X); <span class="comment">// create test data around the lamniscate</span></div>
|
||||
<div class="line"><span class="lineno"> 439</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a>(<span class="stringliteral">"test3.csv"</span>, X); <span class="comment">// save test data points</span></div>
|
||||
<div class="line"><span class="lineno"> 440</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a>(<span class="stringliteral">"w31.csv"</span>, W); <span class="comment">// save initial random weights</span></div>
|
||||
<div class="line"><span class="lineno"> 441</span> kohonen_som_tracer(X, &W, 0.01); <span class="comment">// train the SOM</span></div>
|
||||
<div class="line"><span class="lineno"> 441</span> <a class="code hl_function" href="#a042f435bca0839e721fc1574a61e8da3">kohonen_som_tracer</a>(X, &W, 0.01); <span class="comment">// train the SOM</span></div>
|
||||
<div class="line"><span class="lineno"> 442</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a>(<span class="stringliteral">"w32.csv"</span>, W); <span class="comment">// save the resultant weights</span></div>
|
||||
<div class="line"><span class="lineno"> 443</span>}</div>
|
||||
<div class="ttc" id="akohonen__som__trace_8cpp_html_a7154fe319e6033485a8a6cd6f0d8932d"><div class="ttname"><a href="#a7154fe319e6033485a8a6cd6f0d8932d">test_3d_classes</a></div><div class="ttdeci">void test_3d_classes(std::vector< std::valarray< double > > *data)</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d49/kohonen__som__trace_8cpp_source.html#l00359">kohonen_som_trace.cpp:359</a></div></div>
|
||||
@@ -506,7 +572,7 @@ The compiled code is much slower when compiled with MS Visual C++ 2019 than with
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d9/d49/kohonen__som__trace_8cpp_source.html#l00359">359</a> of file <a class="el" href="../../d9/d49/kohonen__som__trace_8cpp_source.html">kohonen_som_trace.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 359</span> {</div>
|
||||
<div class="line"><span class="lineno"> 360</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>->size();</div>
|
||||
<div class="line"><span class="lineno"> 360</span> <span class="keyword">const</span> <span class="keywordtype">int</span> N = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>->size();</div>
|
||||
<div class="line"><span class="lineno"> 361</span> <span class="keyword">const</span> <span class="keywordtype">double</span> R = 0.1; <span class="comment">// radius of cluster</span></div>
|
||||
<div class="line"><span class="lineno"> 362</span> <span class="keywordtype">int</span> i = 0;</div>
|
||||
<div class="line"><span class="lineno"> 363</span> <span class="keyword">const</span> <span class="keywordtype">int</span> num_classes = 8;</div>
|
||||
@@ -525,7 +591,7 @@ The compiled code is much slower when compiled with MS Visual C++ 2019 than with
|
||||
<div class="line"><span class="lineno"> 376</span><span class="preprocessor">#ifdef _OPENMP</span></div>
|
||||
<div class="line"><span class="lineno"> 377</span><span class="preprocessor">#pragma omp for</span></div>
|
||||
<div class="line"><span class="lineno"> 378</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><span class="lineno"> 379</span> <span class="keywordflow">for</span> (i = 0; i < <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 379</span> <span class="keywordflow">for</span> (i = 0; i < N; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 380</span> <span class="keywordtype">int</span> cls =</div>
|
||||
<div class="line"><span class="lineno"> 381</span> std::rand() % num_classes; <span class="comment">// select a random class for the point</span></div>
|
||||
<div class="line"><span class="lineno"> 382</span> </div>
|
||||
@@ -559,8 +625,7 @@ The compiled code is much slower when compiled with MS Visual C++ 2019 than with
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Creates a random set of points distributed <em>near</em> the circumference of a circle and trains an SOM that finds that circular pattern. The generating function is </p><p class="formulaDsp">
|
||||
\begin{eqnarray*}
|
||||
r &\in& [1-\delta r, 1+\delta r)\\
|
||||
\begin{eqnarray*}r &\in& [1-\delta r, 1+\delta r)\\
|
||||
\theta &\in& [0, 2\pi)\\
|
||||
x &=& r\cos\theta\\
|
||||
y &=& r\sin\theta
|
||||
@@ -575,7 +640,7 @@ y &=& r\sin\theta
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d9/d49/kohonen__som__trace_8cpp_source.html#l00196">196</a> of file <a class="el" href="../../d9/d49/kohonen__som__trace_8cpp_source.html">kohonen_som_trace.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 196</span> {</div>
|
||||
<div class="line"><span class="lineno"> 197</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>->size();</div>
|
||||
<div class="line"><span class="lineno"> 197</span> <span class="keyword">const</span> <span class="keywordtype">int</span> N = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>->size();</div>
|
||||
<div class="line"><span class="lineno"> 198</span> <span class="keyword">const</span> <span class="keywordtype">double</span> R = 0.75, dr = 0.3;</div>
|
||||
<div class="line"><span class="lineno"> 199</span> <span class="keywordtype">double</span> a_t = 0., b_t = 2.f * M_PI; <span class="comment">// theta random between 0 and 2*pi</span></div>
|
||||
<div class="line"><span class="lineno"> 200</span> <span class="keywordtype">double</span> a_r = R - dr, b_r = R + dr; <span class="comment">// radius random between R-dr and R+dr</span></div>
|
||||
@@ -584,7 +649,7 @@ y &=& r\sin\theta
|
||||
<div class="line"><span class="lineno"> 203</span><span class="preprocessor">#ifdef _OPENMP</span></div>
|
||||
<div class="line"><span class="lineno"> 204</span><span class="preprocessor">#pragma omp for</span></div>
|
||||
<div class="line"><span class="lineno"> 205</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><span class="lineno"> 206</span> <span class="keywordflow">for</span> (i = 0; i < <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 206</span> <span class="keywordflow">for</span> (i = 0; i < N; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 207</span> <span class="keywordtype">double</span> r = <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gaf5ce14f026d6d231bef29161bac2b485">_random</a>(a_r, b_r); <span class="comment">// random radius</span></div>
|
||||
<div class="line"><span class="lineno"> 208</span> <span class="keywordtype">double</span> theta = <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gaf5ce14f026d6d231bef29161bac2b485">_random</a>(a_t, b_t); <span class="comment">// random theta</span></div>
|
||||
<div class="line"><span class="lineno"> 209</span> <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>[0][i][0] = r * cos(theta); <span class="comment">// convert from polar to cartesian</span></div>
|
||||
@@ -609,8 +674,7 @@ y &=& r\sin\theta
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Creates a random set of points distributed <em>near</em> the locus of the <a href="https://en.wikipedia.org/wiki/Lemniscate_of_Gerono" target="_blank">Lamniscate of Gerono</a>. </p><p class="formulaDsp">
|
||||
\begin{eqnarray*}
|
||||
\delta r &=& 0.2\\
|
||||
\begin{eqnarray*}\delta r &=& 0.2\\
|
||||
\delta x &\in& [-\delta r, \delta r)\\
|
||||
\delta y &\in& [-\delta r, \delta r)\\
|
||||
\theta &\in& [0, \pi)\\
|
||||
@@ -627,14 +691,14 @@ y &=& \delta y + \frac{\sin(2\theta)}{2}
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d9/d49/kohonen__som__trace_8cpp_source.html#l00277">277</a> of file <a class="el" href="../../d9/d49/kohonen__som__trace_8cpp_source.html">kohonen_som_trace.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 277</span> {</div>
|
||||
<div class="line"><span class="lineno"> 278</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>->size();</div>
|
||||
<div class="line"><span class="lineno"> 278</span> <span class="keyword">const</span> <span class="keywordtype">int</span> N = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>->size();</div>
|
||||
<div class="line"><span class="lineno"> 279</span> <span class="keyword">const</span> <span class="keywordtype">double</span> dr = 0.2;</div>
|
||||
<div class="line"><span class="lineno"> 280</span> <span class="keywordtype">int</span> i = 0;</div>
|
||||
<div class="line"><span class="lineno"> 281</span> </div>
|
||||
<div class="line"><span class="lineno"> 282</span><span class="preprocessor">#ifdef _OPENMP</span></div>
|
||||
<div class="line"><span class="lineno"> 283</span><span class="preprocessor">#pragma omp for</span></div>
|
||||
<div class="line"><span class="lineno"> 284</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><span class="lineno"> 285</span> <span class="keywordflow">for</span> (i = 0; i < <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 285</span> <span class="keywordflow">for</span> (i = 0; i < N; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 286</span> <span class="keywordtype">double</span> dx = <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gaf5ce14f026d6d231bef29161bac2b485">_random</a>(-dr, dr); <span class="comment">// random change in x</span></div>
|
||||
<div class="line"><span class="lineno"> 287</span> <span class="keywordtype">double</span> dy = <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gaf5ce14f026d6d231bef29161bac2b485">_random</a>(-dr, dr); <span class="comment">// random change in y</span></div>
|
||||
<div class="line"><span class="lineno"> 288</span> <span class="keywordtype">double</span> theta = <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gaf5ce14f026d6d231bef29161bac2b485">_random</a>(0, M_PI); <span class="comment">// random theta</span></div>
|
||||
@@ -651,7 +715,7 @@ y &=& \delta y + \frac{\sin(2\theta)}{2}
|
||||
<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="../../d9/d49/kohonen__som__trace_8cpp.html">kohonen_som_trace.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -3,6 +3,7 @@ var kohonen__som__trace_8cpp =
|
||||
[ "_random", "d9/d66/group__machine__learning.html#gaf5ce14f026d6d231bef29161bac2b485", null ],
|
||||
[ "get_clock_diff", "d9/d49/kohonen__som__trace_8cpp.html#a2256c10b16edba377b64a44b6c656908", null ],
|
||||
[ "kohonen_som_tracer", "d9/d49/kohonen__som__trace_8cpp.html#a042f435bca0839e721fc1574a61e8da3", null ],
|
||||
[ "machine_learning::kohonen_som_tracer", "d8/d77/namespacemachine__learning.html#a042f435bca0839e721fc1574a61e8da3", null ],
|
||||
[ "main", "d9/d49/kohonen__som__trace_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627", null ],
|
||||
[ "save_nd_data", "d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67", null ],
|
||||
[ "test1", "d9/d49/kohonen__som__trace_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0", null ],
|
||||
@@ -11,5 +12,5 @@ var kohonen__som__trace_8cpp =
|
||||
[ "test_3d_classes", "d9/d49/kohonen__som__trace_8cpp.html#a7154fe319e6033485a8a6cd6f0d8932d", null ],
|
||||
[ "test_circle", "d9/d49/kohonen__som__trace_8cpp.html#ae571600aa42a81bc14a4a602ea5ff00d", null ],
|
||||
[ "test_lamniscate", "d9/d49/kohonen__som__trace_8cpp.html#a53082f2e5bacec40266499da4547309a", null ],
|
||||
[ "update_weights", "d9/d49/kohonen__som__trace_8cpp.html#aa6aac06ccf128b0a9c55c9ee1a8e5631", null ]
|
||||
[ "machine_learning::update_weights", "d8/d77/namespacemachine__learning.html#aa6aac06ccf128b0a9c55c9ee1a8e5631", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: machine_learning/kohonen_som_trace.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,7 +124,7 @@ $(function(){initNavTree('d9/d49/kohonen__som__trace_8cpp_source.html','../../')
|
||||
<div class="headertitle"><div class="title">kohonen_som_trace.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d9/d49/kohonen__som__trace_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d9/d49/kohonen__som__trace_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#define _USE_MATH_DEFINES </span><span class="comment">// required for MS Visual C++</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include <algorithm></span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#include <array></span></div>
|
||||
@@ -138,11 +138,11 @@ $(function(){initNavTree('d9/d49/kohonen__som__trace_8cpp_source.html','../../')
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#ifdef _OPENMP </span><span class="comment">// check if OpenMP based parallellization is available</span></div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="preprocessor">#include <omp.h></span></div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> </div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span></div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gaf5ce14f026d6d231bef29161bac2b485">_random</a>(<span class="keywordtype">double</span> a, <span class="keywordtype">double</span> b) {</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordflow">return</span> ((b - a) * (std::rand() % 100) / 100.f) + a;</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> </div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span></div>
|
||||
<div class="foldopen" id="foldopen00058" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67"> 58</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *fname,</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keyword">const</span> std::vector<std::valarray<double>> &X) {</div>
|
||||
@@ -175,9 +175,9 @@ $(function(){initNavTree('d9/d49/kohonen__som__trace_8cpp_source.html','../../')
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> </div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span></div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d8/d77/namespacemachine__learning.html">machine_learning</a> {</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> </div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span></div>
|
||||
<div class="foldopen" id="foldopen00103" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"><a class="line" href="../../d8/d77/namespacemachine__learning.html#aa6aac06ccf128b0a9c55c9ee1a8e5631"> 103</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#ae868ad43698a1d69ba46ea3827d7d2c3">update_weights</a>(<span class="keyword">const</span> std::valarray<double> &x,</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> std::vector<std::valarray<double>> *W,</div>
|
||||
@@ -217,7 +217,7 @@ $(function(){initNavTree('d9/d49/kohonen__som__trace_8cpp_source.html','../../')
|
||||
<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>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> </div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span></div>
|
||||
<div class="foldopen" id="foldopen00149" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"><a class="line" href="../../d8/d77/namespacemachine__learning.html#a042f435bca0839e721fc1574a61e8da3"> 149</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a042f435bca0839e721fc1574a61e8da3">kohonen_som_tracer</a>(<span class="keyword">const</span> std::vector<std::valarray<double>> &X,</div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> std::vector<std::valarray<double>> *W,</div>
|
||||
@@ -250,9 +250,10 @@ $(function(){initNavTree('d9/d49/kohonen__som__trace_8cpp_source.html','../../')
|
||||
</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="comment">// namespace machine_learning</span></div>
|
||||
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> </div>
|
||||
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span></div>
|
||||
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> </div>
|
||||
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span><span class="keyword">using </span><a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a042f435bca0839e721fc1574a61e8da3">machine_learning::kohonen_som_tracer</a>;</div>
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> </div>
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span></div>
|
||||
<div class="foldopen" id="foldopen00196" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"><a class="line" href="../../d9/d49/kohonen__som__trace_8cpp.html#ae571600aa42a81bc14a4a602ea5ff00d"> 196</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d49/kohonen__som__trace_8cpp.html#ae571600aa42a81bc14a4a602ea5ff00d">test_circle</a>(std::vector<std::valarray<double>> *<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>) {</div>
|
||||
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> <span class="keyword">const</span> <span class="keywordtype">int</span> N = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>->size();</div>
|
||||
@@ -272,7 +273,7 @@ $(function(){initNavTree('d9/d49/kohonen__som__trace_8cpp_source.html','../../')
|
||||
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> }</div>
|
||||
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> </div>
|
||||
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span></div>
|
||||
<div class="foldopen" id="foldopen00233" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"><a class="line" href="../../d9/d49/kohonen__som__trace_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0"> 233</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d49/kohonen__som__trace_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0">test1</a>() {</div>
|
||||
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> <span class="keywordtype">int</span> j = 0, N = 500;</div>
|
||||
@@ -301,11 +302,11 @@ $(function(){initNavTree('d9/d49/kohonen__som__trace_8cpp_source.html','../../')
|
||||
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> <a class="code hl_function" href="../../d9/d49/kohonen__som__trace_8cpp.html#ae571600aa42a81bc14a4a602ea5ff00d">test_circle</a>(&X); <span class="comment">// create test data around circumference of a circle</span></div>
|
||||
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a>(<span class="stringliteral">"test1.csv"</span>, X); <span class="comment">// save test data points</span></div>
|
||||
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a>(<span class="stringliteral">"w11.csv"</span>, W); <span class="comment">// save initial random weights</span></div>
|
||||
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> kohonen_som_tracer(X, &W, 0.1); <span class="comment">// train the SOM</span></div>
|
||||
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> <a class="code hl_function" href="../../d9/d49/kohonen__som__trace_8cpp.html#a042f435bca0839e721fc1574a61e8da3">kohonen_som_tracer</a>(X, &W, 0.1); <span class="comment">// train the SOM</span></div>
|
||||
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a>(<span class="stringliteral">"w12.csv"</span>, W); <span class="comment">// save the resultant weights</span></div>
|
||||
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span> </div>
|
||||
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span></div>
|
||||
<div class="foldopen" id="foldopen00277" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"><a class="line" href="../../d9/d49/kohonen__som__trace_8cpp.html#a53082f2e5bacec40266499da4547309a"> 277</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d49/kohonen__som__trace_8cpp.html#a53082f2e5bacec40266499da4547309a">test_lamniscate</a>(std::vector<std::valarray<double>> *<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>) {</div>
|
||||
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> <span class="keyword">const</span> <span class="keywordtype">int</span> N = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>->size();</div>
|
||||
@@ -324,7 +325,7 @@ $(function(){initNavTree('d9/d49/kohonen__som__trace_8cpp_source.html','../../')
|
||||
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span> }</div>
|
||||
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span> </div>
|
||||
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span></div>
|
||||
<div class="foldopen" id="foldopen00315" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"><a class="line" href="../../d9/d49/kohonen__som__trace_8cpp.html#a0283886819c7c140a023582b7269e2d0"> 315</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d49/kohonen__som__trace_8cpp.html#a0283886819c7c140a023582b7269e2d0">test2</a>() {</div>
|
||||
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"> 316</span> <span class="keywordtype">int</span> j = 0, N = 500;</div>
|
||||
@@ -353,11 +354,11 @@ $(function(){initNavTree('d9/d49/kohonen__som__trace_8cpp_source.html','../../')
|
||||
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"> 339</span> <a class="code hl_function" href="../../d9/d49/kohonen__som__trace_8cpp.html#a53082f2e5bacec40266499da4547309a">test_lamniscate</a>(&X); <span class="comment">// create test data around the lamniscate</span></div>
|
||||
<div class="line"><a id="l00340" name="l00340"></a><span class="lineno"> 340</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a>(<span class="stringliteral">"test2.csv"</span>, X); <span class="comment">// save test data points</span></div>
|
||||
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno"> 341</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a>(<span class="stringliteral">"w21.csv"</span>, W); <span class="comment">// save initial random weights</span></div>
|
||||
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno"> 342</span> kohonen_som_tracer(X, &W, 0.01); <span class="comment">// train the SOM</span></div>
|
||||
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno"> 342</span> <a class="code hl_function" href="../../d9/d49/kohonen__som__trace_8cpp.html#a042f435bca0839e721fc1574a61e8da3">kohonen_som_tracer</a>(X, &W, 0.01); <span class="comment">// train the SOM</span></div>
|
||||
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno"> 343</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a>(<span class="stringliteral">"w22.csv"</span>, W); <span class="comment">// save the resultant weights</span></div>
|
||||
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno"> 344</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno"> 345</span> </div>
|
||||
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno"> 345</span></div>
|
||||
<div class="foldopen" id="foldopen00359" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno"><a class="line" href="../../d9/d49/kohonen__som__trace_8cpp.html#a7154fe319e6033485a8a6cd6f0d8932d"> 359</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d49/kohonen__som__trace_8cpp.html#a7154fe319e6033485a8a6cd6f0d8932d">test_3d_classes</a>(std::vector<std::valarray<double>> *<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>) {</div>
|
||||
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno"> 360</span> <span class="keyword">const</span> <span class="keywordtype">int</span> N = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>->size();</div>
|
||||
@@ -395,7 +396,7 @@ $(function(){initNavTree('d9/d49/kohonen__som__trace_8cpp_source.html','../../')
|
||||
<div class="line"><a id="l00392" name="l00392"></a><span class="lineno"> 392</span> }</div>
|
||||
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno"> 393</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno"> 394</span> </div>
|
||||
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno"> 394</span></div>
|
||||
<div class="foldopen" id="foldopen00414" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00414" name="l00414"></a><span class="lineno"><a class="line" href="../../d9/d49/kohonen__som__trace_8cpp.html#a6d0455dd5c30adda100e95f0423c786e"> 414</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d49/kohonen__som__trace_8cpp.html#a6d0455dd5c30adda100e95f0423c786e">test3</a>() {</div>
|
||||
<div class="line"><a id="l00415" name="l00415"></a><span class="lineno"> 415</span> <span class="keywordtype">int</span> j = 0, N = 200;</div>
|
||||
@@ -424,17 +425,17 @@ $(function(){initNavTree('d9/d49/kohonen__som__trace_8cpp_source.html','../../')
|
||||
<div class="line"><a id="l00438" name="l00438"></a><span class="lineno"> 438</span> <a class="code hl_function" href="../../d9/d49/kohonen__som__trace_8cpp.html#a7154fe319e6033485a8a6cd6f0d8932d">test_3d_classes</a>(&X); <span class="comment">// create test data around the lamniscate</span></div>
|
||||
<div class="line"><a id="l00439" name="l00439"></a><span class="lineno"> 439</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a>(<span class="stringliteral">"test3.csv"</span>, X); <span class="comment">// save test data points</span></div>
|
||||
<div class="line"><a id="l00440" name="l00440"></a><span class="lineno"> 440</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a>(<span class="stringliteral">"w31.csv"</span>, W); <span class="comment">// save initial random weights</span></div>
|
||||
<div class="line"><a id="l00441" name="l00441"></a><span class="lineno"> 441</span> kohonen_som_tracer(X, &W, 0.01); <span class="comment">// train the SOM</span></div>
|
||||
<div class="line"><a id="l00441" name="l00441"></a><span class="lineno"> 441</span> <a class="code hl_function" href="../../d9/d49/kohonen__som__trace_8cpp.html#a042f435bca0839e721fc1574a61e8da3">kohonen_som_tracer</a>(X, &W, 0.01); <span class="comment">// train the SOM</span></div>
|
||||
<div class="line"><a id="l00442" name="l00442"></a><span class="lineno"> 442</span> <a class="code hl_function" href="../../d9/d66/group__machine__learning.html#gae0208548f8b393528e5db01717e88e67">save_nd_data</a>(<span class="stringliteral">"w32.csv"</span>, W); <span class="comment">// save the resultant weights</span></div>
|
||||
<div class="line"><a id="l00443" name="l00443"></a><span class="lineno"> 443</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00444" name="l00444"></a><span class="lineno"> 444</span> </div>
|
||||
<div class="line"><a id="l00444" name="l00444"></a><span class="lineno"> 444</span></div>
|
||||
<div class="foldopen" id="foldopen00452" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00452" name="l00452"></a><span class="lineno"><a class="line" href="../../d9/d49/kohonen__som__trace_8cpp.html#a2256c10b16edba377b64a44b6c656908"> 452</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d9/d49/kohonen__som__trace_8cpp.html#a2256c10b16edba377b64a44b6c656908">get_clock_diff</a>(clock_t start_t, clock_t end_t) {</div>
|
||||
<div class="line"><a id="l00453" name="l00453"></a><span class="lineno"> 453</span> <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><span class="keywordtype">double</span><span class="keyword">></span>(end_t - start_t) / CLOCKS_PER_SEC;</div>
|
||||
<div class="line"><a id="l00454" name="l00454"></a><span class="lineno"> 454</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00455" name="l00455"></a><span class="lineno"> 455</span> </div>
|
||||
<div class="line"><a id="l00455" name="l00455"></a><span class="lineno"> 455</span></div>
|
||||
<div class="foldopen" id="foldopen00457" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00457" name="l00457"></a><span class="lineno"><a class="line" href="../../d9/d49/kohonen__som__trace_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627"> 457</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv) {</div>
|
||||
<div class="line"><a id="l00458" name="l00458"></a><span class="lineno"> 458</span><span class="preprocessor">#ifdef _OPENMP</span></div>
|
||||
@@ -474,6 +475,7 @@ $(function(){initNavTree('d9/d49/kohonen__som__trace_8cpp_source.html','../../')
|
||||
<div class="ttc" id="agroup__machine__learning_html_gaf5ce14f026d6d231bef29161bac2b485"><div class="ttname"><a href="../../d9/d66/group__machine__learning.html#gaf5ce14f026d6d231bef29161bac2b485">_random</a></div><div class="ttdeci">double _random(double a, double b)</div><div class="ttdef"><b>Definition</b> <a href="../../d4/def/kohonen__som__topology_8cpp_source.html#l00053">kohonen_som_topology.cpp:53</a></div></div>
|
||||
<div class="ttc" id="ahash__search_8cpp_html_a6e1a77282bc65ad359d753d25df23243"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a></div><div class="ttdeci">int data[MAX]</div><div class="ttdoc">test data</div><div class="ttdef"><b>Definition</b> <a href="../../d1/df3/hash__search_8cpp_source.html#l00024">hash_search.cpp:24</a></div></div>
|
||||
<div class="ttc" id="akohonen__som__trace_8cpp_html_a0283886819c7c140a023582b7269e2d0"><div class="ttname"><a href="../../d9/d49/kohonen__som__trace_8cpp.html#a0283886819c7c140a023582b7269e2d0">test2</a></div><div class="ttdeci">void test2()</div><div class="ttdef"><b>Definition</b> <a href="#l00315">kohonen_som_trace.cpp:315</a></div></div>
|
||||
<div class="ttc" id="akohonen__som__trace_8cpp_html_a042f435bca0839e721fc1574a61e8da3"><div class="ttname"><a href="../../d9/d49/kohonen__som__trace_8cpp.html#a042f435bca0839e721fc1574a61e8da3">kohonen_som_tracer</a></div><div class="ttdeci">void kohonen_som_tracer(const std::vector< std::valarray< double > > &X, std::vector< std::valarray< double > > *W, double alpha_min)</div><div class="ttdef"><b>Definition</b> <a href="#l00149">kohonen_som_trace.cpp:149</a></div></div>
|
||||
<div class="ttc" id="akohonen__som__trace_8cpp_html_a1440a7779ac56f47a3f355ce4a8c7da0"><div class="ttname"><a href="../../d9/d49/kohonen__som__trace_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0">test1</a></div><div class="ttdeci">void test1()</div><div class="ttdef"><b>Definition</b> <a href="#l00233">kohonen_som_trace.cpp:233</a></div></div>
|
||||
<div class="ttc" id="akohonen__som__trace_8cpp_html_a2256c10b16edba377b64a44b6c656908"><div class="ttname"><a href="../../d9/d49/kohonen__som__trace_8cpp.html#a2256c10b16edba377b64a44b6c656908">get_clock_diff</a></div><div class="ttdeci">double get_clock_diff(clock_t start_t, clock_t end_t)</div><div class="ttdef"><b>Definition</b> <a href="#l00452">kohonen_som_trace.cpp:452</a></div></div>
|
||||
<div class="ttc" id="akohonen__som__trace_8cpp_html_a53082f2e5bacec40266499da4547309a"><div class="ttname"><a href="../../d9/d49/kohonen__som__trace_8cpp.html#a53082f2e5bacec40266499da4547309a">test_lamniscate</a></div><div class="ttdeci">void test_lamniscate(std::vector< std::valarray< double > > *data)</div><div class="ttdef"><b>Definition</b> <a href="#l00277">kohonen_som_trace.cpp:277</a></div></div>
|
||||
@@ -490,7 +492,7 @@ $(function(){initNavTree('d9/d49/kohonen__som__trace_8cpp_source.html','../../')
|
||||
<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="../../d9/d49/kohonen__som__trace_8cpp.html">kohonen_som_trace.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: data_structures::Node Struct Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -183,7 +183,7 @@ Public Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -272,7 +272,7 @@ Public Attributes</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d5/d3c/namespacedata__structures.html">data_structures</a></li><li class="navelem"><a class="el" href="../../d9/d49/structdata__structures_1_1_node.html">Node</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Member List</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -151,7 +151,7 @@ $(function(){initNavTree('d1/d51/classrange__queries_1_1heavy__light__decomposit
|
||||
<!-- 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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: sorting/gnome_sort.cpp Pages: 1 -->
|
||||
<svg width="258pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: sorting/gnome_sort.cpp Pages: 1 -->
|
||||
<svg width="258pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: sparse_table Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -136,7 +136,7 @@ $(function(){initNavTree('d9/d55/namespacesparse__table.html','../../'); initRes
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d9/d55/namespacesparse__table.html">sparse_table</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Member List</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -128,35 +128,35 @@ $(function(){initNavTree('d1/def/classdata__structures_1_1linked__list_1_1list.h
|
||||
<p>This is the complete list of members for <a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a>, including all inherited members.</p>
|
||||
<table class="directory">
|
||||
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>copy_all_nodes_from_list</b>(const list &other) (defined in <a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a>)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"><span class="mlabel">private</span></td></tr>
|
||||
<tr class="odd"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ac614ed8f1953f5486fab1cd6d7aa0500">delete_all_nodes</a>()</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"><span class="mlabel">private</span></td></tr>
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a1313837c0e9ec67fd9fbd17987e2d615">display</a>()</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="odd"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a540989875252b0d41d297d67efa032a8">delete_all_nodes</a>()</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"><span class="mlabel">private</span></td></tr>
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#abf7c97616b873ffeebdd0eac2d19d13e">display</a>()</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>display</b>() const (defined in <a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a>)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a009b19ac8cca40f2e4daa2e5989fa4f3">erase</a>(int old_elem)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a1fb1792ab867dc26639eef368a56989e">erase</a>(int old_elem)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="odd"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa3801cea564a3b3bb7b03abfffdcf1e1">first</a></td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"><span class="mlabel">private</span></td></tr>
|
||||
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>head</b> (defined in <a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a>)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"><span class="mlabel">private</span></td></tr>
|
||||
<tr class="odd"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(int32_t new_elem)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a454ab4918f579869dfed4bb420a3f897">isEmpty</a>()</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="odd"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a73c52b2243a6c9501af65756123e7149">isEmpty</a>() const</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#af39bcc08641ce0c813023f364a9a9015">last</a></td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"><span class="mlabel">private</span></td></tr>
|
||||
<tr class="odd"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(int32_t new_elem)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ae8424a4fce3d483f7c85d6f6a5c79a1a">isEmpty</a>()</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="odd"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a6d50919d34481a2b96cb74627d227c0e">isEmpty</a>() const</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab87eecc80068fc5a80e98e83536885f2">last</a></td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"><span class="mlabel">private</span></td></tr>
|
||||
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>last</b>() const (defined in <a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a>)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a50e209b55b83622254177050945e7826">list</a>()</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
|
||||
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>list</b>()=default (defined in <a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a>)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a326ac4f721f7b74d5ed4f418a67b8d38">list</a>(const list &other)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="odd"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#adb04f732911fcfd30f7177b367c6af41">operator=</a>(const list &other)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a6e9859d1a0755fb51e41904d20c95496">push_back</a>(int new_elem)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="odd"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a332b965afd9d6bea8d3246673acd52c7">push_front</a>(int new_elem)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ac681c278055081ac11decb6060b300de">list</a>(const list &other)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="odd"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab164909ee7eadc4ab186d850e716abdf">operator=</a>(const list &other)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ad585670a392c7e842c992d088093dff5">push_back</a>(int new_elem)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="odd"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a9c73f393e984f93f33852334d1a04be0">push_front</a>(int new_elem)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>reverse</b>() (defined in <a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a>)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="odd"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ac466ec086c0835822467bd3d8f3ab90e">reverseList</a>()</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ad3423f7518671351340932db3c24959a">search</a>(int find_elem)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="odd"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a9785d1478e59f5a90288b2928a7094d6">top</a>() const</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(int32_t index) const</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="odd"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a8b20ca89a0346c8d4193936481528c70">reverseList</a>()</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a098be172c737f236763afdb8cada4835">search</a>(int find_elem)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="odd"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a89ad00dbd262e2527129813b53e16f81">top</a>() const</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(int32_t index) const</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>~list</b>() (defined in <a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a>)</td><td class="entry"><a class="el" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></td><td class="entry"></td></tr>
|
||||
</table></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- 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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: geometry::jarvis::Point Struct Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -181,7 +181,7 @@ Public Attributes</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d5/d5f/namespacegeometry.html">geometry</a></li><li class="navelem"><b>jarvis</b></li><li class="navelem"><a class="el" href="../../d9/d5a/structgeometry_1_1jarvis_1_1_point.html">Point</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/extended_euclid_algorithm.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -142,13 +142,13 @@ Include dependency graph for extended_euclid_algorithm.cpp:</div>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:abe92d63a0ff9bda7e304df510d5dd217" id="r_abe92d63a0ff9bda7e304df510d5dd217"><td class="memTemplParams" colspan="2">template<typename T , typename T2 > </td></tr>
|
||||
<tr class="memitem:abe92d63a0ff9bda7e304df510d5dd217" id="r_abe92d63a0ff9bda7e304df510d5dd217"><td class="memTemplParams" colspan="2">template<typename T, typename T2> </td></tr>
|
||||
<tr class="memitem:abe92d63a0ff9bda7e304df510d5dd217"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#abe92d63a0ff9bda7e304df510d5dd217">update_step</a> (T *r, T *r0, const T2 quotient)</td></tr>
|
||||
<tr class="separator:abe92d63a0ff9bda7e304df510d5dd217"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a1792ac7c33aaf26b860ab55f5652ab25" id="r_a1792ac7c33aaf26b860ab55f5652ab25"><td class="memTemplParams" colspan="2">template<typename T1 , typename T2 > </td></tr>
|
||||
<tr class="memitem:a1792ac7c33aaf26b860ab55f5652ab25" id="r_a1792ac7c33aaf26b860ab55f5652ab25"><td class="memTemplParams" colspan="2">template<typename T1, typename T2> </td></tr>
|
||||
<tr class="memitem:a1792ac7c33aaf26b860ab55f5652ab25"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a1792ac7c33aaf26b860ab55f5652ab25">extendedEuclid_1</a> (T1 A, T1 B, T1 *GCD, T2 *x, T2 *y)</td></tr>
|
||||
<tr class="separator:a1792ac7c33aaf26b860ab55f5652ab25"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:acba15ca55b3e7dcb91f3c65d72ba052d" id="r_acba15ca55b3e7dcb91f3c65d72ba052d"><td class="memTemplParams" colspan="2">template<typename T , typename T2 > </td></tr>
|
||||
<tr class="memitem:acba15ca55b3e7dcb91f3c65d72ba052d" id="r_acba15ca55b3e7dcb91f3c65d72ba052d"><td class="memTemplParams" colspan="2">template<typename T, typename T2> </td></tr>
|
||||
<tr class="memitem:acba15ca55b3e7dcb91f3c65d72ba052d"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#acba15ca55b3e7dcb91f3c65d72ba052d">extendedEuclid</a> (T A, T B, T *GCD, T2 *x, T2 *y)</td></tr>
|
||||
<tr class="separator:acba15ca55b3e7dcb91f3c65d72ba052d"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4" id="r_ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
|
||||
@@ -170,7 +170,7 @@ Functions</h2></td></tr>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T , typename T2 > </div>
|
||||
template<typename T, typename T2> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">void extendedEuclid </td>
|
||||
@@ -237,7 +237,7 @@ template<typename T , typename T2 > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T1 , typename T2 > </div>
|
||||
template<typename T1, typename T2> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">void extendedEuclid_1 </td>
|
||||
@@ -340,7 +340,7 @@ template<typename T1 , typename T2 > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T , typename T2 > </div>
|
||||
template<typename T, typename T2> </div>
|
||||
<table class="mlabels">
|
||||
<tr>
|
||||
<td class="mlabels-left">
|
||||
@@ -363,7 +363,7 @@ template<typename T , typename T2 > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -394,7 +394,7 @@ template<typename T , typename T2 > </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="../../d9/d5d/extended__euclid__algorithm_8cpp.html">extended_euclid_algorithm.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/extended_euclid_algorithm.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,11 +124,11 @@ $(function(){initNavTree('d9/d5d/extended__euclid__algorithm_8cpp_source.html','
|
||||
<div class="headertitle"><div class="title">extended_euclid_algorithm.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d9/d5d/extended__euclid__algorithm_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d9/d5d/extended__euclid__algorithm_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include <algorithm></span> <span class="comment">// for swap function</span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <cstdint></span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> </div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keyword">typename</span> T2></div>
|
||||
<div class="foldopen" id="foldopen00025" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="../../d9/d5d/extended__euclid__algorithm_8cpp.html#abe92d63a0ff9bda7e304df510d5dd217"> 25</a></span><span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d5d/extended__euclid__algorithm_8cpp.html#abe92d63a0ff9bda7e304df510d5dd217">update_step</a>(T *r, T *r0, <span class="keyword">const</span> T2 quotient) {</div>
|
||||
@@ -137,7 +137,7 @@ $(function(){initNavTree('d9/d5d/extended__euclid__algorithm_8cpp_source.html','
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> *r0 = temp;</div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span></div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="keyword">template</span> <<span class="keyword">typename</span> T1, <span class="keyword">typename</span> T2></div>
|
||||
<div class="foldopen" id="foldopen00042" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="../../d9/d5d/extended__euclid__algorithm_8cpp.html#a1792ac7c33aaf26b860ab55f5652ab25"> 42</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d5d/extended__euclid__algorithm_8cpp.html#a1792ac7c33aaf26b860ab55f5652ab25">extendedEuclid_1</a>(T1 A, T1 B, T1 *GCD, T2 *x, T2 *y) {</div>
|
||||
@@ -159,7 +159,7 @@ $(function(){initNavTree('d9/d5d/extended__euclid__algorithm_8cpp_source.html','
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> *y = t0;</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> </div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span></div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span><span class="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keyword">typename</span> T2></div>
|
||||
<div class="foldopen" id="foldopen00071" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="../../d9/d5d/extended__euclid__algorithm_8cpp.html#acba15ca55b3e7dcb91f3c65d72ba052d"> 71</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d5d/extended__euclid__algorithm_8cpp.html#acba15ca55b3e7dcb91f3c65d72ba052d">extendedEuclid</a>(T A, T B, T *GCD, T2 *x, T2 *y) {</div>
|
||||
@@ -178,7 +178,7 @@ $(function(){initNavTree('d9/d5d/extended__euclid__algorithm_8cpp_source.html','
|
||||
<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>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> </div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span></div>
|
||||
<div class="foldopen" id="foldopen00088" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"><a class="line" href="../../d9/d5d/extended__euclid__algorithm_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 88</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d5d/extended__euclid__algorithm_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> uint32_t a, b, <a class="code hl_function" href="../../d4/da0/gcd__iterative__euclidean_8cpp.html#ae48807fa2b7000afae599e67f327545e">gcd</a>;</div>
|
||||
@@ -202,7 +202,7 @@ $(function(){initNavTree('d9/d5d/extended__euclid__algorithm_8cpp_source.html','
|
||||
<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="../../d9/d5d/extended__euclid__algorithm_8cpp.html">extended_euclid_algorithm.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
142
d9/d5e/classunordered__set_1_1iterator.html
Normal file
@@ -0,0 +1,142 @@
|
||||
<!-- HTML header for doxygen 1.12.0-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<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.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: unordered_set< K >::iterator Class Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../jquery.js"></script>
|
||||
<script type="text/javascript" src="../../dynsections.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
|
||||
<script type="text/javascript">
|
||||
DoxygenAwesomeDarkModeToggle.init()
|
||||
</script>
|
||||
<script type="text/javascript" src="../../clipboard.js"></script>
|
||||
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../navtreedata.js"></script>
|
||||
<script type="text/javascript" src="../../navtree.js"></script>
|
||||
<script type="text/javascript" src="../../resize.js"></script>
|
||||
<script type="text/javascript" src="../../cookie.js"></script>
|
||||
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="../../search/search.js"></script>
|
||||
<script type="text/javascript">
|
||||
window.MathJax = {
|
||||
options: {
|
||||
ignoreHtmlClass: 'tex2jax_ignore',
|
||||
processHtmlClass: 'tex2jax_process'
|
||||
},
|
||||
loader: {
|
||||
load: ['[tex]/ams']
|
||||
},
|
||||
tex: {
|
||||
macros: {},
|
||||
packages: ['base','configmacros','ams']
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
|
||||
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">TheAlgorithms/C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">All the algorithms implemented in C++</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() { codefold.init(1); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="../../menudata.js"></script>
|
||||
<script type="text/javascript" src="../../menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('../../',true,false,'search.php','Search',true);
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||
<div id="nav-tree">
|
||||
<div id="nav-tree-contents">
|
||||
<div id="nav-sync" class="sync"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="splitbar" style="-moz-user-select:none;"
|
||||
class="ui-resizable-handle">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function(){initNavTree('d9/d5e/classunordered__set_1_1iterator.html','../../'); initResizable(true); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="doc-content">
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">unordered_set< K >::iterator Class Reference</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p>STL iterator class.
|
||||
<a href="#details">More...</a></p>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p>STL iterator class. </p>
|
||||
</div><hr/>The documentation for this class was generated from the following files:</div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d3/d6d/classunordered__set.html">unordered_set</a></li><li class="navelem"><a class="el" href="../../d9/d5e/classunordered__set_1_1iterator.html">iterator</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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: graph/dijkstra.cpp Pages: 1 -->
|
||||
<svg width="433pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: graph/dijkstra.cpp Pages: 1 -->
|
||||
<svg width="433pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: search/longest_increasing_subsequence_using_binary_search.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -144,7 +144,7 @@ Include dependency graph for longest_increasing_subsequence_using_binary_search.
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:a313539d9a97fc6e121ce496873ba892e" id="r_a313539d9a97fc6e121ce496873ba892e"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:a313539d9a97fc6e121ce496873ba892e" id="r_a313539d9a97fc6e121ce496873ba892e"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a313539d9a97fc6e121ce496873ba892e"><td class="memTemplItemLeft" align="right" valign="top">std::uint32_t </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a313539d9a97fc6e121ce496873ba892e">longest_increasing_subsequence_using_binary_search</a> (std::vector< T > &nums)</td></tr>
|
||||
<tr class="memdesc:a313539d9a97fc6e121ce496873ba892e"><td class="mdescLeft"> </td><td class="mdescRight">for std::uint32_t <br /></td></tr>
|
||||
<tr class="separator:a313539d9a97fc6e121ce496873ba892e"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -179,7 +179,7 @@ Functions</h2></td></tr>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T > </div>
|
||||
template<typename T> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">std::uint32_t longest_increasing_subsequence_using_binary_search </td>
|
||||
@@ -270,7 +270,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -313,7 +313,7 @@ template<typename T > </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="../../d9/d5f/longest__increasing__subsequence__using__binary__search_8cpp.html">longest_increasing_subsequence_using_binary_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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: search/longest_increasing_subsequence_using_binary_search.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,13 +124,14 @@ $(function(){initNavTree('d9/d5f/longest__increasing__subsequence__using__binary
|
||||
<div class="headertitle"><div class="title">longest_increasing_subsequence_using_binary_search.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d9/d5f/longest__increasing__subsequence__using__binary__search_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d9/d5f/longest__increasing__subsequence__using__binary__search_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> </div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span><span class="preprocessor">#include <vector></span> </div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="preprocessor">#include <algorithm></span> </div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="preprocessor">#include <cstdint></span> </div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> </div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span></div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00065" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="../../d9/d5f/longest__increasing__subsequence__using__binary__search_8cpp.html#a313539d9a97fc6e121ce496873ba892e"> 65</a></span>std::uint32_t <a class="code hl_function" href="../../d9/d5f/longest__increasing__subsequence__using__binary__search_8cpp.html#a313539d9a97fc6e121ce496873ba892e">longest_increasing_subsequence_using_binary_search</a>(std::vector<T>& nums) {</div>
|
||||
@@ -149,7 +150,7 @@ $(function(){initNavTree('d9/d5f/longest__increasing__subsequence__using__binary
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keywordflow">return</span> <span class="keyword">static_cast<</span>std::uint32_t<span class="keyword">></span>(ans.size());</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> </div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span></div>
|
||||
<div class="foldopen" id="foldopen00085" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"><a class="line" href="../../d9/d5f/longest__increasing__subsequence__using__binary__search_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e"> 85</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d5f/longest__increasing__subsequence__using__binary__search_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>() {</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> std::vector<int> arr = {10, 9, 2, 5, 3, 7, 101, 18};</div>
|
||||
@@ -176,7 +177,7 @@ $(function(){initNavTree('d9/d5f/longest__increasing__subsequence__using__binary
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> std::cout << <span class="stringliteral">"All tests have successfully passed!\n"</span>;</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> </div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span></div>
|
||||
<div class="foldopen" id="foldopen00114" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"><a class="line" href="../../d9/d5f/longest__increasing__subsequence__using__binary__search_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 114</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d5f/longest__increasing__subsequence__using__binary__search_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <a class="code hl_function" href="../../d9/d5f/longest__increasing__subsequence__using__binary__search_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>(); <span class="comment">// run self test implementation</span></div>
|
||||
@@ -192,7 +193,7 @@ $(function(){initNavTree('d9/d5f/longest__increasing__subsequence__using__binary
|
||||
<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="../../d9/d5f/longest__increasing__subsequence__using__binary__search_8cpp.html">longest_increasing_subsequence_using_binary_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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: rat_maze Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -137,7 +137,7 @@ solve-a-rat-in-a-maze-c-java-pytho/" target="_blank">Rat in a Maze</a> algorithm
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d9/d60/namespacerat__maze.html">rat_maze</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: others/lfu_cache.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -163,7 +163,7 @@ Namespaces</h2></td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
|
||||
Typedefs</h2></td></tr>
|
||||
<tr class="memitem:a5c0dfbf62803f020205076c3da18d058" id="r_a5c0dfbf62803f020205076c3da18d058"><td class="memTemplParams" colspan="2">template<typename K , typename V > </td></tr>
|
||||
<tr class="memitem:a5c0dfbf62803f020205076c3da18d058" id="r_a5c0dfbf62803f020205076c3da18d058"><td class="memTemplParams" colspan="2">template<typename K, typename V> </td></tr>
|
||||
<tr class="memitem:a5c0dfbf62803f020205076c3da18d058"><td class="memTemplItemLeft" align="right" valign="top">using </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../db/dde/namespaceothers_1_1_cache.html#a5c0dfbf62803f020205076c3da18d058">others::Cache::CacheNode</a> = <a class="el" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">D_Node</a><std::pair<K, V>></td></tr>
|
||||
<tr class="separator:a5c0dfbf62803f020205076c3da18d058"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table><table class="memberdecls">
|
||||
@@ -231,7 +231,7 @@ map).</p>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -296,7 +296,7 @@ map).</p>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9510827d0b234b3cc54b29892f217477.html">others</a></li><li class="navelem"><a class="el" href="../../d9/d65/lfu__cache_8cpp.html">lfu_cache.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: others/lfu_cache.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,35 +124,38 @@ $(function(){initNavTree('d9/d65/lfu__cache_8cpp_source.html','../../'); initRes
|
||||
<div class="headertitle"><div class="title">lfu_cache.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d9/d65/lfu__cache_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d9/d65/lfu__cache_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#include <cassert></span> <span class="comment">// for assert</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="preprocessor">#include <iostream></span> <span class="comment">// for std::cout</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#include <unordered_map></span> <span class="comment">// for std::unordered_map</span></div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> </div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span></div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d0/d6f/namespaceothers.html">others</a> {</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span></div>
|
||||
<div class="foldopen" id="foldopen00037" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="../../db/dde/namespaceothers_1_1_cache.html"> 37</a></span><span class="keyword">namespace </span>Cache {</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="../../db/dde/namespaceothers_1_1_cache.html"> 37</a></span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../db/dde/namespaceothers_1_1_cache.html">Cache</a> {</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span></div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="keyword">class </span><a class="code hl_class" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">D_Node</a> {</div>
|
||||
<div class="foldopen" id="foldopen00045" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html"> 45</a></span><span class="keyword">class </span>D_Node {</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keyword">public</span>:</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a8902e7ff872fa3c80fe6ce5f5cf5cc75"> 47</a></span> T <a class="code hl_variable" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a8902e7ff872fa3c80fe6ce5f5cf5cc75">data</a>; </div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a19e954cbb710ea8318bcb6aaef78e2d5"> 48</a></span> <a class="code hl_class" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">D_Node<T></a> *<a class="code hl_variable" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a19e954cbb710ea8318bcb6aaef78e2d5">prev</a>; </div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a0043eb287c54b3b2fb91ce354878a7bd"> 49</a></span> <a class="code hl_class" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">D_Node<T></a> *<a class="code hl_variable" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a0043eb287c54b3b2fb91ce354878a7bd">next</a>; </div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a19e954cbb710ea8318bcb6aaef78e2d5"> 48</a></span> D_Node<T> *<a class="code hl_variable" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a19e954cbb710ea8318bcb6aaef78e2d5">prev</a>; </div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a0043eb287c54b3b2fb91ce354878a7bd"> 49</a></span> D_Node<T> *<a class="code hl_variable" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a0043eb287c54b3b2fb91ce354878a7bd">next</a>; </div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> </div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keyword">explicit</span> <a class="code hl_class" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">D_Node</a>(T <a class="code hl_variable" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a8902e7ff872fa3c80fe6ce5f5cf5cc75">data</a>) : <a class="code hl_variable" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a8902e7ff872fa3c80fe6ce5f5cf5cc75">data</a>(<a class="code hl_variable" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a8902e7ff872fa3c80fe6ce5f5cf5cc75">data</a>), <a class="code hl_variable" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a19e954cbb710ea8318bcb6aaef78e2d5">prev</a>(nullptr), <a class="code hl_variable" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a0043eb287c54b3b2fb91ce354878a7bd">next</a>(nullptr) {}</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keyword">explicit</span> D_Node(T <a class="code hl_variable" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a8902e7ff872fa3c80fe6ce5f5cf5cc75">data</a>) : <a class="code hl_variable" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a8902e7ff872fa3c80fe6ce5f5cf5cc75">data</a>(<a class="code hl_variable" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a8902e7ff872fa3c80fe6ce5f5cf5cc75">data</a>), <a class="code hl_variable" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a19e954cbb710ea8318bcb6aaef78e2d5">prev</a>(nullptr), <a class="code hl_variable" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a0043eb287c54b3b2fb91ce354878a7bd">next</a>(nullptr) {}</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span>};</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> </div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="keyword">template</span> <<span class="keyword">typename</span> K, <span class="keyword">typename</span> V></div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="keyword">using </span>CacheNode = D_Node<std::pair<K, V>>;</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> </div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span></div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span><span class="keyword">template</span> <<span class="keyword">typename</span> K, <span class="keyword">typename</span> V></div>
|
||||
<div class="foldopen" id="foldopen00064" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html"> 64</a></span><span class="keyword">class </span><a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">LFUCache</a> {</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html"> 64</a></span><span class="keyword">class </span><a class="code hl_function" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#affd7776c246caa2d0f92fd8616f6e5dc">LFUCache</a> {</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> std::unordered_map<K, std::pair<CacheNode<K, V> *, <span class="keywordtype">int</span>>></div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#ac7684879e2e5da3d8bc5b1699ee42d35"> 66</a></span> <a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>; </div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> std::unordered_map<int, std::pair<CacheNode<K, V> *, <a class="code hl_class" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode<K, V></a> *>></div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> std::unordered_map<int, std::pair<CacheNode<K, V> *, CacheNode<K, V> *>></div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#aba5d59d0f6ab0c0d30a92551ca5a05f2"> 68</a></span> <a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>; </div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"><a class="line" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a6de844d1589a809239cc07752f311285"> 70</a></span> <span class="keywordtype">int</span> <a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a6de844d1589a809239cc07752f311285">minFreq</a>; </div>
|
||||
@@ -163,30 +166,30 @@ $(function(){initNavTree('d9/d65/lfu__cache_8cpp_source.html','../../'); initRes
|
||||
<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> <span class="keyword">private</span>:</div>
|
||||
<div class="foldopen" id="foldopen00088" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"><a class="line" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#adad4ab43141fb8ba43facd3a71e07047"> 88</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#adad4ab43141fb8ba43facd3a71e07047">push</a>(<span class="keywordtype">int</span> freq, <a class="code hl_class" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode<K, V></a> *<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>) {</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"><a class="line" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#adad4ab43141fb8ba43facd3a71e07047"> 88</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#adad4ab43141fb8ba43facd3a71e07047">push</a>(<span class="keywordtype">int</span> freq, CacheNode<K, V> *<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>) {</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="comment">// if freq is not present, then make a new list with node as the head as</span></div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="comment">// well as tail.</span></div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="keywordflow">if</span> (!<a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>.count(freq)) {</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[freq] = {<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>, <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>};</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[freq] = {<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>, <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>};</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> }</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> </div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> std::pair<CacheNode<K, V> *, <a class="code hl_class" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode<K, V></a> *> &p = <a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[freq];</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> std::pair<CacheNode<K, V> *, CacheNode<K, V> *> &p = <a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[freq];</div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> </div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="comment">// insert the node at the beginning of the linked list and update the</span></div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="comment">// head.</span></div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> p.first->prev = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> p.first->prev = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>;</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->next = p.first;</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> p.first = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> p.first = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>;</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> </div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span></div>
|
||||
<div class="foldopen" id="foldopen00109" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"><a class="line" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a16a25c102554c5653721a5112ef676c9"> 109</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a16a25c102554c5653721a5112ef676c9">increase_frequency</a>(std::pair<<a class="code hl_class" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode<K, V></a> *, <span class="keywordtype">int</span>> &p_node) {</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <a class="code hl_class" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode<K, V></a> *<a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = p_node.first;</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"><a class="line" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a16a25c102554c5653721a5112ef676c9"> 109</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a16a25c102554c5653721a5112ef676c9">increase_frequency</a>(std::pair<CacheNode<K, V> *, <span class="keywordtype">int</span>> &p_node) {</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> CacheNode<K, V> *<a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = p_node.first;</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="keywordtype">int</span> freq = p_node.second;</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> </div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> std::pair<CacheNode<K, V> *, <a class="code hl_class" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode<K, V></a> *> &p = <a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[freq];</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> std::pair<CacheNode<K, V> *, CacheNode<K, V> *> &p = <a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[freq];</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">// if the given node is the only node in the list,</span></div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="comment">// then erase the frequency from map</span></div>
|
||||
@@ -198,8 +201,8 @@ $(function(){initNavTree('d9/d65/lfu__cache_8cpp_source.html','../../'); initRes
|
||||
<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">else</span> {</div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="comment">// remove the given node from current freq linked list</span></div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <a class="code hl_class" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode<K, V></a> *prev = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->prev;</div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <a class="code hl_class" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode<K, V></a> *next = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->next;</div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> CacheNode<K, V> *prev = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->prev;</div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> CacheNode<K, V> *next = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->next;</div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->prev = <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->next = <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> </div>
|
||||
@@ -219,10 +222,10 @@ $(function(){initNavTree('d9/d65/lfu__cache_8cpp_source.html','../../'); initRes
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> ++p_node.second;</div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> </div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span></div>
|
||||
<div class="foldopen" id="foldopen00149" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"><a class="line" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#ab3561ab204754295199f9566924f7e69"> 149</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#ab3561ab204754295199f9566924f7e69">pop</a>() {</div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> std::pair<CacheNode<K, V> *, <a class="code hl_class" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode<K, V></a> *> &p = <a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[<a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a6de844d1589a809239cc07752f311285">minFreq</a>];</div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> std::pair<CacheNode<K, V> *, CacheNode<K, V> *> &p = <a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[<a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a6de844d1589a809239cc07752f311285">minFreq</a>];</div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> </div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <span class="comment">// if there is only one node</span></div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <span class="comment">// remove the node and erase</span></div>
|
||||
@@ -234,7 +237,7 @@ $(function(){initNavTree('d9/d65/lfu__cache_8cpp_source.html','../../'); initRes
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> }</div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> </div>
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <span class="comment">// remove the last node in the linked list</span></div>
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <a class="code hl_class" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode<K, V></a> *temp = p.second;</div>
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> CacheNode<K, V> *temp = p.second;</div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> p.second = temp-><a class="code hl_variable" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a19e954cbb710ea8318bcb6aaef78e2d5">prev</a>;</div>
|
||||
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> p.second->next = <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="keyword">delete</span> temp;</div>
|
||||
@@ -259,13 +262,13 @@ $(function(){initNavTree('d9/d65/lfu__cache_8cpp_source.html','../../'); initRes
|
||||
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> }</div>
|
||||
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> </div>
|
||||
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> <span class="comment">// insert the new node and set minFreq to 1</span></div>
|
||||
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> <a class="code hl_class" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode<K, V></a> *<a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = <span class="keyword">new</span> <a class="code hl_class" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode<K, V></a>({key, value});</div>
|
||||
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> <a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>[key] = {<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>, 1};</div>
|
||||
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> CacheNode<K, V> *<a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = <span class="keyword">new</span> CacheNode<K, V>({key, value});</div>
|
||||
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> <a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>[key] = {<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>, 1};</div>
|
||||
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> <a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a6de844d1589a809239cc07752f311285">minFreq</a> = 1;</div>
|
||||
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> <a class="code hl_function" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#adad4ab43141fb8ba43facd3a71e07047">push</a>(1, <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>);</div>
|
||||
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> </div>
|
||||
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span></div>
|
||||
<div class="foldopen" id="foldopen00202" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"><a class="line" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a58e37d3713f28d36abbb8cdf6c432781"> 202</a></span> V <a class="code hl_function" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a58e37d3713f28d36abbb8cdf6c432781">get</a>(K key) {</div>
|
||||
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> <span class="keywordflow">if</span> (!<a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.count(key)) {</div>
|
||||
@@ -278,13 +281,13 @@ $(function(){initNavTree('d9/d65/lfu__cache_8cpp_source.html','../../'); initRes
|
||||
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> <span class="keywordflow">return</span> value;</div>
|
||||
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> </div>
|
||||
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span></div>
|
||||
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"><a class="line" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#adbfb2ef7358423fdf1f49d410f55f195"> 217</a></span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#adbfb2ef7358423fdf1f49d410f55f195">size</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.size(); }</div>
|
||||
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> </div>
|
||||
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span></div>
|
||||
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"><a class="line" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#ac27c9076377cbed2a2acc45a189fed2c"> 223</a></span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#ac27c9076377cbed2a2acc45a189fed2c">capacity</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a3acc10e6bb67d9d9c4187f625723e6c5">_capacity</a>; }</div>
|
||||
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> </div>
|
||||
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span></div>
|
||||
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"><a class="line" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a68e1be0a3e0a6478aa35f04000e0e9b0"> 229</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a68e1be0a3e0a6478aa35f04000e0e9b0">empty</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.empty(); }</div>
|
||||
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> </div>
|
||||
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span></div>
|
||||
<div class="foldopen" id="foldopen00235" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"><a class="line" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a8857531ecc8ed2e36868e267148eff36"> 235</a></span> <a class="code hl_function" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a8857531ecc8ed2e36868e267148eff36">~LFUCache</a>() {</div>
|
||||
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> <span class="keyword">auto</span> it = <a class="code hl_variable" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.begin();</div>
|
||||
@@ -299,7 +302,7 @@ $(function(){initNavTree('d9/d65/lfu__cache_8cpp_source.html','../../'); initRes
|
||||
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span>} <span class="comment">// namespace Cache</span></div>
|
||||
</div>
|
||||
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span>} <span class="comment">// namespace others</span></div>
|
||||
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> </div>
|
||||
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span></div>
|
||||
<div class="foldopen" id="foldopen00250" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"><a class="line" href="../../d9/d65/lfu__cache_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 250</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d65/lfu__cache_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">others::Cache::LFUCache<int, int></a> cache(5);</div>
|
||||
@@ -348,18 +351,16 @@ $(function(){initNavTree('d9/d65/lfu__cache_8cpp_source.html','../../'); initRes
|
||||
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span> std::cout << <span class="stringliteral">"test - passed\n"</span>;</div>
|
||||
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"> 295</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span> </div>
|
||||
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span></div>
|
||||
<div class="foldopen" id="foldopen00301" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"><a class="line" href="../../d9/d65/lfu__cache_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 301</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d65/lfu__cache_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"> 302</span> <a class="code hl_function" href="../../d9/d65/lfu__cache_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run the self test implementation</span></div>
|
||||
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"> 304</span>}</div>
|
||||
</div>
|
||||
<div class="ttc" id="aavltree_8cpp_html_a74f0cf18a0e5b832d9994e2f2d022287"><div class="ttname"><a href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a></div><div class="ttdeci">struct node { int data; int height; struct node *left; struct node *right;} node</div><div class="ttdoc">for std::queue</div><div class="ttdef"><b>Definition</b> <a href="../../d8/dee/avltree_8cpp_source.html#l00013">avltree.cpp:13</a></div></div>
|
||||
<div class="ttc" id="aclassothers_1_1_cache_1_1_d___node_html"><div class="ttname"><a href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">others::Cache::D_Node</a></div><div class="ttdoc">Node for a doubly linked list with data, prev and next pointers.</div><div class="ttdef"><b>Definition</b> <a href="../../dc/daa/lru__cache2_8cpp_source.html#l00042">lru_cache2.cpp:42</a></div></div>
|
||||
<div class="ttc" id="aclassothers_1_1_cache_1_1_d___node_html_a0043eb287c54b3b2fb91ce354878a7bd"><div class="ttname"><a href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a0043eb287c54b3b2fb91ce354878a7bd">others::Cache::D_Node::next</a></div><div class="ttdeci">D_Node< T > * next</div><div class="ttdoc">next node in the doubly linked list</div><div class="ttdef"><b>Definition</b> <a href="#l00049">lfu_cache.cpp:49</a></div></div>
|
||||
<div class="ttc" id="aclassothers_1_1_cache_1_1_d___node_html_a19e954cbb710ea8318bcb6aaef78e2d5"><div class="ttname"><a href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a19e954cbb710ea8318bcb6aaef78e2d5">others::Cache::D_Node::prev</a></div><div class="ttdeci">D_Node< T > * prev</div><div class="ttdoc">previous node in the doubly linked list</div><div class="ttdef"><b>Definition</b> <a href="#l00048">lfu_cache.cpp:48</a></div></div>
|
||||
<div class="ttc" id="aclassothers_1_1_cache_1_1_d___node_html_a8902e7ff872fa3c80fe6ce5f5cf5cc75"><div class="ttname"><a href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a8902e7ff872fa3c80fe6ce5f5cf5cc75">others::Cache::D_Node::data</a></div><div class="ttdeci">T data</div><div class="ttdoc">data of the node</div><div class="ttdef"><b>Definition</b> <a href="#l00047">lfu_cache.cpp:47</a></div></div>
|
||||
<div class="ttc" id="aclassothers_1_1_cache_1_1_d___node_html_a0043eb287c54b3b2fb91ce354878a7bd"><div class="ttname"><a href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a0043eb287c54b3b2fb91ce354878a7bd">others::Cache::D_Node< std::pair< K, V > >::next</a></div><div class="ttdeci">D_Node< std::pair< K, V > > * next</div><div class="ttdef"><b>Definition</b> <a href="#l00049">lfu_cache.cpp:49</a></div></div>
|
||||
<div class="ttc" id="aclassothers_1_1_cache_1_1_d___node_html_a19e954cbb710ea8318bcb6aaef78e2d5"><div class="ttname"><a href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a19e954cbb710ea8318bcb6aaef78e2d5">others::Cache::D_Node< std::pair< K, V > >::prev</a></div><div class="ttdeci">D_Node< std::pair< K, V > > * prev</div><div class="ttdef"><b>Definition</b> <a href="#l00048">lfu_cache.cpp:48</a></div></div>
|
||||
<div class="ttc" id="aclassothers_1_1_cache_1_1_d___node_html_a8902e7ff872fa3c80fe6ce5f5cf5cc75"><div class="ttname"><a href="../../de/d21/classothers_1_1_cache_1_1_d___node.html#a8902e7ff872fa3c80fe6ce5f5cf5cc75">others::Cache::D_Node< std::pair< K, V > >::data</a></div><div class="ttdeci">std::pair< K, V > data</div><div class="ttdef"><b>Definition</b> <a href="#l00047">lfu_cache.cpp:47</a></div></div>
|
||||
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html"><div class="ttname"><a href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">others::Cache::LFUCache</a></div><div class="ttdoc">LFUCache.</div><div class="ttdef"><b>Definition</b> <a href="#l00064">lfu_cache.cpp:64</a></div></div>
|
||||
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_a16a25c102554c5653721a5112ef676c9"><div class="ttname"><a href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a16a25c102554c5653721a5112ef676c9">others::Cache::LFUCache::increase_frequency</a></div><div class="ttdeci">void increase_frequency(std::pair< CacheNode< K, V > *, int > &p_node)</div><div class="ttdoc">increase the frequency of node and push it in the respective list.</div><div class="ttdef"><b>Definition</b> <a href="#l00109">lfu_cache.cpp:109</a></div></div>
|
||||
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_a3acc10e6bb67d9d9c4187f625723e6c5"><div class="ttname"><a href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a3acc10e6bb67d9d9c4187f625723e6c5">others::Cache::LFUCache::_capacity</a></div><div class="ttdeci">int _capacity</div><div class="ttdoc">maximum capacity of the cache</div><div class="ttdef"><b>Definition</b> <a href="#l00071">lfu_cache.cpp:71</a></div></div>
|
||||
@@ -377,6 +378,7 @@ $(function(){initNavTree('d9/d65/lfu__cache_8cpp_source.html','../../'); initRes
|
||||
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_affd7776c246caa2d0f92fd8616f6e5dc"><div class="ttname"><a href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#affd7776c246caa2d0f92fd8616f6e5dc">others::Cache::LFUCache::LFUCache</a></div><div class="ttdeci">LFUCache(int _capacity)</div><div class="ttdoc">Constructor, Initialize with minFreq and _capacity.</div><div class="ttdef"><b>Definition</b> <a href="#l00078">lfu_cache.cpp:78</a></div></div>
|
||||
<div class="ttc" id="alfu__cache_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d9/d65/lfu__cache_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> <a href="#l00250">lfu_cache.cpp:250</a></div></div>
|
||||
<div class="ttc" id="alfu__cache_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d9/d65/lfu__cache_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">main function</div><div class="ttdef"><b>Definition</b> <a href="#l00301">lfu_cache.cpp:301</a></div></div>
|
||||
<div class="ttc" id="anamespaceothers_1_1_cache_html"><div class="ttname"><a href="../../db/dde/namespaceothers_1_1_cache.html">others::Cache</a></div><div class="ttdoc">Cache algorithm.</div><div class="ttdef"><b>Definition</b> <a href="#l00037">lfu_cache.cpp:37</a></div></div>
|
||||
<div class="ttc" id="anamespaceothers_html"><div class="ttname"><a href="../../d0/d6f/namespaceothers.html">others</a></div><div class="ttdoc">for vector</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> <a href="../../d3/d26/binary__search__tree_8cpp_source.html#l00011">binary_search_tree.cpp:11</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
@@ -385,7 +387,7 @@ $(function(){initNavTree('d9/d65/lfu__cache_8cpp_source.html','../../'); initRes
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9510827d0b234b3cc54b29892f217477.html">others</a></li><li class="navelem"><a class="el" href="../../d9/d65/lfu__cache_8cpp.html">lfu_cache.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Machine Learning Algorithms</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -285,8 +285,8 @@ Variables</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 108</span> <span class="keywordtype">size_t</span> N = X.size();</div>
|
||||
<div class="line"><span class="lineno"> 109</span> </div>
|
||||
<div class="line"><span class="lineno"> 110</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < N; i++) { <span class="comment">// traverse each x-index</span></div>
|
||||
<div class="line"><span class="lineno"> 111</span> <span class="keyword">auto</span> result = std::min_element(std::begin(X[i]), std::end(X[i]));</div>
|
||||
<div class="line"><span class="lineno"> 112</span> <span class="keywordtype">double</span> d_min = *result;</div>
|
||||
<div class="line"><span class="lineno"> 111</span> <span class="keyword">auto</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> = std::min_element(std::begin(X[i]), std::end(X[i]));</div>
|
||||
<div class="line"><span class="lineno"> 112</span> <span class="keywordtype">double</span> d_min = *<a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
|
||||
<div class="line"><span class="lineno"> 113</span> std::ptrdiff_t j = std::distance(std::begin(X[i]), result);</div>
|
||||
<div class="line"><span class="lineno"> 114</span> </div>
|
||||
<div class="line"><span class="lineno"> 115</span> <span class="keywordflow">if</span> (d_min < val[0]) { <span class="comment">// if a lower value is found</span></div>
|
||||
@@ -297,6 +297,7 @@ Variables</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 120</span> }</div>
|
||||
<div class="line"><span class="lineno"> 121</span> }</div>
|
||||
<div class="line"><span class="lineno"> 122</span>}</div>
|
||||
<div class="ttc" id="afibonacci__sum_8cpp_html_aadb40ac4c74a7efc0680b83eeee138aa"><div class="ttname"><a href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">math::fibonacci_sum::result</a></div><div class="ttdeci">uint64_t result(uint64_t n)</div><div class="ttdef"><b>Definition</b> <a href="../../de/dc3/fibonacci__sum_8cpp_source.html#l00077">fibonacci_sum.cpp:77</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -443,7 +444,7 @@ Variables</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel constexpr">constexpr</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -458,7 +459,7 @@ Variables</h2></td></tr>
|
||||
<!-- 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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: search/median_search.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -264,7 +264,7 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 75</span> pivot = m[(sz- 1) / 2];</div>
|
||||
<div class="line"><span class="lineno"> 76</span> }</div>
|
||||
<div class="line"><span class="lineno"> 77</span> <span class="keywordflow">else</span>{</div>
|
||||
<div class="line"><span class="lineno"> 78</span> pivot = <a class="code hl_function" href="#a868847218f694e78bf433a0ff7648bae">median_of_medians</a>(m, idx);</div>
|
||||
<div class="line"><span class="lineno"> 78</span> pivot = median_of_medians(m, idx);</div>
|
||||
<div class="line"><span class="lineno"> 79</span> }</div>
|
||||
<div class="line"><span class="lineno"> 80</span> std::vector<int> low;</div>
|
||||
<div class="line"><span class="lineno"> 81</span> std::vector<int> high;</div>
|
||||
@@ -311,17 +311,17 @@ Functions</h2></td></tr>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 107</span> {</div>
|
||||
<div class="line"><span class="lineno"> 108</span> std::vector<int> A{25,21,98,100,76,22,43,60,89,87};</div>
|
||||
<div class="line"><span class="lineno"> 109</span> <span class="keywordtype">int</span> i = 3;</div>
|
||||
<div class="line"><span class="lineno"> 110</span> assert(A[6] == search::median_search::median_of_medians(A, i)); <span class="comment">// A[6] = 43, is the fourth smallest element.</span></div>
|
||||
<div class="line"><span class="lineno"> 110</span> assert(A[6] == <a class="code hl_function" href="#a868847218f694e78bf433a0ff7648bae">search::median_search::median_of_medians</a>(A, i)); <span class="comment">// A[6] = 43, is the fourth smallest element.</span></div>
|
||||
<div class="line"><span class="lineno"> 111</span> std::cout << <span class="stringliteral">"test case:1 passed\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 112</span> </div>
|
||||
<div class="line"><span class="lineno"> 113</span> std::vector<int> B{1,2,3,4,5,6};</div>
|
||||
<div class="line"><span class="lineno"> 114</span> <span class="keywordtype">int</span> j = 4;</div>
|
||||
<div class="line"><span class="lineno"> 115</span> assert(B[4] == search::median_search::median_of_medians(B, j)); <span class="comment">// B[4] = 5, is the fifth smallest element.</span></div>
|
||||
<div class="line"><span class="lineno"> 115</span> assert(B[4] == <a class="code hl_function" href="#a868847218f694e78bf433a0ff7648bae">search::median_search::median_of_medians</a>(B, j)); <span class="comment">// B[4] = 5, is the fifth smallest element.</span></div>
|
||||
<div class="line"><span class="lineno"> 116</span> std::cout << <span class="stringliteral">"test case:2 passed\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 117</span> </div>
|
||||
<div class="line"><span class="lineno"> 118</span> std::vector<int> C{1,2,3,4,5,1000,8,9,99};</div>
|
||||
<div class="line"><span class="lineno"> 119</span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a> = 3;</div>
|
||||
<div class="line"><span class="lineno"> 120</span> assert(C[3] == search::median_search::median_of_medians(C, k)); <span class="comment">// C[3] = 4, is the fourth smallest element.</span></div>
|
||||
<div class="line"><span class="lineno"> 120</span> assert(C[3] == <a class="code hl_function" href="#a868847218f694e78bf433a0ff7648bae">search::median_search::median_of_medians</a>(C, k)); <span class="comment">// C[3] = 4, is the fourth smallest element.</span></div>
|
||||
<div class="line"><span class="lineno"> 121</span> std::cout << <span class="stringliteral">"test case:3 passed\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 122</span> std::cout << <span class="stringliteral">"--All tests passed--\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 123</span>}</div>
|
||||
@@ -334,7 +334,7 @@ Functions</h2></td></tr>
|
||||
<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="../../d9/d69/median__search_8cpp.html">median_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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var median__search_8cpp =
|
||||
[
|
||||
[ "main", "d9/d69/median__search_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "median_of_medians", "d9/d69/median__search_8cpp.html#a868847218f694e78bf433a0ff7648bae", null ],
|
||||
[ "search::median_search::median_of_medians", "d9/d69/median__search_8cpp.html#a868847218f694e78bf433a0ff7648bae", null ],
|
||||
[ "test", "d9/d69/median__search_8cpp.html#ae1a3968e7947464bee7714f6d43b7002", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: search/median_search.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,14 +124,15 @@ $(function(){initNavTree('d9/d69/median__search_8cpp_source.html','../../'); ini
|
||||
<div class="headertitle"><div class="title">median_search.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d9/d69/median__search_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d9/d69/median__search_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="preprocessor">#include <algorithm></span></div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="preprocessor">#include <vector></span></div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="preprocessor">#include <cassert></span></div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span></div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d9/dca/namespacesearch.html">search</a> {</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../da/dd4/namespacemedian__search.html">median_search</a> {</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../da/dd4/namespacemedian__search.html">median_search</a> { </div>
|
||||
<div class="foldopen" id="foldopen00062" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="../../d9/d69/median__search_8cpp.html#a868847218f694e78bf433a0ff7648bae"> 62</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d69/median__search_8cpp.html#a868847218f694e78bf433a0ff7648bae">median_of_medians</a>(<span class="keyword">const</span> std::vector<int>& A, <span class="keyword">const</span> <span class="keywordtype">int</span>& idx) {</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordtype">int</span> pivot = 0; <span class="comment">// initialized with zero</span></div>
|
||||
@@ -175,27 +176,27 @@ $(function(){initNavTree('d9/d69/median__search_8cpp_source.html','../../'); ini
|
||||
</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span>} <span class="comment">// namespace median_search</span></div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span>} <span class="comment">// namespace search</span></div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> </div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span></div>
|
||||
<div class="foldopen" id="foldopen00107" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"><a class="line" href="../../d9/d69/median__search_8cpp.html#ae1a3968e7947464bee7714f6d43b7002"> 107</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d69/median__search_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>(){</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> std::vector<int> A{25,21,98,100,76,22,43,60,89,87};</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keywordtype">int</span> i = 3;</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> assert(A[6] == search::median_search::median_of_medians(A, i)); <span class="comment">// A[6] = 43, is the fourth smallest element.</span></div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> assert(A[6] == <a class="code hl_function" href="../../d9/d69/median__search_8cpp.html#a868847218f694e78bf433a0ff7648bae">search::median_search::median_of_medians</a>(A, i)); <span class="comment">// A[6] = 43, is the fourth smallest element.</span></div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> std::cout << <span class="stringliteral">"test case:1 passed\n"</span>;</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> </div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> std::vector<int> B{1,2,3,4,5,6};</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="keywordtype">int</span> j = 4;</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> assert(B[4] == search::median_search::median_of_medians(B, j)); <span class="comment">// B[4] = 5, is the fifth smallest element.</span></div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> assert(B[4] == <a class="code hl_function" href="../../d9/d69/median__search_8cpp.html#a868847218f694e78bf433a0ff7648bae">search::median_search::median_of_medians</a>(B, j)); <span class="comment">// B[4] = 5, is the fifth smallest element.</span></div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> std::cout << <span class="stringliteral">"test case:2 passed\n"</span>;</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> std::vector<int> C{1,2,3,4,5,1000,8,9,99};</div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordtype">int</span> k = 3;</div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> assert(C[3] == search::median_search::median_of_medians(C, k)); <span class="comment">// C[3] = 4, is the fourth smallest element.</span></div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> assert(C[3] == <a class="code hl_function" href="../../d9/d69/median__search_8cpp.html#a868847218f694e78bf433a0ff7648bae">search::median_search::median_of_medians</a>(C, k)); <span class="comment">// C[3] = 4, is the fourth smallest element.</span></div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> std::cout << <span class="stringliteral">"test case:3 passed\n"</span>;</div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> std::cout << <span class="stringliteral">"--All tests passed--\n"</span>;</div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> </div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span></div>
|
||||
<div class="foldopen" id="foldopen00128" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"><a class="line" href="../../d9/d69/median__search_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 128</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d69/median__search_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>()</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span>{</div>
|
||||
@@ -209,9 +210,9 @@ $(function(){initNavTree('d9/d69/median__search_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> std::cin >> a[i];</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> std::cout << <span class="stringliteral">"Median: "</span>; <span class="comment">// Median defination: https://en.wikipedia.org/wiki/Median</span></div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="keywordtype">int</span> x = search::median_search::median_of_medians(a, (n - 1) / 2);</div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="keywordtype">int</span> x = <a class="code hl_function" href="../../d9/d69/median__search_8cpp.html#a868847218f694e78bf433a0ff7648bae">search::median_search::median_of_medians</a>(a, (n - 1) / 2);</div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="keywordflow">if</span>(n % 2 == 0){</div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="keywordtype">int</span> y = search::median_search::median_of_medians(a, n / 2);</div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="keywordtype">int</span> y = <a class="code hl_function" href="../../d9/d69/median__search_8cpp.html#a868847218f694e78bf433a0ff7648bae">search::median_search::median_of_medians</a>(a, n / 2);</div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> std::cout << (float(x) + float(y))/2.0;</div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> }</div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <span class="keywordflow">else</span>{</div>
|
||||
@@ -222,7 +223,7 @@ $(function(){initNavTree('d9/d69/median__search_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <span class="keywordtype">int</span> idx = 0;</div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> std::cin >> idx;</div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> idx--;</div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> std::cout << idx + 1<< <span class="stringliteral">"-th smallest element: "</span> << search::median_search::median_of_medians(a, idx) << <span class="charliteral">'\n'</span>;</div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> std::cout << idx + 1<< <span class="stringliteral">"-th smallest element: "</span> << <a class="code hl_function" href="../../d9/d69/median__search_8cpp.html#a868847218f694e78bf433a0ff7648bae">search::median_search::median_of_medians</a>(a, idx) << <span class="charliteral">'\n'</span>;</div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span>}</div>
|
||||
</div>
|
||||
@@ -238,7 +239,7 @@ $(function(){initNavTree('d9/d69/median__search_8cpp_source.html','../../'); ini
|
||||
<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="../../d9/d69/median__search_8cpp.html">median_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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: dynamic_programming/coin_change.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -138,7 +138,7 @@ $(function(){initNavTree('d9/d6b/coin__change_8cpp_source.html','../../'); initR
|
||||
<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> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[0] = 0;</div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i <= <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i <= N; i++) {</div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="comment">// initialize minimum number of coins needed to infinity</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i] = INT_MAX;</div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keywordtype">int</span> res = INT_MAX;</div>
|
||||
@@ -157,7 +157,7 @@ $(function(){initNavTree('d9/d6b/coin__change_8cpp_source.html','../../'); initR
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> }</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="comment">// The Minimum No of Coins Required for N = dp[N]</span></div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keywordflow">return</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[<a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>];</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keywordflow">return</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[N];</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> </div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="keywordtype">int</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
@@ -166,7 +166,7 @@ $(function(){initNavTree('d9/d6b/coin__change_8cpp_source.html','../../'); initR
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</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="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="comment">// Total Change Required</span></div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 15;</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keywordtype">int</span> N = 15;</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> cout << <span class="stringliteral">"Minimum Number of Coins Required "</span> << findMinCoins(arr, n, N)</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> << <span class="stringliteral">"\n"</span>;</div>
|
||||
@@ -175,14 +175,13 @@ $(function(){initNavTree('d9/d6b/coin__change_8cpp_source.html','../../'); initR
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span>}</div>
|
||||
<div class="ttc" id="agenerate__parentheses_8cpp_html_gae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">Main function.</div><div class="ttdef"><b>Definition</b> <a href="../../dd/d1e/generate__parentheses_8cpp_source.html#l00110">generate_parentheses.cpp:110</a></div></div>
|
||||
<div class="ttc" id="anamespacedp_html"><div class="ttname"><a href="../../df/d88/namespacedp.html">dp</a></div><div class="ttdoc">for std::vector</div><div class="ttdef"><b>Definition</b> <a href="../../de/d8c/partition__problem_8cpp_source.html#l00039">partition_problem.cpp:39</a></div></div>
|
||||
<div class="ttc" id="asparse__table_8cpp_html_a10f3ffb3f6f7e1b83d556b9c8de89a5d"><div class="ttname"><a href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">data_structures::sparse_table::N</a></div><div class="ttdeci">constexpr uint32_t N</div><div class="ttdoc">A struct to represent sparse table for min() as their invariant function, for the given array A....</div><div class="ttdef"><b>Definition</b> <a href="../../d8/dab/sparse__table_8cpp_source.html#l00048">sparse_table.cpp:48</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_8a20dd5bfd5341a725342bf72b6b686f.html">dynamic_programming</a></li><li class="navelem"><b>coin_change.cpp</b></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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: queue_using_array Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d9/d70/namespacequeue__using__array.html','../../'); i
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d9/d70/namespacequeue__using__array.html">queue_using_array</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: search/median_search2.cpp Pages: 1 -->
|
||||
<svg width="146pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: search/median_search2.cpp Pages: 1 -->
|
||||
<svg width="146pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: dnf_sort Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d9/d75/namespacednf__sort.html','../../'); initResizab
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d9/d75/namespacednf__sort.html">dnf_sort</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: math/factorial.cpp Pages: 1 -->
|
||||
<svg width="191pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: math/factorial.cpp Pages: 1 -->
|
||||
<svg width="191pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: others/primality_test.cpp Pages: 1 -->
|
||||
<svg width="131pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: others/primality_test.cpp Pages: 1 -->
|
||||
<svg width="131pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: dynamic_programming/trapped_rainwater.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -212,7 +212,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -265,7 +265,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_8a20dd5bfd5341a725342bf72b6b686f.html">dynamic_programming</a></li><li class="navelem"><a class="el" href="../../d9/d80/trapped__rainwater_8cpp.html">trapped_rainwater.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -2,5 +2,5 @@ var trapped__rainwater_8cpp =
|
||||
[
|
||||
[ "main", "d9/d80/trapped__rainwater_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "test", "d9/d80/trapped__rainwater_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ],
|
||||
[ "trappedRainwater", "d9/d80/trapped__rainwater_8cpp.html#a066e0e739e7c276eee6e61d5b4d37ce8", null ]
|
||||
[ "dynamic_programming::trappedRainwater", "dd/d24/namespacedynamic__programming.html#a066e0e739e7c276eee6e61d5b4d37ce8", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: dynamic_programming/trapped_rainwater.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,7 +124,8 @@ $(function(){initNavTree('d9/d80/trapped__rainwater_8cpp_source.html','../../');
|
||||
<div class="headertitle"><div class="title">trapped_rainwater.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d9/d80/trapped__rainwater_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d9/d80/trapped__rainwater_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include <algorithm></span> </div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include <cstddef></span> </div>
|
||||
@@ -168,7 +169,7 @@ $(function(){initNavTree('d9/d80/trapped__rainwater_8cpp_source.html','../../');
|
||||
</div>
|
||||
<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="comment">// namespace dynamic_programming</span></div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span></div>
|
||||
<div class="foldopen" id="foldopen00062" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="../../d9/d80/trapped__rainwater_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 62</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d80/trapped__rainwater_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> std::vector<uint32_t> test_basic = {0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1};</div>
|
||||
@@ -205,7 +206,7 @@ $(function(){initNavTree('d9/d80/trapped__rainwater_8cpp_source.html','../../');
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> test_large_elevation_map_difference) == 15);</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> </div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span></div>
|
||||
<div class="foldopen" id="foldopen00101" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"><a class="line" href="../../d9/d80/trapped__rainwater_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 101</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d80/trapped__rainwater_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <a class="code hl_function" href="../../d9/d80/trapped__rainwater_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -222,7 +223,7 @@ $(function(){initNavTree('d9/d80/trapped__rainwater_8cpp_source.html','../../');
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_8a20dd5bfd5341a725342bf72b6b686f.html">dynamic_programming</a></li><li class="navelem"><a class="el" href="../../d9/d80/trapped__rainwater_8cpp.html">trapped_rainwater.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: sorting/selection_sort_iterative.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -199,7 +199,7 @@ $(function(){initNavTree('d9/d85/selection__sort__iterative_8cpp_source.html','.
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span><span class="comment"> * @brief Self-test implementations</span></div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span><span class="comment"> * @returns void</span></div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span><span class="comment"> *******************************************************************************/</span></div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>() {</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="comment">// testcase #1</span></div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="comment">// [1, 0, 0, 1, 1, 0, 2, 1] returns [0, 0, 0, 1, 1, 1, 1, 2]</span></div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> std::vector<uint64_t> vector1 = {1, 0, 0, 1, 1, 0, 2, 1};</div>
|
||||
@@ -248,10 +248,10 @@ $(function(){initNavTree('d9/d85/selection__sort__iterative_8cpp_source.html','.
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span><span class="comment"> * @returns 0 on exit</span></div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span><span class="comment"> *******************************************************************************/</span></div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span><span class="keywordtype">int</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span>}</div>
|
||||
<div class="ttc" id="acaesar__cipher_8cpp_html_ae1a3968e7947464bee7714f6d43b7002"><div class="ttname"><a href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a></div><div class="ttdeci">void test()</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d2c/caesar__cipher_8cpp_source.html#l00100">caesar_cipher.cpp:100</a></div></div>
|
||||
<div class="ttc" id="agenerate__parentheses_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> <a href="../../dd/d1e/generate__parentheses_8cpp_source.html#l00082">generate_parentheses.cpp:82</a></div></div>
|
||||
<div class="ttc" id="agenerate__parentheses_8cpp_html_gae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">Main function.</div><div class="ttdef"><b>Definition</b> <a href="../../dd/d1e/generate__parentheses_8cpp_source.html#l00110">generate_parentheses.cpp:110</a></div></div>
|
||||
<div class="ttc" id="anamespacesorting_html"><div class="ttname"><a href="../../d5/d91/namespacesorting.html">sorting</a></div><div class="ttdoc">for working with vectors</div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
@@ -260,7 +260,7 @@ $(function(){initNavTree('d9/d85/selection__sort__iterative_8cpp_source.html','.
|
||||
<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"><b>selection_sort_iterative.cpp</b></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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: std::is_unsigned< uint128_t > Pages: 1 -->
|
||||
<svg width="153pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: std::is_unsigned< uint128_t > Pages: 1 -->
|
||||
<svg width="153pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: dynamic_programming/palindrome_partitioning.cpp Pages: 1 -->
|
||||
<svg width="324pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: dynamic_programming/palindrome_partitioning.cpp Pages: 1 -->
|
||||
<svg width="324pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/fibonacci.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -255,7 +255,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -265,15 +265,16 @@ Functions</h2></td></tr>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d9/d89/fibonacci_8cpp_source.html#l00049">49</a> of file <a class="el" href="../../d9/d89/fibonacci_8cpp_source.html">fibonacci.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 49</span> {</div>
|
||||
<div class="line"><span class="lineno"> 50</span> assert(math::fibonacci::fibonacci(0) == 0);</div>
|
||||
<div class="line"><span class="lineno"> 51</span> assert(math::fibonacci::fibonacci(1) == 1);</div>
|
||||
<div class="line"><span class="lineno"> 52</span> assert(math::fibonacci::fibonacci(2) == 1);</div>
|
||||
<div class="line"><span class="lineno"> 53</span> assert(math::fibonacci::fibonacci(3) == 2);</div>
|
||||
<div class="line"><span class="lineno"> 54</span> assert(math::fibonacci::fibonacci(4) == 3);</div>
|
||||
<div class="line"><span class="lineno"> 55</span> assert(math::fibonacci::fibonacci(15) == 610);</div>
|
||||
<div class="line"><span class="lineno"> 56</span> assert(math::fibonacci::fibonacci(20) == 6765);</div>
|
||||
<div class="line"><span class="lineno"> 50</span> assert(<a class="code hl_function" href="#aeaaf5439cb29de4630c7dff2fd914b28">math::fibonacci::fibonacci</a>(0) == 0);</div>
|
||||
<div class="line"><span class="lineno"> 51</span> assert(<a class="code hl_function" href="#aeaaf5439cb29de4630c7dff2fd914b28">math::fibonacci::fibonacci</a>(1) == 1);</div>
|
||||
<div class="line"><span class="lineno"> 52</span> assert(<a class="code hl_function" href="#aeaaf5439cb29de4630c7dff2fd914b28">math::fibonacci::fibonacci</a>(2) == 1);</div>
|
||||
<div class="line"><span class="lineno"> 53</span> assert(<a class="code hl_function" href="#aeaaf5439cb29de4630c7dff2fd914b28">math::fibonacci::fibonacci</a>(3) == 2);</div>
|
||||
<div class="line"><span class="lineno"> 54</span> assert(<a class="code hl_function" href="#aeaaf5439cb29de4630c7dff2fd914b28">math::fibonacci::fibonacci</a>(4) == 3);</div>
|
||||
<div class="line"><span class="lineno"> 55</span> assert(<a class="code hl_function" href="#aeaaf5439cb29de4630c7dff2fd914b28">math::fibonacci::fibonacci</a>(15) == 610);</div>
|
||||
<div class="line"><span class="lineno"> 56</span> assert(<a class="code hl_function" href="#aeaaf5439cb29de4630c7dff2fd914b28">math::fibonacci::fibonacci</a>(20) == 6765);</div>
|
||||
<div class="line"><span class="lineno"> 57</span> std::cout << <span class="stringliteral">"All tests have passed successfully!\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 58</span>}</div>
|
||||
<div class="ttc" id="afibonacci_8cpp_html_aeaaf5439cb29de4630c7dff2fd914b28"><div class="ttname"><a href="#aeaaf5439cb29de4630c7dff2fd914b28">math::fibonacci::fibonacci</a></div><div class="ttdeci">uint64_t fibonacci(uint64_t n)</div><div class="ttdoc">Function to compute the n-th Fibonacci number.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d89/fibonacci_8cpp_source.html#l00032">fibonacci.cpp:32</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -283,7 +284,7 @@ Functions</h2></td></tr>
|
||||
<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="../../d9/d89/fibonacci_8cpp.html">fibonacci.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var fibonacci_8cpp =
|
||||
[
|
||||
[ "fibonacci", "d9/d89/fibonacci_8cpp.html#aeaaf5439cb29de4630c7dff2fd914b28", null ],
|
||||
[ "math::fibonacci::fibonacci", "d9/d89/fibonacci_8cpp.html#aeaaf5439cb29de4630c7dff2fd914b28", null ],
|
||||
[ "main", "d9/d89/fibonacci_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "test", "d9/d89/fibonacci_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/fibonacci.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,11 +124,12 @@ $(function(){initNavTree('d9/d89/fibonacci_8cpp_source.html','../../'); initResi
|
||||
<div class="headertitle"><div class="title">fibonacci.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d9/d89/fibonacci_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d9/d89/fibonacci_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<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="preprocessor">#include <cstdint></span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../dd/d47/namespacemath.html">math</a> {</div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../df/d76/namespacefibonacci.html">fibonacci</a> {</div>
|
||||
<div class="foldopen" id="foldopen00032" data-start="{" data-end="}">
|
||||
@@ -145,20 +146,20 @@ $(function(){initNavTree('d9/d89/fibonacci_8cpp_source.html','../../'); initResi
|
||||
</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span>} <span class="comment">// namespace fibonacci</span></div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span>} <span class="comment">// namespace math</span></div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> </div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span></div>
|
||||
<div class="foldopen" id="foldopen00049" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="../../d9/d89/fibonacci_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 49</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d89/fibonacci_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> assert(math::fibonacci::fibonacci(0) == 0);</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> assert(math::fibonacci::fibonacci(1) == 1);</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> assert(math::fibonacci::fibonacci(2) == 1);</div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> assert(math::fibonacci::fibonacci(3) == 2);</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> assert(math::fibonacci::fibonacci(4) == 3);</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> assert(math::fibonacci::fibonacci(15) == 610);</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> assert(math::fibonacci::fibonacci(20) == 6765);</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> assert(<a class="code hl_function" href="../../d9/d89/fibonacci_8cpp.html#aeaaf5439cb29de4630c7dff2fd914b28">math::fibonacci::fibonacci</a>(0) == 0);</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> assert(<a class="code hl_function" href="../../d9/d89/fibonacci_8cpp.html#aeaaf5439cb29de4630c7dff2fd914b28">math::fibonacci::fibonacci</a>(1) == 1);</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> assert(<a class="code hl_function" href="../../d9/d89/fibonacci_8cpp.html#aeaaf5439cb29de4630c7dff2fd914b28">math::fibonacci::fibonacci</a>(2) == 1);</div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> assert(<a class="code hl_function" href="../../d9/d89/fibonacci_8cpp.html#aeaaf5439cb29de4630c7dff2fd914b28">math::fibonacci::fibonacci</a>(3) == 2);</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> assert(<a class="code hl_function" href="../../d9/d89/fibonacci_8cpp.html#aeaaf5439cb29de4630c7dff2fd914b28">math::fibonacci::fibonacci</a>(4) == 3);</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> assert(<a class="code hl_function" href="../../d9/d89/fibonacci_8cpp.html#aeaaf5439cb29de4630c7dff2fd914b28">math::fibonacci::fibonacci</a>(15) == 610);</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> assert(<a class="code hl_function" href="../../d9/d89/fibonacci_8cpp.html#aeaaf5439cb29de4630c7dff2fd914b28">math::fibonacci::fibonacci</a>(20) == 6765);</div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> std::cout << <span class="stringliteral">"All tests have passed successfully!\n"</span>;</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> </div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span></div>
|
||||
<div class="foldopen" id="foldopen00064" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="../../d9/d89/fibonacci_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 64</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d89/fibonacci_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <a class="code hl_function" href="../../d9/d89/fibonacci_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -167,6 +168,7 @@ $(function(){initNavTree('d9/d89/fibonacci_8cpp_source.html','../../'); initResi
|
||||
</div>
|
||||
<div class="ttc" id="afibonacci_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d9/d89/fibonacci_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> <a href="#l00049">fibonacci.cpp:49</a></div></div>
|
||||
<div class="ttc" id="afibonacci_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d9/d89/fibonacci_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">Main function.</div><div class="ttdef"><b>Definition</b> <a href="#l00064">fibonacci.cpp:64</a></div></div>
|
||||
<div class="ttc" id="afibonacci_8cpp_html_aeaaf5439cb29de4630c7dff2fd914b28"><div class="ttname"><a href="../../d9/d89/fibonacci_8cpp.html#aeaaf5439cb29de4630c7dff2fd914b28">math::fibonacci::fibonacci</a></div><div class="ttdeci">uint64_t fibonacci(uint64_t n)</div><div class="ttdoc">Function to compute the n-th Fibonacci number.</div><div class="ttdef"><b>Definition</b> <a href="#l00032">fibonacci.cpp:32</a></div></div>
|
||||
<div class="ttc" id="anamespacefibonacci_html"><div class="ttname"><a href="../../df/d76/namespacefibonacci.html">fibonacci</a></div><div class="ttdoc">Functions for Fibonacci sequence.</div></div>
|
||||
<div class="ttc" id="anamespacemath_html"><div class="ttname"><a href="../../dd/d47/namespacemath.html">math</a></div><div class="ttdoc">for assert</div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
@@ -175,7 +177,7 @@ $(function(){initNavTree('d9/d89/fibonacci_8cpp_source.html','../../'); initResi
|
||||
<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="../../d9/d89/fibonacci_8cpp.html">fibonacci.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Btree Struct Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -203,7 +203,7 @@ Public Attributes</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d9/d90/struct_btree.html">Btree</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: hashing/chaining.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -243,7 +243,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_ece9b94c107bbaa1dd68197a8c9983b9.html">hashing</a></li><li class="navelem"><a class="el" href="../../d9/d92/chaining_8cpp.html">chaining.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: hashing/chaining.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,17 +124,17 @@ $(function(){initNavTree('d9/d92/chaining_8cpp_source.html','../../'); initResiz
|
||||
<div class="headertitle"><div class="title">chaining.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d9/d92/chaining_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d9/d92/chaining_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include <cmath></span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include <memory></span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include <vector></span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span></div>
|
||||
<div class="foldopen" id="foldopen00016" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"><a class="line" href="../../dd/d1c/classhash__chain.html"> 16</a></span><span class="keyword">class </span><a class="code hl_class" href="../../dd/d1c/classhash__chain.html">hash_chain</a> {</div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"><a class="line" href="../../dd/d1c/classhash__chain.html"> 16</a></span><span class="keyword">class </span><a class="code hl_function" href="../../dd/d1c/classhash__chain.html#a80c8b902a15b4fd062ed727ecf8f3595">hash_chain</a> {</div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keyword">private</span>:</div>
|
||||
<div class="foldopen" id="foldopen00021" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="../../dd/d1c/classhash__chain.html#a8b204861e9470377c956d3b5cd313036"> 21</a></span> <span class="keyword">using </span><a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> = <span class="keyword">struct </span><a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> {</div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="../../dd/d1c/classhash__chain.html#a8b204861e9470377c956d3b5cd313036"> 21</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="../../dd/d1c/classhash__chain.html#a8b204861e9470377c956d3b5cd313036">Node</a> = <span class="keyword">struct </span><a class="code hl_typedef" href="../../dd/d1c/classhash__chain.html#a8b204861e9470377c956d3b5cd313036">Node</a> {</div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>{}; </div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> std::shared_ptr<struct Node> next; </div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> };</div>
|
||||
@@ -149,11 +149,11 @@ $(function(){initNavTree('d9/d92/chaining_8cpp_source.html','../../'); initResiz
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keywordflow">while</span> (mod--) <a class="code hl_variable" href="../../dd/d1c/classhash__chain.html#ae8457d13620497fa2046ac566252c4b0">head</a>.push_back(<span class="keyword">nullptr</span>);</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span></div>
|
||||
<div class="foldopen" id="foldopen00045" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="../../dd/d1c/classhash__chain.html#a6b4b4de1a8c96f98a63a77f650a9dcff"> 45</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../dd/d1c/classhash__chain.html#a6b4b4de1a8c96f98a63a77f650a9dcff">add</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>) {</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> std::shared_ptr<Node> curr;</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> std::shared_ptr<Node> temp(<span class="keyword">new</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a>);</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> std::shared_ptr<Node> temp(<span class="keyword">new</span> <a class="code hl_typedef" href="../../dd/d1c/classhash__chain.html#a8b204861e9470377c956d3b5cd313036">Node</a>);</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> temp->data = x;</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> temp->next = <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keywordflow">if</span> (!<a class="code hl_variable" href="../../dd/d1c/classhash__chain.html#ae8457d13620497fa2046ac566252c4b0">head</a>[<a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>]) {</div>
|
||||
@@ -166,7 +166,7 @@ $(function(){initNavTree('d9/d92/chaining_8cpp_source.html','../../'); initResiz
|
||||
<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> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> </div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span></div>
|
||||
<div class="foldopen" id="foldopen00063" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="../../dd/d1c/classhash__chain.html#a706964ad13587fc9a8b3fe8381d410ed"> 63</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../dd/d1c/classhash__chain.html#a706964ad13587fc9a8b3fe8381d410ed">display</a>() {</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> std::shared_ptr<Node> temp = <span class="keyword">nullptr</span>;</div>
|
||||
@@ -187,9 +187,9 @@ $(function(){initNavTree('d9/d92/chaining_8cpp_source.html','../../'); initResiz
|
||||
<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> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> </div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span></div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"><a class="line" href="../../dd/d1c/classhash__chain.html#a846a2f921f8fb7ea572e03901b671d64"> 91</a></span> <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../dd/d1c/classhash__chain.html#a846a2f921f8fb7ea572e03901b671d64">hash</a>(<span class="keywordtype">int</span> x)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> x % <a class="code hl_variable" href="../../dd/d1c/classhash__chain.html#ae9ddce410015ed8dda6380130d82d6c2">_mod</a>; }</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> </div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span></div>
|
||||
<div class="foldopen" id="foldopen00101" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"><a class="line" href="../../dd/d1c/classhash__chain.html#a55aa5c6753cb8853152d469c375d946a"> 101</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../dd/d1c/classhash__chain.html#a55aa5c6753cb8853152d469c375d946a">find</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>)<span class="keyword"> const </span>{</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> std::shared_ptr<Node> temp = <a class="code hl_variable" href="../../dd/d1c/classhash__chain.html#ae8457d13620497fa2046ac566252c4b0">head</a>[<a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>];</div>
|
||||
@@ -221,7 +221,7 @@ $(function(){initNavTree('d9/d92/chaining_8cpp_source.html','../../'); initResiz
|
||||
</div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span>};</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> </div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span></div>
|
||||
<div class="foldopen" id="foldopen00133" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"><a class="line" href="../../d9/d92/chaining_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 133</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d92/chaining_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keywordtype">int</span> c = 0, x = 0, mod = 0, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a> = 0;</div>
|
||||
@@ -285,18 +285,18 @@ $(function(){initNavTree('d9/d92/chaining_8cpp_source.html','../../'); initResiz
|
||||
<div class="ttc" id="aclasshash__chain_html_a706964ad13587fc9a8b3fe8381d410ed"><div class="ttname"><a href="../../dd/d1c/classhash__chain.html#a706964ad13587fc9a8b3fe8381d410ed">hash_chain::display</a></div><div class="ttdeci">void display()</div><div class="ttdoc">Display the chain.</div><div class="ttdef"><b>Definition</b> <a href="#l00063">chaining.cpp:63</a></div></div>
|
||||
<div class="ttc" id="aclasshash__chain_html_a80c8b902a15b4fd062ed727ecf8f3595"><div class="ttname"><a href="../../dd/d1c/classhash__chain.html#a80c8b902a15b4fd062ed727ecf8f3595">hash_chain::hash_chain</a></div><div class="ttdeci">hash_chain(int mod)</div><div class="ttdoc">Construct a new chain object.</div><div class="ttdef"><b>Definition</b> <a href="#l00035">chaining.cpp:35</a></div></div>
|
||||
<div class="ttc" id="aclasshash__chain_html_a846a2f921f8fb7ea572e03901b671d64"><div class="ttname"><a href="../../dd/d1c/classhash__chain.html#a846a2f921f8fb7ea572e03901b671d64">hash_chain::hash</a></div><div class="ttdeci">virtual int hash(int x) const</div><div class="ttdoc">Compute the hash of a value for current chain.</div><div class="ttdef"><b>Definition</b> <a href="#l00091">chaining.cpp:91</a></div></div>
|
||||
<div class="ttc" id="aclasshash__chain_html_a8b204861e9470377c956d3b5cd313036"><div class="ttname"><a href="../../dd/d1c/classhash__chain.html#a8b204861e9470377c956d3b5cd313036">hash_chain::Node</a></div><div class="ttdeci">struct Node { int data{}; std::shared_ptr< struct Node > next; } Node</div><div class="ttdoc">Define a linked node.</div><div class="ttdef"><b>Definition</b> <a href="#l00021">chaining.cpp:21</a></div></div>
|
||||
<div class="ttc" id="aclasshash__chain_html_ae8457d13620497fa2046ac566252c4b0"><div class="ttname"><a href="../../dd/d1c/classhash__chain.html#ae8457d13620497fa2046ac566252c4b0">hash_chain::head</a></div><div class="ttdeci">std::vector< std::shared_ptr< Node > > head</div><div class="ttdoc">array of nodes</div><div class="ttdef"><b>Definition</b> <a href="#l00026">chaining.cpp:26</a></div></div>
|
||||
<div class="ttc" id="aclasshash__chain_html_ae9ddce410015ed8dda6380130d82d6c2"><div class="ttname"><a href="../../dd/d1c/classhash__chain.html#ae9ddce410015ed8dda6380130d82d6c2">hash_chain::_mod</a></div><div class="ttdeci">int _mod</div><div class="ttdoc">modulus of the class</div><div class="ttdef"><b>Definition</b> <a href="#l00027">chaining.cpp:27</a></div></div>
|
||||
<div class="ttc" id="ahash__search_8cpp_html_a566eaf0ffafd50bc61e644561fd27001"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a></div><div class="ttdeci">int h(int key)</div><div class="ttdef"><b>Definition</b> <a href="../../d1/df3/hash__search_8cpp_source.html#l00045">hash_search.cpp:45</a></div></div>
|
||||
<div class="ttc" id="ahash__search_8cpp_html_a6e1a77282bc65ad359d753d25df23243"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a></div><div class="ttdeci">int data[MAX]</div><div class="ttdoc">test data</div><div class="ttdef"><b>Definition</b> <a href="../../d1/df3/hash__search_8cpp_source.html#l00024">hash_search.cpp:24</a></div></div>
|
||||
<div class="ttc" id="astruct_node_html"><div class="ttname"><a href="../../db/d8b/struct_node.html">Node</a></div><div class="ttdef"><b>Definition</b> <a href="../../d3/dce/linkedlist__implentation__usingarray_8cpp_source.html#l00014">linkedlist_implentation_usingarray.cpp:14</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_ece9b94c107bbaa1dd68197a8c9983b9.html">hashing</a></li><li class="navelem"><a class="el" href="../../d9/d92/chaining_8cpp.html">chaining.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: numerical_methods/golden_search_extrema.cpp Pages: 1 -->
|
||||
<svg width="386pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: numerical_methods/golden_search_extrema.cpp Pages: 1 -->
|
||||
<svg width="386pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: probability/exponential_dist.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -318,7 +318,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -350,31 +350,31 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 92</span> </div>
|
||||
<div class="line"><span class="lineno"> 93</span> std::cout << <span class="stringliteral">"Test for lambda = 1 \n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 94</span> assert(</div>
|
||||
<div class="line"><span class="lineno"> 95</span> std::abs(expected_1 - probability::geometric_dist::exponential_expected(</div>
|
||||
<div class="line"><span class="lineno"> 95</span> std::abs(expected_1 - <a class="code hl_function" href="#a1c8b6e787f72a209ef96c096eedf7afc">probability::geometric_dist::exponential_expected</a>(</div>
|
||||
<div class="line"><span class="lineno"> 96</span> lambda_1)) < threshold);</div>
|
||||
<div class="line"><span class="lineno"> 97</span> assert(std::abs(var_1 - probability::geometric_dist::exponential_var(</div>
|
||||
<div class="line"><span class="lineno"> 97</span> assert(std::abs(var_1 - <a class="code hl_function" href="#af435dbeb43a05c8c7785f53bf4ce1df1">probability::geometric_dist::exponential_var</a>(</div>
|
||||
<div class="line"><span class="lineno"> 98</span> lambda_1)) < threshold);</div>
|
||||
<div class="line"><span class="lineno"> 99</span> assert(std::abs(std_1 - probability::geometric_dist::exponential_std(</div>
|
||||
<div class="line"><span class="lineno"> 99</span> assert(std::abs(std_1 - <a class="code hl_function" href="#ac7b0091e17479d47438a281fefc2549a">probability::geometric_dist::exponential_std</a>(</div>
|
||||
<div class="line"><span class="lineno"> 100</span> lambda_1)) < threshold);</div>
|
||||
<div class="line"><span class="lineno"> 101</span> std::cout << <span class="stringliteral">"ALL TEST PASSED\n\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 102</span> </div>
|
||||
<div class="line"><span class="lineno"> 103</span> std::cout << <span class="stringliteral">"Test for lambda = 2 \n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 104</span> assert(</div>
|
||||
<div class="line"><span class="lineno"> 105</span> std::abs(expected_2 - probability::geometric_dist::exponential_expected(</div>
|
||||
<div class="line"><span class="lineno"> 105</span> std::abs(expected_2 - <a class="code hl_function" href="#a1c8b6e787f72a209ef96c096eedf7afc">probability::geometric_dist::exponential_expected</a>(</div>
|
||||
<div class="line"><span class="lineno"> 106</span> lambda_2)) < threshold);</div>
|
||||
<div class="line"><span class="lineno"> 107</span> assert(std::abs(var_2 - probability::geometric_dist::exponential_var(</div>
|
||||
<div class="line"><span class="lineno"> 107</span> assert(std::abs(var_2 - <a class="code hl_function" href="#af435dbeb43a05c8c7785f53bf4ce1df1">probability::geometric_dist::exponential_var</a>(</div>
|
||||
<div class="line"><span class="lineno"> 108</span> lambda_2)) < threshold);</div>
|
||||
<div class="line"><span class="lineno"> 109</span> assert(std::abs(std_2 - probability::geometric_dist::exponential_std(</div>
|
||||
<div class="line"><span class="lineno"> 109</span> assert(std::abs(std_2 - <a class="code hl_function" href="#ac7b0091e17479d47438a281fefc2549a">probability::geometric_dist::exponential_std</a>(</div>
|
||||
<div class="line"><span class="lineno"> 110</span> lambda_2)) < threshold);</div>
|
||||
<div class="line"><span class="lineno"> 111</span> std::cout << <span class="stringliteral">"ALL TEST PASSED\n\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 112</span> </div>
|
||||
<div class="line"><span class="lineno"> 113</span> std::cout << <span class="stringliteral">"Test for lambda = 3 \n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 114</span> assert(</div>
|
||||
<div class="line"><span class="lineno"> 115</span> std::abs(expected_3 - probability::geometric_dist::exponential_expected(</div>
|
||||
<div class="line"><span class="lineno"> 115</span> std::abs(expected_3 - <a class="code hl_function" href="#a1c8b6e787f72a209ef96c096eedf7afc">probability::geometric_dist::exponential_expected</a>(</div>
|
||||
<div class="line"><span class="lineno"> 116</span> lambda_3)) < threshold);</div>
|
||||
<div class="line"><span class="lineno"> 117</span> assert(std::abs(var_3 - probability::geometric_dist::exponential_var(</div>
|
||||
<div class="line"><span class="lineno"> 117</span> assert(std::abs(var_3 - <a class="code hl_function" href="#af435dbeb43a05c8c7785f53bf4ce1df1">probability::geometric_dist::exponential_var</a>(</div>
|
||||
<div class="line"><span class="lineno"> 118</span> lambda_3)) < threshold);</div>
|
||||
<div class="line"><span class="lineno"> 119</span> assert(std::abs(std_3 - probability::geometric_dist::exponential_std(</div>
|
||||
<div class="line"><span class="lineno"> 119</span> assert(std::abs(std_3 - <a class="code hl_function" href="#ac7b0091e17479d47438a281fefc2549a">probability::geometric_dist::exponential_std</a>(</div>
|
||||
<div class="line"><span class="lineno"> 120</span> lambda_3)) < threshold);</div>
|
||||
<div class="line"><span class="lineno"> 121</span> std::cout << <span class="stringliteral">"ALL TEST PASSED\n\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 122</span> </div>
|
||||
@@ -410,7 +410,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_82e494173a87936756866de2fa774307.html">probability</a></li><li class="navelem"><a class="el" href="../../d9/da2/exponential__dist_8cpp.html">exponential_dist.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
var exponential__dist_8cpp =
|
||||
[
|
||||
[ "exponential_expected", "d9/da2/exponential__dist_8cpp.html#a1c8b6e787f72a209ef96c096eedf7afc", null ],
|
||||
[ "exponential_std", "d9/da2/exponential__dist_8cpp.html#ac7b0091e17479d47438a281fefc2549a", null ],
|
||||
[ "exponential_var", "d9/da2/exponential__dist_8cpp.html#af435dbeb43a05c8c7785f53bf4ce1df1", null ],
|
||||
[ "probability::geometric_dist::exponential_expected", "d9/da2/exponential__dist_8cpp.html#a1c8b6e787f72a209ef96c096eedf7afc", null ],
|
||||
[ "probability::geometric_dist::exponential_std", "d9/da2/exponential__dist_8cpp.html#ac7b0091e17479d47438a281fefc2549a", null ],
|
||||
[ "probability::geometric_dist::exponential_var", "d9/da2/exponential__dist_8cpp.html#af435dbeb43a05c8c7785f53bf4ce1df1", null ],
|
||||
[ "main", "d9/da2/exponential__dist_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "test", "d9/da2/exponential__dist_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: probability/exponential_dist.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,13 +124,14 @@ $(function(){initNavTree('d9/da2/exponential__dist_8cpp_source.html','../../');
|
||||
<div class="headertitle"><div class="title">exponential_dist.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d9/da2/exponential__dist_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d9/da2/exponential__dist_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <cassert></span> <span class="comment">// For assert</span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <cmath></span> <span class="comment">// For std::pow</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include <iostream></span> <span class="comment">// For I/O operation</span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include <stdexcept></span> <span class="comment">// For std::invalid_argument</span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include <string></span> <span class="comment">// For std::string</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d4/ded/namespaceprobability.html">probability</a> {</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../dd/d8a/namespacegeometric__dist.html">geometric_dist</a> {</div>
|
||||
<div class="foldopen" id="foldopen00037" data-start="{" data-end="}">
|
||||
@@ -141,7 +142,7 @@ $(function(){initNavTree('d9/da2/exponential__dist_8cpp_source.html','../../');
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keywordflow">return</span> 1 / lambda;</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> </div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span></div>
|
||||
<div class="foldopen" id="foldopen00048" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="../../d9/da2/exponential__dist_8cpp.html#af435dbeb43a05c8c7785f53bf4ce1df1"> 48</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#af435dbeb43a05c8c7785f53bf4ce1df1">exponential_var</a>(<span class="keywordtype">double</span> lambda) {</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordflow">if</span> (lambda <= 0) {</div>
|
||||
@@ -150,7 +151,7 @@ $(function(){initNavTree('d9/da2/exponential__dist_8cpp_source.html','../../');
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordflow">return</span> 1 / pow(lambda, 2);</div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> </div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span></div>
|
||||
<div class="foldopen" id="foldopen00059" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="../../d9/da2/exponential__dist_8cpp.html#ac7b0091e17479d47438a281fefc2549a"> 59</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#ac7b0091e17479d47438a281fefc2549a">exponential_std</a>(<span class="keywordtype">double</span> lambda) {</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="keywordflow">if</span> (lambda <= 0) {</div>
|
||||
@@ -161,7 +162,7 @@ $(function(){initNavTree('d9/da2/exponential__dist_8cpp_source.html','../../');
|
||||
</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span>} <span class="comment">// namespace geometric_dist</span></div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span>} <span class="comment">// namespace probability</span></div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> </div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span></div>
|
||||
<div class="foldopen" id="foldopen00072" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="../../d9/da2/exponential__dist_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 72</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordtype">double</span> lambda_1 = 1;</div>
|
||||
@@ -186,39 +187,39 @@ $(function(){initNavTree('d9/da2/exponential__dist_8cpp_source.html','../../');
|
||||
<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> std::cout << <span class="stringliteral">"Test for lambda = 1 \n"</span>;</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> assert(</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> std::abs(expected_1 - probability::geometric_dist::exponential_expected(</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> std::abs(expected_1 - <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#a1c8b6e787f72a209ef96c096eedf7afc">probability::geometric_dist::exponential_expected</a>(</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> lambda_1)) < threshold);</div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> assert(std::abs(var_1 - probability::geometric_dist::exponential_var(</div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> assert(std::abs(var_1 - <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#af435dbeb43a05c8c7785f53bf4ce1df1">probability::geometric_dist::exponential_var</a>(</div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> lambda_1)) < threshold);</div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> assert(std::abs(std_1 - probability::geometric_dist::exponential_std(</div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> assert(std::abs(std_1 - <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#ac7b0091e17479d47438a281fefc2549a">probability::geometric_dist::exponential_std</a>(</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> lambda_1)) < threshold);</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> std::cout << <span class="stringliteral">"ALL TEST PASSED\n\n"</span>;</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> </div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> std::cout << <span class="stringliteral">"Test for lambda = 2 \n"</span>;</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> assert(</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> std::abs(expected_2 - probability::geometric_dist::exponential_expected(</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> std::abs(expected_2 - <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#a1c8b6e787f72a209ef96c096eedf7afc">probability::geometric_dist::exponential_expected</a>(</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> lambda_2)) < threshold);</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> assert(std::abs(var_2 - probability::geometric_dist::exponential_var(</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> assert(std::abs(var_2 - <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#af435dbeb43a05c8c7785f53bf4ce1df1">probability::geometric_dist::exponential_var</a>(</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> lambda_2)) < threshold);</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> assert(std::abs(std_2 - probability::geometric_dist::exponential_std(</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> assert(std::abs(std_2 - <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#ac7b0091e17479d47438a281fefc2549a">probability::geometric_dist::exponential_std</a>(</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> lambda_2)) < threshold);</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> std::cout << <span class="stringliteral">"ALL TEST PASSED\n\n"</span>;</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> </div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> std::cout << <span class="stringliteral">"Test for lambda = 3 \n"</span>;</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> assert(</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> std::abs(expected_3 - probability::geometric_dist::exponential_expected(</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> std::abs(expected_3 - <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#a1c8b6e787f72a209ef96c096eedf7afc">probability::geometric_dist::exponential_expected</a>(</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> lambda_3)) < threshold);</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> assert(std::abs(var_3 - probability::geometric_dist::exponential_var(</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> assert(std::abs(var_3 - <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#af435dbeb43a05c8c7785f53bf4ce1df1">probability::geometric_dist::exponential_var</a>(</div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> lambda_3)) < threshold);</div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> assert(std::abs(std_3 - probability::geometric_dist::exponential_std(</div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> assert(std::abs(std_3 - <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#ac7b0091e17479d47438a281fefc2549a">probability::geometric_dist::exponential_std</a>(</div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> lambda_3)) < threshold);</div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> std::cout << <span class="stringliteral">"ALL TEST PASSED\n\n"</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> std::cout << <span class="stringliteral">"Test for lambda = 0 \n"</span>;</div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="keywordflow">try</span> {</div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> probability::geometric_dist::exponential_expected(lambda_4);</div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> probability::geometric_dist::exponential_var(lambda_4);</div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> probability::geometric_dist::exponential_std(lambda_4);</div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#a1c8b6e787f72a209ef96c096eedf7afc">probability::geometric_dist::exponential_expected</a>(lambda_4);</div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#af435dbeb43a05c8c7785f53bf4ce1df1">probability::geometric_dist::exponential_var</a>(lambda_4);</div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#ac7b0091e17479d47438a281fefc2549a">probability::geometric_dist::exponential_std</a>(lambda_4);</div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> } <span class="keywordflow">catch</span> (std::invalid_argument& err) {</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> assert(std::string(err.what()) == <span class="stringliteral">"lambda must be greater than 0"</span>);</div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> }</div>
|
||||
@@ -226,16 +227,16 @@ $(function(){initNavTree('d9/da2/exponential__dist_8cpp_source.html','../../');
|
||||
<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> std::cout << <span class="stringliteral">"Test for lambda = -2.3 \n"</span>;</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keywordflow">try</span> {</div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> probability::geometric_dist::exponential_expected(lambda_5);</div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> probability::geometric_dist::exponential_var(lambda_5);</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> probability::geometric_dist::exponential_std(lambda_5);</div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#a1c8b6e787f72a209ef96c096eedf7afc">probability::geometric_dist::exponential_expected</a>(lambda_5);</div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#af435dbeb43a05c8c7785f53bf4ce1df1">probability::geometric_dist::exponential_var</a>(lambda_5);</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#ac7b0091e17479d47438a281fefc2549a">probability::geometric_dist::exponential_std</a>(lambda_5);</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> } <span class="keywordflow">catch</span> (std::invalid_argument& err) {</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> assert(std::string(err.what()) == <span class="stringliteral">"lambda must be greater than 0"</span>);</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> std::cout << <span class="stringliteral">"ALL TEST PASSED\n\n"</span>;</div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> </div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span></div>
|
||||
<div class="foldopen" id="foldopen00148" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"><a class="line" href="../../d9/da2/exponential__dist_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 148</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <a class="code hl_function" href="../../d9/da2/exponential__dist_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// Self test implementation</span></div>
|
||||
@@ -255,7 +256,7 @@ $(function(){initNavTree('d9/da2/exponential__dist_8cpp_source.html','../../');
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_82e494173a87936756866de2fa774307.html">probability</a></li><li class="navelem"><a class="el" href="../../d9/da2/exponential__dist_8cpp.html">exponential_dist.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||