mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-05-01 22:13:03 +08:00
Documentation for 8a6f2052e2
This commit is contained in:
10
de/d1c/midpoint__integral__method_8cpp__incl.map
Normal file
10
de/d1c/midpoint__integral__method_8cpp__incl.map
Normal file
@@ -0,0 +1,10 @@
|
||||
<map id="numerical_methods/midpoint_integral_method.cpp" name="numerical_methods/midpoint_integral_method.cpp">
|
||||
<area shape="rect" id="node1" title="A numerical method for easy approximation of integrals" alt="" coords="197,5,389,47"/>
|
||||
<area shape="rect" id="node2" title=" " alt="" coords="5,95,71,121"/>
|
||||
<area shape="rect" id="node3" title=" " alt="" coords="95,95,154,121"/>
|
||||
<area shape="rect" id="node4" title=" " alt="" coords="179,95,239,121"/>
|
||||
<area shape="rect" id="node5" title=" " alt="" coords="263,95,323,121"/>
|
||||
<area shape="rect" id="node6" title=" " alt="" coords="347,95,425,121"/>
|
||||
<area shape="rect" id="node7" title=" " alt="" coords="449,95,523,121"/>
|
||||
<area shape="rect" id="node8" title=" " alt="" coords="547,95,595,121"/>
|
||||
</map>
|
||||
1
de/d1c/midpoint__integral__method_8cpp__incl.md5
Normal file
1
de/d1c/midpoint__integral__method_8cpp__incl.md5
Normal file
@@ -0,0 +1 @@
|
||||
cb4d842974681cf60eb688b551f3de3f
|
||||
128
de/d1c/midpoint__integral__method_8cpp__incl.svg
Normal file
128
de/d1c/midpoint__integral__method_8cpp__incl.svg
Normal file
@@ -0,0 +1,128 @@
|
||||
<?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 2.49.2 (20211016.1639)
|
||||
-->
|
||||
<!-- Title: numerical_methods/midpoint_integral_method.cpp Pages: 1 -->
|
||||
<svg width="451pt" height="95pt"
|
||||
viewBox="0.00 0.00 450.50 95.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 91)">
|
||||
<title>numerical_methods/midpoint_integral_method.cpp</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-91 446.5,-91 446.5,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="A numerical method for easy approximation of integrals">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="143.5,-56.5 143.5,-86.5 287.5,-86.5 287.5,-56.5 143.5,-56.5"/>
|
||||
<text text-anchor="start" x="151.5" y="-74.5" font-family="Helvetica,sans-Serif" font-size="10.00">numerical_methods/midpoint</text>
|
||||
<text text-anchor="middle" x="215.5" y="-63.5" font-family="Helvetica,sans-Serif" font-size="10.00">_integral_method.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="0,-0.5 0,-19.5 49,-19.5 49,-0.5 0,-0.5"/>
|
||||
<text text-anchor="middle" x="24.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M170.24,-56.4C136.14,-45.78 90.11,-31.44 58.97,-21.74"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="59.61,-18.27 49.02,-18.64 57.52,-24.95 59.61,-18.27"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="67.5,-0.5 67.5,-19.5 111.5,-19.5 111.5,-0.5 67.5,-0.5"/>
|
||||
<text text-anchor="middle" x="89.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">cmath</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M185.64,-56.4C164.88,-46.59 137.4,-33.62 117.14,-24.05"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="118.37,-20.76 107.83,-19.66 115.38,-27.09 118.37,-20.76"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="130,-0.5 130,-19.5 175,-19.5 175,-0.5 130,-0.5"/>
|
||||
<text text-anchor="middle" x="152.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M200.57,-56.4C191.13,-47.49 178.92,-35.95 169.17,-26.74"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="171.34,-23.98 161.67,-19.66 166.53,-29.07 171.34,-23.98"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="193,-0.5 193,-19.5 238,-19.5 238,-0.5 193,-0.5"/>
|
||||
<text text-anchor="middle" x="215.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">cstdlib</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node5 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M215.5,-56.4C215.5,-48.47 215.5,-38.46 215.5,-29.86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="219,-29.66 215.5,-19.66 212,-29.66 219,-29.66"/>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="256,-0.5 256,-19.5 315,-19.5 315,-0.5 256,-0.5"/>
|
||||
<text text-anchor="middle" x="285.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">functional</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node6 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>Node1->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M232.09,-56.4C242.79,-47.31 256.69,-35.49 267.63,-26.19"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="269.96,-28.8 275.31,-19.66 265.43,-23.47 269.96,-28.8"/>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="333,-0.5 333,-19.5 388,-19.5 388,-0.5 333,-0.5"/>
|
||||
<text text-anchor="middle" x="360.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node7 -->
|
||||
<g id="edge6" class="edge">
|
||||
<title>Node1->Node7</title>
|
||||
<path fill="none" stroke="midnightblue" d="M249.86,-56.4C274.19,-46.42 306.53,-33.15 329.96,-23.53"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="331.48,-26.69 339.4,-19.66 328.82,-20.22 331.48,-26.69"/>
|
||||
</g>
|
||||
<!-- Node8 -->
|
||||
<g id="node8" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_node8"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="406.5,-0.5 406.5,-19.5 442.5,-19.5 442.5,-0.5 406.5,-0.5"/>
|
||||
<text text-anchor="middle" x="424.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">map</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node8 -->
|
||||
<g id="edge7" class="edge">
|
||||
<title>Node1->Node8</title>
|
||||
<path fill="none" stroke="midnightblue" d="M269.07,-56.41C303.16,-47.26 348.44,-34.79 396.58,-20.18"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="397.7,-23.5 406.24,-17.23 395.65,-16.8 397.7,-23.5"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.6 KiB |
@@ -355,12 +355,13 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < R1; i++) {</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j < C2; j++) {</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> OUT[0][i][j] = 0.f;</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k = 0; k < C1; k++) {</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> OUT[0][i][j] += A[i][k] * B[k][j];</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k = 0; <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#ae9f66040f8e0ba73c1c741261c22a52a">k</a> < C1; <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#ae9f66040f8e0ba73c1c741261c22a52a">k</a>++) {</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> OUT[0][i][j] += A[i][<a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#ae9f66040f8e0ba73c1c741261c22a52a">k</a>] * B[<a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#ae9f66040f8e0ba73c1c741261c22a52a">k</a>][j];</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> }</div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> }</div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> }</div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span>}</div>
|
||||
<div class="ttc" id="amidpoint__integral__method_8cpp_html_ae9f66040f8e0ba73c1c741261c22a52a"><div class="ttname"><a href="../../df/d11/midpoint__integral__method_8cpp.html#ae9f66040f8e0ba73c1c741261c22a52a">numerical_methods::midpoint_rule::k</a></div><div class="ttdeci">double k(double x)</div><div class="ttdoc">A function k(x) that will be used to test the method.</div><div class="ttdef"><b>Definition:</b> midpoint_integral_method.cpp:103</div></div>
|
||||
<div class="ttc" id="aperror_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/c/perror.html">std::perror</a></div><div class="ttdeci">T perror(T... args)</div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
|
||||
@@ -181,11 +181,11 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/emplace_back.html">emplace_back</a>(i);</div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> }</div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> p : res) {</div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keywordtype">size_t</span> k = i * p;</div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#ae9f66040f8e0ba73c1c741261c22a52a">k</a> = i * p;</div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordflow">if</span> (k > max) {</div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> }</div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> is_not_prime[k] = <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> is_not_prime[<a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#ae9f66040f8e0ba73c1c741261c22a52a">k</a>] = <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <span class="keywordflow">if</span> (i % p == 0) {</div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> }</div>
|
||||
@@ -195,6 +195,7 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span>}</div>
|
||||
<div class="ttc" id="aemplace_back_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/emplace_back.html">std::vector::emplace_back</a></div><div class="ttdeci">T emplace_back(T... args)</div></div>
|
||||
<div class="ttc" id="amax_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/max.html">std::max</a></div><div class="ttdeci">T max(T... args)</div></div>
|
||||
<div class="ttc" id="amidpoint__integral__method_8cpp_html_ae9f66040f8e0ba73c1c741261c22a52a"><div class="ttname"><a href="../../df/d11/midpoint__integral__method_8cpp.html#ae9f66040f8e0ba73c1c741261c22a52a">numerical_methods::midpoint_rule::k</a></div><div class="ttdeci">double k(double x)</div><div class="ttdoc">A function k(x) that will be used to test the method.</div><div class="ttdef"><b>Definition:</b> midpoint_integral_method.cpp:103</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
|
||||
Reference in New Issue
Block a user