mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-25 22:32:24 +08:00
Documentation for e64e3df18f
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<map id="numerical_methods/babylonian_method.cpp" name="numerical_methods/babylonian_method.cpp">
|
||||
<area shape="rect" id="node1" title="A babylonian method (BM) is an algorithm that computes the square root." alt="" coords="28,5,235,47"/>
|
||||
<area shape="rect" id="node1" title="A babylonian method (BM) is an algorithm that computes the square root." alt="" coords="21,5,228,47"/>
|
||||
<area shape="rect" id="node2" title=" " alt="" coords="5,95,71,121"/>
|
||||
<area shape="rect" id="node3" title=" " alt="" coords="95,95,168,121"/>
|
||||
<area shape="rect" id="node4" title=" " alt="" coords="192,95,255,121"/>
|
||||
<area shape="rect" id="node3" title=" " alt="" coords="95,95,154,121"/>
|
||||
<area shape="rect" id="node4" title=" " alt="" coords="179,95,252,121"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
006111d22b19eae1139acf05ad55a8b4
|
||||
f05fe7c29b7d5338e15065a7a3a89e38
|
||||
@@ -4,18 +4,18 @@
|
||||
<!-- Generated by graphviz version 2.49.3 (20211023.0002)
|
||||
-->
|
||||
<!-- Title: numerical_methods/babylonian_method.cpp Pages: 1 -->
|
||||
<svg width="195pt" height="95pt"
|
||||
viewBox="0.00 0.00 195.00 95.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="193pt" height="95pt"
|
||||
viewBox="0.00 0.00 193.00 95.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 91)">
|
||||
<title>numerical_methods/babylonian_method.cpp</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-91 191,-91 191,4 -4,4"/>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-91 189,-91 189,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="A babylonian method (BM) is an algorithm that computes the square root.">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="17,-56.5 17,-86.5 172,-86.5 172,-56.5 17,-56.5"/>
|
||||
<text text-anchor="start" x="25" y="-74.5" font-family="Helvetica,sans-Serif" font-size="10.00">numerical_methods/babylonian</text>
|
||||
<text text-anchor="middle" x="94.5" y="-63.5" font-family="Helvetica,sans-Serif" font-size="10.00">_method.cpp</text>
|
||||
<polygon fill="#bfbfbf" stroke="black" points="12,-56.5 12,-86.5 167,-86.5 167,-56.5 12,-56.5"/>
|
||||
<text text-anchor="start" x="20" y="-74.5" font-family="Helvetica,sans-Serif" font-size="10.00">numerical_methods/babylonian</text>
|
||||
<text text-anchor="middle" x="89.5" y="-63.5" font-family="Helvetica,sans-Serif" font-size="10.00">_method.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -31,38 +31,38 @@
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M77.91,-56.4C67.21,-47.31 53.31,-35.49 42.37,-26.19"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="44.57,-23.47 34.69,-19.66 40.04,-28.8 44.57,-23.47"/>
|
||||
<path fill="none" stroke="midnightblue" d="M74.1,-56.4C64.26,-47.4 51.51,-35.72 41.39,-26.47"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="43.7,-23.83 33.96,-19.66 38.97,-28.99 43.7,-23.83"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="67,-0.5 67,-19.5 122,-19.5 122,-0.5 67,-0.5"/>
|
||||
<text text-anchor="middle" x="94.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="white" stroke="#bfbfbf" points="67.5,-0.5 67.5,-19.5 111.5,-19.5 111.5,-0.5 67.5,-0.5"/>
|
||||
<text text-anchor="middle" x="89.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">cmath</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M94.5,-56.4C94.5,-48.47 94.5,-38.46 94.5,-29.86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="98,-29.66 94.5,-19.66 91,-29.66 98,-29.66"/>
|
||||
<path fill="none" stroke="midnightblue" d="M89.5,-56.4C89.5,-48.47 89.5,-38.46 89.5,-29.86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="93,-29.66 89.5,-19.66 86,-29.66 93,-29.66"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="140,-0.5 140,-19.5 187,-19.5 187,-0.5 140,-0.5"/>
|
||||
<text text-anchor="middle" x="163.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">math.h</text>
|
||||
<polygon fill="white" stroke="#bfbfbf" points="130,-0.5 130,-19.5 185,-19.5 185,-0.5 130,-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="M110.85,-56.4C121.4,-47.31 135.1,-35.49 145.88,-26.19"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="148.17,-28.84 153.46,-19.66 143.6,-23.54 148.17,-28.84"/>
|
||||
<path fill="none" stroke="midnightblue" d="M105.62,-56.4C115.9,-47.4 129.25,-35.72 139.83,-26.47"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="142.38,-28.88 147.61,-19.66 137.77,-23.61 142.38,-28.88"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
@@ -116,7 +116,7 @@ Include dependency graph for composite_simpson_rule.cpp:</div>
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
|
||||
Namespaces</h2></td></tr>
|
||||
<tr class="memitem:d1/de0/namespacenumerical__methods"><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/de0/namespacenumerical__methods.html">numerical_methods</a></td></tr>
|
||||
<tr class="memdesc:d1/de0/namespacenumerical__methods"><td class="mdescLeft"> </td><td class="mdescRight">for IO operations <br /></td></tr>
|
||||
<tr class="memdesc:d1/de0/namespacenumerical__methods"><td class="mdescLeft"> </td><td class="mdescRight">for assert <br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:d3/d6d/namespacesimpson__method"><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d6d/namespacesimpson__method.html">simpson_method</a></td></tr>
|
||||
<tr class="memdesc:d3/d6d/namespacesimpson__method"><td class="mdescLeft"> </td><td class="mdescRight">Contains the Simpson's method implementation. <br /></td></tr>
|
||||
@@ -124,8 +124,8 @@ 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:a8b5934403b0a07e1e4599ee8c869f8ef"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d18/composite__simpson__rule_8cpp.html#a8b5934403b0a07e1e4599ee8c869f8ef">numerical_methods::simpson_method::evaluate_by_simpson</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> N, double <a class="el" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, double a, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/functional/function.html">std::function</a>< double(double)> func)</td></tr>
|
||||
<tr class="separator:a8b5934403b0a07e1e4599ee8c869f8ef"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a6ccc5eddc537dc0293d0ae3d0480f068"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6ccc5eddc537dc0293d0ae3d0480f068">numerical_methods::simpson_method::evaluate_by_simpson</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> N, double <a class="el" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, double a, const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/functional/function.html">std::function</a>< double(double)> &func)</td></tr>
|
||||
<tr class="separator:a6ccc5eddc537dc0293d0ae3d0480f068"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a4251b4df4748a0b9c43a48f61bdd2397"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d18/composite__simpson__rule_8cpp.html#a4251b4df4748a0b9c43a48f61bdd2397">numerical_methods::simpson_method::f</a> (double x)</td></tr>
|
||||
<tr class="memdesc:a4251b4df4748a0b9c43a48f61bdd2397"><td class="mdescLeft"> </td><td class="mdescRight">A function f(x) that will be used to test the method. <a href="../../d4/d18/composite__simpson__rule_8cpp.html#a4251b4df4748a0b9c43a48f61bdd2397">More...</a><br /></td></tr>
|
||||
<tr class="separator:a4251b4df4748a0b9c43a48f61bdd2397"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -158,8 +158,8 @@ Functions</h2></td></tr>
|
||||
<p >Add sample function by replacing one of the f, g, k, l and the assert</p>
|
||||
<dl class="section author"><dt>Author</dt><dd><a href="https://github.com/ggkogkou" target="_blank">ggkogkou</a> </dd></dl>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="a8b5934403b0a07e1e4599ee8c869f8ef" name="a8b5934403b0a07e1e4599ee8c869f8ef"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a8b5934403b0a07e1e4599ee8c869f8ef">◆ </a></span>evaluate_by_simpson()</h2>
|
||||
<a id="a6ccc5eddc537dc0293d0ae3d0480f068" name="a6ccc5eddc537dc0293d0ae3d0480f068"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a6ccc5eddc537dc0293d0ae3d0480f068">◆ </a></span>evaluate_by_simpson()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
@@ -185,7 +185,7 @@ Functions</h2></td></tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/functional/function.html">std::function</a>< double(double)> </td>
|
||||
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/functional/function.html">std::function</a>< double(double)> & </td>
|
||||
<td class="paramname"><em>func</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -195,43 +195,44 @@ Functions</h2></td></tr>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<div class="fragment"><div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> {</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map.html">std::map<std::int32_t, double></a></div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> data_table; <span class="comment">// Contains the data points. key: i, value: f(xi)</span></div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keywordtype">double</span> xi = a; <span class="comment">// Initialize xi to the starting point x0 = a</span></div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> </div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="comment">// Create the data table</span></div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordtype">double</span> temp;</div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keywordflow">for</span> (<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> i = 0; i <= <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> temp = func(xi);</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> data_table.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map/insert.html">insert</a>(</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<std::int32_t, double></a>(i, temp)); <span class="comment">// add i and f(xi)</span></div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> xi += <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>; <span class="comment">// Get the next point xi for the next iteration</span></div>
|
||||
<div class="line"><a id="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 class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="comment">// Evaluate the integral.</span></div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="comment">// Remember: f(x0) + 4*f(x1) + 2*f(x2) + ... + 2*f(xN-2) + 4*f(xN-1) + f(xN)</span></div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keywordtype">double</span> evaluate_integral = 0;</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keywordflow">for</span> (<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> i = 0; i <= <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordflow">if</span> (i == 0 || i == N)</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> evaluate_integral += data_table.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map/at.html">at</a>(i);</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (i % 2 == 1)</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> evaluate_integral += 4 * data_table.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map/at.html">at</a>(i);</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> evaluate_integral += 2 * data_table.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map/at.html">at</a>(i);</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> }</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> </div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="comment">// Multiply by the coefficient h/3</span></div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> evaluate_integral *= <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a> / 3;</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> <span class="comment">// If the result calculated is nan, then the user has given wrong input</span></div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="comment">// interval.</span></div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> assert(!<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/isnan.html">std::isnan</a>(evaluate_integral) &&</div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="stringliteral">"The definite integral can't be evaluated. Check the validity of "</span></div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="stringliteral">"your input.\n"</span>);</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="comment">// Else return</span></div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordflow">return</span> evaluate_integral;</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span>}</div>
|
||||
<div class="fragment"><div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> {</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map.html">std::map<std::int32_t, double></a></div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> data_table; <span class="comment">// Contains the data points. key: i, value: f(xi)</span></div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keywordtype">double</span> xi = a; <span class="comment">// Initialize xi to the starting point x0 = a</span></div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="comment">// Create the data table</span></div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keywordtype">double</span> temp = NAN;</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keywordflow">for</span> (<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> i = 0; i <= <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> temp = func(xi);</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> data_table.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map/insert.html">insert</a>(</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<std::int32_t, double></a>(i, temp)); <span class="comment">// add i and f(xi)</span></div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> xi += <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>; <span class="comment">// Get the next point xi for the next iteration</span></div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> }</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> </div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="comment">// Evaluate the integral.</span></div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="comment">// Remember: f(x0) + 4*f(x1) + 2*f(x2) + ... + 2*f(xN-2) + 4*f(xN-1) + f(xN)</span></div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keywordtype">double</span> evaluate_integral = 0;</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordflow">for</span> (<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> i = 0; i <= <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordflow">if</span> (i == 0 || i == N) {</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> evaluate_integral += data_table.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map/at.html">at</a>(i);</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (i % 2 == 1) {</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> evaluate_integral += 4 * data_table.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map/at.html">at</a>(i);</div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> evaluate_integral += 2 * data_table.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map/at.html">at</a>(i);</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</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> </div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="comment">// Multiply by the coefficient h/3</span></div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> evaluate_integral *= <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a> / 3;</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">// If the result calculated is nan, then the user has given wrong input</span></div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="comment">// interval.</span></div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> assert(!<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/isnan.html">std::isnan</a>(evaluate_integral) &&</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="stringliteral">"The definite integral can't be evaluated. Check the validity of "</span></div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="stringliteral">"your input.\n"</span>);</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="comment">// Else return</span></div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keywordflow">return</span> evaluate_integral;</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span>}</div>
|
||||
<div class="ttc" id="aat_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/map/at.html">std::map::at</a></div><div class="ttdeci">T at(T... args)</div></div>
|
||||
<div class="ttc" id="adata__structures_2sparse__table_8cpp_html_a10f3ffb3f6f7e1b83d556b9c8de89a5d"><div class="ttname"><a href="../../d6/d42/data__structures_2sparse__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> sparse_table.cpp:47</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>
|
||||
@@ -267,7 +268,7 @@ Functions</h2></td></tr>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>the value of the dependent variable yi = f(xi) </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span>{ <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>(x) + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">std::log</a>(x); }</div>
|
||||
<div class="fragment"><div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span>{ <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>(x) + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">std::log</a>(x); }</div>
|
||||
<div class="ttc" id="alog_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/log.html">std::log</a></div><div class="ttdeci">T log(T... args)</div></div>
|
||||
<div class="ttc" id="asqrt_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a></div><div class="ttdeci">T sqrt(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
@@ -296,7 +297,7 @@ Here is the call graph for this function:</div>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Another test function. </p>
|
||||
<div class="fragment"><div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span>{ <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/exp.html">std::exp</a>(-x) * (4 - <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>(x, 2)); }</div>
|
||||
<div class="fragment"><div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span>{ <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/exp.html">std::exp</a>(-x) * (4 - <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>(x, 2)); }</div>
|
||||
<div class="ttc" id="aexp_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/exp.html">std::exp</a></div><div class="ttdeci">T exp(T... args)</div></div>
|
||||
<div class="ttc" id="apow_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a></div><div class="ttdeci">T pow(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
@@ -327,7 +328,7 @@ Here is the call graph for this function:</div>
|
||||
<p>Another test function. </p>
|
||||
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="../../dc/dc4/_2_users_2runner_2work_2_c-_plus-_plus_2_c-_plus-_plus_2numerical_methods_2rungekutta_8cpp-example.html#a4">/Users/runner/work/C-Plus-Plus/C-Plus-Plus/numerical_methods/rungekutta.cpp</a>.</dd>
|
||||
</dl>
|
||||
<div class="fragment"><div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span>{ <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>(2 * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>(x, 3) + 3); }</div>
|
||||
<div class="fragment"><div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span>{ <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>(2 * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>(x, 3) + 3); }</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -354,7 +355,7 @@ Here is the call graph for this function:</div>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Another test function. </p>
|
||||
<div class="fragment"><div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span>{ <span class="keywordflow">return</span> x + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">std::log</a>(2 * x + 1); }</div>
|
||||
<div class="fragment"><div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span>{ <span class="keywordflow">return</span> x + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">std::log</a>(2 * x + 1); }</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -402,45 +403,47 @@ Here is the call graph for this function:</div>
|
||||
<p >Number of intervals to divide the integration interval. MUST BE EVEN</p>
|
||||
<p >Starting and ending point of the integration in the real axis</p>
|
||||
<p >Step, calculated by a, b and N</p>
|
||||
<div class="fragment"><div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> {</div>
|
||||
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 16; <span class="comment">/// Number of intervals to divide the integration</span><span class="comment"></span></div>
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span><span class="comment"> /// interval. MUST BE EVEN</span></div>
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span><span class="comment"></span> <span class="keywordtype">double</span> a = 1, b = 3; <span class="comment">/// Starting and ending point of the integration in</span><span class="comment"></span></div>
|
||||
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span><span class="comment"> /// the real axis</span></div>
|
||||
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span><span class="comment"></span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>; <span class="comment">/// Step, calculated by a, b and N</span></div>
|
||||
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> </div>
|
||||
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> <span class="keywordtype">bool</span> used_argv_parameters =</div>
|
||||
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> <span class="keyword">false</span>; <span class="comment">// If argv parameters are used then the assert must be omitted</span></div>
|
||||
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <span class="comment">// for the tst cases</span></div>
|
||||
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> </div>
|
||||
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> <span class="comment">// Get user input (by the command line parameters or the console after</span></div>
|
||||
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> <span class="comment">// displaying messages)</span></div>
|
||||
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> <span class="keywordflow">if</span> (argc == 4) {</div>
|
||||
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/atoi.html">std::atoi</a>(argv[1]);</div>
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> a = (double)<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/atof.html">std::atof</a>(argv[2]);</div>
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> b = (double)<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/atof.html">std::atof</a>(argv[3]);</div>
|
||||
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> <span class="comment">// Check if a<b else abort</span></div>
|
||||
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> assert(a < b && <span class="stringliteral">"a has to be less than b"</span>);</div>
|
||||
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> assert(N > 0 && <span class="stringliteral">"N has to be > 0"</span>);</div>
|
||||
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> <span class="keywordflow">if</span> (N < 16 || a != 1 || b != 3)</div>
|
||||
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> used_argv_parameters = <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"You selected N="</span> << <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> << <span class="stringliteral">", a="</span> << a << <span class="stringliteral">", b="</span> << b</div>
|
||||
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> } <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Default N="</span> << <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> << <span class="stringliteral">", a="</span> << a << <span class="stringliteral">", b="</span> << b</div>
|
||||
<div class="fragment"><div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> {</div>
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a> <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 16; <span class="comment">/// Number of intervals to divide the integration</span><span class="comment"></span></div>
|
||||
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span><span class="comment"> /// interval. MUST BE EVEN</span></div>
|
||||
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span><span class="comment"></span> <span class="keywordtype">double</span> a = 1, b = 3; <span class="comment">/// Starting and ending point of the integration in</span><span class="comment"></span></div>
|
||||
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span><span class="comment"> /// the real axis</span></div>
|
||||
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span><span class="comment"></span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a> = NAN; <span class="comment">/// Step, calculated by a, b and N</span></div>
|
||||
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> </div>
|
||||
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <span class="keywordtype">bool</span> used_argv_parameters =</div>
|
||||
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> <span class="keyword">false</span>; <span class="comment">// If argv parameters are used then the assert must be omitted</span></div>
|
||||
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> <span class="comment">// for the tst cases</span></div>
|
||||
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> </div>
|
||||
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> <span class="comment">// Get user input (by the command line parameters or the console after</span></div>
|
||||
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> <span class="comment">// displaying messages)</span></div>
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> <span class="keywordflow">if</span> (argc == 4) {</div>
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/atoi.html">std::atoi</a>(argv[1]);</div>
|
||||
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> a = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/atof.html">std::atof</a>(argv[2]);</div>
|
||||
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> b = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/atof.html">std::atof</a>(argv[3]);</div>
|
||||
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> <span class="comment">// Check if a<b else abort</span></div>
|
||||
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> assert(a < b && <span class="stringliteral">"a has to be less than b"</span>);</div>
|
||||
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> assert(N > 0 && <span class="stringliteral">"N has to be > 0"</span>);</div>
|
||||
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> <span class="keywordflow">if</span> (N < 16 || a != 1 || b != 3) {</div>
|
||||
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> used_argv_parameters = <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> }</div>
|
||||
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"You selected N="</span> << <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> << <span class="stringliteral">", a="</span> << a << <span class="stringliteral">", b="</span> << b</div>
|
||||
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> </div>
|
||||
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <span class="comment">// Find the step</span></div>
|
||||
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a> = (b - a) / N;</div>
|
||||
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> </div>
|
||||
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2ae48a41e43dc6ab11b962742349646e">test</a>(N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, b, used_argv_parameters); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> </div>
|
||||
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span>}</div>
|
||||
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Default N="</span> << <a class="code hl_variable" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> << <span class="stringliteral">", a="</span> << a << <span class="stringliteral">", b="</span> << b</div>
|
||||
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> }</div>
|
||||
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> </div>
|
||||
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <span class="comment">// Find the step</span></div>
|
||||
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a> = (b - a) / N;</div>
|
||||
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> </div>
|
||||
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2ae48a41e43dc6ab11b962742349646e">test</a>(N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, b, used_argv_parameters); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> </div>
|
||||
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span>}</div>
|
||||
<div class="ttc" id="aatof_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/byte/atof.html">std::atof</a></div><div class="ttdeci">T atof(T... args)</div></div>
|
||||
<div class="ttc" id="aatoi_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/byte/atoi.html">std::atoi</a></div><div class="ttdeci">T atoi(T... args)</div></div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a2ae48a41e43dc6ab11b962742349646e"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a2ae48a41e43dc6ab11b962742349646e">test</a></div><div class="ttdeci">static void test(std::int32_t N, double h, double a, double b, bool used_argv_parameters)</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition:</b> composite_simpson_rule.cpp:130</div></div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a2ae48a41e43dc6ab11b962742349646e"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a2ae48a41e43dc6ab11b962742349646e">test</a></div><div class="ttdeci">static void test(std::int32_t N, double h, double a, double b, bool used_argv_parameters)</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition:</b> composite_simpson_rule.cpp:132</div></div>
|
||||
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -514,36 +517,36 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="fragment"><div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> {</div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="comment">// Call the functions and find the integral of each function</span></div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <span class="keywordtype">double</span> result_f = numerical_methods::simpson_method::evaluate_by_simpson(</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::simpson_method::f);</div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> assert((used_argv_parameters || (result_f >= 4.09 && result_f <= 4.10)) &&</div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <span class="stringliteral">"The result of f(x) is wrong"</span>);</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The result of integral f(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> << <span class="stringliteral">"] is equal to: "</span> << result_f << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> </div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="keywordtype">double</span> result_g = numerical_methods::simpson_method::evaluate_by_simpson(</div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::simpson_method::g);</div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> assert((used_argv_parameters || (result_g >= 0.27 && result_g <= 0.28)) &&</div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <span class="stringliteral">"The result of g(x) is wrong"</span>);</div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The result of integral g(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> << <span class="stringliteral">"] is equal to: "</span> << result_g << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> </div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keywordtype">double</span> result_k = numerical_methods::simpson_method::evaluate_by_simpson(</div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::simpson_method::k);</div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> assert((used_argv_parameters || (result_k >= 9.06 && result_k <= 9.07)) &&</div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <span class="stringliteral">"The result of k(x) is wrong"</span>);</div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The result of integral k(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> << <span class="stringliteral">"] is equal to: "</span> << result_k << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> </div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="keywordtype">double</span> result_l = numerical_methods::simpson_method::evaluate_by_simpson(</div>
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::simpson_method::l);</div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> assert((used_argv_parameters || (result_l >= 7.16 && result_l <= 7.17)) &&</div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> <span class="stringliteral">"The result of l(x) is wrong"</span>);</div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The result of integral l(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> << <span class="stringliteral">"] is equal to: "</span> << result_l << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span>}</div>
|
||||
<div class="fragment"><div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> {</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="comment">// Call the functions and find the integral of each function</span></div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="keywordtype">double</span> result_f = numerical_methods::simpson_method::evaluate_by_simpson(</div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::simpson_method::f);</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> assert((used_argv_parameters || (result_f >= 4.09 && result_f <= 4.10)) &&</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="stringliteral">"The result of f(x) is wrong"</span>);</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The result of integral f(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> << <span class="stringliteral">"] is equal to: "</span> << result_f << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> </div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="keywordtype">double</span> result_g = numerical_methods::simpson_method::evaluate_by_simpson(</div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::simpson_method::g);</div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> assert((used_argv_parameters || (result_g >= 0.27 && result_g <= 0.28)) &&</div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <span class="stringliteral">"The result of g(x) is wrong"</span>);</div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The result of integral g(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> << <span class="stringliteral">"] is equal to: "</span> << result_g << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="keywordtype">double</span> result_k = numerical_methods::simpson_method::evaluate_by_simpson(</div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::simpson_method::k);</div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> assert((used_argv_parameters || (result_k >= 9.06 && result_k <= 9.07)) &&</div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <span class="stringliteral">"The result of k(x) is wrong"</span>);</div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The result of integral k(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> << <span class="stringliteral">"] is equal to: "</span> << result_k << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> </div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="keywordtype">double</span> result_l = numerical_methods::simpson_method::evaluate_by_simpson(</div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::simpson_method::l);</div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> assert((used_argv_parameters || (result_l >= 7.16 && result_l <= 7.17)) &&</div>
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="stringliteral">"The result of l(x) is wrong"</span>);</div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The result of integral l(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> << <span class="stringliteral">"] is equal to: "</span> << result_l << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -336,7 +336,7 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><a id="l00398" name="l00398"></a><span class="lineno"> 398</span> <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#ac43d294e21a0c4fa33c53757df054576">kohonen_som</a>(X, &W, 1e-4); <span class="comment">// train the SOM</span></div>
|
||||
<div class="line"><a id="l00399" name="l00399"></a><span class="lineno"> 399</span> <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#aa72a53c88203fde278f1fe6c3afe5b07">save_u_matrix</a>(<span class="stringliteral">"w12.csv"</span>, W); <span class="comment">// save the resultant weights</span></div>
|
||||
<div class="line"><a id="l00400" name="l00400"></a><span class="lineno"> 400</span>}</div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a1b74d828b33760094906797042b89442"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">numerical_methods::simpson_method::k</a></div><div class="ttdeci">double k(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition:</b> composite_simpson_rule.cpp:115</div></div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a1b74d828b33760094906797042b89442"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">numerical_methods::simpson_method::k</a></div><div class="ttdeci">double k(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition:</b> composite_simpson_rule.cpp:117</div></div>
|
||||
<div class="ttc" id="adata__structures_2sparse__table_8cpp_html_a10f3ffb3f6f7e1b83d556b9c8de89a5d"><div class="ttname"><a href="../../d6/d42/data__structures_2sparse__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> sparse_table.cpp:47</div></div>
|
||||
<div class="ttc" id="agroup__machine__learning_html_gabc90175770bf0d5853c466e14993a08c"><div class="ttname"><a href="../../d9/d66/group__machine__learning.html#gabc90175770bf0d5853c466e14993a08c">save_2d_data</a></div><div class="ttdeci">int save_2d_data(const char *fname, const std::vector< std::valarray< double > > &X)</div><div class="ttdef"><b>Definition:</b> kohonen_som_topology.cpp:65</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> kohonen_som_topology.cpp:53</div></div>
|
||||
|
||||
@@ -452,7 +452,7 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</span> }</div>
|
||||
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"> 298</span> <span class="keywordflow">return</span> details;</div>
|
||||
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span> }</div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a6d8df83a6f26ce24a75d3b358b7f5b8a"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">numerical_methods::simpson_method::l</a></div><div class="ttdeci">double l(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition:</b> composite_simpson_rule.cpp:117</div></div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a6d8df83a6f26ce24a75d3b358b7f5b8a"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">numerical_methods::simpson_method::l</a></div><div class="ttdeci">double l(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition:</b> composite_simpson_rule.cpp:119</div></div>
|
||||
<div class="ttc" id="aemplace_back_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/emplace_back.html">std::vector::emplace_back</a></div><div class="ttdeci">T emplace_back(T... args)</div></div>
|
||||
<div class="ttc" id="anamespacemachine__learning_html_a5342906d42b80fc6b6b3ad17bf00fcb9"><div class="ttname"><a href="../../d8/d77/namespacemachine__learning.html#a5342906d42b80fc6b6b3ad17bf00fcb9">machine_learning::multiply</a></div><div class="ttdeci">std::vector< std::valarray< T > > multiply(const std::vector< std::valarray< T > > &A, const std::vector< std::valarray< T > > &B)</div><div class="ttdef"><b>Definition:</b> vector_ops.hpp:460</div></div>
|
||||
<div class="ttc" id="anamespacemachine__learning_html_ad0bdc88e5f1be47c46c0f0c8ebf754bb"><div class="ttname"><a href="../../d8/d77/namespacemachine__learning.html#ad0bdc88e5f1be47c46c0f0c8ebf754bb">machine_learning::apply_function</a></div><div class="ttdeci">std::vector< std::valarray< T > > apply_function(const std::vector< std::valarray< T > > &A, T(*func)(const T &))</div><div class="ttdef"><b>Definition:</b> vector_ops.hpp:329</div></div>
|
||||
|
||||
Reference in New Issue
Block a user