Documentation for 0953376d31

This commit is contained in:
github-actions
2023-06-16 21:18:14 +00:00
parent 26f1eee566
commit 14deeecd50
7241 changed files with 234176 additions and 54779 deletions

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="generator" content="Doxygen 1.9.7"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: math/integral_approximation2.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.6 -->
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -118,8 +118,7 @@ $(document).ready(function(){initNavTree('db/d40/integral__approximation2_8cpp.h
</div><div class="textblock"><div class="dynheader">
Include dependency graph for integral_approximation2.cpp:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d5/d5c/integral__approximation2_8cpp__incl.svg" width="598" height="111"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d5/d5c/integral__approximation2_8cpp__incl.svg" width="598" height="111"><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>
@@ -139,10 +138,10 @@ using&#160;</td><td class="memItemRight" valign="bottom"><b>math::monte_carlo::F
</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:a71249ee535f16f8ed2e9cc8f0199a2cf"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d40/integral__approximation2_8cpp.html#a71249ee535f16f8ed2e9cc8f0199a2cf">math::monte_carlo::generate_samples</a> (const double &amp;start_point, const Function &amp;pdf, const uint32_t &amp;num_samples, const uint32_t &amp;discard=100000)</td></tr>
<tr class="memitem:a71249ee535f16f8ed2e9cc8f0199a2cf"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d40/integral__approximation2_8cpp.html#a71249ee535f16f8ed2e9cc8f0199a2cf">math::monte_carlo::generate_samples</a> (const double &amp;start_point, const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/functional/function.html">Function</a> &amp;pdf, const uint32_t &amp;num_samples, const uint32_t &amp;discard=100000)</td></tr>
<tr class="memdesc:a71249ee535f16f8ed2e9cc8f0199a2cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">short-hand for std::functions used in this implementation <br /></td></tr>
<tr class="separator:a71249ee535f16f8ed2e9cc8f0199a2cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af7da9ba8932f1f48b9bbc2d80471af51"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d40/integral__approximation2_8cpp.html#af7da9ba8932f1f48b9bbc2d80471af51">math::monte_carlo::integral_monte_carlo</a> (const double &amp;start_point, const Function &amp;function, const Function &amp;pdf, const uint32_t &amp;num_samples=1000000)</td></tr>
<tr class="memitem:af7da9ba8932f1f48b9bbc2d80471af51"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d40/integral__approximation2_8cpp.html#af7da9ba8932f1f48b9bbc2d80471af51">math::monte_carlo::integral_monte_carlo</a> (const double &amp;start_point, const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/functional/function.html">Function</a> &amp;function, const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/functional/function.html">Function</a> &amp;pdf, const uint32_t &amp;num_samples=1000000)</td></tr>
<tr class="memdesc:af7da9ba8932f1f48b9bbc2d80471af51"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute an approximation of an integral using Monte Carlo integration. <br /></td></tr>
<tr class="separator:af7da9ba8932f1f48b9bbc2d80471af51"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8dca7b867074164d5f45b0f3851269d"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d40/integral__approximation2_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a> ()</td></tr>
@@ -249,8 +248,7 @@ Functions</h2></td></tr>
</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="../../db/d40/integral__approximation2_8cpp_a71249ee535f16f8ed2e9cc8f0199a2cf_cgraph.svg" width="351" height="135"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../db/d40/integral__approximation2_8cpp_a71249ee535f16f8ed2e9cc8f0199a2cf_cgraph.svg" width="351" height="135"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
@@ -313,14 +311,14 @@ Here is the call graph for this function:</div>
<div class="line"><span class="lineno"> 120</span> integral += function(sample) / pdf(sample);</div>
<div class="line"><span class="lineno"> 121</span> }</div>
<div class="line"><span class="lineno"> 122</span> </div>
<div class="line"><span class="lineno"> 123</span> <span class="keywordflow">return</span> integral / <span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(samples.size());</div>
<div class="line"><span class="lineno"> 123</span> <span class="keywordflow">return</span> integral / <span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(samples.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>());</div>
<div class="line"><span class="lineno"> 124</span>}</div>
<div class="ttc" id="aintegral__approximation2_8cpp_html_a71249ee535f16f8ed2e9cc8f0199a2cf"><div class="ttname"><a href="../../db/d40/integral__approximation2_8cpp.html#a71249ee535f16f8ed2e9cc8f0199a2cf">math::monte_carlo::generate_samples</a></div><div class="ttdeci">std::vector&lt; double &gt; generate_samples(const double &amp;start_point, const Function &amp;pdf, const uint32_t &amp;num_samples, const uint32_t &amp;discard=100000)</div><div class="ttdoc">short-hand for std::functions used in this implementation</div><div class="ttdef"><b>Definition:</b> integral_approximation2.cpp:64</div></div>
<div class="ttc" id="aintegral__approximation2_8cpp_html_a71249ee535f16f8ed2e9cc8f0199a2cf"><div class="ttname"><a href="../../db/d40/integral__approximation2_8cpp.html#a71249ee535f16f8ed2e9cc8f0199a2cf">math::monte_carlo::generate_samples</a></div><div class="ttdeci">std::vector&lt; double &gt; generate_samples(const double &amp;start_point, const Function &amp;pdf, const uint32_t &amp;num_samples, const uint32_t &amp;discard=100000)</div><div class="ttdoc">short-hand for std::functions used in this implementation</div><div class="ttdef"><b>Definition</b> integral_approximation2.cpp:64</div></div>
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/size.html">std::vector::size</a></div><div class="ttdeci">T size(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../db/d40/integral__approximation2_8cpp_af7da9ba8932f1f48b9bbc2d80471af51_cgraph.svg" width="540" height="143"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../db/d40/integral__approximation2_8cpp_af7da9ba8932f1f48b9bbc2d80471af51_cgraph.svg" width="540" height="143"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
@@ -347,12 +345,11 @@ Here is the call graph for this function:</div>
<div class="line"><span class="lineno"> 216</span> <a class="code hl_function" href="../../db/d40/integral__approximation2_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
<div class="line"><span class="lineno"> 217</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 218</span>}</div>
<div class="ttc" id="aintegral__approximation2_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../db/d40/integral__approximation2_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> integral_approximation2.cpp:133</div></div>
<div class="ttc" id="aintegral__approximation2_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../db/d40/integral__approximation2_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> integral_approximation2.cpp:133</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="../../db/d40/integral__approximation2_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="271" height="184"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../db/d40/integral__approximation2_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="271" height="184"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
@@ -460,11 +457,11 @@ Here is the call graph for this function:</div>
<div class="line"><span class="lineno"> 208</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"> 209</span>}</div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a4251b4df4748a0b9c43a48f61bdd2397"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a4251b4df4748a0b9c43a48f61bdd2397">numerical_methods::simpson_method::f</a></div><div class="ttdeci">double f(double x)</div><div class="ttdoc">A function f(x) that will be used to test the method.</div><div class="ttdef"><b>Definition:</b> composite_simpson_rule.cpp:113</div></div>
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a4251b4df4748a0b9c43a48f61bdd2397"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a4251b4df4748a0b9c43a48f61bdd2397">numerical_methods::simpson_method::f</a></div><div class="ttdeci">double f(double x)</div><div class="ttdoc">A function f(x) that will be used to test the method.</div><div class="ttdef"><b>Definition</b> composite_simpson_rule.cpp:113</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="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="afunction_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/functional/function.html">std::function</a></div></div>
<div class="ttc" id="aintegral__approximation2_8cpp_html_af7da9ba8932f1f48b9bbc2d80471af51"><div class="ttname"><a href="../../db/d40/integral__approximation2_8cpp.html#af7da9ba8932f1f48b9bbc2d80471af51">math::monte_carlo::integral_monte_carlo</a></div><div class="ttdeci">double integral_monte_carlo(const double &amp;start_point, const Function &amp;function, const Function &amp;pdf, const uint32_t &amp;num_samples=1000000)</div><div class="ttdoc">Compute an approximation of an integral using Monte Carlo integration.</div><div class="ttdef"><b>Definition:</b> integral_approximation2.cpp:112</div></div>
<div class="ttc" id="aintegral__approximation2_8cpp_html_af7da9ba8932f1f48b9bbc2d80471af51"><div class="ttname"><a href="../../db/d40/integral__approximation2_8cpp.html#af7da9ba8932f1f48b9bbc2d80471af51">math::monte_carlo::integral_monte_carlo</a></div><div class="ttdeci">double integral_monte_carlo(const double &amp;start_point, const Function &amp;function, const Function &amp;pdf, const uint32_t &amp;num_samples=1000000)</div><div class="ttdoc">Compute an approximation of an integral using Monte Carlo integration.</div><div class="ttdef"><b>Definition</b> integral_approximation2.cpp:112</div></div>
<div class="ttc" id="alower_bound_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/lower_bound.html">std::lower_bound</a></div><div class="ttdeci">T lower_bound(T... args)</div></div>
<div class="ttc" id="asin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/sin.html">std::sin</a></div><div class="ttdeci">T sin(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>
@@ -472,8 +469,7 @@ Here is the call graph for this function:</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="../../db/d40/integral__approximation2_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg" width="174" height="184"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../db/d40/integral__approximation2_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg" width="174" height="184"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
@@ -484,7 +480,7 @@ Here is the call graph for this function:</div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../db/d40/integral__approximation2_8cpp.html">integral_approximation2.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.7 </li>
</ul>
</div>
</body>