mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-24 13:53:35 +08:00
Documentation for 8b1eab204b
This commit is contained in:
@@ -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/false_position.cpp File Reference</title>
|
||||
<title>TheAlgorithms/C++: numerical_methods/false_position.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"> 1.0.0</span>
|
||||
<div id="projectname">TheAlgorithms/C++<span id="projectnumber"> 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>
|
||||
@@ -120,7 +137,9 @@ Include dependency graph for false_position.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dc/de2/false__position_8cpp__incl.svg" width="178" 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="../../dd/d29/false__position_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="namespaces" name="namespaces"></a>
|
||||
Namespaces</h2></td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/de0/namespacenumerical__methods.html">numerical_methods</a></td></tr>
|
||||
@@ -158,6 +177,8 @@ x_{i+1} = \frac{a_i\cdot f(b_i) - b_i\cdot f(a_i)}{f(b_i) - f(a_i)}
|
||||
<dl class="section author"><dt>Author</dt><dd>Unknown author </dd>
|
||||
<dd>
|
||||
<a href="https://github.com/sampatil578" target="_blank">Samruddha Patil</a> </dd></dl>
|
||||
|
||||
<p class="definition">Definition in file <a class="el" href="../../dd/d29/false__position_8cpp_source.html">false_position.cpp</a>.</p>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="a85a6ec58b5064d63d4f0df3854496713" name="a85a6ec58b5064d63d4f0df3854496713"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a85a6ec58b5064d63d4f0df3854496713">◆ </a></span>eq()</h2>
|
||||
@@ -190,15 +211,12 @@ x_{i+1} = \frac{a_i\cdot f(b_i) - b_i\cdot f(a_i)}{f(b_i) - f(a_i)}
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>value of f(x) for given x. </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../dd/d29/false__position_8cpp_source.html#l00044">44</a> of file <a class="el" href="../../dd/d29/false__position_8cpp_source.html">false_position.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 44</span> {</div>
|
||||
<div class="line"><span class="lineno"> 45</span> <span class="keywordflow">return</span> (x * x - x); <span class="comment">// original equation</span></div>
|
||||
<div class="line"><span class="lineno"> 46</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dd/d29/false__position_8cpp_a85a6ec58b5064d63d4f0df3854496713_cgraph.svg" width="154" height="76"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
|
||||
@@ -218,6 +236,8 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Main function. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../dd/d29/false__position_8cpp_source.html#l00102">102</a> of file <a class="el" href="../../dd/d29/false__position_8cpp_source.html">false_position.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 102</span> {</div>
|
||||
<div class="line"><span class="lineno"> 103</span> <span class="keywordtype">float</span> a = 0, b = 0, i = 0, root = 0;</div>
|
||||
<div class="line"><span class="lineno"> 104</span> int16_t count = 0;</div>
|
||||
@@ -245,9 +265,9 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><span class="lineno"> 126</span> }</div>
|
||||
<div class="line"><span class="lineno"> 127</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 128</span>}</div>
|
||||
<div class="ttc" id="afalse__position_8cpp_html_a7d69b49dc37da1c02b3ab8c7fe783494"><div class="ttname"><a href="#a7d69b49dc37da1c02b3ab8c7fe783494">numerical_methods::false_position::regula_falsi</a></div><div class="ttdeci">static float regula_falsi(float x1, float x2, float y1, float y2)</div><div class="ttdoc">This function finds root of the equation in given interval i.e. (x1,x2).</div><div class="ttdef"><b>Definition</b> false_position.cpp:55</div></div>
|
||||
<div class="ttc" id="afalse__position_8cpp_html_a85a6ec58b5064d63d4f0df3854496713"><div class="ttname"><a href="#a85a6ec58b5064d63d4f0df3854496713">numerical_methods::false_position::eq</a></div><div class="ttdeci">static float eq(float x)</div><div class="ttdoc">This function gives the value of f(x) for given x.</div><div class="ttdef"><b>Definition</b> false_position.cpp:44</div></div>
|
||||
<div class="ttc" id="afalse__position_8cpp_html_a85cb7bfb90abc898e042d624372c5345"><div class="ttname"><a href="#a85cb7bfb90abc898e042d624372c5345">numerical_methods::false_position::printRoot</a></div><div class="ttdeci">void printRoot(float root, const int16_t &count)</div><div class="ttdoc">This function prints roots of the equation.</div><div class="ttdef"><b>Definition</b> false_position.cpp:84</div></div>
|
||||
<div class="ttc" id="afalse__position_8cpp_html_a7d69b49dc37da1c02b3ab8c7fe783494"><div class="ttname"><a href="#a7d69b49dc37da1c02b3ab8c7fe783494">numerical_methods::false_position::regula_falsi</a></div><div class="ttdeci">static float regula_falsi(float x1, float x2, float y1, float y2)</div><div class="ttdoc">This function finds root of the equation in given interval i.e. (x1,x2).</div><div class="ttdef"><b>Definition</b> <a href="../../dd/d29/false__position_8cpp_source.html#l00055">false_position.cpp:55</a></div></div>
|
||||
<div class="ttc" id="afalse__position_8cpp_html_a85a6ec58b5064d63d4f0df3854496713"><div class="ttname"><a href="#a85a6ec58b5064d63d4f0df3854496713">numerical_methods::false_position::eq</a></div><div class="ttdeci">static float eq(float x)</div><div class="ttdoc">This function gives the value of f(x) for given x.</div><div class="ttdef"><b>Definition</b> <a href="../../dd/d29/false__position_8cpp_source.html#l00044">false_position.cpp:44</a></div></div>
|
||||
<div class="ttc" id="afalse__position_8cpp_html_a85cb7bfb90abc898e042d624372c5345"><div class="ttname"><a href="#a85cb7bfb90abc898e042d624372c5345">numerical_methods::false_position::printRoot</a></div><div class="ttdeci">void printRoot(float root, const int16_t &count)</div><div class="ttdoc">This function prints roots of the equation.</div><div class="ttdef"><b>Definition</b> <a href="../../dd/d29/false__position_8cpp_source.html#l00084">false_position.cpp:84</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -278,25 +298,20 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../dd/d29/false__position_8cpp_source.html#l00084">84</a> of file <a class="el" href="../../dd/d29/false__position_8cpp_source.html">false_position.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 84</span> {</div>
|
||||
<div class="line"><span class="lineno"> 85</span> <span class="keywordflow">if</span> (count == 1) {</div>
|
||||
<div class="line"><span class="lineno"> 86</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Your 1st root is : "</span> << root << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 86</span> std::cout << <span class="stringliteral">"Your 1st root is : "</span> << root << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 87</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (count == 2) {</div>
|
||||
<div class="line"><span class="lineno"> 88</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Your 2nd root is : "</span> << root << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 88</span> std::cout << <span class="stringliteral">"Your 2nd root is : "</span> << root << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 89</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (count == 3) {</div>
|
||||
<div class="line"><span class="lineno"> 90</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Your 3rd root is : "</span> << root << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 90</span> std::cout << <span class="stringliteral">"Your 3rd root is : "</span> << root << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 91</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 92</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Your "</span> << count << <span class="stringliteral">"th root is : "</span> << root << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 92</span> std::cout << <span class="stringliteral">"Your "</span> << count << <span class="stringliteral">"th root is : "</span> << root << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 93</span> }</div>
|
||||
<div class="line"><span class="lineno"> 94</span>}</div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dd/d29/false__position_8cpp_a85cb7bfb90abc898e042d624372c5345_cgraph.svg" width="292" height="76"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="a7d69b49dc37da1c02b3ab8c7fe783494" name="a7d69b49dc37da1c02b3ab8c7fe783494"></a>
|
||||
@@ -345,6 +360,8 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>root of the equation in the given interval. </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../dd/d29/false__position_8cpp_source.html#l00055">55</a> of file <a class="el" href="../../dd/d29/false__position_8cpp_source.html">false_position.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 55</span> {</div>
|
||||
<div class="line"><span class="lineno"> 56</span> <span class="keywordtype">float</span> diff = x1 - x2;</div>
|
||||
<div class="line"><span class="lineno"> 57</span> <span class="keywordflow">if</span> (diff < 0) {</div>
|
||||
@@ -368,13 +385,8 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><span class="lineno"> 75</span> y3 = <a class="code hl_function" href="../../d7/d6a/bisection__method_8cpp.html#a2003b5b2dcfff0769b957ab5c968b03d">eq</a>(x3);</div>
|
||||
<div class="line"><span class="lineno"> 76</span> <span class="keywordflow">return</span> <a class="code hl_function" href="#a7d69b49dc37da1c02b3ab8c7fe783494">regula_falsi</a>(x2, x3, y2, y3);</div>
|
||||
<div class="line"><span class="lineno"> 77</span>}</div>
|
||||
<div class="ttc" id="abisection__method_8cpp_html_a2003b5b2dcfff0769b957ab5c968b03d"><div class="ttname"><a href="../../d7/d6a/bisection__method_8cpp.html#a2003b5b2dcfff0769b957ab5c968b03d">eq</a></div><div class="ttdeci">static double eq(double i)</div><div class="ttdef"><b>Definition</b> bisection_method.cpp:26</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="../../dd/d29/false__position_8cpp_a7d69b49dc37da1c02b3ab8c7fe783494_cgraph.svg" width="376" height="76"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
<div class="ttc" id="abisection__method_8cpp_html_a2003b5b2dcfff0769b957ab5c968b03d"><div class="ttname"><a href="../../d7/d6a/bisection__method_8cpp.html#a2003b5b2dcfff0769b957ab5c968b03d">eq</a></div><div class="ttdeci">static double eq(double i)</div><div class="ttdef"><b>Definition</b> <a href="../../d7/d6a/bisection__method_8cpp_source.html#l00026">bisection_method.cpp:26</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- contents -->
|
||||
|
||||
Reference in New Issue
Block a user