mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-22 04:42:10 +08:00
Documentation for 33750ec1f8
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<map id="math/n_bonacci.cpp" name="math/n_bonacci.cpp">
|
||||
<area shape="rect" id="node1" title="Implementation of the N-bonacci series." alt="" coords="112,5,250,31"/>
|
||||
<area shape="rect" id="node2" title=" " alt="" coords="5,79,80,105"/>
|
||||
<area shape="rect" id="node3" title=" " alt="" coords="104,79,168,105"/>
|
||||
<area shape="rect" id="node4" title=" " alt="" coords="192,79,264,105"/>
|
||||
<area shape="rect" id="node5" title=" " alt="" coords="287,79,345,105"/>
|
||||
<area shape="rect" id="node1" title="Implementation of the N-bonacci series." alt="" coords="60,5,199,31"/>
|
||||
<area shape="rect" id="node2" title=" " alt="" coords="5,79,70,105"/>
|
||||
<area shape="rect" id="node3" title=" " alt="" coords="94,79,165,105"/>
|
||||
<area shape="rect" id="node4" title=" " alt="" coords="189,79,246,105"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
2621374471b0f9f68aa8347260643de3
|
||||
560780ba81458fb0c0c830c5c5bf30a8
|
||||
@@ -4,16 +4,16 @@
|
||||
<!-- Generated by graphviz version 8.0.5 (20230430.1635)
|
||||
-->
|
||||
<!-- Title: math/n_bonacci.cpp Pages: 1 -->
|
||||
<svg width="262pt" height="83pt"
|
||||
viewBox="0.00 0.00 262.38 82.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="189pt" height="83pt"
|
||||
viewBox="0.00 0.00 188.62 82.50" 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.5)">
|
||||
<title>math/n_bonacci.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Implementation of the N-bonacci series.">
|
||||
<polygon fill="#999999" stroke="#666666" points="183.75,-74.5 80,-74.5 80,-55.25 183.75,-55.25 183.75,-74.5"/>
|
||||
<text text-anchor="middle" x="131.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">math/n_bonacci.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="145,-74.5 41.25,-74.5 41.25,-55.25 145,-55.25 145,-74.5"/>
|
||||
<text text-anchor="middle" x="93.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">math/n_bonacci.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -21,61 +21,46 @@
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="55.75,-19.25 0,-19.25 0,0 55.75,0 55.75,-19.25"/>
|
||||
<text text-anchor="middle" x="27.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">algorithm</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="48.25,-19.25 0,-19.25 0,0 48.25,0 48.25,-19.25"/>
|
||||
<text text-anchor="middle" x="24.12" y="-5.75" 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="#63b8ff" d="M114.23,-54.84C98.1,-46.58 73.97,-34.23 55.32,-24.68"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="57.1,-21.14 46.6,-19.7 53.91,-27.38 57.1,-21.14"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M81.42,-54.84C71.25,-46.99 56.29,-35.45 44.21,-26.12"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="46.71,-22.86 36.66,-19.52 42.44,-28.41 46.71,-22.86"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="122,-19.25 73.75,-19.25 73.75,0 122,0 122,-19.25"/>
|
||||
<text text-anchor="middle" x="97.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="119.88,-19.25 66.38,-19.25 66.38,0 119.88,0 119.88,-19.25"/>
|
||||
<text text-anchor="middle" x="93.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<path fill="none" stroke="#63b8ff" d="M126.26,-55.08C121.71,-47.96 115.15,-37.68 109.48,-28.8"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="111.94,-27.15 103.61,-20.61 106.04,-30.92 111.94,-27.15"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M93.12,-55.08C93.12,-48.42 93.12,-38.99 93.12,-30.53"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="96.63,-30.61 93.12,-20.61 89.63,-30.61 96.63,-30.61"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="193.62,-19.25 140.12,-19.25 140.12,0 193.62,0 193.62,-19.25"/>
|
||||
<text text-anchor="middle" x="166.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="180.62,-19.25 137.62,-19.25 137.62,0 180.62,0 180.62,-19.25"/>
|
||||
<text text-anchor="middle" x="159.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<path fill="none" stroke="#63b8ff" d="M137.65,-55.08C142.34,-47.96 149.09,-37.68 154.93,-28.8"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="158.4,-30.89 160.97,-20.61 152.55,-27.04 158.4,-30.89"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="254.38,-19.25 211.38,-19.25 211.38,0 254.38,0 254.38,-19.25"/>
|
||||
<text text-anchor="middle" x="232.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node5 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<path fill="none" stroke="#63b8ff" d="M149.01,-54.84C164.61,-46.62 187.89,-34.34 205.97,-24.81"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="207.44,-27.46 214.66,-19.7 204.18,-21.27 207.44,-27.46"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M104.32,-54.84C113.96,-47.07 128.08,-35.67 139.57,-26.4"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="141.51,-28.53 147.09,-19.52 137.11,-23.08 141.51,-28.53"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 2.8 KiB |
@@ -106,14 +106,13 @@ $(document).ready(function(){initNavTree('db/d27/n__bonacci_8cpp.html','../../')
|
||||
|
||||
<p>Implementation of the <a href="http://oeis.org/wiki/N-bonacci_numbers" target="_blank">N-bonacci</a> series.
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <algorithm></code><br />
|
||||
<code>#include <cassert></code><br />
|
||||
<div class="textblock"><code>#include <cassert></code><br />
|
||||
<code>#include <iostream></code><br />
|
||||
<code>#include <vector></code><br />
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for n_bonacci.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d5/d95/n__bonacci_8cpp__incl.svg" width="350" height="111"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d5/d95/n__bonacci_8cpp__incl.svg" width="252" height="111"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div><table class="memberdecls">
|
||||
@@ -162,15 +161,15 @@ Functions</h2></td></tr>
|
||||
|
||||
<p>Main function. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 120</span> {</div>
|
||||
<div class="line"><span class="lineno"> 121</span> <a class="code hl_function" href="../../db/d27/n__bonacci_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 122</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 123</span>}</div>
|
||||
<div class="ttc" id="an__bonacci_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../db/d27/n__bonacci_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition:</b> n_bonacci.cpp:63</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 104</span> {</div>
|
||||
<div class="line"><span class="lineno"> 105</span> <a class="code hl_function" href="../../db/d27/n__bonacci_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 106</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 107</span>}</div>
|
||||
<div class="ttc" id="an__bonacci_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../db/d27/n__bonacci_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition:</b> n_bonacci.cpp:69</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/d27/n__bonacci_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="278" height="184"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../db/d27/n__bonacci_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="271" height="36"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -213,21 +212,28 @@ Here is the call graph for this function:</div>
|
||||
<dl class="section return"><dt>Returns</dt><dd>the n-bonacci sequence as vector array </dd></dl>
|
||||
<p>we initialise the (n-1)th term as 1 which is the sum of preceding N zeros</p>
|
||||
<p>similarily the sum of preceding N zeros and the (N+1)th 1 is also 1</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 41</span> {</div>
|
||||
<div class="line"><span class="lineno"> 42</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> a(m, 0); <span class="comment">// we create an empty array of size m</span></div>
|
||||
<div class="line"><span class="lineno"> 43</span> </div>
|
||||
<div class="line"><span class="lineno"> 44</span> a[n - 1] = 1; <span class="comment">/// we initialise the (n-1)th term as 1 which is the sum of</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 45</span><span class="comment"> /// preceding N zeros</span></div>
|
||||
<div class="line"><span class="lineno"> 46</span><span class="comment"></span> a[n] = 1; <span class="comment">/// similarily the sum of preceding N zeros and the (N+1)th 1 is</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 47</span><span class="comment"> /// also 1</span></div>
|
||||
<div class="line"><span class="lineno"> 48</span><span class="comment"></span> <span class="keywordflow">for</span> (uint64_t i = n + 1; i < m; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 49</span> <span class="comment">// this is an optimized solution that works in O(M) time and takes O(M)</span></div>
|
||||
<div class="line"><span class="lineno"> 50</span> <span class="comment">// extra space here we use the concept of the sliding window the current</span></div>
|
||||
<div class="line"><span class="lineno"> 51</span> <span class="comment">// term can be computed using the given formula</span></div>
|
||||
<div class="line"><span class="lineno"> 52</span> a[i] = 2 * a[i - 1] - a[i - 1 - n];</div>
|
||||
<div class="line"><span class="lineno"> 53</span> }</div>
|
||||
<div class="line"><span class="lineno"> 54</span> <span class="keywordflow">return</span> a;</div>
|
||||
<div class="line"><span class="lineno"> 55</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 40</span> {</div>
|
||||
<div class="line"><span class="lineno"> 41</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> a(</div>
|
||||
<div class="line"><span class="lineno"> 42</span> m, 0); <span class="comment">// we create an array of size m filled with zeros</span></div>
|
||||
<div class="line"><span class="lineno"> 43</span> <span class="keywordflow">if</span> (m < n || n == 0) {</div>
|
||||
<div class="line"><span class="lineno"> 44</span> <span class="keywordflow">return</span> 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> a[n - 1] = 1; <span class="comment">/// we initialise the (n-1)th term as 1 which is the sum of</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 48</span><span class="comment"> /// preceding N zeros</span></div>
|
||||
<div class="line"><span class="lineno"> 49</span><span class="comment"></span> <span class="keywordflow">if</span> (n == m) {</div>
|
||||
<div class="line"><span class="lineno"> 50</span> <span class="keywordflow">return</span> a;</div>
|
||||
<div class="line"><span class="lineno"> 51</span> }</div>
|
||||
<div class="line"><span class="lineno"> 52</span> a[n] = 1; <span class="comment">/// similarily the sum of preceding N zeros and the (N+1)th 1 is</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 53</span><span class="comment"> /// also 1</span></div>
|
||||
<div class="line"><span class="lineno"> 54</span><span class="comment"></span> <span class="keywordflow">for</span> (uint64_t i = n + 1; i < m; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 55</span> <span class="comment">// this is an optimized solution that works in O(M) time and takes O(M)</span></div>
|
||||
<div class="line"><span class="lineno"> 56</span> <span class="comment">// extra space here we use the concept of the sliding window the current</span></div>
|
||||
<div class="line"><span class="lineno"> 57</span> <span class="comment">// term can be computed using the given formula</span></div>
|
||||
<div class="line"><span class="lineno"> 58</span> a[i] = 2 * a[i - 1] - a[i - 1 - n];</div>
|
||||
<div class="line"><span class="lineno"> 59</span> }</div>
|
||||
<div class="line"><span class="lineno"> 60</span> <span class="keywordflow">return</span> a;</div>
|
||||
<div class="line"><span class="lineno"> 61</span>}</div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -263,68 +269,44 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Self-test implementations. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 63</span> {</div>
|
||||
<div class="line"><span class="lineno"> 64</span> <span class="comment">// n = 1 m = 1 return [1, 1]</span></div>
|
||||
<div class="line"><span class="lineno"> 65</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">"1st test"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 66</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> arr1 = <a class="code hl_function" href="../../db/d27/n__bonacci_8cpp.html#a6849b68f760be628d5975ab3eddec63d">math::n_bonacci::N_bonacci</a>(</div>
|
||||
<div class="line"><span class="lineno"> 67</span> 1, 1); <span class="comment">// first input is the param n and second one is the param m for</span></div>
|
||||
<div class="line"><span class="lineno"> 68</span> <span class="comment">// N-bonacci func</span></div>
|
||||
<div class="line"><span class="lineno"> 69</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> output_array1 = {</div>
|
||||
<div class="line"><span class="lineno"> 70</span> 1, 1}; <span class="comment">// It is the expected output series of length m</span></div>
|
||||
<div class="line"><span class="lineno"> 71</span> assert(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/equal.html">std::equal</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a>(arr1), <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">std::end</a>(arr1),</div>
|
||||
<div class="line"><span class="lineno"> 72</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a>(output_array1)));</div>
|
||||
<div class="line"><span class="lineno"> 73</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">"passed"</span> << <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"> 74</span> </div>
|
||||
<div class="line"><span class="lineno"> 75</span> <span class="comment">// n = 5 m = 15 return [0, 0, 0, 0, 1, 1, 2, 4, 8, 16, 31, 61, 120, 236,</span></div>
|
||||
<div class="line"><span class="lineno"> 76</span> <span class="comment">// 464]</span></div>
|
||||
<div class="line"><span class="lineno"> 77</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">"2nd test"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 78</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> arr2 = <a class="code hl_function" href="../../db/d27/n__bonacci_8cpp.html#a6849b68f760be628d5975ab3eddec63d">math::n_bonacci::N_bonacci</a>(</div>
|
||||
<div class="line"><span class="lineno"> 79</span> 5, 15); <span class="comment">// first input is the param n and second one is the param m for</span></div>
|
||||
<div class="line"><span class="lineno"> 80</span> <span class="comment">// N-bonacci func</span></div>
|
||||
<div class="line"><span class="lineno"> 81</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> output_array2 = {</div>
|
||||
<div class="line"><span class="lineno"> 82</span> 0, 0, 0, 0, 1, 1, 2, 4,</div>
|
||||
<div class="line"><span class="lineno"> 83</span> 8, 16, 31, 61, 120, 236, 464}; <span class="comment">// It is the expected output series of</span></div>
|
||||
<div class="line"><span class="lineno"> 84</span> <span class="comment">// length m</span></div>
|
||||
<div class="line"><span class="lineno"> 85</span> assert(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/equal.html">std::equal</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a>(arr2), <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">std::end</a>(arr2),</div>
|
||||
<div class="line"><span class="lineno"> 86</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a>(output_array2)));</div>
|
||||
<div class="line"><span class="lineno"> 87</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">"passed"</span> << <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> </div>
|
||||
<div class="line"><span class="lineno"> 89</span> <span class="comment">// n = 6 m = 17 return [0, 0, 0, 0, 0, 1, 1, 2, 4, 8, 16, 32, 63, 125, 248,</span></div>
|
||||
<div class="line"><span class="lineno"> 90</span> <span class="comment">// 492, 976]</span></div>
|
||||
<div class="line"><span class="lineno"> 91</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">"3rd test"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 92</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> arr3 = <a class="code hl_function" href="../../db/d27/n__bonacci_8cpp.html#a6849b68f760be628d5975ab3eddec63d">math::n_bonacci::N_bonacci</a>(</div>
|
||||
<div class="line"><span class="lineno"> 93</span> 6, 17); <span class="comment">// first input is the param n and second one is the param m for</span></div>
|
||||
<div class="line"><span class="lineno"> 94</span> <span class="comment">// N-bonacci func</span></div>
|
||||
<div class="line"><span class="lineno"> 95</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> output_array3 = {</div>
|
||||
<div class="line"><span class="lineno"> 96</span> 0, 0, 0, 0, 0, 1, 1, 2, 4,</div>
|
||||
<div class="line"><span class="lineno"> 97</span> 8, 16, 32, 63, 125, 248, 492, 976}; <span class="comment">// It is the expected output series</span></div>
|
||||
<div class="line"><span class="lineno"> 98</span> <span class="comment">// of length m</span></div>
|
||||
<div class="line"><span class="lineno"> 99</span> assert(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/equal.html">std::equal</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a>(arr3), <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">std::end</a>(arr3),</div>
|
||||
<div class="line"><span class="lineno"> 100</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a>(output_array3)));</div>
|
||||
<div class="line"><span class="lineno"> 101</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">"passed"</span> << <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"> 102</span> </div>
|
||||
<div class="line"><span class="lineno"> 103</span> <span class="comment">// n = 56 m = 15 return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]</span></div>
|
||||
<div class="line"><span class="lineno"> 104</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">"4th test"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 105</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> arr4 = <a class="code hl_function" href="../../db/d27/n__bonacci_8cpp.html#a6849b68f760be628d5975ab3eddec63d">math::n_bonacci::N_bonacci</a>(</div>
|
||||
<div class="line"><span class="lineno"> 106</span> 56, 15); <span class="comment">// first input is the param n and second one is the param m</span></div>
|
||||
<div class="line"><span class="lineno"> 107</span> <span class="comment">// for N-bonacci func</span></div>
|
||||
<div class="line"><span class="lineno"> 108</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> output_array4 = {</div>
|
||||
<div class="line"><span class="lineno"> 109</span> 0, 0, 0, 0, 0, 0, 0, 0,</div>
|
||||
<div class="line"><span class="lineno"> 110</span> 0, 0, 0, 0, 0, 0, 0}; <span class="comment">// It is the expected output series of length m</span></div>
|
||||
<div class="line"><span class="lineno"> 111</span> assert(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/equal.html">std::equal</a>(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a>(arr4), <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">std::end</a>(arr4),</div>
|
||||
<div class="line"><span class="lineno"> 112</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a>(output_array4)));</div>
|
||||
<div class="line"><span class="lineno"> 113</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">"passed"</span> << <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"> 114</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 69</span> {</div>
|
||||
<div class="line"><span class="lineno"> 70</span> <span class="keyword">struct </span>TestCase {</div>
|
||||
<div class="line"><span class="lineno"> 71</span> <span class="keyword">const</span> uint64_t n;</div>
|
||||
<div class="line"><span class="lineno"> 72</span> <span class="keyword">const</span> uint64_t m;</div>
|
||||
<div class="line"><span class="lineno"> 73</span> <span class="keyword">const</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a> expected;</div>
|
||||
<div class="line"><span class="lineno"> 74</span> TestCase(<span class="keyword">const</span> uint64_t in_n, <span class="keyword">const</span> uint64_t in_m,</div>
|
||||
<div class="line"><span class="lineno"> 75</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/initializer_list.html">std::initializer_list<uint64_t></a> <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>)</div>
|
||||
<div class="line"><span class="lineno"> 76</span> : n(in_n), m(in_m), expected(<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>) {</div>
|
||||
<div class="line"><span class="lineno"> 77</span> assert(<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>.size() == m);</div>
|
||||
<div class="line"><span class="lineno"> 78</span> }</div>
|
||||
<div class="line"><span class="lineno"> 79</span> };</div>
|
||||
<div class="line"><span class="lineno"> 80</span> <span class="keyword">const</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<TestCase></a> test_cases = {</div>
|
||||
<div class="line"><span class="lineno"> 81</span> TestCase(0, 0, {}),</div>
|
||||
<div class="line"><span class="lineno"> 82</span> TestCase(0, 1, {0}),</div>
|
||||
<div class="line"><span class="lineno"> 83</span> TestCase(0, 2, {0, 0}),</div>
|
||||
<div class="line"><span class="lineno"> 84</span> TestCase(1, 0, {}),</div>
|
||||
<div class="line"><span class="lineno"> 85</span> TestCase(1, 1, {1}),</div>
|
||||
<div class="line"><span class="lineno"> 86</span> TestCase(1, 2, {1, 1}),</div>
|
||||
<div class="line"><span class="lineno"> 87</span> TestCase(1, 3, {1, 1, 1}),</div>
|
||||
<div class="line"><span class="lineno"> 88</span> TestCase(5, 15, {0, 0, 0, 0, 1, 1, 2, 4, 8, 16, 31, 61, 120, 236, 464}),</div>
|
||||
<div class="line"><span class="lineno"> 89</span> TestCase(</div>
|
||||
<div class="line"><span class="lineno"> 90</span> 6, 17,</div>
|
||||
<div class="line"><span class="lineno"> 91</span> {0, 0, 0, 0, 0, 1, 1, 2, 4, 8, 16, 32, 63, 125, 248, 492, 976}),</div>
|
||||
<div class="line"><span class="lineno"> 92</span> TestCase(56, 15, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0})};</div>
|
||||
<div class="line"><span class="lineno"> 93</span> </div>
|
||||
<div class="line"><span class="lineno"> 94</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> &tc : test_cases) {</div>
|
||||
<div class="line"><span class="lineno"> 95</span> assert(math::n_bonacci::N_bonacci(tc.n, tc.m) == tc.expected);</div>
|
||||
<div class="line"><span class="lineno"> 96</span> }</div>
|
||||
<div class="line"><span class="lineno"> 97</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">"passed"</span> << <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"> 98</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="abegin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a></div><div class="ttdeci">T begin(T... args)</div></div>
|
||||
<div class="ttc" id="aend_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/iterator/end.html">std::end</a></div><div class="ttdeci">T end(T... args)</div></div>
|
||||
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
|
||||
<div class="ttc" id="aequal_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/equal.html">std::equal</a></div><div class="ttdeci">T equal(T... args)</div></div>
|
||||
<div class="ttc" id="an__bonacci_8cpp_html_a6849b68f760be628d5975ab3eddec63d"><div class="ttname"><a href="../../db/d27/n__bonacci_8cpp.html#a6849b68f760be628d5975ab3eddec63d">math::n_bonacci::N_bonacci</a></div><div class="ttdeci">std::vector< uint64_t > N_bonacci(const uint64_t &n, const uint64_t &m)</div><div class="ttdoc">Finds the N-Bonacci series for the n parameter value and m parameter terms.</div><div class="ttdef"><b>Definition:</b> n_bonacci.cpp:41</div></div>
|
||||
<div class="ttc" id="ahash__search_8cpp_html_a6e1a77282bc65ad359d753d25df23243"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a></div><div class="ttdeci">int data[MAX]</div><div class="ttdoc">test data</div><div class="ttdef"><b>Definition:</b> hash_search.cpp:24</div></div>
|
||||
<div class="ttc" id="ainitializer_list_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/initializer_list.html">std::initializer_list</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/d27/n__bonacci_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg" width="180" height="184"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../db/d27/n__bonacci_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg" width="174" height="36"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
<map id="test" name="test">
|
||||
<area shape="rect" id="node1" title="Self-test implementations." alt="" coords="5,80,49,106"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/begin.html#" title=" " alt="" coords="97,5,175,31"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/end.html#" title=" " alt="" coords="102,55,170,80"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="100,104,172,130"/>
|
||||
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/equal.html#" title=" " alt="" coords="97,153,175,179"/>
|
||||
<area shape="rect" id="node1" title="Self-test implementations." alt="" coords="5,5,49,31"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="97,5,168,31"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
100237f3396188af4089a52f8dfab1c0
|
||||
f486c9c49ba8056684cc8746d21a532f
|
||||
@@ -4,78 +4,33 @@
|
||||
<!-- Generated by graphviz version 8.0.5 (20230430.1635)
|
||||
-->
|
||||
<!-- Title: test Pages: 1 -->
|
||||
<svg width="135pt" height="138pt"
|
||||
viewBox="0.00 0.00 135.25 138.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 134.25)">
|
||||
<svg width="130pt" height="27pt"
|
||||
viewBox="0.00 0.00 130.00 27.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 23.25)">
|
||||
<title>test</title>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Self-test implementations.">
|
||||
<polygon fill="#999999" stroke="#666666" points="32.5,-74.25 0,-74.25 0,-55 32.5,-55 32.5,-74.25"/>
|
||||
<text text-anchor="middle" x="16.25" y="-60.75" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="32.5,-19.25 0,-19.25 0,0 32.5,0 32.5,-19.25"/>
|
||||
<text text-anchor="middle" x="16.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/begin.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="127.25,-130.25 68.5,-130.25 68.5,-111 127.25,-111 127.25,-130.25"/>
|
||||
<text text-anchor="middle" x="97.88" y="-116.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::begin</text>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="122,-19.25 68.5,-19.25 68.5,0 122,0 122,-19.25"/>
|
||||
<text text-anchor="middle" x="95.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="#63b8ff" d="M30.12,-74.57C40.37,-82.4 55.17,-93.47 68.5,-102.62 69.46,-103.29 70.45,-103.95 71.44,-104.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="69.25,-108.02 79.54,-110.55 73.07,-102.15 69.25,-108.02"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/end.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="123.5,-93.25 72.25,-93.25 72.25,-74 123.5,-74 123.5,-93.25"/>
|
||||
<text text-anchor="middle" x="97.88" y="-79.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::end</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<path fill="none" stroke="#63b8ff" d="M32.98,-68.38C41.1,-70.32 51.37,-72.77 61.28,-75.13"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="60.23,-78.72 70.77,-77.64 61.86,-71.91 60.23,-78.72"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="124.62,-56.25 71.12,-56.25 71.12,-37 124.62,-37 124.62,-56.25"/>
|
||||
<text text-anchor="middle" x="97.88" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<path fill="none" stroke="#63b8ff" d="M32.98,-61.07C40.82,-59.3 50.65,-57.07 60.23,-54.91"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="60.85,-58.13 69.83,-52.51 59.31,-51.3 60.85,-58.13"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/equal.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="127.25,-19.25 68.5,-19.25 68.5,0 127.25,0 127.25,-19.25"/>
|
||||
<text text-anchor="middle" x="97.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::equal</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node5 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<path fill="none" stroke="#63b8ff" d="M30.58,-54.66C40.84,-47.09 55.42,-36.49 68.5,-27.62 69.47,-26.97 70.45,-26.31 71.46,-25.64"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="73.08,-28.12 79.56,-19.74 69.27,-22.24 73.08,-28.12"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M32.83,-9.62C39.94,-9.62 48.68,-9.62 57.32,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="57.08,-13.13 67.08,-9.62 57.08,-6.13 57.08,-13.13"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -1,8 +1,5 @@
|
||||
<map id="main" name="main">
|
||||
<area shape="rect" id="node1" title="Main function." alt="" coords="5,80,55,106"/>
|
||||
<area shape="rect" id="node2" href="$db/d27/n__bonacci_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" title="Self-test implementations." alt="" coords="103,80,146,106"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/begin.html#" title=" " alt="" coords="194,5,272,31"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/end.html#" title=" " alt="" coords="199,55,267,80"/>
|
||||
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="198,104,269,130"/>
|
||||
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/equal.html#" title=" " alt="" coords="194,153,272,179"/>
|
||||
<area shape="rect" id="node1" title="Main function." alt="" coords="5,5,55,31"/>
|
||||
<area shape="rect" id="node2" href="$db/d27/n__bonacci_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" title="Self-test implementations." alt="" coords="103,5,146,31"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="194,5,265,31"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6e413a1379bdcfde8a5d64890f8a34af
|
||||
ae3a6dc3065298e66fd9a09de00f9083
|
||||
@@ -4,16 +4,16 @@
|
||||
<!-- Generated by graphviz version 8.0.5 (20230430.1635)
|
||||
-->
|
||||
<!-- Title: main Pages: 1 -->
|
||||
<svg width="208pt" height="138pt"
|
||||
viewBox="0.00 0.00 208.25 138.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 134.25)">
|
||||
<svg width="203pt" height="27pt"
|
||||
viewBox="0.00 0.00 203.00 27.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 23.25)">
|
||||
<title>main</title>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Main function.">
|
||||
<polygon fill="#999999" stroke="#666666" points="37,-74.25 0,-74.25 0,-55 37,-55 37,-74.25"/>
|
||||
<text text-anchor="middle" x="18.5" y="-60.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="37,-19.25 0,-19.25 0,0 37,0 37,-19.25"/>
|
||||
<text text-anchor="middle" x="18.5" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -21,76 +21,31 @@
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a xlink:href="../../db/d27/n__bonacci_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" target="_top" xlink:title="Self-test implementations.">
|
||||
<polygon fill="white" stroke="#666666" points="105.5,-74.25 73,-74.25 73,-55 105.5,-55 105.5,-74.25"/>
|
||||
<text text-anchor="middle" x="89.25" y="-60.75" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
|
||||
<polygon fill="white" stroke="#666666" points="105.5,-19.25 73,-19.25 73,0 105.5,0 105.5,-19.25"/>
|
||||
<text text-anchor="middle" x="89.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="#63b8ff" d="M37.2,-64.62C44.67,-64.62 53.52,-64.62 61.73,-64.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.71,-68.13 71.71,-64.62 61.71,-61.13 61.71,-68.13"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M37.2,-9.62C44.67,-9.62 53.52,-9.62 61.73,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.71,-13.13 71.71,-9.62 61.71,-6.13 61.71,-13.13"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/begin.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="200.25,-130.25 141.5,-130.25 141.5,-111 200.25,-111 200.25,-130.25"/>
|
||||
<text text-anchor="middle" x="170.88" y="-116.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::begin</text>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="195,-19.25 141.5,-19.25 141.5,0 195,0 195,-19.25"/>
|
||||
<text text-anchor="middle" x="168.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<path fill="none" stroke="#63b8ff" d="M103.12,-74.57C113.37,-82.4 128.17,-93.47 141.5,-102.62 142.46,-103.29 143.45,-103.95 144.44,-104.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="142.25,-108.02 152.54,-110.55 146.07,-102.15 142.25,-108.02"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/end.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="196.5,-93.25 145.25,-93.25 145.25,-74 196.5,-74 196.5,-93.25"/>
|
||||
<text text-anchor="middle" x="170.88" y="-79.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::end</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node2->Node4</title>
|
||||
<path fill="none" stroke="#63b8ff" d="M105.98,-68.38C114.1,-70.32 124.37,-72.77 134.28,-75.13"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="133.23,-78.72 143.77,-77.64 134.86,-71.91 133.23,-78.72"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="197.62,-56.25 144.12,-56.25 144.12,-37 197.62,-37 197.62,-56.25"/>
|
||||
<text text-anchor="middle" x="170.88" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node5 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>Node2->Node5</title>
|
||||
<path fill="none" stroke="#63b8ff" d="M105.98,-61.07C113.82,-59.3 123.65,-57.07 133.23,-54.91"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="133.85,-58.13 142.83,-52.51 132.31,-51.3 133.85,-58.13"/>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/equal.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="200.25,-19.25 141.5,-19.25 141.5,0 200.25,0 200.25,-19.25"/>
|
||||
<text text-anchor="middle" x="170.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::equal</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node6 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>Node2->Node6</title>
|
||||
<path fill="none" stroke="#63b8ff" d="M103.58,-54.66C113.84,-47.09 128.42,-36.49 141.5,-27.62 142.47,-26.97 143.45,-26.31 144.46,-25.64"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="146.08,-28.12 152.56,-19.74 142.27,-22.24 146.08,-28.12"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M105.83,-9.62C112.94,-9.62 121.68,-9.62 130.32,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="130.08,-13.13 140.08,-9.62 130.08,-6.13 130.08,-13.13"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 2.2 KiB |
@@ -281,7 +281,7 @@ Algorithm</h3>
|
||||
<p>This problem can be solved using matrix exponentiation method. </p><dl class="section see"><dt>See also</dt><dd>here for simple <a href="https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/math/modular_exponentiation.cpp" target="_blank">number exponentiation algorithm</a> or <a href="https://en.wikipedia.org/wiki/Exponentiation_by_squaring" target="_blank">explaination here</a>. </dd></dl>
|
||||
<dl class="section author"><dt>Author</dt><dd><a href="https://github.com/AshishYUO" target="_blank">Ashish Daulatabad</a> for assert for IO operations for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a> STL</dd></dl>
|
||||
<p>Mathematical algorithms</p>
|
||||
<p>for std::is_equal, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/swap.html">std::swap</a> for assert for IO operations</p>
|
||||
<p>for assert for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></p>
|
||||
<p>Mathematical algorithms</p>
|
||||
<p>for assert for io operations</p>
|
||||
<p>Mathematical algorithms</p>
|
||||
|
||||
Reference in New Issue
Block a user