Documentation for 8b1eab204b

This commit is contained in:
realstealthninja
2024-11-04 12:43:05 +00:00
parent 4fb6e622e9
commit a7bccf7d01
6732 changed files with 153919 additions and 365711 deletions

View File

@@ -1,3 +1,4 @@
<!-- HTML header for doxygen 1.12.0-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
@@ -5,10 +6,15 @@
<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/brent_method_extrema.cpp File Reference</title>
<title>TheAlgorithms/C++: numerical_methods/brent_method_extrema.cpp File Reference</title>
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
</script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../navtreedata.js"></script>
@@ -18,14 +24,24 @@
<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 type="text/javascript">
window.MathJax = {
options: {
ignoreHtmlClass: 'tex2jax_ignore',
processHtmlClass: 'tex2jax_process'
},
loader: {
load: ['[tex]/ams']
},
tex: {
macros: {},
packages: ['base','configmacros','ams']
}
};
</script>
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
@@ -33,10 +49,11 @@ MathJax.Hub.Config({
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
<div id="projectname">TheAlgorithms/C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
<div id="projectbrief">All the algorithms implemented in C++</div>
</td>
</tr>
</tbody>
@@ -124,12 +141,13 @@ Include dependency graph for brent_method_extrema.cpp:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d9/d0e/brent__method__extrema_8cpp__incl.svg" width="515" 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">
</div>
<p><a href="../../db/d01/brent__method__extrema_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a525335710b53cb064ca56b936120431e" id="r_a525335710b53cb064ca56b936120431e"><td class="memItemLeft" align="right" valign="top"><a id="a525335710b53cb064ca56b936120431e" name="a525335710b53cb064ca56b936120431e"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>_USE_MATH_DEFINES</b></td></tr>
<tr class="memdesc:a525335710b53cb064ca56b936120431e"><td class="mdescLeft">&#160;</td><td class="mdescRight">required for MS Visual C++ <br /></td></tr>
<tr class="memitem:a525335710b53cb064ca56b936120431e" id="r_a525335710b53cb064ca56b936120431e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a525335710b53cb064ca56b936120431e">_USE_MATH_DEFINES</a></td></tr>
<tr class="memdesc:a525335710b53cb064ca56b936120431e"><td class="mdescLeft">&#160;</td><td class="mdescRight">required for MS Visual C++ <br /></td></tr>
<tr class="separator:a525335710b53cb064ca56b936120431e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a002b2f4894492820fe708b1b7e7c5e70" id="r_a002b2f4894492820fe708b1b7e7c5e70"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a></td></tr>
<tr class="memdesc:a002b2f4894492820fe708b1b7e7c5e70"><td class="mdescLeft">&#160;</td><td class="mdescRight">system accuracy limit <br /></td></tr>
@@ -137,7 +155,7 @@ Macros</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:a1aa76a6d5fd4d333f9072beff1dc486b" id="r_a1aa76a6d5fd4d333f9072beff1dc486b"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1aa76a6d5fd4d333f9072beff1dc486b">get_minima</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;f, double lim_a, double lim_b)</td></tr>
<tr class="memitem:a1aa76a6d5fd4d333f9072beff1dc486b" id="r_a1aa76a6d5fd4d333f9072beff1dc486b"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1aa76a6d5fd4d333f9072beff1dc486b">get_minima</a> (const std::function&lt; double(double)&gt; &amp;f, double lim_a, double lim_b)</td></tr>
<tr class="memdesc:a1aa76a6d5fd4d333f9072beff1dc486b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the real root of a function in the given interval. <br /></td></tr>
<tr class="separator:a1aa76a6d5fd4d333f9072beff1dc486b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1440a7779ac56f47a3f355ce4a8c7da0" id="r_a1440a7779ac56f47a3f355ce4a8c7da0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1440a7779ac56f47a3f355ce4a8c7da0">test1</a> ()</td></tr>
@@ -162,7 +180,27 @@ Functions</h2></td></tr>
</blockquote>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d6/d7a/golden__search__extrema_8cpp.html" title="Find extrema of a univariate real function in a given interval using golden section search algorithm.">golden_search_extrema.cpp</a></dd></dl>
<dl class="section author"><dt>Author</dt><dd><a href="https://github.com/kvedala" target="_blank">Krishna Vedala</a> </dd></dl>
<p class="definition">Definition in file <a class="el" href="../../db/d01/brent__method__extrema_8cpp_source.html">brent_method_extrema.cpp</a>.</p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a525335710b53cb064ca56b936120431e" name="a525335710b53cb064ca56b936120431e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a525335710b53cb064ca56b936120431e">&#9670;&#160;</a></span>_USE_MATH_DEFINES</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define _USE_MATH_DEFINES</td>
</tr>
</table>
</div><div class="memdoc">
<p>required for MS Visual C++ </p>
<p class="definition">Definition at line <a class="el" href="../../db/d01/brent__method__extrema_8cpp_source.html#l00016">16</a> of file <a class="el" href="../../db/d01/brent__method__extrema_8cpp_source.html">brent_method_extrema.cpp</a>.</p>
</div>
</div>
<a id="a002b2f4894492820fe708b1b7e7c5e70" name="a002b2f4894492820fe708b1b7e7c5e70"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a002b2f4894492820fe708b1b7e7c5e70">&#9670;&#160;</a></span>EPSILON</h2>
@@ -174,15 +212,15 @@ Functions</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>( \</div>
<div class="line"> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/numeric_limits.html">std::numeric_limits&lt;double&gt;::epsilon</a>())</div>
<div class="ttc" id="anumeric_limits_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/numeric_limits.html">std::numeric_limits</a></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>
<b>Value:</b><div class="fragment"><div class="line"> std::sqrt( \</div>
<div class="line"> std::numeric_limits&lt;double&gt;::epsilon())</div>
</div><!-- fragment -->
<p>system accuracy limit </p>
<p class="definition">Definition at line <a class="el" href="../../db/d01/brent__method__extrema_8cpp_source.html#l00024">24</a> of file <a class="el" href="../../db/d01/brent__method__extrema_8cpp_source.html">brent_method_extrema.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 24</span><span class="preprocessor">#define EPSILON \</span></div>
<div class="line"><span class="lineno"> 25</span><span class="preprocessor"> std::sqrt( \</span></div>
<div class="line"><span class="lineno"> 26</span><span class="preprocessor"> std::numeric_limits&lt;double&gt;::epsilon()) </span><span class="comment">///&lt; system accuracy limit</span></div>
<div class="line"><span class="lineno"> 26</span><span class="preprocessor"> std::numeric_limits&lt;double&gt;::epsilon()) </span></div>
</div><!-- fragment -->
</div>
</div>
@@ -196,7 +234,7 @@ Functions</h2></td></tr>
<tr>
<td class="memname">double get_minima </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>f</em></span>, </td>
<td class="paramtype">const std::function&lt; double(double)&gt; &amp;</td> <td class="paramname"><span class="paramname"><em>f</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
@@ -221,18 +259,20 @@ Functions</h2></td></tr>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>root found in the interval </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../db/d01/brent__method__extrema_8cpp_source.html#l00036">36</a> of file <a class="el" href="../../db/d01/brent__method__extrema_8cpp_source.html">brent_method_extrema.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 37</span> {</div>
<div class="line"><span class="lineno"> 38</span> uint32_t iters = 0;</div>
<div class="line"><span class="lineno"> 39</span> </div>
<div class="line"><span class="lineno"> 40</span> <span class="keywordflow">if</span> (lim_a &gt; lim_b) {</div>
<div class="line"><span class="lineno"> 41</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/swap.html">std::swap</a>(lim_a, lim_b);</div>
<div class="line"><span class="lineno"> 41</span> std::swap(lim_a, lim_b);</div>
<div class="line"><span class="lineno"> 42</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (std::abs(lim_a - lim_b) &lt;= <a class="code hl_define" href="#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a>) {</div>
<div class="line"><span class="lineno"> 43</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cerr</a> &lt;&lt; <span class="stringliteral">&quot;Search range must be greater than &quot;</span> &lt;&lt; <a class="code hl_define" href="#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a> &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 43</span> std::cerr &lt;&lt; <span class="stringliteral">&quot;Search range must be greater than &quot;</span> &lt;&lt; <a class="code hl_define" href="#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a> &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 44</span> <span class="keywordflow">return</span> lim_a;</div>
<div class="line"><span class="lineno"> 45</span> }</div>
<div class="line"><span class="lineno"> 46</span> </div>
<div class="line"><span class="lineno"> 47</span> <span class="comment">// golden ratio value</span></div>
<div class="line"><span class="lineno"> 48</span> <span class="keyword">const</span> <span class="keywordtype">double</span> M_GOLDEN_RATIO = (3.f - <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>(5.f)) / 2.f;</div>
<div class="line"><span class="lineno"> 48</span> <span class="keyword">const</span> <span class="keywordtype">double</span> M_GOLDEN_RATIO = (3.f - std::sqrt(5.f)) / 2.f;</div>
<div class="line"><span class="lineno"> 49</span> </div>
<div class="line"><span class="lineno"> 50</span> <span class="keywordtype">double</span> v = lim_a + M_GOLDEN_RATIO * (lim_b - lim_a);</div>
<div class="line"><span class="lineno"> 51</span> <span class="keywordtype">double</span> u, w = v, x = v;</div>
@@ -317,20 +357,13 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 130</span> iters++;</div>
<div class="line"><span class="lineno"> 131</span> } <span class="keywordflow">while</span> (std::abs(x - mid_point) &gt; (tolerance - (lim_b - lim_a) / 2.f));</div>
<div class="line"><span class="lineno"> 132</span> </div>
<div class="line"><span class="lineno"> 133</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; (iters: &quot;</span> &lt;&lt; iters &lt;&lt; <span class="stringliteral">&quot;) &quot;</span>;</div>
<div class="line"><span class="lineno"> 133</span> std::cout &lt;&lt; <span class="stringliteral">&quot; (iters: &quot;</span> &lt;&lt; iters &lt;&lt; <span class="stringliteral">&quot;) &quot;</span>;</div>
<div class="line"><span class="lineno"> 134</span> </div>
<div class="line"><span class="lineno"> 135</span> <span class="keywordflow">return</span> x;</div>
<div class="line"><span class="lineno"> 136</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::cerr</a></div></div>
<div class="ttc" id="abrent__method__extrema_8cpp_html_a002b2f4894492820fe708b1b7e7c5e70"><div class="ttname"><a href="#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a></div><div class="ttdeci">#define EPSILON</div><div class="ttdoc">system accuracy limit</div><div class="ttdef"><b>Definition</b> brent_method_extrema.cpp:24</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="aswap_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/swap.html">std::swap</a></div><div class="ttdeci">T swap(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/d01/brent__method__extrema_8cpp_a1aa76a6d5fd4d333f9072beff1dc486b_cgraph.svg" width="226" 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 class="ttc" id="abrent__method__extrema_8cpp_html_a002b2f4894492820fe708b1b7e7c5e70"><div class="ttname"><a href="#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a></div><div class="ttdeci">#define EPSILON</div><div class="ttdoc">system accuracy limit</div><div class="ttdef"><b>Definition</b> <a href="../../db/d01/brent__method__extrema_8cpp_source.html#l00024">brent_method_extrema.cpp:24</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> <a href="../../d4/d18/composite__simpson__rule_8cpp_source.html#l00113">composite_simpson_rule.cpp:113</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
@@ -348,10 +381,12 @@ Here is the call graph for this function:</div>
</table>
</div><div class="memdoc">
<p>Main function </p>
<p class="definition">Definition at line <a class="el" href="../../db/d01/brent__method__extrema_8cpp_source.html#l00205">205</a> of file <a class="el" href="../../db/d01/brent__method__extrema_8cpp_source.html">brent_method_extrema.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 205</span> {</div>
<div class="line"><span class="lineno"> 206</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a>.precision(18);</div>
<div class="line"><span class="lineno"> 206</span> std::cout.precision(18);</div>
<div class="line"><span class="lineno"> 207</span> </div>
<div class="line"><span class="lineno"> 208</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;Computations performed with machine epsilon: &quot;</span> &lt;&lt; <a class="code hl_define" href="#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a></div>
<div class="line"><span class="lineno"> 208</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Computations performed with machine epsilon: &quot;</span> &lt;&lt; <a class="code hl_define" href="#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a></div>
<div class="line"><span class="lineno"> 209</span> &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 210</span> </div>
<div class="line"><span class="lineno"> 211</span> <a class="code hl_function" href="#a1440a7779ac56f47a3f355ce4a8c7da0">test1</a>();</div>
@@ -360,15 +395,10 @@ Here is the call graph for this function:</div>
<div class="line"><span class="lineno"> 214</span> </div>
<div class="line"><span class="lineno"> 215</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 216</span>}</div>
<div class="ttc" id="abrent__method__extrema_8cpp_html_a0283886819c7c140a023582b7269e2d0"><div class="ttname"><a href="#a0283886819c7c140a023582b7269e2d0">test2</a></div><div class="ttdeci">void test2()</div><div class="ttdoc">Test function to find root for the function in the interval Expected result: .</div><div class="ttdef"><b>Definition</b> brent_method_extrema.cpp:166</div></div>
<div class="ttc" id="abrent__method__extrema_8cpp_html_a1440a7779ac56f47a3f355ce4a8c7da0"><div class="ttname"><a href="#a1440a7779ac56f47a3f355ce4a8c7da0">test1</a></div><div class="ttdeci">void test1()</div><div class="ttdoc">Test function to find root for the function in the interval Expected result = 2.</div><div class="ttdef"><b>Definition</b> brent_method_extrema.cpp:144</div></div>
<div class="ttc" id="abrent__method__extrema_8cpp_html_a6d0455dd5c30adda100e95f0423c786e"><div class="ttname"><a href="#a6d0455dd5c30adda100e95f0423c786e">test3</a></div><div class="ttdeci">void test3()</div><div class="ttdoc">Test function to find maxima for the function in the interval Expected result: .</div><div class="ttdef"><b>Definition</b> brent_method_extrema.cpp:189</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/d01/brent__method__extrema_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="422" 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 class="ttc" id="abrent__method__extrema_8cpp_html_a0283886819c7c140a023582b7269e2d0"><div class="ttname"><a href="#a0283886819c7c140a023582b7269e2d0">test2</a></div><div class="ttdeci">void test2()</div><div class="ttdoc">Test function to find root for the function in the interval Expected result: .</div><div class="ttdef"><b>Definition</b> <a href="../../db/d01/brent__method__extrema_8cpp_source.html#l00166">brent_method_extrema.cpp:166</a></div></div>
<div class="ttc" id="abrent__method__extrema_8cpp_html_a1440a7779ac56f47a3f355ce4a8c7da0"><div class="ttname"><a href="#a1440a7779ac56f47a3f355ce4a8c7da0">test1</a></div><div class="ttdeci">void test1()</div><div class="ttdoc">Test function to find root for the function in the interval Expected result = 2.</div><div class="ttdef"><b>Definition</b> <a href="../../db/d01/brent__method__extrema_8cpp_source.html#l00144">brent_method_extrema.cpp:144</a></div></div>
<div class="ttc" id="abrent__method__extrema_8cpp_html_a6d0455dd5c30adda100e95f0423c786e"><div class="ttname"><a href="#a6d0455dd5c30adda100e95f0423c786e">test3</a></div><div class="ttdeci">void test3()</div><div class="ttdoc">Test function to find maxima for the function in the interval Expected result: .</div><div class="ttdef"><b>Definition</b> <a href="../../db/d01/brent__method__extrema_8cpp_source.html#l00189">brent_method_extrema.cpp:189</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="a1440a7779ac56f47a3f355ce4a8c7da0" name="a1440a7779ac56f47a3f355ce4a8c7da0"></a>
@@ -388,29 +418,25 @@ Here is the call graph for this function:</div>
<p>Test function to find root for the function \(f(x)= (x-2)^2\) in the interval \([1,5]\) <br />
Expected result = 2. </p>
<p class="definition">Definition at line <a class="el" href="../../db/d01/brent__method__extrema_8cpp_source.html#l00144">144</a> of file <a class="el" href="../../db/d01/brent__method__extrema_8cpp_source.html">brent_method_extrema.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 144</span> {</div>
<div class="line"><span class="lineno"> 145</span> <span class="comment">// define the function to minimize as a lambda function</span></div>
<div class="line"><span class="lineno"> 146</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/functional/function.html">std::function</a>&lt;double(<span class="keywordtype">double</span>)&gt; f1 = [](<span class="keywordtype">double</span> x) {</div>
<div class="line"><span class="lineno"> 146</span> std::function&lt;double(<span class="keywordtype">double</span>)&gt; f1 = [](<span class="keywordtype">double</span> x) {</div>
<div class="line"><span class="lineno"> 147</span> <span class="keywordflow">return</span> (x - 2) * (x - 2);</div>
<div class="line"><span class="lineno"> 148</span> };</div>
<div class="line"><span class="lineno"> 149</span> </div>
<div class="line"><span class="lineno"> 150</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;Test 1.... &quot;</span>;</div>
<div class="line"><span class="lineno"> 150</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Test 1.... &quot;</span>;</div>
<div class="line"><span class="lineno"> 151</span> </div>
<div class="line"><span class="lineno"> 152</span> <span class="keywordtype">double</span> minima = <a class="code hl_function" href="#a1aa76a6d5fd4d333f9072beff1dc486b">get_minima</a>(f1, -1, 5);</div>
<div class="line"><span class="lineno"> 153</span> </div>
<div class="line"><span class="lineno"> 154</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; minima &lt;&lt; <span class="stringliteral">&quot;...&quot;</span>;</div>
<div class="line"><span class="lineno"> 154</span> std::cout &lt;&lt; minima &lt;&lt; <span class="stringliteral">&quot;...&quot;</span>;</div>
<div class="line"><span class="lineno"> 155</span> </div>
<div class="line"><span class="lineno"> 156</span> assert(std::abs(minima - 2) &lt; <a class="code hl_define" href="#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a>);</div>
<div class="line"><span class="lineno"> 157</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;passed\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 157</span> std::cout &lt;&lt; <span class="stringliteral">&quot;passed\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 158</span>}</div>
<div class="ttc" id="abrent__method__extrema_8cpp_html_a1aa76a6d5fd4d333f9072beff1dc486b"><div class="ttname"><a href="#a1aa76a6d5fd4d333f9072beff1dc486b">get_minima</a></div><div class="ttdeci">double get_minima(const std::function&lt; double(double)&gt; &amp;f, double lim_a, double lim_b)</div><div class="ttdoc">Get the real root of a function in the given interval.</div><div class="ttdef"><b>Definition</b> brent_method_extrema.cpp:36</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><!-- 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/d01/brent__method__extrema_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg" width="324" 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 class="ttc" id="abrent__method__extrema_8cpp_html_a1aa76a6d5fd4d333f9072beff1dc486b"><div class="ttname"><a href="#a1aa76a6d5fd4d333f9072beff1dc486b">get_minima</a></div><div class="ttdeci">double get_minima(const std::function&lt; double(double)&gt; &amp;f, double lim_a, double lim_b)</div><div class="ttdoc">Get the real root of a function in the given interval.</div><div class="ttdef"><b>Definition</b> <a href="../../db/d01/brent__method__extrema_8cpp_source.html#l00036">brent_method_extrema.cpp:36</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="a0283886819c7c140a023582b7269e2d0" name="a0283886819c7c140a023582b7269e2d0"></a>
@@ -430,29 +456,25 @@ Here is the call graph for this function:</div>
<p>Test function to find root for the function \(f(x)= x^{\frac{1}{x}}\) in the interval \([-2,10]\) <br />
Expected result: \(e\approx 2.71828182845904509\). </p>
<p class="definition">Definition at line <a class="el" href="../../db/d01/brent__method__extrema_8cpp_source.html#l00166">166</a> of file <a class="el" href="../../db/d01/brent__method__extrema_8cpp_source.html">brent_method_extrema.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 166</span> {</div>
<div class="line"><span class="lineno"> 167</span> <span class="comment">// define the function to maximize as a lambda function</span></div>
<div class="line"><span class="lineno"> 168</span> <span class="comment">// since we are maximixing, we negated the function return value</span></div>
<div class="line"><span class="lineno"> 169</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/functional/function.html">std::function</a>&lt;double(<span class="keywordtype">double</span>)&gt; func = [](<span class="keywordtype">double</span> x) {</div>
<div class="line"><span class="lineno"> 170</span> <span class="keywordflow">return</span> -<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>(x, 1.f / x);</div>
<div class="line"><span class="lineno"> 169</span> std::function&lt;double(<span class="keywordtype">double</span>)&gt; func = [](<span class="keywordtype">double</span> x) {</div>
<div class="line"><span class="lineno"> 170</span> <span class="keywordflow">return</span> -std::pow(x, 1.f / x);</div>
<div class="line"><span class="lineno"> 171</span> };</div>
<div class="line"><span class="lineno"> 172</span> </div>
<div class="line"><span class="lineno"> 173</span> <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;Test 2.... &quot;</span>;</div>
<div class="line"><span class="lineno"> 173</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Test 2.... &quot;</span>;</div>
<div class="line"><span class="lineno"> 174</span> </div>
<div class="line"><span class="lineno"> 175</span> <span class="keywordtype">double</span> minima = <a class="code hl_function" href="#a1aa76a6d5fd4d333f9072beff1dc486b">get_minima</a>(func, -2, 5);</div>
<div class="line"><span class="lineno"> 176</span> </div>
<div class="line"><span class="lineno"> 177</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; minima &lt;&lt; <span class="stringliteral">&quot; (&quot;</span> &lt;&lt; M_E &lt;&lt; <span class="stringliteral">&quot;)...&quot;</span>;</div>
<div class="line"><span class="lineno"> 177</span> std::cout &lt;&lt; minima &lt;&lt; <span class="stringliteral">&quot; (&quot;</span> &lt;&lt; M_E &lt;&lt; <span class="stringliteral">&quot;)...&quot;</span>;</div>
<div class="line"><span class="lineno"> 178</span> </div>
<div class="line"><span class="lineno"> 179</span> assert(std::abs(minima - M_E) &lt; <a class="code hl_define" href="#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a>);</div>
<div class="line"><span class="lineno"> 180</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;passed\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 180</span> std::cout &lt;&lt; <span class="stringliteral">&quot;passed\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 181</span>}</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="../../db/d01/brent__method__extrema_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg" width="324" height="110"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div><!-- fragment -->
</div>
</div>
<a id="a6d0455dd5c30adda100e95f0423c786e" name="a6d0455dd5c30adda100e95f0423c786e"></a>
@@ -472,27 +494,23 @@ Here is the call graph for this function:</div>
<p>Test function to find <em>maxima</em> for the function \(f(x)= \cos x\) in the interval \([0,12]\) <br />
Expected result: \(\pi\approx 3.14159265358979312\). </p>
<p class="definition">Definition at line <a class="el" href="../../db/d01/brent__method__extrema_8cpp_source.html#l00189">189</a> of file <a class="el" href="../../db/d01/brent__method__extrema_8cpp_source.html">brent_method_extrema.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 189</span> {</div>
<div class="line"><span class="lineno"> 190</span> <span class="comment">// define the function to maximize as a lambda function</span></div>
<div class="line"><span class="lineno"> 191</span> <span class="comment">// since we are maximixing, we negated the function return value</span></div>
<div class="line"><span class="lineno"> 192</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/functional/function.html">std::function</a>&lt;double(<span class="keywordtype">double</span>)&gt; func = [](<span class="keywordtype">double</span> x) { <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/cos.html">std::cos</a>(x); };</div>
<div class="line"><span class="lineno"> 192</span> std::function&lt;double(<span class="keywordtype">double</span>)&gt; func = [](<span class="keywordtype">double</span> x) { <span class="keywordflow">return</span> std::cos(x); };</div>
<div class="line"><span class="lineno"> 193</span> </div>
<div class="line"><span class="lineno"> 194</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;Test 3.... &quot;</span>;</div>
<div class="line"><span class="lineno"> 194</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Test 3.... &quot;</span>;</div>
<div class="line"><span class="lineno"> 195</span> </div>
<div class="line"><span class="lineno"> 196</span> <span class="keywordtype">double</span> minima = <a class="code hl_function" href="#a1aa76a6d5fd4d333f9072beff1dc486b">get_minima</a>(func, -4, 12);</div>
<div class="line"><span class="lineno"> 197</span> </div>
<div class="line"><span class="lineno"> 198</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; minima &lt;&lt; <span class="stringliteral">&quot; (&quot;</span> &lt;&lt; M_PI &lt;&lt; <span class="stringliteral">&quot;)...&quot;</span>;</div>
<div class="line"><span class="lineno"> 198</span> std::cout &lt;&lt; minima &lt;&lt; <span class="stringliteral">&quot; (&quot;</span> &lt;&lt; M_PI &lt;&lt; <span class="stringliteral">&quot;)...&quot;</span>;</div>
<div class="line"><span class="lineno"> 199</span> </div>
<div class="line"><span class="lineno"> 200</span> assert(std::abs(minima - M_PI) &lt; <a class="code hl_define" href="#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a>);</div>
<div class="line"><span class="lineno"> 201</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;passed\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 201</span> std::cout &lt;&lt; <span class="stringliteral">&quot;passed\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 202</span>}</div>
<div class="ttc" id="acos_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/cos.html">std::cos</a></div><div class="ttdeci">T cos(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/d01/brent__method__extrema_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.svg" width="324" height="110"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->

View File

@@ -1,11 +0,0 @@
<map id="test2" name="test2">
<area shape="rect" id="Node000001" title="Test function to find root for the function &#160;in the interval &#160;&#160;&#160;Expected result: ." alt="" coords="5,55,56,80"/>
<area shape="rect" id="Node000002" href="$db/d01/brent__method__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b" title="Get the real root of a function in the given interval." alt="" coords="104,29,192,55"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="56,60,88,52,89,58,57,65"/>
<area shape="rect" id="Node000005" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/pow.html#" title=" " alt="" coords="112,79,184,104"/>
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="57,70,97,79,96,84,56,75"/>
<area shape="rect" id="Node000003" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sqrt.html#" title=" " alt="" coords="244,5,314,31"/>
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="192,31,229,25,230,30,193,37"/>
<area shape="rect" id="Node000004" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap.html#" title=" " alt="" coords="240,55,318,80"/>
<area shape="poly" id="edge3_Node000002_Node000004" title=" " alt="" coords="193,48,225,54,224,60,192,53"/>
</map>

View File

@@ -1 +0,0 @@
14652a9c98011545eb5be58cdcf902f5

View File

@@ -1,119 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: test2 Pages: 1 -->
<svg width="243pt" height="82pt"
viewBox="0.00 0.00 242.75 82.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<style type="text/css"><![CDATA[
.node, .edge {opacity: 0.7;}
.node.selected, .edge.selected {opacity: 1;}
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 78.25)">
<title>test2</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Test function to find root for the function &#160;in the interval &#160;&#160;&#160;Expected result: .">
<polygon fill="#999999" stroke="#666666" points="37.75,-37.25 0,-37.25 0,-18 37.75,-18 37.75,-37.25"/>
<text text-anchor="middle" x="18.88" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">test2</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../db/d01/brent__method__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b" target="_top" xlink:title="Get the real root of a function in the given interval.">
<polygon fill="white" stroke="#666666" points="140,-56.25 73.75,-56.25 73.75,-37 140,-37 140,-56.25"/>
<text text-anchor="middle" x="106.88" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">get_minima</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M38.11,-31.65C45.24,-33.23 53.75,-35.11 62.29,-37"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.43,-40.39 71.95,-39.13 62.94,-33.55 61.43,-40.39"/>
</a>
</g>
</g>
<!-- Node5 -->
<g id="Node000005" class="node">
<title>Node5</title>
<g id="a_Node000005"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/pow.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="133.62,-19.25 80.12,-19.25 80.12,0 133.62,0 133.62,-19.25"/>
<text text-anchor="middle" x="106.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::pow</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node5 -->
<g id="edge4_Node000001_Node000005" class="edge">
<title>Node1&#45;&gt;Node5</title>
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M38.11,-23.81C47.02,-21.94 58.08,-19.63 68.66,-17.41"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="69.28,-20.86 78.35,-15.39 67.85,-14.01 69.28,-20.86"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="231.38,-74.25 179.38,-74.25 179.38,-55 231.38,-55 231.38,-74.25"/>
<text text-anchor="middle" x="205.38" y="-60.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::sqrt</text>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node3 -->
<g id="edge2_Node000002_Node000003" class="edge">
<title>Node2&#45;&gt;Node3</title>
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M140.28,-52.67C149.13,-54.32 158.79,-56.12 167.85,-57.81"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="166.96,-61.21 177.43,-59.6 168.24,-54.33 166.96,-61.21"/>
</a>
</g>
</g>
<!-- Node4 -->
<g id="Node000004" class="node">
<title>Node4</title>
<g id="a_Node000004"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="234.75,-37.25 176,-37.25 176,-18 234.75,-18 234.75,-37.25"/>
<text text-anchor="middle" x="205.38" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node4 -->
<g id="edge3_Node000002_Node000004" class="edge">
<title>Node2&#45;&gt;Node4</title>
<g id="a_edge3_Node000002_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M140.28,-40.25C148.09,-38.71 156.53,-37.05 164.64,-35.45"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="165.16,-38.91 174.3,-33.55 163.81,-32.04 165.16,-38.91"/>
</a>
</g>
</g>
</g>
</svg>
</svg>
<style type='text/css'>
<![CDATA[
[data-mouse-over-selected='false'] { opacity: 0.7; }
[data-mouse-over-selected='true'] { opacity: 1.0; }
]]>
</style>
<script type="application/ecmascript"><![CDATA[
document.addEventListener('DOMContentLoaded', (event) => {
highlightEdges();
highlightAdjacentNodes();
});
]]></script>
</svg>

Before

Width:  |  Height:  |  Size: 5.0 KiB

View File

@@ -1,93 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: test2 Pages: 1 -->
<svg width="243pt" height="82pt"
viewBox="0.00 0.00 242.75 82.25" 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 78.25)">
<title>test2</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Test function to find root for the function &#160;in the interval &#160;&#160;&#160;Expected result: .">
<polygon fill="#999999" stroke="#666666" points="37.75,-37.25 0,-37.25 0,-18 37.75,-18 37.75,-37.25"/>
<text text-anchor="middle" x="18.88" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">test2</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../db/d01/brent__method__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b" target="_top" xlink:title="Get the real root of a function in the given interval.">
<polygon fill="white" stroke="#666666" points="140,-56.25 73.75,-56.25 73.75,-37 140,-37 140,-56.25"/>
<text text-anchor="middle" x="106.88" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">get_minima</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M38.11,-31.65C45.24,-33.23 53.75,-35.11 62.29,-37"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.43,-40.39 71.95,-39.13 62.94,-33.55 61.43,-40.39"/>
</a>
</g>
</g>
<!-- Node5 -->
<g id="Node000005" class="node">
<title>Node5</title>
<g id="a_Node000005"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/pow.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="133.62,-19.25 80.12,-19.25 80.12,0 133.62,0 133.62,-19.25"/>
<text text-anchor="middle" x="106.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::pow</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node5 -->
<g id="edge4_Node000001_Node000005" class="edge">
<title>Node1&#45;&gt;Node5</title>
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M38.11,-23.81C47.02,-21.94 58.08,-19.63 68.66,-17.41"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="69.28,-20.86 78.35,-15.39 67.85,-14.01 69.28,-20.86"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="231.38,-74.25 179.38,-74.25 179.38,-55 231.38,-55 231.38,-74.25"/>
<text text-anchor="middle" x="205.38" y="-60.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::sqrt</text>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node3 -->
<g id="edge2_Node000002_Node000003" class="edge">
<title>Node2&#45;&gt;Node3</title>
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M140.28,-52.67C149.13,-54.32 158.79,-56.12 167.85,-57.81"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="166.96,-61.21 177.43,-59.6 168.24,-54.33 166.96,-61.21"/>
</a>
</g>
</g>
<!-- Node4 -->
<g id="Node000004" class="node">
<title>Node4</title>
<g id="a_Node000004"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="234.75,-37.25 176,-37.25 176,-18 234.75,-18 234.75,-37.25"/>
<text text-anchor="middle" x="205.38" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node4 -->
<g id="edge3_Node000002_Node000004" class="edge">
<title>Node2&#45;&gt;Node4</title>
<g id="a_edge3_Node000002_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M140.28,-40.25C148.09,-38.71 156.53,-37.05 164.64,-35.45"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="165.16,-38.91 174.3,-33.55 163.81,-32.04 165.16,-38.91"/>
</a>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -1,9 +0,0 @@
<map id="test1" name="test1">
<area shape="rect" id="Node000001" title="Test function to find root for the function &#160;in the interval &#160;&#160;&#160;Expected result = 2." alt="" coords="5,31,56,56"/>
<area shape="rect" id="Node000002" href="$db/d01/brent__method__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b" title="Get the real root of a function in the given interval." alt="" coords="104,31,192,56"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="56,41,88,41,88,46,56,46"/>
<area shape="rect" id="Node000003" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sqrt.html#" title=" " alt="" coords="244,5,314,31"/>
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="192,32,229,25,230,30,193,38"/>
<area shape="rect" id="Node000004" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap.html#" title=" " alt="" coords="240,55,318,80"/>
<area shape="poly" id="edge3_Node000002_Node000004" title=" " alt="" coords="193,49,225,55,224,60,192,54"/>
</map>

View File

@@ -1 +0,0 @@
ffef50ce6fc5d161d5b0ebd97455b9f6

View File

@@ -1,101 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: test1 Pages: 1 -->
<svg width="243pt" height="64pt"
viewBox="0.00 0.00 242.75 64.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<style type="text/css"><![CDATA[
.node, .edge {opacity: 0.7;}
.node.selected, .edge.selected {opacity: 1;}
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 60.25)">
<title>test1</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Test function to find root for the function &#160;in the interval &#160;&#160;&#160;Expected result = 2.">
<polygon fill="#999999" stroke="#666666" points="37.75,-37.25 0,-37.25 0,-18 37.75,-18 37.75,-37.25"/>
<text text-anchor="middle" x="18.88" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">test1</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../db/d01/brent__method__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b" target="_top" xlink:title="Get the real root of a function in the given interval.">
<polygon fill="white" stroke="#666666" points="140,-37.25 73.75,-37.25 73.75,-18 140,-18 140,-37.25"/>
<text text-anchor="middle" x="106.88" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">get_minima</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M38.11,-27.62C45.16,-27.62 53.56,-27.62 62.01,-27.62"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.91,-31.13 71.91,-27.63 61.91,-24.13 61.91,-31.13"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="231.38,-56.25 179.38,-56.25 179.38,-37 231.38,-37 231.38,-56.25"/>
<text text-anchor="middle" x="205.38" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::sqrt</text>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node3 -->
<g id="edge2_Node000002_Node000003" class="edge">
<title>Node2&#45;&gt;Node3</title>
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M140.28,-34C149.13,-35.75 158.79,-37.65 167.85,-39.43"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="166.95,-42.82 177.44,-41.32 168.3,-35.96 166.95,-42.82"/>
</a>
</g>
</g>
<!-- Node4 -->
<g id="Node000004" class="node">
<title>Node4</title>
<g id="a_Node000004"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="234.75,-19.25 176,-19.25 176,0 234.75,0 234.75,-19.25"/>
<text text-anchor="middle" x="205.38" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node4 -->
<g id="edge3_Node000002_Node000004" class="edge">
<title>Node2&#45;&gt;Node4</title>
<g id="a_edge3_Node000002_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M140.28,-21.58C148.09,-20.12 156.53,-18.55 164.64,-17.04"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="165.11,-20.51 174.29,-15.24 163.82,-13.63 165.11,-20.51"/>
</a>
</g>
</g>
</g>
</svg>
</svg>
<style type='text/css'>
<![CDATA[
[data-mouse-over-selected='false'] { opacity: 0.7; }
[data-mouse-over-selected='true'] { opacity: 1.0; }
]]>
</style>
<script type="application/ecmascript"><![CDATA[
document.addEventListener('DOMContentLoaded', (event) => {
highlightEdges();
highlightAdjacentNodes();
});
]]></script>
</svg>

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -1,75 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: test1 Pages: 1 -->
<svg width="243pt" height="64pt"
viewBox="0.00 0.00 242.75 64.25" 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 60.25)">
<title>test1</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Test function to find root for the function &#160;in the interval &#160;&#160;&#160;Expected result = 2.">
<polygon fill="#999999" stroke="#666666" points="37.75,-37.25 0,-37.25 0,-18 37.75,-18 37.75,-37.25"/>
<text text-anchor="middle" x="18.88" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">test1</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../db/d01/brent__method__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b" target="_top" xlink:title="Get the real root of a function in the given interval.">
<polygon fill="white" stroke="#666666" points="140,-37.25 73.75,-37.25 73.75,-18 140,-18 140,-37.25"/>
<text text-anchor="middle" x="106.88" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">get_minima</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M38.11,-27.62C45.16,-27.62 53.56,-27.62 62.01,-27.62"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.91,-31.13 71.91,-27.63 61.91,-24.13 61.91,-31.13"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="231.38,-56.25 179.38,-56.25 179.38,-37 231.38,-37 231.38,-56.25"/>
<text text-anchor="middle" x="205.38" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::sqrt</text>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node3 -->
<g id="edge2_Node000002_Node000003" class="edge">
<title>Node2&#45;&gt;Node3</title>
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M140.28,-34C149.13,-35.75 158.79,-37.65 167.85,-39.43"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="166.95,-42.82 177.44,-41.32 168.3,-35.96 166.95,-42.82"/>
</a>
</g>
</g>
<!-- Node4 -->
<g id="Node000004" class="node">
<title>Node4</title>
<g id="a_Node000004"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="234.75,-19.25 176,-19.25 176,0 234.75,0 234.75,-19.25"/>
<text text-anchor="middle" x="205.38" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node4 -->
<g id="edge3_Node000002_Node000004" class="edge">
<title>Node2&#45;&gt;Node4</title>
<g id="a_edge3_Node000002_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M140.28,-21.58C148.09,-20.12 156.53,-18.55 164.64,-17.04"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="165.11,-20.51 174.29,-15.24 163.82,-13.63 165.11,-20.51"/>
</a>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -1,7 +0,0 @@
<map id="get_minima" name="get_minima">
<area shape="rect" id="Node000001" title="Get the real root of a function in the given interval." alt="" coords="5,31,94,56"/>
<area shape="rect" id="Node000002" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sqrt.html#" title=" " alt="" coords="146,5,216,31"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="94,32,130,25,131,30,95,38"/>
<area shape="rect" id="Node000003" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap.html#" title=" " alt="" coords="142,55,220,80"/>
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="95,49,127,55,126,60,94,54"/>
</map>

View File

@@ -1 +0,0 @@
e288b36e24f716f01f00988b97207f0f

View File

@@ -1,83 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: get_minima Pages: 1 -->
<svg width="169pt" height="64pt"
viewBox="0.00 0.00 169.00 64.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<style type="text/css"><![CDATA[
.node, .edge {opacity: 0.7;}
.node.selected, .edge.selected {opacity: 1;}
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 60.25)">
<title>get_minima</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Get the real root of a function in the given interval.">
<polygon fill="#999999" stroke="#666666" points="66.25,-37.25 0,-37.25 0,-18 66.25,-18 66.25,-37.25"/>
<text text-anchor="middle" x="33.12" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">get_minima</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="157.62,-56.25 105.62,-56.25 105.62,-37 157.62,-37 157.62,-56.25"/>
<text text-anchor="middle" x="131.62" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::sqrt</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M66.53,-34C75.38,-35.75 85.04,-37.65 94.1,-39.43"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="93.2,-42.82 103.69,-41.32 94.55,-35.96 93.2,-42.82"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="161,-19.25 102.25,-19.25 102.25,0 161,0 161,-19.25"/>
<text text-anchor="middle" x="131.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge2_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M66.53,-21.58C74.34,-20.12 82.78,-18.55 90.89,-17.04"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="91.36,-20.51 100.54,-15.24 90.07,-13.63 91.36,-20.51"/>
</a>
</g>
</g>
</g>
</svg>
</svg>
<style type='text/css'>
<![CDATA[
[data-mouse-over-selected='false'] { opacity: 0.7; }
[data-mouse-over-selected='true'] { opacity: 1.0; }
]]>
</style>
<script type="application/ecmascript"><![CDATA[
document.addEventListener('DOMContentLoaded', (event) => {
highlightEdges();
highlightAdjacentNodes();
});
]]></script>
</svg>

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -1,57 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: get_minima Pages: 1 -->
<svg width="169pt" height="64pt"
viewBox="0.00 0.00 169.00 64.25" 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 60.25)">
<title>get_minima</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Get the real root of a function in the given interval.">
<polygon fill="#999999" stroke="#666666" points="66.25,-37.25 0,-37.25 0,-18 66.25,-18 66.25,-37.25"/>
<text text-anchor="middle" x="33.12" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">get_minima</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="157.62,-56.25 105.62,-56.25 105.62,-37 157.62,-37 157.62,-56.25"/>
<text text-anchor="middle" x="131.62" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::sqrt</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M66.53,-34C75.38,-35.75 85.04,-37.65 94.1,-39.43"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="93.2,-42.82 103.69,-41.32 94.55,-35.96 93.2,-42.82"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="161,-19.25 102.25,-19.25 102.25,0 161,0 161,-19.25"/>
<text text-anchor="middle" x="131.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge2_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M66.53,-21.58C74.34,-20.12 82.78,-18.55 90.89,-17.04"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="91.36,-20.51 100.54,-15.24 90.07,-13.63 91.36,-20.51"/>
</a>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -1,11 +0,0 @@
<map id="test3" name="test3">
<area shape="rect" id="Node000001" title="Test function to find maxima for the function &#160;in the interval &#160;&#160;&#160;Expected result: ." alt="" coords="5,31,56,56"/>
<area shape="rect" id="Node000002" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/cos.html#" title=" " alt="" coords="114,5,182,31"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="56,36,98,26,99,31,57,41"/>
<area shape="rect" id="Node000003" href="$db/d01/brent__method__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b" title="Get the real root of a function in the given interval." alt="" coords="104,55,192,80"/>
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="57,46,89,53,88,58,56,51"/>
<area shape="rect" id="Node000004" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sqrt.html#" title=" " alt="" coords="244,29,314,55"/>
<area shape="poly" id="edge3_Node000003_Node000004" title=" " alt="" coords="192,56,229,49,230,54,193,62"/>
<area shape="rect" id="Node000005" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap.html#" title=" " alt="" coords="240,79,318,104"/>
<area shape="poly" id="edge4_Node000003_Node000005" title=" " alt="" coords="193,73,225,79,224,84,192,78"/>
</map>

View File

@@ -1 +0,0 @@
f82f41e8556c3934fb11596d63fe5970

View File

@@ -1,119 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: test3 Pages: 1 -->
<svg width="243pt" height="82pt"
viewBox="0.00 0.00 242.75 82.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<style type="text/css"><![CDATA[
.node, .edge {opacity: 0.7;}
.node.selected, .edge.selected {opacity: 1;}
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 78.25)">
<title>test3</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Test function to find maxima for the function &#160;in the interval &#160;&#160;&#160;Expected result: .">
<polygon fill="#999999" stroke="#666666" points="37.75,-55.25 0,-55.25 0,-36 37.75,-36 37.75,-55.25"/>
<text text-anchor="middle" x="18.88" y="-41.75" font-family="Helvetica,sans-Serif" font-size="10.00">test3</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/cos.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="132.5,-74.25 81.25,-74.25 81.25,-55 132.5,-55 132.5,-74.25"/>
<text text-anchor="middle" x="106.88" y="-60.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::cos</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M38.11,-49.65C47.34,-51.69 58.86,-54.24 69.78,-56.65"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="68.81,-60.02 79.33,-58.76 70.33,-53.19 68.81,-60.02"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a xlink:href="../../db/d01/brent__method__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b" target="_top" xlink:title="Get the real root of a function in the given interval.">
<polygon fill="white" stroke="#666666" points="140,-37.25 73.75,-37.25 73.75,-18 140,-18 140,-37.25"/>
<text text-anchor="middle" x="106.88" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">get_minima</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge2_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M38.11,-41.81C45.24,-40.32 53.75,-38.53 62.29,-36.75"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="62.87,-40.2 71.94,-34.73 61.44,-33.35 62.87,-40.2"/>
</a>
</g>
</g>
<!-- Node4 -->
<g id="Node000004" class="node">
<title>Node4</title>
<g id="a_Node000004"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="231.38,-56.25 179.38,-56.25 179.38,-37 231.38,-37 231.38,-56.25"/>
<text text-anchor="middle" x="205.38" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::sqrt</text>
</a>
</g>
</g>
<!-- Node3&#45;&gt;Node4 -->
<g id="edge3_Node000003_Node000004" class="edge">
<title>Node3&#45;&gt;Node4</title>
<g id="a_edge3_Node000003_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M140.28,-34C149.13,-35.75 158.79,-37.65 167.85,-39.43"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="166.95,-42.82 177.44,-41.32 168.3,-35.96 166.95,-42.82"/>
</a>
</g>
</g>
<!-- Node5 -->
<g id="Node000005" class="node">
<title>Node5</title>
<g id="a_Node000005"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="234.75,-19.25 176,-19.25 176,0 234.75,0 234.75,-19.25"/>
<text text-anchor="middle" x="205.38" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
</a>
</g>
</g>
<!-- Node3&#45;&gt;Node5 -->
<g id="edge4_Node000003_Node000005" class="edge">
<title>Node3&#45;&gt;Node5</title>
<g id="a_edge4_Node000003_Node000005"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M140.28,-21.58C148.09,-20.12 156.53,-18.55 164.64,-17.04"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="165.11,-20.51 174.29,-15.24 163.82,-13.63 165.11,-20.51"/>
</a>
</g>
</g>
</g>
</svg>
</svg>
<style type='text/css'>
<![CDATA[
[data-mouse-over-selected='false'] { opacity: 0.7; }
[data-mouse-over-selected='true'] { opacity: 1.0; }
]]>
</style>
<script type="application/ecmascript"><![CDATA[
document.addEventListener('DOMContentLoaded', (event) => {
highlightEdges();
highlightAdjacentNodes();
});
]]></script>
</svg>

Before

Width:  |  Height:  |  Size: 5.0 KiB

View File

@@ -1,93 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: test3 Pages: 1 -->
<svg width="243pt" height="82pt"
viewBox="0.00 0.00 242.75 82.25" 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 78.25)">
<title>test3</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Test function to find maxima for the function &#160;in the interval &#160;&#160;&#160;Expected result: .">
<polygon fill="#999999" stroke="#666666" points="37.75,-55.25 0,-55.25 0,-36 37.75,-36 37.75,-55.25"/>
<text text-anchor="middle" x="18.88" y="-41.75" font-family="Helvetica,sans-Serif" font-size="10.00">test3</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/cos.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="132.5,-74.25 81.25,-74.25 81.25,-55 132.5,-55 132.5,-74.25"/>
<text text-anchor="middle" x="106.88" y="-60.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::cos</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M38.11,-49.65C47.34,-51.69 58.86,-54.24 69.78,-56.65"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="68.81,-60.02 79.33,-58.76 70.33,-53.19 68.81,-60.02"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a xlink:href="../../db/d01/brent__method__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b" target="_top" xlink:title="Get the real root of a function in the given interval.">
<polygon fill="white" stroke="#666666" points="140,-37.25 73.75,-37.25 73.75,-18 140,-18 140,-37.25"/>
<text text-anchor="middle" x="106.88" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">get_minima</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge2_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M38.11,-41.81C45.24,-40.32 53.75,-38.53 62.29,-36.75"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="62.87,-40.2 71.94,-34.73 61.44,-33.35 62.87,-40.2"/>
</a>
</g>
</g>
<!-- Node4 -->
<g id="Node000004" class="node">
<title>Node4</title>
<g id="a_Node000004"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="231.38,-56.25 179.38,-56.25 179.38,-37 231.38,-37 231.38,-56.25"/>
<text text-anchor="middle" x="205.38" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::sqrt</text>
</a>
</g>
</g>
<!-- Node3&#45;&gt;Node4 -->
<g id="edge3_Node000003_Node000004" class="edge">
<title>Node3&#45;&gt;Node4</title>
<g id="a_edge3_Node000003_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M140.28,-34C149.13,-35.75 158.79,-37.65 167.85,-39.43"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="166.95,-42.82 177.44,-41.32 168.3,-35.96 166.95,-42.82"/>
</a>
</g>
</g>
<!-- Node5 -->
<g id="Node000005" class="node">
<title>Node5</title>
<g id="a_Node000005"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="234.75,-19.25 176,-19.25 176,0 234.75,0 234.75,-19.25"/>
<text text-anchor="middle" x="205.38" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
</a>
</g>
</g>
<!-- Node3&#45;&gt;Node5 -->
<g id="edge4_Node000003_Node000005" class="edge">
<title>Node3&#45;&gt;Node5</title>
<g id="a_edge4_Node000003_Node000005"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M140.28,-21.58C148.09,-20.12 156.53,-18.55 164.64,-17.04"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="165.11,-20.51 174.29,-15.24 163.82,-13.63 165.11,-20.51"/>
</a>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -1,21 +0,0 @@
<map id="main" name="main">
<area shape="rect" id="Node000001" title=" " alt="" coords="5,55,55,80"/>
<area shape="rect" id="Node000002" href="$db/d01/brent__method__extrema_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0" title="Test function to find root for the function &#160;in the interval &#160;&#160;&#160;Expected result = 2." alt="" coords="103,55,153,80"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="55,65,88,65,88,70,55,70"/>
<area shape="rect" id="Node000006" href="$db/d01/brent__method__extrema_8cpp.html#a0283886819c7c140a023582b7269e2d0" title="Test function to find root for the function &#160;in the interval &#160;&#160;&#160;Expected result: ." alt="" coords="103,5,153,31"/>
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="54,53,88,35,90,40,56,58"/>
<area shape="rect" id="Node000008" href="$db/d01/brent__method__extrema_8cpp.html#a6d0455dd5c30adda100e95f0423c786e" title="Test function to find maxima for the function &#160;in the interval &#160;&#160;&#160;Expected result: ." alt="" coords="103,104,153,130"/>
<area shape="poly" id="edge8_Node000001_Node000008" title=" " alt="" coords="56,77,90,95,88,100,54,82"/>
<area shape="rect" id="Node000003" href="$db/d01/brent__method__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b" title="Get the real root of a function in the given interval." alt="" coords="201,55,289,80"/>
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="153,65,185,65,185,70,153,70"/>
<area shape="rect" id="Node000004" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sqrt.html#" title=" " alt="" coords="342,31,411,56"/>
<area shape="poly" id="edge3_Node000003_Node000004" title=" " alt="" coords="289,57,326,50,327,55,290,62"/>
<area shape="rect" id="Node000005" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap.html#" title=" " alt="" coords="337,80,416,106"/>
<area shape="poly" id="edge4_Node000003_Node000005" title=" " alt="" coords="290,73,323,80,322,85,289,79"/>
<area shape="poly" id="edge6_Node000006_Node000003" title=" " alt="" coords="155,26,200,46,198,51,152,31"/>
<area shape="rect" id="Node000007" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/pow.html#" title=" " alt="" coords="210,5,281,31"/>
<area shape="poly" id="edge7_Node000006_Node000007" title=" " alt="" coords="153,16,194,16,194,21,153,21"/>
<area shape="poly" id="edge10_Node000008_Node000003" title=" " alt="" coords="152,104,198,84,200,89,155,109"/>
<area shape="rect" id="Node000009" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/cos.html#" title=" " alt="" coords="211,104,279,130"/>
<area shape="poly" id="edge9_Node000008_Node000009" title=" " alt="" coords="153,114,195,114,195,120,153,120"/>
</map>

View File

@@ -1 +0,0 @@
0e4ba6442127a29c9d76da28e5277598

View File

@@ -1,209 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: main Pages: 1 -->
<svg width="316pt" height="101pt"
viewBox="0.00 0.00 315.75 101.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<style type="text/css"><![CDATA[
.node, .edge {opacity: 0.7;}
.node.selected, .edge.selected {opacity: 1;}
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 97.25)">
<title>main</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title=" ">
<polygon fill="#999999" stroke="#666666" points="37,-56.25 0,-56.25 0,-37 37,-37 37,-56.25"/>
<text text-anchor="middle" x="18.5" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../db/d01/brent__method__extrema_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0" target="_top" xlink:title="Test function to find root for the function &#160;in the interval &#160;&#160;&#160;Expected result = 2.">
<polygon fill="white" stroke="#666666" points="110.75,-56.25 73,-56.25 73,-37 110.75,-37 110.75,-56.25"/>
<text text-anchor="middle" x="91.88" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">test1</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.14,-46.62C44.55,-46.62 53.37,-46.62 61.69,-46.62"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.43,-50.13 71.43,-46.63 61.43,-43.13 61.43,-50.13"/>
</a>
</g>
</g>
<!-- Node6 -->
<g id="Node000006" class="node">
<title>Node6</title>
<g id="a_Node000006"><a xlink:href="../../db/d01/brent__method__extrema_8cpp.html#a0283886819c7c140a023582b7269e2d0" target="_top" xlink:title="Test function to find root for the function &#160;in the interval &#160;&#160;&#160;Expected result: .">
<polygon fill="white" stroke="#666666" points="110.75,-93.25 73,-93.25 73,-74 110.75,-74 110.75,-93.25"/>
<text text-anchor="middle" x="91.88" y="-79.75" font-family="Helvetica,sans-Serif" font-size="10.00">test2</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node6 -->
<g id="edge5_Node000001_Node000006" class="edge">
<title>Node1&#45;&gt;Node6</title>
<g id="a_edge5_Node000001_Node000006"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.14,-55.77C44.89,-59.79 54.18,-64.6 62.84,-69.09"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.11,-72.14 71.6,-73.63 64.33,-65.92 61.11,-72.14"/>
</a>
</g>
</g>
<!-- Node8 -->
<g id="Node000008" class="node">
<title>Node8</title>
<g id="a_Node000008"><a xlink:href="../../db/d01/brent__method__extrema_8cpp.html#a6d0455dd5c30adda100e95f0423c786e" target="_top" xlink:title="Test function to find maxima for the function &#160;in the interval &#160;&#160;&#160;Expected result: .">
<polygon fill="white" stroke="#666666" points="110.75,-19.25 73,-19.25 73,0 110.75,0 110.75,-19.25"/>
<text text-anchor="middle" x="91.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">test3</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node8 -->
<g id="edge8_Node000001_Node000008" class="edge">
<title>Node1&#45;&gt;Node8</title>
<g id="a_edge8_Node000001_Node000008"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.14,-37.48C44.89,-33.46 54.18,-28.65 62.84,-24.16"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="64.33,-27.33 71.6,-19.62 61.11,-21.11 64.33,-27.33"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a xlink:href="../../db/d01/brent__method__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b" target="_top" xlink:title="Get the real root of a function in the given interval.">
<polygon fill="white" stroke="#666666" points="213,-56.25 146.75,-56.25 146.75,-37 213,-37 213,-56.25"/>
<text text-anchor="middle" x="179.88" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">get_minima</text>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node3 -->
<g id="edge2_Node000002_Node000003" class="edge">
<title>Node2&#45;&gt;Node3</title>
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M111.11,-46.62C118.16,-46.62 126.56,-46.62 135.01,-46.62"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="134.91,-50.13 144.91,-46.63 134.91,-43.13 134.91,-50.13"/>
</a>
</g>
</g>
<!-- Node4 -->
<g id="Node000004" class="node">
<title>Node4</title>
<g id="a_Node000004"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="304.38,-74.25 252.38,-74.25 252.38,-55 304.38,-55 304.38,-74.25"/>
<text text-anchor="middle" x="278.38" y="-60.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::sqrt</text>
</a>
</g>
</g>
<!-- Node3&#45;&gt;Node4 -->
<g id="edge3_Node000003_Node000004" class="edge">
<title>Node3&#45;&gt;Node4</title>
<g id="a_edge3_Node000003_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M213.28,-52.67C222.13,-54.32 231.79,-56.12 240.85,-57.81"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="239.96,-61.21 250.43,-59.6 241.24,-54.33 239.96,-61.21"/>
</a>
</g>
</g>
<!-- Node5 -->
<g id="Node000005" class="node">
<title>Node5</title>
<g id="a_Node000005"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="307.75,-37.25 249,-37.25 249,-18 307.75,-18 307.75,-37.25"/>
<text text-anchor="middle" x="278.38" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
</a>
</g>
</g>
<!-- Node3&#45;&gt;Node5 -->
<g id="edge4_Node000003_Node000005" class="edge">
<title>Node3&#45;&gt;Node5</title>
<g id="a_edge4_Node000003_Node000005"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M213.28,-40.25C221.09,-38.71 229.53,-37.05 237.64,-35.45"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="238.16,-38.91 247.3,-33.55 236.81,-32.04 238.16,-38.91"/>
</a>
</g>
</g>
<!-- Node6&#45;&gt;Node3 -->
<g id="edge6_Node000006_Node000003" class="edge">
<title>Node6&#45;&gt;Node3</title>
<g id="a_edge6_Node000006_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M111.11,-75.78C121,-71.52 133.55,-66.13 145.14,-61.14"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="146.23,-64.48 154.03,-57.31 143.47,-58.05 146.23,-64.48"/>
</a>
</g>
</g>
<!-- Node7 -->
<g id="Node000007" class="node">
<title>Node7</title>
<g id="a_Node000007"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/pow.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="206.62,-93.25 153.12,-93.25 153.12,-74 206.62,-74 206.62,-93.25"/>
<text text-anchor="middle" x="179.88" y="-79.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::pow</text>
</a>
</g>
</g>
<!-- Node6&#45;&gt;Node7 -->
<g id="edge7_Node000006_Node000007" class="edge">
<title>Node6&#45;&gt;Node7</title>
<g id="a_edge7_Node000006_Node000007"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M111.11,-83.62C119.93,-83.62 130.84,-83.62 141.32,-83.62"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="141.32,-87.13 151.32,-83.63 141.32,-80.13 141.32,-87.13"/>
</a>
</g>
</g>
<!-- Node8&#45;&gt;Node3 -->
<g id="edge10_Node000008_Node000003" class="edge">
<title>Node8&#45;&gt;Node3</title>
<g id="a_edge10_Node000008_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M111.11,-17.47C121,-21.73 133.55,-27.12 145.14,-32.11"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="143.47,-35.2 154.03,-35.94 146.23,-28.77 143.47,-35.2"/>
</a>
</g>
</g>
<!-- Node9 -->
<g id="Node000009" class="node">
<title>Node9</title>
<g id="a_Node000009"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/cos.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="205.5,-19.25 154.25,-19.25 154.25,0 205.5,0 205.5,-19.25"/>
<text text-anchor="middle" x="179.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::cos</text>
</a>
</g>
</g>
<!-- Node8&#45;&gt;Node9 -->
<g id="edge9_Node000008_Node000009" class="edge">
<title>Node8&#45;&gt;Node9</title>
<g id="a_edge9_Node000008_Node000009"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M111.11,-9.62C120.24,-9.62 131.62,-9.62 142.43,-9.62"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="142.3,-13.13 152.3,-9.63 142.3,-6.13 142.3,-13.13"/>
</a>
</g>
</g>
</g>
</svg>
</svg>
<style type='text/css'>
<![CDATA[
[data-mouse-over-selected='false'] { opacity: 0.7; }
[data-mouse-over-selected='true'] { opacity: 1.0; }
]]>
</style>
<script type="application/ecmascript"><![CDATA[
document.addEventListener('DOMContentLoaded', (event) => {
highlightEdges();
highlightAdjacentNodes();
});
]]></script>
</svg>

Before

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -1,183 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: main Pages: 1 -->
<svg width="316pt" height="101pt"
viewBox="0.00 0.00 315.75 101.25" 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 97.25)">
<title>main</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title=" ">
<polygon fill="#999999" stroke="#666666" points="37,-56.25 0,-56.25 0,-37 37,-37 37,-56.25"/>
<text text-anchor="middle" x="18.5" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../db/d01/brent__method__extrema_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0" target="_top" xlink:title="Test function to find root for the function &#160;in the interval &#160;&#160;&#160;Expected result = 2.">
<polygon fill="white" stroke="#666666" points="110.75,-56.25 73,-56.25 73,-37 110.75,-37 110.75,-56.25"/>
<text text-anchor="middle" x="91.88" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">test1</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.14,-46.62C44.55,-46.62 53.37,-46.62 61.69,-46.62"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.43,-50.13 71.43,-46.63 61.43,-43.13 61.43,-50.13"/>
</a>
</g>
</g>
<!-- Node6 -->
<g id="Node000006" class="node">
<title>Node6</title>
<g id="a_Node000006"><a xlink:href="../../db/d01/brent__method__extrema_8cpp.html#a0283886819c7c140a023582b7269e2d0" target="_top" xlink:title="Test function to find root for the function &#160;in the interval &#160;&#160;&#160;Expected result: .">
<polygon fill="white" stroke="#666666" points="110.75,-93.25 73,-93.25 73,-74 110.75,-74 110.75,-93.25"/>
<text text-anchor="middle" x="91.88" y="-79.75" font-family="Helvetica,sans-Serif" font-size="10.00">test2</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node6 -->
<g id="edge5_Node000001_Node000006" class="edge">
<title>Node1&#45;&gt;Node6</title>
<g id="a_edge5_Node000001_Node000006"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.14,-55.77C44.89,-59.79 54.18,-64.6 62.84,-69.09"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.11,-72.14 71.6,-73.63 64.33,-65.92 61.11,-72.14"/>
</a>
</g>
</g>
<!-- Node8 -->
<g id="Node000008" class="node">
<title>Node8</title>
<g id="a_Node000008"><a xlink:href="../../db/d01/brent__method__extrema_8cpp.html#a6d0455dd5c30adda100e95f0423c786e" target="_top" xlink:title="Test function to find maxima for the function &#160;in the interval &#160;&#160;&#160;Expected result: .">
<polygon fill="white" stroke="#666666" points="110.75,-19.25 73,-19.25 73,0 110.75,0 110.75,-19.25"/>
<text text-anchor="middle" x="91.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">test3</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node8 -->
<g id="edge8_Node000001_Node000008" class="edge">
<title>Node1&#45;&gt;Node8</title>
<g id="a_edge8_Node000001_Node000008"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.14,-37.48C44.89,-33.46 54.18,-28.65 62.84,-24.16"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="64.33,-27.33 71.6,-19.62 61.11,-21.11 64.33,-27.33"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a xlink:href="../../db/d01/brent__method__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b" target="_top" xlink:title="Get the real root of a function in the given interval.">
<polygon fill="white" stroke="#666666" points="213,-56.25 146.75,-56.25 146.75,-37 213,-37 213,-56.25"/>
<text text-anchor="middle" x="179.88" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">get_minima</text>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node3 -->
<g id="edge2_Node000002_Node000003" class="edge">
<title>Node2&#45;&gt;Node3</title>
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M111.11,-46.62C118.16,-46.62 126.56,-46.62 135.01,-46.62"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="134.91,-50.13 144.91,-46.63 134.91,-43.13 134.91,-50.13"/>
</a>
</g>
</g>
<!-- Node4 -->
<g id="Node000004" class="node">
<title>Node4</title>
<g id="a_Node000004"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="304.38,-74.25 252.38,-74.25 252.38,-55 304.38,-55 304.38,-74.25"/>
<text text-anchor="middle" x="278.38" y="-60.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::sqrt</text>
</a>
</g>
</g>
<!-- Node3&#45;&gt;Node4 -->
<g id="edge3_Node000003_Node000004" class="edge">
<title>Node3&#45;&gt;Node4</title>
<g id="a_edge3_Node000003_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M213.28,-52.67C222.13,-54.32 231.79,-56.12 240.85,-57.81"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="239.96,-61.21 250.43,-59.6 241.24,-54.33 239.96,-61.21"/>
</a>
</g>
</g>
<!-- Node5 -->
<g id="Node000005" class="node">
<title>Node5</title>
<g id="a_Node000005"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="307.75,-37.25 249,-37.25 249,-18 307.75,-18 307.75,-37.25"/>
<text text-anchor="middle" x="278.38" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
</a>
</g>
</g>
<!-- Node3&#45;&gt;Node5 -->
<g id="edge4_Node000003_Node000005" class="edge">
<title>Node3&#45;&gt;Node5</title>
<g id="a_edge4_Node000003_Node000005"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M213.28,-40.25C221.09,-38.71 229.53,-37.05 237.64,-35.45"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="238.16,-38.91 247.3,-33.55 236.81,-32.04 238.16,-38.91"/>
</a>
</g>
</g>
<!-- Node6&#45;&gt;Node3 -->
<g id="edge6_Node000006_Node000003" class="edge">
<title>Node6&#45;&gt;Node3</title>
<g id="a_edge6_Node000006_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M111.11,-75.78C121,-71.52 133.55,-66.13 145.14,-61.14"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="146.23,-64.48 154.03,-57.31 143.47,-58.05 146.23,-64.48"/>
</a>
</g>
</g>
<!-- Node7 -->
<g id="Node000007" class="node">
<title>Node7</title>
<g id="a_Node000007"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/pow.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="206.62,-93.25 153.12,-93.25 153.12,-74 206.62,-74 206.62,-93.25"/>
<text text-anchor="middle" x="179.88" y="-79.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::pow</text>
</a>
</g>
</g>
<!-- Node6&#45;&gt;Node7 -->
<g id="edge7_Node000006_Node000007" class="edge">
<title>Node6&#45;&gt;Node7</title>
<g id="a_edge7_Node000006_Node000007"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M111.11,-83.62C119.93,-83.62 130.84,-83.62 141.32,-83.62"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="141.32,-87.13 151.32,-83.63 141.32,-80.13 141.32,-87.13"/>
</a>
</g>
</g>
<!-- Node8&#45;&gt;Node3 -->
<g id="edge10_Node000008_Node000003" class="edge">
<title>Node8&#45;&gt;Node3</title>
<g id="a_edge10_Node000008_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M111.11,-17.47C121,-21.73 133.55,-27.12 145.14,-32.11"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="143.47,-35.2 154.03,-35.94 146.23,-28.77 143.47,-35.2"/>
</a>
</g>
</g>
<!-- Node9 -->
<g id="Node000009" class="node">
<title>Node9</title>
<g id="a_Node000009"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/cos.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="205.5,-19.25 154.25,-19.25 154.25,0 205.5,0 205.5,-19.25"/>
<text text-anchor="middle" x="179.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::cos</text>
</a>
</g>
</g>
<!-- Node8&#45;&gt;Node9 -->
<g id="edge9_Node000008_Node000009" class="edge">
<title>Node8&#45;&gt;Node9</title>
<g id="a_edge9_Node000008_Node000009"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M111.11,-9.62C120.24,-9.62 131.62,-9.62 142.43,-9.62"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="142.3,-13.13 152.3,-9.63 142.3,-6.13 142.3,-13.13"/>
</a>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 8.4 KiB

View File

@@ -0,0 +1,330 @@
<!-- HTML header for doxygen 1.12.0-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>TheAlgorithms/C++: numerical_methods/brent_method_extrema.cpp Source File</title>
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
</script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
window.MathJax = {
options: {
ignoreHtmlClass: 'tex2jax_ignore',
processHtmlClass: 'tex2jax_process'
},
loader: {
load: ['[tex]/ams']
},
tex: {
macros: {},
packages: ['base','configmacros','ams']
}
};
</script>
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
<td id="projectalign">
<div id="projectname">TheAlgorithms/C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">All the algorithms implemented in C++</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.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('db/d01/brent__method__extrema_8cpp_source.html','../../'); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">brent_method_extrema.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../db/d01/brent__method__extrema_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"><a class="line" href="../../db/d01/brent__method__extrema_8cpp.html#a525335710b53cb064ca56b936120431e"> 16</a></span><span class="preprocessor">#define _USE_MATH_DEFINES </span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include &lt;cassert&gt;</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include &lt;cmath&gt;</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include &lt;cstdint&gt;</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include &lt;limits&gt;</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="foldopen" id="foldopen00024" data-start="" data-end="">
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="../../db/d01/brent__method__extrema_8cpp.html#a002b2f4894492820fe708b1b7e7c5e70"> 24</a></span><span class="preprocessor">#define EPSILON \</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor"> std::sqrt( \</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor"> std::numeric_limits&lt;double&gt;::epsilon()) </span></div>
</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> </div>
<div class="foldopen" id="foldopen00036" data-start="{" data-end="}">
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="../../db/d01/brent__method__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b"> 36</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../db/d01/brent__method__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b">get_minima</a>(<span class="keyword">const</span> std::function&lt;<span class="keywordtype">double</span>(<span class="keywordtype">double</span>)&gt; &amp;f, <span class="keywordtype">double</span> lim_a,</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keywordtype">double</span> lim_b) {</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> uint32_t iters = 0;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keywordflow">if</span> (lim_a &gt; lim_b) {</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> std::swap(lim_a, lim_b);</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (std::abs(lim_a - lim_b) &lt;= <a class="code hl_define" href="../../db/d01/brent__method__extrema_8cpp.html#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a>) {</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> std::cerr &lt;&lt; <span class="stringliteral">&quot;Search range must be greater than &quot;</span> &lt;&lt; <a class="code hl_define" href="../../db/d01/brent__method__extrema_8cpp.html#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a> &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordflow">return</span> lim_a;</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> }</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> </div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="comment">// golden ratio value</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keyword">const</span> <span class="keywordtype">double</span> M_GOLDEN_RATIO = (3.f - std::sqrt(5.f)) / 2.f;</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> </div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keywordtype">double</span> v = lim_a + M_GOLDEN_RATIO * (lim_b - lim_a);</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordtype">double</span> u, w = v, x = v;</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordtype">double</span> fu, fv = f(v);</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keywordtype">double</span> fw = fv, fx = fv;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordtype">double</span> mid_point = (lim_a + lim_b) / 2.f;</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keywordtype">double</span> p = 0, q = 0, r = 0;</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keywordtype">double</span> d, e = 0;</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keywordtype">double</span> tolerance, tolerance2;</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordflow">do</span> {</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> mid_point = (lim_a + lim_b) / 2.f;</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> tolerance = <a class="code hl_define" href="../../db/d01/brent__method__extrema_8cpp.html#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a> * std::abs(x);</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> tolerance2 = 2 * tolerance;</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordflow">if</span> (std::abs(e) &gt; tolerance2) {</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="comment">// fit parabola</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> r = (x - w) * (fx - fv);</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> q = (x - v) * (fx - fw);</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> p = (x - v) * q - (x - w) * r;</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> q = 2.f * (q - r);</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordflow">if</span> (q &gt; 0)</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> p = -p;</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keywordflow">else</span></div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> q = -q;</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> r = e;</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> e = d;</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</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> <span class="keywordflow">if</span> (std::abs(p) &lt; std::abs(0.5 * q * r) &amp;&amp; p &lt; q * (lim_b - x)) {</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="comment">// parabolic interpolation step</span></div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> d = p / q;</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> u = x + d;</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keywordflow">if</span> (u - lim_a &lt; tolerance2 || lim_b - u &lt; tolerance2)</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> d = x &lt; mid_point ? tolerance : -tolerance;</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="comment">// golden section interpolation step</span></div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> e = (x &lt; mid_point ? lim_b : lim_a) - x;</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> d = M_GOLDEN_RATIO * e;</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> }</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> </div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="comment">// evaluate not too close to x</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keywordflow">if</span> (std::abs(d) &gt;= tolerance)</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> u = d;</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (d &gt; 0)</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> u = tolerance;</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="keywordflow">else</span></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> u = -tolerance;</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> u += x;</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> fu = f(u);</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> </div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="comment">// update variables</span></div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="keywordflow">if</span> (fu &lt;= fx) {</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keywordflow">if</span> (u &lt; x)</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> lim_b = x;</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keywordflow">else</span></div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> lim_a = x;</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> v = w;</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> fv = fw;</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> w = x;</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> fw = fx;</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> x = u;</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> fx = fu;</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="keywordflow">if</span> (u &lt; x)</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> lim_a = u;</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keywordflow">else</span></div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> lim_b = u;</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordflow">if</span> (fu &lt;= fw || x == w) {</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> v = w;</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> fv = fw;</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> w = u;</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> fw = fu;</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (fu &lt;= fv || v == x || v == w) {</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> v = u;</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> fv = fu;</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> }</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> }</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> </div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> iters++;</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> } <span class="keywordflow">while</span> (std::abs(x - mid_point) &gt; (tolerance - (lim_b - lim_a) / 2.f));</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> </div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> std::cout &lt;&lt; <span class="stringliteral">&quot; (iters: &quot;</span> &lt;&lt; iters &lt;&lt; <span class="stringliteral">&quot;) &quot;</span>;</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> </div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="keywordflow">return</span> x;</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span>}</div>
</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> </div>
<div class="foldopen" id="foldopen00144" data-start="{" data-end="}">
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"><a class="line" href="../../db/d01/brent__method__extrema_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0"> 144</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d01/brent__method__extrema_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0">test1</a>() {</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <span class="comment">// define the function to minimize as a lambda function</span></div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> std::function&lt;double(<span class="keywordtype">double</span>)&gt; f1 = [](<span class="keywordtype">double</span> x) {</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keywordflow">return</span> (x - 2) * (x - 2);</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> </div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Test 1.... &quot;</span>;</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> </div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <span class="keywordtype">double</span> minima = <a class="code hl_function" href="../../db/d01/brent__method__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b">get_minima</a>(f1, -1, 5);</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> std::cout &lt;&lt; minima &lt;&lt; <span class="stringliteral">&quot;...&quot;</span>;</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> assert(std::abs(minima - 2) &lt; <a class="code hl_define" href="../../db/d01/brent__method__extrema_8cpp.html#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a>);</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> std::cout &lt;&lt; <span class="stringliteral">&quot;passed\n&quot;</span>;</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span>}</div>
</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> </div>
<div class="foldopen" id="foldopen00166" data-start="{" data-end="}">
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"><a class="line" href="../../db/d01/brent__method__extrema_8cpp.html#a0283886819c7c140a023582b7269e2d0"> 166</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d01/brent__method__extrema_8cpp.html#a0283886819c7c140a023582b7269e2d0">test2</a>() {</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <span class="comment">// define the function to maximize as a lambda function</span></div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <span class="comment">// since we are maximixing, we negated the function return value</span></div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> std::function&lt;double(<span class="keywordtype">double</span>)&gt; func = [](<span class="keywordtype">double</span> x) {</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> <span class="keywordflow">return</span> -std::pow(x, 1.f / x);</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> };</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> </div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Test 2.... &quot;</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">double</span> minima = <a class="code hl_function" href="../../db/d01/brent__method__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b">get_minima</a>(func, -2, 5);</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> std::cout &lt;&lt; minima &lt;&lt; <span class="stringliteral">&quot; (&quot;</span> &lt;&lt; M_E &lt;&lt; <span class="stringliteral">&quot;)...&quot;</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> assert(std::abs(minima - M_E) &lt; <a class="code hl_define" href="../../db/d01/brent__method__extrema_8cpp.html#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a>);</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> std::cout &lt;&lt; <span class="stringliteral">&quot;passed\n&quot;</span>;</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span>}</div>
</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> </div>
<div class="foldopen" id="foldopen00189" data-start="{" data-end="}">
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"><a class="line" href="../../db/d01/brent__method__extrema_8cpp.html#a6d0455dd5c30adda100e95f0423c786e"> 189</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d01/brent__method__extrema_8cpp.html#a6d0455dd5c30adda100e95f0423c786e">test3</a>() {</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> <span class="comment">// define the function to maximize as a lambda function</span></div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> <span class="comment">// since we are maximixing, we negated the function return value</span></div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> std::function&lt;double(<span class="keywordtype">double</span>)&gt; func = [](<span class="keywordtype">double</span> x) { <span class="keywordflow">return</span> std::cos(x); };</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> </div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Test 3.... &quot;</span>;</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="keywordtype">double</span> minima = <a class="code hl_function" href="../../db/d01/brent__method__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b">get_minima</a>(func, -4, 12);</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> </div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> std::cout &lt;&lt; minima &lt;&lt; <span class="stringliteral">&quot; (&quot;</span> &lt;&lt; M_PI &lt;&lt; <span class="stringliteral">&quot;)...&quot;</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> assert(std::abs(minima - M_PI) &lt; <a class="code hl_define" href="../../db/d01/brent__method__extrema_8cpp.html#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a>);</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> std::cout &lt;&lt; <span class="stringliteral">&quot;passed\n&quot;</span>;</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span>}</div>
</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> </div>
<div class="foldopen" id="foldopen00205" data-start="{" data-end="}">
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"><a class="line" href="../../db/d01/brent__method__extrema_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 205</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../db/d01/brent__method__extrema_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> std::cout.precision(18);</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> </div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Computations performed with machine epsilon: &quot;</span> &lt;&lt; <a class="code hl_define" href="../../db/d01/brent__method__extrema_8cpp.html#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a></div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> </div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> <a class="code hl_function" href="../../db/d01/brent__method__extrema_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0">test1</a>();</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> <a class="code hl_function" href="../../db/d01/brent__method__extrema_8cpp.html#a0283886819c7c140a023582b7269e2d0">test2</a>();</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> <a class="code hl_function" href="../../db/d01/brent__method__extrema_8cpp.html#a6d0455dd5c30adda100e95f0423c786e">test3</a>();</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> </div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span>}</div>
</div>
<div class="ttc" id="abrent__method__extrema_8cpp_html_a002b2f4894492820fe708b1b7e7c5e70"><div class="ttname"><a href="../../db/d01/brent__method__extrema_8cpp.html#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a></div><div class="ttdeci">#define EPSILON</div><div class="ttdoc">system accuracy limit</div><div class="ttdef"><b>Definition</b> <a href="#l00024">brent_method_extrema.cpp:24</a></div></div>
<div class="ttc" id="abrent__method__extrema_8cpp_html_a0283886819c7c140a023582b7269e2d0"><div class="ttname"><a href="../../db/d01/brent__method__extrema_8cpp.html#a0283886819c7c140a023582b7269e2d0">test2</a></div><div class="ttdeci">void test2()</div><div class="ttdoc">Test function to find root for the function in the interval Expected result: .</div><div class="ttdef"><b>Definition</b> <a href="#l00166">brent_method_extrema.cpp:166</a></div></div>
<div class="ttc" id="abrent__method__extrema_8cpp_html_a1440a7779ac56f47a3f355ce4a8c7da0"><div class="ttname"><a href="../../db/d01/brent__method__extrema_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0">test1</a></div><div class="ttdeci">void test1()</div><div class="ttdoc">Test function to find root for the function in the interval Expected result = 2.</div><div class="ttdef"><b>Definition</b> <a href="#l00144">brent_method_extrema.cpp:144</a></div></div>
<div class="ttc" id="abrent__method__extrema_8cpp_html_a1aa76a6d5fd4d333f9072beff1dc486b"><div class="ttname"><a href="../../db/d01/brent__method__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b">get_minima</a></div><div class="ttdeci">double get_minima(const std::function&lt; double(double)&gt; &amp;f, double lim_a, double lim_b)</div><div class="ttdoc">Get the real root of a function in the given interval.</div><div class="ttdef"><b>Definition</b> <a href="#l00036">brent_method_extrema.cpp:36</a></div></div>
<div class="ttc" id="abrent__method__extrema_8cpp_html_a6d0455dd5c30adda100e95f0423c786e"><div class="ttname"><a href="../../db/d01/brent__method__extrema_8cpp.html#a6d0455dd5c30adda100e95f0423c786e">test3</a></div><div class="ttdeci">void test3()</div><div class="ttdoc">Test function to find maxima for the function in the interval Expected result: .</div><div class="ttdef"><b>Definition</b> <a href="#l00189">brent_method_extrema.cpp:189</a></div></div>
<div class="ttc" id="abrent__method__extrema_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../db/d01/brent__method__extrema_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdef"><b>Definition</b> <a href="#l00205">brent_method_extrema.cpp:205</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../db/d01/brent__method__extrema_8cpp.html">brent_method_extrema.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>