mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-24 05:42:59 +08:00
Documentation for 67e26cfbae
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<map id="dynamic_programming/coin_change_topdown.cpp" name="dynamic_programming/coin_change_topdown.cpp">
|
||||
<area shape="rect" id="node1" title="Minimum coins change problem is a problem used to find the minimum number of coins required to comple..." alt="" coords="83,5,263,47"/>
|
||||
<area shape="rect" id="node2" title=" " alt="" coords="5,95,77,121"/>
|
||||
<area shape="rect" id="node3" title=" " alt="" coords="101,95,160,121"/>
|
||||
<area shape="rect" id="node4" title=" " alt="" coords="185,95,250,121"/>
|
||||
<area shape="rect" id="node5" title=" " alt="" coords="274,95,334,121"/>
|
||||
<area shape="rect" id="node1" title="Minimum coins change problem is a problem used to find the minimum number of coins required to comple..." alt="" coords="80,5,260,47"/>
|
||||
<area shape="rect" id="node2" title=" " alt="" coords="5,95,71,121"/>
|
||||
<area shape="rect" id="node3" title=" " alt="" coords="95,95,155,121"/>
|
||||
<area shape="rect" id="node4" title=" " alt="" coords="179,95,251,121"/>
|
||||
<area shape="rect" id="node5" title=" " alt="" coords="275,95,334,121"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
bfb82388f373aae8405462e8423467eb
|
||||
f997c846942bf3c30d149388ebdb5556
|
||||
@@ -13,9 +13,9 @@
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Minimum coins change problem is a problem used to find the minimum number of coins required to comple...">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="58.5,-56.5 58.5,-86.5 193.5,-86.5 193.5,-56.5 58.5,-56.5"/>
|
||||
<text text-anchor="start" x="66.5" y="-74.5" font-family="Helvetica,sans-Serif" font-size="10.00">dynamic_programming</text>
|
||||
<text text-anchor="middle" x="126" y="-63.5" font-family="Helvetica,sans-Serif" font-size="10.00">/coin_change_topdown.cpp</text>
|
||||
<polygon fill="#bfbfbf" stroke="black" points="56,-56.5 56,-86.5 191,-86.5 191,-56.5 56,-56.5"/>
|
||||
<text text-anchor="start" x="64" y="-74.5" font-family="Helvetica,sans-Serif" font-size="10.00">dynamic_programming</text>
|
||||
<text text-anchor="middle" x="123.5" y="-63.5" font-family="Helvetica,sans-Serif" font-size="10.00">/coin_change_topdown.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -23,61 +23,61 @@
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="0,-0.5 0,-19.5 54,-19.5 54,-0.5 0,-0.5"/>
|
||||
<text text-anchor="middle" x="27" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="white" stroke="#bfbfbf" points="0,-0.5 0,-19.5 49,-19.5 49,-0.5 0,-0.5"/>
|
||||
<text text-anchor="middle" x="24.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M102.54,-56.4C86.67,-46.86 65.81,-34.32 50.03,-24.84"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="51.78,-21.81 41.41,-19.66 48.17,-27.81 51.78,-21.81"/>
|
||||
<path fill="none" stroke="midnightblue" d="M100.04,-56.4C84.17,-46.86 63.31,-34.32 47.53,-24.84"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="49.28,-21.81 38.91,-19.66 45.67,-27.81 49.28,-21.81"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="72,-0.5 72,-19.5 116,-19.5 116,-0.5 72,-0.5"/>
|
||||
<text text-anchor="middle" x="94" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
<polygon fill="white" stroke="#bfbfbf" points="67,-0.5 67,-19.5 112,-19.5 112,-0.5 67,-0.5"/>
|
||||
<text text-anchor="middle" x="89.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">climits</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M118.42,-56.4C113.96,-48.11 108.28,-37.55 103.52,-28.71"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="106.48,-26.81 98.66,-19.66 100.31,-30.12 106.48,-26.81"/>
|
||||
<path fill="none" stroke="midnightblue" d="M115.44,-56.4C110.65,-48.02 104.54,-37.33 99.46,-28.42"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="102.45,-26.6 94.45,-19.66 96.37,-30.08 102.45,-26.6"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="134.5,-0.5 134.5,-19.5 183.5,-19.5 183.5,-0.5 134.5,-0.5"/>
|
||||
<text text-anchor="middle" x="159" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
|
||||
<polygon fill="white" stroke="#bfbfbf" points="130.5,-0.5 130.5,-19.5 184.5,-19.5 184.5,-0.5 130.5,-0.5"/>
|
||||
<text text-anchor="middle" x="157.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M133.82,-56.4C138.47,-48.02 144.4,-37.33 149.34,-28.42"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="152.41,-30.1 154.2,-19.66 146.29,-26.71 152.41,-30.1"/>
|
||||
<path fill="none" stroke="midnightblue" d="M131.56,-56.4C136.35,-48.02 142.46,-37.33 147.54,-28.42"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="150.63,-30.08 152.55,-19.66 144.55,-26.6 150.63,-30.08"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="201.5,-0.5 201.5,-19.5 246.5,-19.5 246.5,-0.5 201.5,-0.5"/>
|
||||
<text text-anchor="middle" x="224" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">climits</text>
|
||||
<polygon fill="white" stroke="#bfbfbf" points="202.5,-0.5 202.5,-19.5 246.5,-19.5 246.5,-0.5 202.5,-0.5"/>
|
||||
<text text-anchor="middle" x="224.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node5 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M149.22,-56.4C164.79,-46.95 185.2,-34.56 200.76,-25.11"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="203.01,-27.84 209.74,-19.66 199.38,-21.86 203.01,-27.84"/>
|
||||
<path fill="none" stroke="midnightblue" d="M147.44,-56.4C163.63,-46.86 184.91,-34.32 201,-24.84"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="202.96,-27.75 209.8,-19.66 199.41,-21.72 202.96,-27.75"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
@@ -1063,7 +1063,7 @@ template<typename T > </div>
|
||||
<div class="ttc" id="aordinary__least__squares__regressor_8cpp_html_a4261f3c3c3dfdb86f3004eb8aaffea8d"><div class="ttname"><a href="../../dc/d38/ordinary__least__squares__regressor_8cpp.html#a4261f3c3c3dfdb86f3004eb8aaffea8d">ols_test</a></div><div class="ttdeci">void ols_test()</div><div class="ttdef"><b>Definition:</b> ordinary_least_squares_regressor.cpp:369</div></div>
|
||||
<div class="ttc" id="asetw_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a></div><div class="ttdeci">T setw(T... args)</div></div>
|
||||
<div class="ttc" id="abasic_istream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a></div></div>
|
||||
<div class="ttc" id="afibonacci__sum_8cpp_html_aadb40ac4c74a7efc0680b83eeee138aa"><div class="ttname"><a href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">math::fibonacci_sum::result</a></div><div class="ttdeci">uint64_t result(uint64_t n)</div><div class="ttdef"><b>Definition:</b> fibonacci_sum.cpp:75</div></div>
|
||||
<div class="ttc" id="afibonacci__sum_8cpp_html_aadb40ac4c74a7efc0680b83eeee138aa"><div class="ttname"><a href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">math::fibonacci_sum::result</a></div><div class="ttdeci">uint64_t result(uint64_t n)</div><div class="ttdef"><b>Definition:</b> fibonacci_sum.cpp:76</div></div>
|
||||
<div class="ttc" id="aordinary__least__squares__regressor_8cpp_html_a889f9de199fa793497c864d8e493af05"><div class="ttname"><a href="../../dc/d38/ordinary__least__squares__regressor_8cpp.html#a889f9de199fa793497c864d8e493af05">get_transpose</a></div><div class="ttdeci">std::vector< std::vector< T > > get_transpose(std::vector< std::vector< T >> const &A)</div><div class="ttdef"><b>Definition:</b> ordinary_least_squares_regressor.cpp:300</div></div>
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
|
||||
@@ -116,8 +116,8 @@ Collaboration diagram for graph::Graph< T >:</div>
|
||||
Public Member Functions</h2></td></tr>
|
||||
<tr class="memitem:a877b2cba40d8d46dde6fb4209effed19"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d61/classgraph_1_1_graph.html#a877b2cba40d8d46dde6fb4209effed19">add_edge</a> (T u, T v, bool bidir=true)</td></tr>
|
||||
<tr class="separator:a877b2cba40d8d46dde6fb4209effed19"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a6e3efabd5e401ef0f47c179866e7454e"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map.html">std::map</a>< T, bool > </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d61/classgraph_1_1_graph.html#a6e3efabd5e401ef0f47c179866e7454e">breadth_first_search</a> (T src)</td></tr>
|
||||
<tr class="separator:a6e3efabd5e401ef0f47c179866e7454e"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ab1a1a96cd4cddf0d4feb02855c4c16af"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map.html">std::map</a>< T, bool > </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d61/classgraph_1_1_graph.html#ab1a1a96cd4cddf0d4feb02855c4c16af">breadth_first_search</a> (T src)</td></tr>
|
||||
<tr class="separator:ab1a1a96cd4cddf0d4feb02855c4c16af"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a8839fa14bff19d2deab4a618447c13e5"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d61/classgraph_1_1_graph.html#a8839fa14bff19d2deab4a618447c13e5">Graph</a> (size_t N, const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a>< int, int > > &undirected_edges)</td></tr>
|
||||
<tr class="memdesc:a8839fa14bff19d2deab4a618447c13e5"><td class="mdescLeft"> </td><td class="mdescRight">Populate the adjacency list for each vertex in the graph. Assumes that evey edge is a pair of valid vertex indices. <a href="../../dc/d61/classgraph_1_1_graph.html#a8839fa14bff19d2deab4a618447c13e5">More...</a><br /></td></tr>
|
||||
<tr class="separator:a8839fa14bff19d2deab4a618447c13e5"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -133,8 +133,8 @@ Public Attributes</h2></td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
|
||||
Private Attributes</h2></td></tr>
|
||||
<tr class="memitem:a3ab95bb3ba618a7e883ead8ee696c25c"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map.html">std::map</a>< T, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list.html">std::list</a>< T > > </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d61/classgraph_1_1_graph.html#a3ab95bb3ba618a7e883ead8ee696c25c">adjacency_list</a></td></tr>
|
||||
<tr class="separator:a3ab95bb3ba618a7e883ead8ee696c25c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:acebf0505d625b043bb9c8c27c7a8def0"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map.html">std::map</a>< T, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list.html">std::list</a>< T > > </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d61/classgraph_1_1_graph.html#acebf0505d625b043bb9c8c27c7a8def0">adjacency_list</a></td></tr>
|
||||
<tr class="separator:acebf0505d625b043bb9c8c27c7a8def0"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><h3>template<typename T><br />
|
||||
@@ -246,26 +246,27 @@ template<typename T > </div>
|
||||
</div><div class="memdoc">
|
||||
<p>add_edge(u,v,bidir) is used to add an edge between node u and node v by default , bidir is made true , i.e graph is bidirectional . It means if edge(u,v) is added then u-->v and v-->u both edges exist.</p>
|
||||
<p>to make the graph unidirectional pass the third parameter of add_edge as false which will</p>
|
||||
<div class="fragment"><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  {<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <span class="comment"> /**</span></div>
|
||||
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span> <span class="comment"> * add_edge(u,v,bidir) is used to add an edge between node u and node v</span></div>
|
||||
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span> <span class="comment"> * by default , bidir is made true , i.e graph is bidirectional .</span></div>
|
||||
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span> <span class="comment"> * It means if edge(u,v) is added then u-->v and v-->u both edges exist.</span></div>
|
||||
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span> <span class="comment"> *</span></div>
|
||||
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span> <span class="comment"> * to make the graph unidirectional pass the third parameter of add_edge as</span></div>
|
||||
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <span class="comment"> * false which will</span></div>
|
||||
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="comment"> */</span></div>
|
||||
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <a class="code" href="../../dc/d61/classgraph_1_1_graph.html#a3ab95bb3ba618a7e883ead8ee696c25c">adjacency_list</a>[u].push_back(v); <span class="comment">// u-->v edge added</span></div>
|
||||
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <span class="keywordflow">if</span>(bidir==<span class="keyword">true</span>){</div>
|
||||
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="comment">// if graph is bidirectional</span></div>
|
||||
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <a class="code" href="../../dc/d61/classgraph_1_1_graph.html#a3ab95bb3ba618a7e883ead8ee696c25c">adjacency_list</a>[v].push_back(u); <span class="comment">// v-->u edge added</span></div>
|
||||
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  }</div>
|
||||
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  }</div>
|
||||
<div class="fragment"><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  {<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span> <span class="comment"> /**</span></div>
|
||||
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span> <span class="comment"> * add_edge(u,v,bidir) is used to add an edge between node u and</span></div>
|
||||
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span> <span class="comment"> * node v by default , bidir is made true , i.e graph is</span></div>
|
||||
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span> <span class="comment"> * bidirectional . It means if edge(u,v) is added then u-->v and</span></div>
|
||||
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <span class="comment"> * v-->u both edges exist.</span></div>
|
||||
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="comment"> *</span></div>
|
||||
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <span class="comment"> * to make the graph unidirectional pass the third parameter of</span></div>
|
||||
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="comment"> * add_edge as false which will</span></div>
|
||||
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="comment"> */</span></div>
|
||||
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <a class="code" href="../../dc/d61/classgraph_1_1_graph.html#acebf0505d625b043bb9c8c27c7a8def0">adjacency_list</a>[u].push_back(v); <span class="comment">// u-->v edge added</span></div>
|
||||
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="keywordflow">if</span> (bidir == <span class="keyword">true</span>) {</div>
|
||||
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <span class="comment">// if graph is bidirectional</span></div>
|
||||
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <a class="code" href="../../dc/d61/classgraph_1_1_graph.html#acebf0505d625b043bb9c8c27c7a8def0">adjacency_list</a>[v].push_back(u); <span class="comment">// v-->u edge added</span></div>
|
||||
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  }</div>
|
||||
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  }</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="a6e3efabd5e401ef0f47c179866e7454e"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a6e3efabd5e401ef0f47c179866e7454e">◆ </a></span>breadth_first_search()</h2>
|
||||
<a id="ab1a1a96cd4cddf0d4feb02855c4c16af"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ab1a1a96cd4cddf0d4feb02855c4c16af">◆ </a></span>breadth_first_search()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
@@ -276,7 +277,7 @@ template<typename T > </div>
|
||||
<td class="mlabels-left">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map.html">std::map</a><T,bool> <a class="el" href="../../dc/d61/classgraph_1_1_graph.html">graph::Graph</a>< T >::breadth_first_search </td>
|
||||
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map.html">std::map</a><T, bool> <a class="el" href="../../dc/d61/classgraph_1_1_graph.html">graph::Graph</a>< T >::breadth_first_search </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">T </td>
|
||||
<td class="paramname"><em>src</em></td><td>)</td>
|
||||
@@ -300,47 +301,48 @@ template<typename T > </div>
|
||||
<p>check every vertex connected to the node which are still unvisited</p>
|
||||
<p>if the neighbour is unvisited , push it into the queue</p>
|
||||
<p>mark the neighbour as visited</p>
|
||||
<div class="fragment"><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  {<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span> <span class="comment"> /// mapping to keep track of all visited nodes </span></div>
|
||||
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span> <span class="comment"></span> <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map.html">std::map<T,bool></a> visited;<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span> <span class="comment"> /// initialise every possible vertex to map to false</span></div>
|
||||
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span> <span class="comment"> /// initially none of the vertices are unvisited</span></div>
|
||||
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span> <span class="comment"></span> <span class="keywordflow">for</span>(<span class="keyword">auto</span> <span class="keyword">const</span> &adjlist: <a class="code" href="../../dc/d61/classgraph_1_1_graph.html#a3ab95bb3ba618a7e883ead8ee696c25c">adjacency_list</a>){</div>
|
||||
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  visited[adjlist.first]=<span class="keyword">false</span>;</div>
|
||||
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="keywordflow">for</span>(<span class="keyword">auto</span> <span class="keyword">const</span> &<a class="code" href="../../d5/da1/structnode.html">node</a>:<a class="code" href="../../dc/d61/classgraph_1_1_graph.html#a3ab95bb3ba618a7e883ead8ee696c25c">adjacency_list</a>[adjlist.first]){</div>
|
||||
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  visited[<a class="code" href="../../d1/df3/hash__search_8cpp.html#a8ca8dcb494104d273679e219e53d0555">node</a>]=<span class="keyword">false</span>;</div>
|
||||
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  }</div>
|
||||
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  }</div>
|
||||
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="comment"></span></div>
|
||||
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span> <span class="comment"> /// queue to store the nodes which are yet to be traversed</span></div>
|
||||
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span> <span class="comment"></span> <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue.html">std::queue<T></a> tracker;</div>
|
||||
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="comment"></span></div>
|
||||
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span> <span class="comment"> /// push the source vertex to queue to begin traversing </span></div>
|
||||
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span> <span class="comment"></span> tracker.<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/push.html">push</a>(src);<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span> <span class="comment"> ///mark the source vertex as visited</span></div>
|
||||
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span> <span class="comment"></span> visited[src]=<span class="keyword">true</span>;</div>
|
||||
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keywordflow">while</span>(!tracker.<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/empty.html">empty</a>()){<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span> <span class="comment"> /// traverse the graph till no connected vertex are left </span></div>
|
||||
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span> <span class="comment"> /// extract a node from queue for further traversal</span></div>
|
||||
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span> <span class="comment"></span> T <a class="code" href="../../d5/da1/structnode.html">node</a> = tracker.<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/front.html">front</a>();<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span> <span class="comment"> /// remove the node from the queue</span></div>
|
||||
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> <span class="comment"></span> tracker.<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/pop.html">pop</a>();</div>
|
||||
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <span class="keywordflow">for</span>(T <span class="keyword">const</span> &neighbour : <a class="code" href="../../dc/d61/classgraph_1_1_graph.html#a3ab95bb3ba618a7e883ead8ee696c25c">adjacency_list</a>[<a class="code" href="../../d5/da1/structnode.html">node</a>]){<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span> <span class="comment"> /// check every vertex connected to the node which are still unvisited</span></div>
|
||||
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span> <span class="comment"></span> <span class="keywordflow">if</span>(!visited[neighbour]){<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span> <span class="comment"> /// if the neighbour is unvisited , push it into the queue</span></div>
|
||||
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span> <span class="comment"></span> tracker.<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/push.html">push</a>(neighbour);<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span> <span class="comment"> /// mark the neighbour as visited</span></div>
|
||||
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span> <span class="comment"></span> visited[neighbour]=<span class="keyword">true</span>;</div>
|
||||
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  }</div>
|
||||
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  }</div>
|
||||
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  }</div>
|
||||
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keywordflow">return</span> visited;</div>
|
||||
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  }</div>
|
||||
<div class="fragment"><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  {<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span> <span class="comment"> /// mapping to keep track of all visited nodes</span></div>
|
||||
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span> <span class="comment"></span> <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map.html">std::map<T, bool></a> visited;<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span> <span class="comment"> /// initialise every possible vertex to map to false</span></div>
|
||||
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span> <span class="comment"> /// initially none of the vertices are unvisited</span></div>
|
||||
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span> <span class="comment"></span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span> &adjlist : <a class="code" href="../../dc/d61/classgraph_1_1_graph.html#acebf0505d625b043bb9c8c27c7a8def0">adjacency_list</a>) {</div>
|
||||
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  visited[adjlist.first] = <span class="keyword">false</span>;</div>
|
||||
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span> &<a class="code" href="../../d5/da1/structnode.html">node</a> : <a class="code" href="../../dc/d61/classgraph_1_1_graph.html#acebf0505d625b043bb9c8c27c7a8def0">adjacency_list</a>[adjlist.first]) {</div>
|
||||
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  visited[<a class="code" href="../../d1/df3/hash__search_8cpp.html#a8ca8dcb494104d273679e219e53d0555">node</a>] = <span class="keyword">false</span>;</div>
|
||||
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  }</div>
|
||||
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  }</div>
|
||||
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span> <span class="comment"></span> </div>
|
||||
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span> <span class="comment"> /// queue to store the nodes which are yet to be traversed</span></div>
|
||||
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span> <span class="comment"></span> <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue.html">std::queue<T></a> tracker;</div>
|
||||
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span> <span class="comment"></span> </div>
|
||||
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span> <span class="comment"> /// push the source vertex to queue to begin traversing</span></div>
|
||||
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span> <span class="comment"></span> tracker.<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/push.html">push</a>(src);<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span> <span class="comment"> /// mark the source vertex as visited</span></div>
|
||||
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span> <span class="comment"></span> visited[src] = <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="keywordflow">while</span> (!tracker.<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/empty.html">empty</a>()) {<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span> <span class="comment"> /// traverse the graph till no connected vertex are left</span></div>
|
||||
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span> <span class="comment"> /// extract a node from queue for further traversal</span></div>
|
||||
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> <span class="comment"></span> T <a class="code" href="../../d5/da1/structnode.html">node</a> = tracker.<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/front.html">front</a>();<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span> <span class="comment"> /// remove the node from the queue</span></div>
|
||||
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span> <span class="comment"></span> tracker.<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/pop.html">pop</a>();</div>
|
||||
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="keywordflow">for</span> (T <span class="keyword">const</span> &neighbour : <a class="code" href="../../dc/d61/classgraph_1_1_graph.html#acebf0505d625b043bb9c8c27c7a8def0">adjacency_list</a>[<a class="code" href="../../d5/da1/structnode.html">node</a>]) {<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span> <span class="comment"> /// check every vertex connected to the node which are still</span></div>
|
||||
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span> <span class="comment"> /// unvisited</span></div>
|
||||
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span> <span class="comment"></span> <span class="keywordflow">if</span> (!visited[neighbour]) {<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span> <span class="comment"> /// if the neighbour is unvisited , push it into the queue</span></div>
|
||||
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span> <span class="comment"></span> tracker.<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/push.html">push</a>(neighbour);<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span> <span class="comment"> /// mark the neighbour as visited</span></div>
|
||||
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span> <span class="comment"></span> visited[neighbour] = <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  }</div>
|
||||
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  }</div>
|
||||
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  }</div>
|
||||
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <span class="keywordflow">return</span> visited;</div>
|
||||
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  }</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dc/d61/classgraph_1_1_graph_a6e3efabd5e401ef0f47c179866e7454e_cgraph.svg" width="334" height="190"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dc/d61/classgraph_1_1_graph_ab1a1a96cd4cddf0d4feb02855c4c16af_cgraph.svg" width="334" height="190"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -382,8 +384,8 @@ Here is the call graph for this function:</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2 class="groupheader">Member Data Documentation</h2>
|
||||
<a id="a3ab95bb3ba618a7e883ead8ee696c25c"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a3ab95bb3ba618a7e883ead8ee696c25c">◆ </a></span>adjacency_list</h2>
|
||||
<a id="acebf0505d625b043bb9c8c27c7a8def0"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#acebf0505d625b043bb9c8c27c7a8def0">◆ </a></span>adjacency_list</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
@@ -394,7 +396,7 @@ template<typename T > </div>
|
||||
<td class="mlabels-left">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map.html">std::map</a><T,<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list.html">std::list</a><T> > <a class="el" href="../../dc/d61/classgraph_1_1_graph.html">graph::Graph</a>< T >::adjacency_list</td>
|
||||
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map.html">std::map</a><T, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list.html">std::list</a><T> > <a class="el" href="../../dc/d61/classgraph_1_1_graph.html">graph::Graph</a>< T >::adjacency_list</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
@@ -413,7 +415,6 @@ template<typename T > </div>
|
||||
</ul>
|
||||
</div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<div class="ttc" id="aclassgraph_1_1_graph_html_a3ab95bb3ba618a7e883ead8ee696c25c"><div class="ttname"><a href="../../dc/d61/classgraph_1_1_graph.html#a3ab95bb3ba618a7e883ead8ee696c25c">graph::Graph::adjacency_list</a></div><div class="ttdeci">std::map< T, std::list< T > > adjacency_list</div><div class="ttdef"><b>Definition:</b> breadth_first_search.cpp:69</div></div>
|
||||
<div class="ttc" id="aresize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/resize.html">std::vector::resize</a></div><div class="ttdeci">T resize(T... args)</div></div>
|
||||
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/size.html">std::vector::size</a></div><div class="ttdeci">T size(T... args)</div></div>
|
||||
<div class="ttc" id="astructnode_html"><div class="ttname"><a href="../../d5/da1/structnode.html">node</a></div><div class="ttdef"><b>Definition:</b> avltree.cpp:13</div></div>
|
||||
@@ -426,6 +427,7 @@ template<typename T > </div>
|
||||
<div class="ttc" id="amap_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/map.html">std::map</a></div><div class="ttdoc">STL class.</div></div>
|
||||
<div class="ttc" id="aempty_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/queue/empty.html">std::queue::empty</a></div><div class="ttdeci">T empty(T... args)</div></div>
|
||||
<div class="ttc" id="apush_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/queue/push.html">std::queue::push</a></div><div class="ttdeci">T push(T... args)</div></div>
|
||||
<div class="ttc" id="aclassgraph_1_1_graph_html_acebf0505d625b043bb9c8c27c7a8def0"><div class="ttname"><a href="../../dc/d61/classgraph_1_1_graph.html#acebf0505d625b043bb9c8c27c7a8def0">graph::Graph::adjacency_list</a></div><div class="ttdeci">std::map< T, std::list< T > > adjacency_list</div><div class="ttdef"><b>Definition:</b> breadth_first_search.cpp:69</div></div>
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
var classgraph_1_1_graph =
|
||||
[
|
||||
[ "Graph", "dc/d61/classgraph_1_1_graph.html#a1b3d8b89e184169360b5485e8dbe347e", null ],
|
||||
[ "Graph", "dc/d61/classgraph_1_1_graph.html#a190c0eb4739b6a8dfc1c3f684e66d937", null ],
|
||||
[ "Graph", "dc/d61/classgraph_1_1_graph.html#a8839fa14bff19d2deab4a618447c13e5", null ],
|
||||
[ "add_edge", "dc/d61/classgraph_1_1_graph.html#a877b2cba40d8d46dde6fb4209effed19", null ],
|
||||
[ "breadth_first_search", "dc/d61/classgraph_1_1_graph.html#a6e3efabd5e401ef0f47c179866e7454e", null ],
|
||||
[ "breadth_first_search", "dc/d61/classgraph_1_1_graph.html#ab1a1a96cd4cddf0d4feb02855c4c16af", null ],
|
||||
[ "number_of_vertices", "dc/d61/classgraph_1_1_graph.html#a8930d1470d132b19e430d1c71f94c904", null ],
|
||||
[ "adjacency_list", "dc/d61/classgraph_1_1_graph.html#a3ab95bb3ba618a7e883ead8ee696c25c", null ],
|
||||
[ "adjacency_list", "dc/d61/classgraph_1_1_graph.html#acebf0505d625b043bb9c8c27c7a8def0", null ],
|
||||
[ "neighbors", "dc/d61/classgraph_1_1_graph.html#a59940c462861f2fcf4951d1b6c084e6a", null ]
|
||||
];
|
||||
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
@@ -98,38 +98,36 @@ $(document).ready(function(){initNavTree('dc/dc4/_2_users_2runner_2work_2_c-_plu
|
||||
<div class="fragment"><div class="line"><span class="comment">/**</span></div>
|
||||
<div class="line"><span class="comment"> * @{</span></div>
|
||||
<div class="line"><span class="comment"> * \file</span></div>
|
||||
<div class="line"><span class="comment"> * \brief [Runge Kutta fourth order](https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods) method implementation</span></div>
|
||||
<div class="line"><span class="comment"> * \brief [Runge Kutta fourth</span></div>
|
||||
<div class="line"><span class="comment"> * order](https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods) method</span></div>
|
||||
<div class="line"><span class="comment"> * implementation</span></div>
|
||||
<div class="line"><span class="comment"> *</span></div>
|
||||
<div class="line"><span class="comment"> * \author [Rudra Prasad Das](http://github.com/rudra697)</span></div>
|
||||
<div class="line"><span class="comment"> *</span></div>
|
||||
<div class="line"><span class="comment"> * \details</span></div>
|
||||
<div class="line"><span class="comment"> * It solves the unknown value of y </span></div>
|
||||
<div class="line"><span class="comment"> * It solves the unknown value of y</span></div>
|
||||
<div class="line"><span class="comment"> * for a given value of x</span></div>
|
||||
<div class="line"><span class="comment"> * only first order differential equations</span></div>
|
||||
<div class="line"><span class="comment"> * can be solved</span></div>
|
||||
<div class="line"><span class="comment"> * \example</span></div>
|
||||
<div class="line"><span class="comment"> * it solves \frac{\mathrm{d} y}{\mathrm{d} x}= \frac{\left ( x-y \right )}{2}</span></div>
|
||||
<div class="line"><span class="comment"> * given x for given initial </span></div>
|
||||
<div class="line"><span class="comment"> * given x for given initial</span></div>
|
||||
<div class="line"><span class="comment"> * conditions</span></div>
|
||||
<div class="line"><span class="comment"> * There can be many such equations </span></div>
|
||||
<div class="line"><span class="comment"> * There can be many such equations</span></div>
|
||||
<div class="line"><span class="comment"> */</span></div>
|
||||
<div class="line"><span class="preprocessor">#include <iostream></span> <span class="comment">/// for io operations</span></div>
|
||||
<div class="line"><span class="comment"></span><span class="preprocessor">#include <vector></span> <span class="comment">/// for using the vector container</span></div>
|
||||
<div class="line"><span class="comment"></span><span class="preprocessor">#include <cassert></span> <span class="comment">/// asserting the test functions</span></div>
|
||||
<div class="line"><span class="preprocessor">#include <cassert></span> <span class="comment">/// asserting the test functions</span></div>
|
||||
<div class="line"><span class="comment"></span><span class="preprocessor">#include <iostream></span> <span class="comment">/// for io operations</span></div>
|
||||
<div class="line"><span class="comment"></span><span class="preprocessor">#include <vector></span> <span class="comment">/// for using the vector container</span></div>
|
||||
<div class="line"><span class="comment"></span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="comment">/**</span></div>
|
||||
<div class="line"><span class="comment"> * @brief The change() function is used </span></div>
|
||||
<div class="line"><span class="comment"> * to return the updated iterative value corresponding </span></div>
|
||||
<div class="line"><span class="comment"> * @brief The change() function is used</span></div>
|
||||
<div class="line"><span class="comment"> * to return the updated iterative value corresponding</span></div>
|
||||
<div class="line"><span class="comment"> * to the given function</span></div>
|
||||
<div class="line"><span class="comment"> * @param x is the value corresponding to the x coordinate</span></div>
|
||||
<div class="line"><span class="comment"> * @param y is the value corresponding to the y coordinate </span></div>
|
||||
<div class="line"><span class="comment"> * @param y is the value corresponding to the y coordinate</span></div>
|
||||
<div class="line"><span class="comment"> * @returns the computed function value at that call</span></div>
|
||||
<div class="line"><span class="comment"> */</span></div>
|
||||
<div class="line"><span class="keyword">static</span> <span class="keywordtype">double</span> <a name="a0"></a><a class="code" href="../../d1/da6/rungekutta_8cpp.html#a450497475f5607333f9aca8f88901579">change</a>(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y) </div>
|
||||
<div class="line">{ </div>
|
||||
<div class="line"> <span class="keywordflow">return</span> ((x - y)/2.0); </div>
|
||||
<div class="line"> </div>
|
||||
<div class="line">} </div>
|
||||
<div class="line"><span class="keyword">static</span> <span class="keywordtype">double</span> <a name="a0"></a><a class="code" href="../../d1/da6/rungekutta_8cpp.html#a450497475f5607333f9aca8f88901579">change</a>(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y) { <span class="keywordflow">return</span> ((x - y) / 2.0); }</div>
|
||||
<div class="line"><span class="comment"></span> </div>
|
||||
<div class="line"><span class="comment">/**</span></div>
|
||||
<div class="line"><span class="comment"> * @namespace numerical_methods</span></div>
|
||||
@@ -138,98 +136,98 @@ $(document).ready(function(){initNavTree('dc/dc4/_2_users_2runner_2work_2_c-_plu
|
||||
<div class="line"><span class="keyword">namespace </span><a class="code" href="../../d1/de0/namespacenumerical__methods.html">numerical_methods</a> {<span class="comment"></span></div>
|
||||
<div class="line"><span class="comment">/**</span></div>
|
||||
<div class="line"><span class="comment"> * @namespace runge_kutta</span></div>
|
||||
<div class="line"><span class="comment"> * @brief Functions for [Runge Kutta fourth order](https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods) method</span></div>
|
||||
<div class="line"><span class="comment"> * @brief Functions for [Runge Kutta fourth</span></div>
|
||||
<div class="line"><span class="comment"> * order](https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods) method</span></div>
|
||||
<div class="line"><span class="comment"> */</span></div>
|
||||
<div class="line"><span class="keyword">namespace </span><a class="code" href="../../d2/de7/namespacerunge__kutta.html">runge_kutta</a> {<span class="comment"></span></div>
|
||||
<div class="line"><span class="comment">/**</span></div>
|
||||
<div class="line"><span class="comment"> * @brief the Runge Kutta method finds the value of integration of a function in the given limits.</span></div>
|
||||
<div class="line"><span class="comment"> * the lower limit of integration as the initial value and the upper limit is the given x</span></div>
|
||||
<div class="line"><span class="comment"> * @brief the Runge Kutta method finds the value of integration of a function in</span></div>
|
||||
<div class="line"><span class="comment"> * the given limits. the lower limit of integration as the initial value and the</span></div>
|
||||
<div class="line"><span class="comment"> * upper limit is the given x</span></div>
|
||||
<div class="line"><span class="comment"> * @param init_x is the value of initial x and is updated after each call</span></div>
|
||||
<div class="line"><span class="comment"> * @param init_y is the value of initial x and is updated after each call</span></div>
|
||||
<div class="line"><span class="comment"> * @param x is current iteration at which the function needs to be evaluated</span></div>
|
||||
<div class="line"><span class="comment"> * @param h is the step value </span></div>
|
||||
<div class="line"><span class="comment"> * @returns the value of y at thr required value of x from the initial conditions</span></div>
|
||||
<div class="line"><span class="comment"> * @param h is the step value</span></div>
|
||||
<div class="line"><span class="comment"> * @returns the value of y at thr required value of x from the initial</span></div>
|
||||
<div class="line"><span class="comment"> * conditions</span></div>
|
||||
<div class="line"><span class="comment"> */</span></div>
|
||||
<div class="line"><span class="keywordtype">double</span> <a name="a1"></a><a class="code" href="../../d1/da6/rungekutta_8cpp.html#a7b9f40c7b5e9749cc550f19be3dc8856">rungeKutta</a>(<span class="keywordtype">double</span> init_x, <span class="keyword">const</span> <span class="keywordtype">double</span> &init_y, <span class="keyword">const</span> <span class="keywordtype">double</span> &x, <span class="keyword">const</span> <span class="keywordtype">double</span> &<a name="a2"></a><a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>) </div>
|
||||
<div class="line">{ </div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> <span class="comment">// Count number of iterations </span></div>
|
||||
<div class="line"> <span class="comment">// using step size or </span></div>
|
||||
<div class="line"> <span class="comment">// step height h </span></div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> <span class="comment">// n calucates the number of iterations</span></div>
|
||||
<div class="line"> <span class="comment">// k1, k2, k3, k4 are the Runge Kutta variables </span></div>
|
||||
<div class="line"> <span class="comment">// used for calculation of y at each iteration</span></div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> <span class="keyword">auto</span> n = <span class="keyword">static_cast<</span>uint64_t<span class="keyword">></span>((x - init_x) / <a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>); </div>
|
||||
<div class="line"> <span class="comment">// used a vector container for the variables</span></div>
|
||||
<div class="line"> <a name="_a3"></a><a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<double></a> k(4,0.0);</div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> <span class="comment">// Iterate for number of iterations </span></div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> <span class="keywordtype">double</span> y = init_y; </div>
|
||||
<div class="line"> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=1; i<=n; ++i) </div>
|
||||
<div class="line"> { </div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> <span class="comment">// Apply Runge Kutta Formulas </span></div>
|
||||
<div class="line"> <span class="comment">// to find next value of y </span></div>
|
||||
<div class="line"> k[0] = <a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>*<a class="code" href="../../d1/da6/rungekutta_8cpp.html#a450497475f5607333f9aca8f88901579">change</a>(init_x, y); </div>
|
||||
<div class="line"> k[1] = <a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>*<a class="code" href="../../d1/da6/rungekutta_8cpp.html#a450497475f5607333f9aca8f88901579">change</a>(init_x + 0.5*<a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, y + 0.5*k[0]); </div>
|
||||
<div class="line"> k[2] = <a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>*<a class="code" href="../../d1/da6/rungekutta_8cpp.html#a450497475f5607333f9aca8f88901579">change</a>(init_x + 0.5*<a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, y + 0.5*k[1]); </div>
|
||||
<div class="line"> k[3] = <a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>*<a class="code" href="../../d1/da6/rungekutta_8cpp.html#a450497475f5607333f9aca8f88901579">change</a>(init_x + <a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, y + k[2]); </div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> <span class="comment">// Update next value of y </span></div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> y += (1.0/6.0)*(k[0] + 2*k[1] + 2*k[2] + k[3]);</div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> <span class="comment">// Update next value of x </span></div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> init_x += <a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>; </div>
|
||||
<div class="line"> } </div>
|
||||
<div class="line"><span class="keywordtype">double</span> <a name="a1"></a><a class="code" href="../../d1/da6/rungekutta_8cpp.html#a7b9f40c7b5e9749cc550f19be3dc8856">rungeKutta</a>(<span class="keywordtype">double</span> init_x, <span class="keyword">const</span> <span class="keywordtype">double</span> &init_y, <span class="keyword">const</span> <span class="keywordtype">double</span> &x,</div>
|
||||
<div class="line"> <span class="keyword">const</span> <span class="keywordtype">double</span> &<a name="a2"></a><a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>) {</div>
|
||||
<div class="line"> <span class="comment">// Count number of iterations</span></div>
|
||||
<div class="line"> <span class="comment">// using step size or</span></div>
|
||||
<div class="line"> <span class="comment">// step height h</span></div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> <span class="keywordflow">return</span> y; </div>
|
||||
<div class="line">} </div>
|
||||
<div class="line">} <span class="comment">// namespace runge_kutta</span></div>
|
||||
<div class="line">} <span class="comment">// namespace numerical_methods</span></div>
|
||||
<div class="line"> <span class="comment">// n calucates the number of iterations</span></div>
|
||||
<div class="line"> <span class="comment">// k1, k2, k3, k4 are the Runge Kutta variables</span></div>
|
||||
<div class="line"> <span class="comment">// used for calculation of y at each iteration</span></div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> <span class="keyword">auto</span> n = <span class="keyword">static_cast<</span>uint64_t<span class="keyword">></span>((x - init_x) / <a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>);</div>
|
||||
<div class="line"> <span class="comment">// used a vector container for the variables</span></div>
|
||||
<div class="line"> <a name="_a3"></a><a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<double></a> k(4, 0.0);</div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> <span class="comment">// Iterate for number of iterations</span></div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> <span class="keywordtype">double</span> y = init_y;</div>
|
||||
<div class="line"> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i <= n; ++i) {</div>
|
||||
<div class="line"> <span class="comment">// Apply Runge Kutta Formulas</span></div>
|
||||
<div class="line"> <span class="comment">// to find next value of y</span></div>
|
||||
<div class="line"> k[0] = <a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a> * <a class="code" href="../../d1/da6/rungekutta_8cpp.html#a450497475f5607333f9aca8f88901579">change</a>(init_x, y);</div>
|
||||
<div class="line"> k[1] = <a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a> * <a class="code" href="../../d1/da6/rungekutta_8cpp.html#a450497475f5607333f9aca8f88901579">change</a>(init_x + 0.5 * <a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, y + 0.5 * k[0]);</div>
|
||||
<div class="line"> k[2] = <a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a> * <a class="code" href="../../d1/da6/rungekutta_8cpp.html#a450497475f5607333f9aca8f88901579">change</a>(init_x + 0.5 * <a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, y + 0.5 * k[1]);</div>
|
||||
<div class="line"> k[3] = <a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a> * <a class="code" href="../../d1/da6/rungekutta_8cpp.html#a450497475f5607333f9aca8f88901579">change</a>(init_x + <a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, y + k[2]);</div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> <span class="comment">// Update next value of y</span></div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> y += (1.0 / 6.0) * (k[0] + 2 * k[1] + 2 * k[2] + k[3]);</div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> <span class="comment">// Update next value of x</span></div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> init_x += <a class="code" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>;</div>
|
||||
<div class="line"> }</div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> <span class="keywordflow">return</span> y;</div>
|
||||
<div class="line">}</div>
|
||||
<div class="line">} <span class="comment">// namespace runge_kutta</span></div>
|
||||
<div class="line">} <span class="comment">// namespace numerical_methods</span></div>
|
||||
<div class="line"><span class="comment"></span> </div>
|
||||
<div class="line"><span class="comment">/**</span></div>
|
||||
<div class="line"><span class="comment"> * @brief Tests to check algorithm implementation.</span></div>
|
||||
<div class="line"><span class="comment"> * @returns void </span></div>
|
||||
<div class="line"><span class="comment"> * @returns void</span></div>
|
||||
<div class="line"><span class="comment"> */</span></div>
|
||||
<div class="line"> <span class="keyword">static</span> <span class="keywordtype">void</span> <a name="a4"></a><a class="code" href="../../dc/d5a/rat__maze_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>()</div>
|
||||
<div class="line"> {</div>
|
||||
<div class="line"> <a name="_a5"></a><a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The Runge Kutta function will be tested on the basis of precomputed values\n"</span>;</div>
|
||||
<div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> <a name="a4"></a><a class="code" href="../../dc/d5a/rat__maze_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"> <a name="_a5"></a><a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The Runge Kutta function will be tested on the basis of "</span></div>
|
||||
<div class="line"> <span class="stringliteral">"precomputed values\n"</span>;</div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 1...."</span> << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"> <span class="keywordtype">double</span> valfirst=<a class="code" href="../../d1/da6/rungekutta_8cpp.html#a7b9f40c7b5e9749cc550f19be3dc8856">numerical_methods::runge_kutta::rungeKutta</a>(2,3,4,0.2); <span class="comment">// Tests the function with pre calculated values</span></div>
|
||||
<div class="line"> assert(valfirst==3.10363932323749570);</div>
|
||||
<div class="line"> <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Passed Test 1\n"</span>;</div>
|
||||
<div class="line"> <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 1...."</span></div>
|
||||
<div class="line"> << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"> <span class="keywordtype">double</span> valfirst = <a class="code" href="../../d1/da6/rungekutta_8cpp.html#a7b9f40c7b5e9749cc550f19be3dc8856">numerical_methods::runge_kutta::rungeKutta</a>(</div>
|
||||
<div class="line"> 2, 3, 4, 0.2); <span class="comment">// Tests the function with pre calculated values</span></div>
|
||||
<div class="line"> assert(valfirst == 3.10363932323749570);</div>
|
||||
<div class="line"> <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Passed Test 1\n"</span>;</div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 2...."</span> << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"> <span class="keywordtype">double</span> valsec=<a class="code" href="../../d1/da6/rungekutta_8cpp.html#a7b9f40c7b5e9749cc550f19be3dc8856">numerical_methods::runge_kutta::rungeKutta</a>(1,2,5,0.1); <span class="comment">// The value of step changed</span></div>
|
||||
<div class="line"> assert(valsec==3.40600589380261409);</div>
|
||||
<div class="line"> <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Passed Test 2\n"</span>;</div>
|
||||
<div class="line"> <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 2...."</span></div>
|
||||
<div class="line"> << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"> <span class="keywordtype">double</span> valsec = <a class="code" href="../../d1/da6/rungekutta_8cpp.html#a7b9f40c7b5e9749cc550f19be3dc8856">numerical_methods::runge_kutta::rungeKutta</a>(</div>
|
||||
<div class="line"> 1, 2, 5, 0.1); <span class="comment">// The value of step changed</span></div>
|
||||
<div class="line"> assert(valsec == 3.40600589380261409);</div>
|
||||
<div class="line"> <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Passed Test 2\n"</span>;</div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 3...."</span> << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"> <span class="keywordtype">double</span> valthird=<a class="code" href="../../d1/da6/rungekutta_8cpp.html#a7b9f40c7b5e9749cc550f19be3dc8856">numerical_methods::runge_kutta::rungeKutta</a>(-1,3,4,0.1); <span class="comment">// Tested with negative value</span></div>
|
||||
<div class="line"> assert(valthird==2.49251005860244268);</div>
|
||||
<div class="line"> <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Passed Test 3\n"</span>;</div>
|
||||
<div class="line"> }</div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"> <span class="comment"></span></div>
|
||||
<div class="line"> <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Test 3...."</span></div>
|
||||
<div class="line"> << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"> <span class="keywordtype">double</span> valthird = <a class="code" href="../../d1/da6/rungekutta_8cpp.html#a7b9f40c7b5e9749cc550f19be3dc8856">numerical_methods::runge_kutta::rungeKutta</a>(</div>
|
||||
<div class="line"> -1, 3, 4, 0.1); <span class="comment">// Tested with negative value</span></div>
|
||||
<div class="line"> assert(valthird == 2.49251005860244268);</div>
|
||||
<div class="line"> <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Passed Test 3\n"</span>;</div>
|
||||
<div class="line">}</div>
|
||||
<div class="line"><span class="comment"></span> </div>
|
||||
<div class="line"><span class="comment">/**</span></div>
|
||||
<div class="line"><span class="comment"> * @brief Main function</span></div>
|
||||
<div class="line"><span class="comment"> * @returns 0 on exit </span></div>
|
||||
<div class="line"><span class="comment"> * @returns 0 on exit</span></div>
|
||||
<div class="line"><span class="comment"> */</span></div>
|
||||
<div class="line"><span class="keywordtype">int</span> <a name="a6"></a><a class="code" href="../../d3/d40/graph__coloring_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() </div>
|
||||
<div class="line">{ </div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"><span class="keywordtype">int</span> <a name="a6"></a><a class="code" href="../../d3/d40/graph__coloring_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"> <a class="code" href="../../dc/d5a/rat__maze_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// Execute the tests</span></div>
|
||||
<div class="line"> <span class="keywordflow">return</span> 0; </div>
|
||||
<div class="line">} </div>
|
||||
<div class="line"> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line">}</div>
|
||||
</div><!-- fragment --> </div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<div class="ttc" id="arat__maze_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../dc/d5a/rat__maze_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Test implementations.</div><div class="ttdef"><b>Definition:</b> rat_maze.cpp:84</div></div>
|
||||
@@ -239,8 +237,8 @@ $(document).ready(function(){initNavTree('dc/dc4/_2_users_2runner_2work_2_c-_plu
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="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> hash_search.cpp:45</div></div>
|
||||
<div class="ttc" id="anamespacerunge__kutta_html"><div class="ttname"><a href="../../d2/de7/namespacerunge__kutta.html">runge_kutta</a></div><div class="ttdoc">Functions for Runge Kutta fourth order method.</div></div>
|
||||
<div class="ttc" id="arungekutta_8cpp_html_a450497475f5607333f9aca8f88901579"><div class="ttname"><a href="../../d1/da6/rungekutta_8cpp.html#a450497475f5607333f9aca8f88901579">change</a></div><div class="ttdeci">static double change(double x, double y)</div><div class="ttdoc">asserting the test functions</div><div class="ttdef"><b>Definition:</b> rungekutta.cpp:31</div></div>
|
||||
<div class="ttc" id="arungekutta_8cpp_html_a7b9f40c7b5e9749cc550f19be3dc8856"><div class="ttname"><a href="../../d1/da6/rungekutta_8cpp.html#a7b9f40c7b5e9749cc550f19be3dc8856">numerical_methods::runge_kutta::rungeKutta</a></div><div class="ttdeci">double rungeKutta(double init_x, const double &init_y, const double &x, const double &h)</div><div class="ttdoc">the Runge Kutta method finds the value of integration of a function in the given limits....</div><div class="ttdef"><b>Definition:</b> rungekutta.cpp:56</div></div>
|
||||
<div class="ttc" id="arungekutta_8cpp_html_a450497475f5607333f9aca8f88901579"><div class="ttname"><a href="../../d1/da6/rungekutta_8cpp.html#a450497475f5607333f9aca8f88901579">change</a></div><div class="ttdeci">static double change(double x, double y)</div><div class="ttdoc">for using the vector container</div><div class="ttdef"><b>Definition:</b> rungekutta.cpp:33</div></div>
|
||||
<div class="ttc" id="arungekutta_8cpp_html_a7b9f40c7b5e9749cc550f19be3dc8856"><div class="ttname"><a href="../../d1/da6/rungekutta_8cpp.html#a7b9f40c7b5e9749cc550f19be3dc8856">numerical_methods::runge_kutta::rungeKutta</a></div><div class="ttdeci">double rungeKutta(double init_x, const double &init_y, const double &x, const double &h)</div><div class="ttdoc">the Runge Kutta method finds the value of integration of a function in the given limits....</div><div class="ttdef"><b>Definition:</b> rungekutta.cpp:57</div></div>
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<map id="numerical_methods/rungekutta.cpp" name="numerical_methods/rungekutta.cpp">
|
||||
<area shape="rect" id="node1" title="Runge Kutta fourth order method implementation" alt="" coords="18,5,243,32"/>
|
||||
<area shape="rect" id="node2" title=" " alt="" coords="5,80,77,107"/>
|
||||
<area shape="rect" id="node3" title=" " alt="" coords="101,80,160,107"/>
|
||||
<area shape="rect" id="node4" title=" " alt="" coords="185,80,250,107"/>
|
||||
<area shape="rect" id="node1" title="Runge Kutta fourth order method implementation" alt="" coords="19,5,244,32"/>
|
||||
<area shape="rect" id="node2" title=" " alt="" coords="5,80,71,107"/>
|
||||
<area shape="rect" id="node3" title=" " alt="" coords="95,80,167,107"/>
|
||||
<area shape="rect" id="node4" title=" " alt="" coords="191,80,250,107"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
71964ee4e0ecca036604e5639b0cff75
|
||||
2f5eeb5441327c16bafde8672cd37515
|
||||
@@ -13,8 +13,8 @@
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Runge Kutta fourth order method implementation">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="9.5,-56.5 9.5,-75.5 178.5,-75.5 178.5,-56.5 9.5,-56.5"/>
|
||||
<text text-anchor="middle" x="94" y="-63.5" font-family="Helvetica,sans-Serif" font-size="10.00">numerical_methods/rungekutta.cpp</text>
|
||||
<polygon fill="#bfbfbf" stroke="black" points="10,-56.5 10,-75.5 179,-75.5 179,-56.5 10,-56.5"/>
|
||||
<text text-anchor="middle" x="94.5" y="-63.5" font-family="Helvetica,sans-Serif" font-size="10.00">numerical_methods/rungekutta.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -22,46 +22,46 @@
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="0,-0.5 0,-19.5 54,-19.5 54,-0.5 0,-0.5"/>
|
||||
<text text-anchor="middle" x="27" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="white" stroke="#bfbfbf" points="0,-0.5 0,-19.5 49,-19.5 49,-0.5 0,-0.5"/>
|
||||
<text text-anchor="middle" x="24.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M83.24,-56.32C73.23,-48.26 58.11,-36.08 46.07,-26.37"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="47.94,-23.38 37.96,-19.83 43.55,-28.83 47.94,-23.38"/>
|
||||
<path fill="none" stroke="midnightblue" d="M83.25,-56.32C72.7,-48.18 56.7,-35.84 44.06,-26.09"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="46.01,-23.17 35.95,-19.83 41.73,-28.71 46.01,-23.17"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="72,-0.5 72,-19.5 116,-19.5 116,-0.5 72,-0.5"/>
|
||||
<text text-anchor="middle" x="94" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
<polygon fill="white" stroke="#bfbfbf" points="67.5,-0.5 67.5,-19.5 121.5,-19.5 121.5,-0.5 67.5,-0.5"/>
|
||||
<text text-anchor="middle" x="94.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M94,-56.08C94,-49.01 94,-38.86 94,-29.99"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="97.5,-29.75 94,-19.75 90.5,-29.75 97.5,-29.75"/>
|
||||
<path fill="none" stroke="midnightblue" d="M94.5,-56.08C94.5,-49.01 94.5,-38.86 94.5,-29.99"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="98,-29.75 94.5,-19.75 91,-29.75 98,-29.75"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="134.5,-0.5 134.5,-19.5 183.5,-19.5 183.5,-0.5 134.5,-0.5"/>
|
||||
<text text-anchor="middle" x="159" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
|
||||
<polygon fill="white" stroke="#bfbfbf" points="139.5,-0.5 139.5,-19.5 183.5,-19.5 183.5,-0.5 139.5,-0.5"/>
|
||||
<text text-anchor="middle" x="161.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M104.44,-56.32C114.15,-48.26 128.82,-36.08 140.5,-26.37"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="142.91,-28.92 148.37,-19.83 138.44,-23.53 142.91,-28.92"/>
|
||||
<path fill="none" stroke="midnightblue" d="M105.26,-56.32C115.27,-48.26 130.39,-36.08 142.43,-26.37"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="144.95,-28.83 150.54,-19.83 140.56,-23.38 144.95,-28.83"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
@@ -288,7 +288,7 @@ Here is the call graph for this function:</div>
|
||||
<div class="ttc" id="abegin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/list/begin.html">std::list::begin</a></div><div class="ttdeci">T begin(T... args)</div></div>
|
||||
<div class="ttc" id="aempty_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/list/empty.html">std::list::empty</a></div><div class="ttdeci">T empty(T... args)</div></div>
|
||||
<div class="ttc" id="aend_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/list/end.html">std::list::end</a></div><div class="ttdeci">T end(T... args)</div></div>
|
||||
<div class="ttc" id="afibonacci__sum_8cpp_html_aadb40ac4c74a7efc0680b83eeee138aa"><div class="ttname"><a href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">math::fibonacci_sum::result</a></div><div class="ttdeci">uint64_t result(uint64_t n)</div><div class="ttdef"><b>Definition:</b> fibonacci_sum.cpp:75</div></div>
|
||||
<div class="ttc" id="afibonacci__sum_8cpp_html_aadb40ac4c74a7efc0680b83eeee138aa"><div class="ttname"><a href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">math::fibonacci_sum::result</a></div><div class="ttdeci">uint64_t result(uint64_t n)</div><div class="ttdef"><b>Definition:</b> fibonacci_sum.cpp:76</div></div>
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
|
||||
Reference in New Issue
Block a user