Files
C-Plus-Plus/d4/d18/composite__simpson__rule_8cpp.html
2024-11-04 12:32:06 +00:00

545 lines
46 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: numerical_methods/composite_simpson_rule.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('../../',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('d4/d18/composite__simpson__rule_8cpp.html','../../'); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#namespaces">Namespaces</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">composite_simpson_rule.cpp File Reference</div></div>
</div><!--header-->
<div class="contents">
<p>Implementation of the Composite Simpson Rule for the approximation.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;cassert&gt;</code><br />
<code>#include &lt;cmath&gt;</code><br />
<code>#include &lt;cstdint&gt;</code><br />
<code>#include &lt;cstdlib&gt;</code><br />
<code>#include &lt;functional&gt;</code><br />
<code>#include &lt;iostream&gt;</code><br />
<code>#include &lt;map&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for composite_simpson_rule.cpp:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d7/db0/composite__simpson__rule_8cpp__incl.svg" width="592" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace &#160;</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">&#160;</td><td class="mdescRight">for assert <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace &#160;</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">&#160;</td><td class="mdescRight">Contains the Simpson's method implementation. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</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:a6ccc5eddc537dc0293d0ae3d0480f068" id="r_a6ccc5eddc537dc0293d0ae3d0480f068"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#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>&lt; double(double)&gt; &amp;func)</td></tr>
<tr class="separator:a6ccc5eddc537dc0293d0ae3d0480f068"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4251b4df4748a0b9c43a48f61bdd2397" id="r_a4251b4df4748a0b9c43a48f61bdd2397"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4251b4df4748a0b9c43a48f61bdd2397">numerical_methods::simpson_method::f</a> (double x)</td></tr>
<tr class="memdesc:a4251b4df4748a0b9c43a48f61bdd2397"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function f(x) that will be used to test the method. <br /></td></tr>
<tr class="separator:a4251b4df4748a0b9c43a48f61bdd2397"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f67508d5f392b0321772169342c98ad" id="r_a2f67508d5f392b0321772169342c98ad"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a2f67508d5f392b0321772169342c98ad">numerical_methods::simpson_method::g</a> (double x)</td></tr>
<tr class="memdesc:a2f67508d5f392b0321772169342c98ad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Another test function. <br /></td></tr>
<tr class="separator:a2f67508d5f392b0321772169342c98ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1b74d828b33760094906797042b89442" id="r_a1b74d828b33760094906797042b89442"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1b74d828b33760094906797042b89442">numerical_methods::simpson_method::k</a> (double x)</td></tr>
<tr class="memdesc:a1b74d828b33760094906797042b89442"><td class="mdescLeft">&#160;</td><td class="mdescRight">Another test function. <br /></td></tr>
<tr class="separator:a1b74d828b33760094906797042b89442"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6d8df83a6f26ce24a75d3b358b7f5b8a" id="r_a6d8df83a6f26ce24a75d3b358b7f5b8a"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a6d8df83a6f26ce24a75d3b358b7f5b8a">numerical_methods::simpson_method::l</a> (double x)</td></tr>
<tr class="memdesc:a6d8df83a6f26ce24a75d3b358b7f5b8a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Another test function. <br /></td></tr>
<tr class="separator:a6d8df83a6f26ce24a75d3b358b7f5b8a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2ae48a41e43dc6ab11b962742349646e" id="r_a2ae48a41e43dc6ab11b962742349646e"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a2ae48a41e43dc6ab11b962742349646e">test</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, double b, bool used_argv_parameters)</td></tr>
<tr class="memdesc:a2ae48a41e43dc6ab11b962742349646e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Self-test implementations. <br /></td></tr>
<tr class="separator:a2ae48a41e43dc6ab11b962742349646e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c04138a5bfe5d72780bb7e82a18e627" id="r_a3c04138a5bfe5d72780bb7e82a18e627"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a3c04138a5bfe5d72780bb7e82a18e627">main</a> (int argc, char **argv)</td></tr>
<tr class="memdesc:a3c04138a5bfe5d72780bb7e82a18e627"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function. <br /></td></tr>
<tr class="separator:a3c04138a5bfe5d72780bb7e82a18e627"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Implementation of the Composite Simpson Rule for the approximation. </p>
<p>The following is an implementation of the Composite Simpson Rule for the approximation of definite integrals. More info -&gt; wiki: <a href="https://en.wikipedia.org/wiki/Simpson%27s_rule#Composite_Simpson's_rule">https://en.wikipedia.org/wiki/Simpson%27s_rule#Composite_Simpson's_rule</a></p>
<p>The idea is to split the interval in an EVEN number N of intervals and use as interpolation points the xi for which it applies that xi = x0 + i*h, where h is a step defined as h = (b-a)/N where a and b are the first and last points of the interval of the integration [a, b].</p>
<p>We create a table of the xi and their corresponding f(xi) values and we evaluate the integral by the formula: I = h/3 * {f(x0) + 4*f(x1) + 2*f(x2) + ... + 2*f(xN-2) + 4*f(xN-1) + f(xN)}</p>
<p>That means that the first and last indexed i f(xi) are multiplied by 1, the odd indexed f(xi) by 4 and the even by 2.</p>
<p>In this program there are 4 sample test functions f, g, k, l that are evaluated in the same interval.</p>
<p>Arguments can be passed as parameters from the command line argv[1] = N, argv[2] = a, argv[3] = b</p>
<p>N must be even number and a&lt;b.</p>
<p>In the end of the <a class="el" href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4" title="Main function.">main()</a> i compare the program's result with the one from mathematical software with 2 decimal points margin.</p>
<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="a6ccc5eddc537dc0293d0ae3d0480f068" name="a6ccc5eddc537dc0293d0ae3d0480f068"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6ccc5eddc537dc0293d0ae3d0480f068">&#9670;&#160;</a></span>evaluate_by_simpson()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double numerical_methods::simpson_method::evaluate_by_simpson </td>
<td>(</td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a></td> <td class="paramname"><span class="paramname"><em>N</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>h</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>a</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/functional/function.html">std::function</a>&lt; double(double)&gt; &amp;</td> <td class="paramname"><span class="paramname"><em>func</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<div class="fragment"><div class="line"><span class="lineno"> 68</span> {</div>
<div class="line"><span class="lineno"> 69</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map.html">std::map&lt;std::int32_t, double&gt;</a></div>
<div class="line"><span class="lineno"> 70</span> data_table; <span class="comment">// Contains the data points. key: i, value: f(xi)</span></div>
<div class="line"><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"><span class="lineno"> 72</span> </div>
<div class="line"><span class="lineno"> 73</span> <span class="comment">// Create the data table</span></div>
<div class="line"><span class="lineno"> 74</span> <span class="keywordtype">double</span> temp = NAN;</div>
<div class="line"><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 &lt;= <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
<div class="line"><span class="lineno"> 76</span> temp = func(xi);</div>
<div class="line"><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"><span class="lineno"> 78</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair&lt;std::int32_t, double&gt;</a>(i, temp)); <span class="comment">// add i and f(xi)</span></div>
<div class="line"><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"><span class="lineno"> 80</span> }</div>
<div class="line"><span class="lineno"> 81</span> </div>
<div class="line"><span class="lineno"> 82</span> <span class="comment">// Evaluate the integral.</span></div>
<div class="line"><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"><span class="lineno"> 84</span> <span class="keywordtype">double</span> evaluate_integral = 0;</div>
<div class="line"><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 &lt;= <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
<div class="line"><span class="lineno"> 86</span> <span class="keywordflow">if</span> (i == 0 || i == N) {</div>
<div class="line"><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"><span class="lineno"> 88</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (i % 2 == 1) {</div>
<div class="line"><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"><span class="lineno"> 90</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><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"><span class="lineno"> 92</span> }</div>
<div class="line"><span class="lineno"> 93</span> }</div>
<div class="line"><span class="lineno"> 94</span> </div>
<div class="line"><span class="lineno"> 95</span> <span class="comment">// Multiply by the coefficient h/3</span></div>
<div class="line"><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"><span class="lineno"> 97</span> </div>
<div class="line"><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"><span class="lineno"> 99</span> <span class="comment">// interval.</span></div>
<div class="line"><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) &amp;&amp;</div>
<div class="line"><span class="lineno"> 101</span> <span class="stringliteral">&quot;The definite integral can&#39;t be evaluated. Check the validity of &quot;</span></div>
<div class="line"><span class="lineno"> 102</span> <span class="stringliteral">&quot;your input.\n&quot;</span>);</div>
<div class="line"><span class="lineno"> 103</span> <span class="comment">// Else return</span></div>
<div class="line"><span class="lineno"> 104</span> <span class="keywordflow">return</span> evaluate_integral;</div>
<div class="line"><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="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="ainsert_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/map/insert.html">std::map::insert</a></div><div class="ttdeci">T insert(T... args)</div></div>
<div class="ttc" id="ainteger_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a></div></div>
<div class="ttc" id="aisnan_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/isnan.html">std::isnan</a></div><div class="ttdeci">T isnan(T... args)</div></div>
<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>
<div class="ttc" id="apair_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a></div></div>
<div class="ttc" id="asparse__table_8cpp_html_a10f3ffb3f6f7e1b83d556b9c8de89a5d"><div class="ttname"><a href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">data_structures::sparse_table::N</a></div><div class="ttdeci">constexpr uint32_t N</div><div class="ttdoc">A struct to represent sparse table for min() as their invariant function, for the given array A....</div><div class="ttdef"><b>Definition</b> sparse_table.cpp:48</div></div>
</div><!-- fragment -->
</div>
</div>
<a id="a4251b4df4748a0b9c43a48f61bdd2397" name="a4251b4df4748a0b9c43a48f61bdd2397"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4251b4df4748a0b9c43a48f61bdd2397">&#9670;&#160;</a></span>f()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double numerical_methods::simpson_method::f </td>
<td>(</td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>x</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>A function f(x) that will be used to test the method. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">x</td><td>The independent variable xi </td></tr>
</table>
</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"><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">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/d18/composite__simpson__rule_8cpp_a4251b4df4748a0b9c43a48f61bdd2397_cgraph.svg" width="271" height="92"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
</div>
<a id="a2f67508d5f392b0321772169342c98ad" name="a2f67508d5f392b0321772169342c98ad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2f67508d5f392b0321772169342c98ad">&#9670;&#160;</a></span>g()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double numerical_methods::simpson_method::g </td>
<td>(</td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>x</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Another test function. </p>
<div class="fragment"><div class="line"><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">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/d18/composite__simpson__rule_8cpp_a2f67508d5f392b0321772169342c98ad_cgraph.svg" width="272" height="92"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
</div>
<a id="a1b74d828b33760094906797042b89442" name="a1b74d828b33760094906797042b89442"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1b74d828b33760094906797042b89442">&#9670;&#160;</a></span>k()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double numerical_methods::simpson_method::k </td>
<td>(</td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>x</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Another test function. </p>
<div class="fragment"><div class="line"><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">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/d18/composite__simpson__rule_8cpp_a1b74d828b33760094906797042b89442_cgraph.svg" width="272" height="92"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
</div>
<a id="a6d8df83a6f26ce24a75d3b358b7f5b8a" name="a6d8df83a6f26ce24a75d3b358b7f5b8a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6d8df83a6f26ce24a75d3b358b7f5b8a">&#9670;&#160;</a></span>l()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double numerical_methods::simpson_method::l </td>
<td>(</td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>x</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Another test function. </p>
<div class="fragment"><div class="line"><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">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/d18/composite__simpson__rule_8cpp_a6d8df83a6f26ce24a75d3b358b7f5b8a_cgraph.svg" width="266" height="76"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
</div>
<a id="a3c04138a5bfe5d72780bb7e82a18e627" name="a3c04138a5bfe5d72780bb7e82a18e627"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3c04138a5bfe5d72780bb7e82a18e627">&#9670;&#160;</a></span>main()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int main </td>
<td>(</td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>argc</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char **</td> <td class="paramname"><span class="paramname"><em>argv</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Main function. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">argc</td><td>commandline argument count (ignored) </td></tr>
<tr><td class="paramname">argv</td><td>commandline array of arguments (ignored) </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
<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"><span class="lineno"> 170</span> {</div>
<div class="line"><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="../../d8/dab/sparse__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"><span class="lineno"> 172</span><span class="comment"> /// interval. MUST BE EVEN</span></div>
<div class="line"><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"><span class="lineno"> 174</span><span class="comment"> /// the real axis</span></div>
<div class="line"><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"><span class="lineno"> 176</span> </div>
<div class="line"><span class="lineno"> 177</span> <span class="keywordtype">bool</span> used_argv_parameters =</div>
<div class="line"><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"><span class="lineno"> 179</span> <span class="comment">// for the tst cases</span></div>
<div class="line"><span class="lineno"> 180</span> </div>
<div class="line"><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"><span class="lineno"> 182</span> <span class="comment">// displaying messages)</span></div>
<div class="line"><span class="lineno"> 183</span> <span class="keywordflow">if</span> (argc == 4) {</div>
<div class="line"><span class="lineno"> 184</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/atoi.html">std::atoi</a>(argv[1]);</div>
<div class="line"><span class="lineno"> 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"><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"><span class="lineno"> 187</span> <span class="comment">// Check if a&lt;b else abort</span></div>
<div class="line"><span class="lineno"> 188</span> assert(a &lt; b &amp;&amp; <span class="stringliteral">&quot;a has to be less than b&quot;</span>);</div>
<div class="line"><span class="lineno"> 189</span> assert(N &gt; 0 &amp;&amp; <span class="stringliteral">&quot;N has to be &gt; 0&quot;</span>);</div>
<div class="line"><span class="lineno"> 190</span> <span class="keywordflow">if</span> (N &lt; 16 || a != 1 || b != 3) {</div>
<div class="line"><span class="lineno"> 191</span> used_argv_parameters = <span class="keyword">true</span>;</div>
<div class="line"><span class="lineno"> 192</span> }</div>
<div class="line"><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> &lt;&lt; <span class="stringliteral">&quot;You selected N=&quot;</span> &lt;&lt; <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> &lt;&lt; <span class="stringliteral">&quot;, a=&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, b=&quot;</span> &lt;&lt; b</div>
<div class="line"><span class="lineno"> 194</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 195</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><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> &lt;&lt; <span class="stringliteral">&quot;Default N=&quot;</span> &lt;&lt; <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> &lt;&lt; <span class="stringliteral">&quot;, a=&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, b=&quot;</span> &lt;&lt; b</div>
<div class="line"><span class="lineno"> 197</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 198</span> }</div>
<div class="line"><span class="lineno"> 199</span> </div>
<div class="line"><span class="lineno"> 200</span> <span class="comment">// Find the step</span></div>
<div class="line"><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"><span class="lineno"> 202</span> </div>
<div class="line"><span class="lineno"> 203</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, b, used_argv_parameters); <span class="comment">// run self-test implementations</span></div>
<div class="line"><span class="lineno"> 204</span> </div>
<div class="line"><span class="lineno"> 205</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><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="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
<div class="ttc" id="agenerate__parentheses_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> generate_parentheses.cpp:82</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d4/d18/composite__simpson__rule_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg" width="100%" height="523"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div></div>
</div>
</div>
</div>
<a id="a2ae48a41e43dc6ab11b962742349646e" name="a2ae48a41e43dc6ab11b962742349646e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2ae48a41e43dc6ab11b962742349646e">&#9670;&#160;</a></span>test()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void test </td>
<td>(</td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int32_t</a></td> <td class="paramname"><span class="paramname"><em>N</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>h</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>a</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>b</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>used_argv_parameters</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Self-test implementations. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">N</td><td>is the number of intervals </td></tr>
<tr><td class="paramname">h</td><td>is the step </td></tr>
<tr><td class="paramname">a</td><td>is x0 </td></tr>
<tr><td class="paramname">b</td><td>is the end of the interval </td></tr>
<tr><td class="paramname">used_argv_parameters</td><td>is 'true' if argv parameters are given and 'false' if not </td></tr>
</table>
</dd>
</dl>
<div class="fragment"><div class="line"><span class="lineno"> 133</span> {</div>
<div class="line"><span class="lineno"> 134</span> <span class="comment">// Call the functions and find the integral of each function</span></div>
<div class="line"><span class="lineno"> 135</span> <span class="keywordtype">double</span> result_f = numerical_methods::simpson_method::evaluate_by_simpson(</div>
<div class="line"><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"><span class="lineno"> 137</span> assert((used_argv_parameters || (result_f &gt;= 4.09 &amp;&amp; result_f &lt;= 4.10)) &amp;&amp;</div>
<div class="line"><span class="lineno"> 138</span> <span class="stringliteral">&quot;The result of f(x) is wrong&quot;</span>);</div>
<div class="line"><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> &lt;&lt; <span class="stringliteral">&quot;The result of integral f(x) on interval [&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, &quot;</span> &lt;&lt; b</div>
<div class="line"><span class="lineno"> 140</span> &lt;&lt; <span class="stringliteral">&quot;] is equal to: &quot;</span> &lt;&lt; result_f &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 141</span> </div>
<div class="line"><span class="lineno"> 142</span> <span class="keywordtype">double</span> result_g = numerical_methods::simpson_method::evaluate_by_simpson(</div>
<div class="line"><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"><span class="lineno"> 144</span> assert((used_argv_parameters || (result_g &gt;= 0.27 &amp;&amp; result_g &lt;= 0.28)) &amp;&amp;</div>
<div class="line"><span class="lineno"> 145</span> <span class="stringliteral">&quot;The result of g(x) is wrong&quot;</span>);</div>
<div class="line"><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> &lt;&lt; <span class="stringliteral">&quot;The result of integral g(x) on interval [&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, &quot;</span> &lt;&lt; b</div>
<div class="line"><span class="lineno"> 147</span> &lt;&lt; <span class="stringliteral">&quot;] is equal to: &quot;</span> &lt;&lt; result_g &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 148</span> </div>
<div class="line"><span class="lineno"> 149</span> <span class="keywordtype">double</span> result_k = numerical_methods::simpson_method::evaluate_by_simpson(</div>
<div class="line"><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"><span class="lineno"> 151</span> assert((used_argv_parameters || (result_k &gt;= 9.06 &amp;&amp; result_k &lt;= 9.07)) &amp;&amp;</div>
<div class="line"><span class="lineno"> 152</span> <span class="stringliteral">&quot;The result of k(x) is wrong&quot;</span>);</div>
<div class="line"><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> &lt;&lt; <span class="stringliteral">&quot;The result of integral k(x) on interval [&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, &quot;</span> &lt;&lt; b</div>
<div class="line"><span class="lineno"> 154</span> &lt;&lt; <span class="stringliteral">&quot;] is equal to: &quot;</span> &lt;&lt; result_k &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 155</span> </div>
<div class="line"><span class="lineno"> 156</span> <span class="keywordtype">double</span> result_l = numerical_methods::simpson_method::evaluate_by_simpson(</div>
<div class="line"><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"><span class="lineno"> 158</span> assert((used_argv_parameters || (result_l &gt;= 7.16 &amp;&amp; result_l &lt;= 7.17)) &amp;&amp;</div>
<div class="line"><span class="lineno"> 159</span> <span class="stringliteral">&quot;The result of l(x) is wrong&quot;</span>);</div>
<div class="line"><span class="lineno"> 160</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;The result of integral l(x) on interval [&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, &quot;</span> &lt;&lt; b</div>
<div class="line"><span class="lineno"> 161</span> &lt;&lt; <span class="stringliteral">&quot;] is equal to: &quot;</span> &lt;&lt; result_l &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 162</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="../../d4/d18/composite__simpson__rule_8cpp_a2ae48a41e43dc6ab11b962742349646e_cgraph.svg" width="174" height="86"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../d4/d18/composite__simpson__rule_8cpp.html">composite_simpson_rule.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
</ul>
</div>
</body>
</html>