Documentation for 53a6c16730

This commit is contained in:
github-actions
2022-01-16 16:05:19 +00:00
parent 778f1be9e5
commit 2cab28c905
3620 changed files with 52045 additions and 41188 deletions

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: math/n_bonacci.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
@@ -155,10 +155,10 @@ 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"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> {</div>
<div class="line"><a id="l00121" name="l00121"></a><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"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span>}</div>
<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><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
@@ -206,22 +206,22 @@ 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"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> {</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;uint64_t&gt;</a> a(m, 0); <span class="comment">// we create an empty array of size m</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> </div>
<div class="line"><a id="l00044" name="l00044"></a><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"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="comment"> /// preceding N zeros</span></div>
<div class="line"><a id="l00046" name="l00046"></a><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"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="comment"> /// also 1</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="comment"></span> <span class="keywordflow">for</span> (uint64_t i = n + 1; i &lt; m; i++) {</div>
<div class="line"><a id="l00049" name="l00049"></a><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"><a id="l00050" name="l00050"></a><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"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="comment">// term can be computed using the given formula</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> a[i] = 2 * a[i - 1] - a[i - 1 - n];</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> }</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordflow">return</span> a;</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</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 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&lt;uint64_t&gt;</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 &lt; 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="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt; uint64_t &gt;</a></div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
@@ -256,58 +256,58 @@ 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"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> {</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="comment">// n = 1 m = 1 return [1, 1]</span></div>
<div class="line"><a id="l00065" name="l00065"></a><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> &lt;&lt; <span class="stringliteral">&quot;1st test&quot;</span>;</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;uint64_t&gt;</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"><a id="l00067" name="l00067"></a><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"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="comment">// N-bonacci func</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;uint64_t&gt;</a> output_array1 = {</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> 1, 1}; <span class="comment">// It is the expected output series of length m</span></div>
<div class="line"><a id="l00071" name="l00071"></a><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"><a id="l00072" name="l00072"></a><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"><a id="l00073" name="l00073"></a><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> &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> </div>
<div class="line"><a id="l00075" name="l00075"></a><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"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="comment">// 464]</span></div>
<div class="line"><a id="l00077" name="l00077"></a><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> &lt;&lt; <span class="stringliteral">&quot;2nd test&quot;</span>;</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;uint64_t&gt;</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"><a id="l00079" name="l00079"></a><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"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="comment">// N-bonacci func</span></div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;uint64_t&gt;</a> output_array2 = {</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> 0, 0, 0, 0, 1, 1, 2, 4,</div>
<div class="line"><a id="l00083" name="l00083"></a><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"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="comment">// length m</span></div>
<div class="line"><a id="l00085" name="l00085"></a><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"><a id="l00086" name="l00086"></a><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"><a id="l00087" name="l00087"></a><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> &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> </div>
<div class="line"><a id="l00089" name="l00089"></a><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"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="comment">// 492, 976]</span></div>
<div class="line"><a id="l00091" name="l00091"></a><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> &lt;&lt; <span class="stringliteral">&quot;3rd test&quot;</span>;</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;uint64_t&gt;</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"><a id="l00093" name="l00093"></a><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"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="comment">// N-bonacci func</span></div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;uint64_t&gt;</a> output_array3 = {</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> 0, 0, 0, 0, 0, 1, 1, 2, 4,</div>
<div class="line"><a id="l00097" name="l00097"></a><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"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="comment">// of length m</span></div>
<div class="line"><a id="l00099" name="l00099"></a><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"><a id="l00100" name="l00100"></a><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"><a id="l00101" name="l00101"></a><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> &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> </div>
<div class="line"><a id="l00103" name="l00103"></a><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"><a id="l00104" name="l00104"></a><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> &lt;&lt; <span class="stringliteral">&quot;4th test&quot;</span>;</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;uint64_t&gt;</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"><a id="l00106" name="l00106"></a><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"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="comment">// for N-bonacci func</span></div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;uint64_t&gt;</a> output_array4 = {</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> 0, 0, 0, 0, 0, 0, 0, 0,</div>
<div class="line"><a id="l00110" name="l00110"></a><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"><a id="l00111" name="l00111"></a><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"><a id="l00112" name="l00112"></a><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"><a id="l00113" name="l00113"></a><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> &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span>}</div>
<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> &lt;&lt; <span class="stringliteral">&quot;1st test&quot;</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&lt;uint64_t&gt;</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&lt;uint64_t&gt;</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> &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 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> &lt;&lt; <span class="stringliteral">&quot;2nd test&quot;</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&lt;uint64_t&gt;</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&lt;uint64_t&gt;</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> &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 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> &lt;&lt; <span class="stringliteral">&quot;3rd test&quot;</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&lt;uint64_t&gt;</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&lt;uint64_t&gt;</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> &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 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> &lt;&lt; <span class="stringliteral">&quot;4th test&quot;</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&lt;uint64_t&gt;</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&lt;uint64_t&gt;</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> &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 114</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>
@@ -329,7 +329,7 @@ Here is the call graph for this function:</div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../db/d27/n__bonacci_8cpp.html">n_bonacci.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
</ul>
</div>
</body>

View File

@@ -1,7 +1,7 @@
<map id="test" name="test">
<area shape="rect" id="node1" title="Self&#45;test implementations." alt="" coords="5,81,49,108"/>
<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,176,32"/>
<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,56,171,83"/>
<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="101,107,173,133"/>
<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,157,176,184"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/begin#" title=" " alt="" coords="97,5,176,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/end#" title=" " alt="" coords="102,56,171,83"/>
<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#" title=" " alt="" coords="101,107,173,133"/>
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/equal#" title=" " alt="" coords="97,157,176,184"/>
</map>

View File

@@ -1 +1 @@
82ecc1261753a678db478e342f70dee2
94579618d8e8597b8ea75f029ea44ef1

View File

@@ -21,7 +21,7 @@
<!-- 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=" ">
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/begin#" xlink:title=" ">
<polygon fill="white" stroke="black" points="69,-114.5 69,-133.5 128,-133.5 128,-114.5 69,-114.5"/>
<text text-anchor="middle" x="98.5" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::begin</text>
</a>
@@ -36,7 +36,7 @@
<!-- 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=" ">
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/end#" xlink:title=" ">
<polygon fill="white" stroke="black" points="72.5,-76.5 72.5,-95.5 124.5,-95.5 124.5,-76.5 72.5,-76.5"/>
<text text-anchor="middle" x="98.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::end</text>
</a>
@@ -51,7 +51,7 @@
<!-- 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=" ">
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
<polygon fill="white" stroke="black" points="71.5,-38.5 71.5,-57.5 125.5,-57.5 125.5,-38.5 71.5,-38.5"/>
<text text-anchor="middle" x="98.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
</a>
@@ -66,7 +66,7 @@
<!-- 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=" ">
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/equal#" xlink:title=" ">
<polygon fill="white" stroke="black" points="69,-0.5 69,-19.5 128,-19.5 128,-0.5 69,-0.5"/>
<text text-anchor="middle" x="98.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::equal</text>
</a>

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -1,8 +1,8 @@
<map id="main" name="main">
<area shape="rect" id="node1" title="Main function." alt="" coords="5,81,56,108"/>
<area shape="rect" id="node2" href="$db/d27/n__bonacci_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" title="Self&#45;test implementations." alt="" coords="104,81,148,108"/>
<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="196,5,275,32"/>
<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="201,56,270,83"/>
<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="199,107,271,133"/>
<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="196,157,275,184"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/begin#" title=" " alt="" coords="196,5,275,32"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/iterator/end#" title=" " alt="" coords="201,56,270,83"/>
<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#" title=" " alt="" coords="199,107,271,133"/>
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/equal#" title=" " alt="" coords="196,157,275,184"/>
</map>

View File

@@ -1 +1 @@
ae0eb23fc5285330c95c7105e84b277e
36a1a4638caf7c0235c9842bdf0d4bd5

View File

@@ -36,7 +36,7 @@
<!-- 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=" ">
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/begin#" xlink:title=" ">
<polygon fill="white" stroke="black" points="143,-114.5 143,-133.5 202,-133.5 202,-114.5 143,-114.5"/>
<text text-anchor="middle" x="172.5" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::begin</text>
</a>
@@ -51,7 +51,7 @@
<!-- 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=" ">
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/iterator/end#" xlink:title=" ">
<polygon fill="white" stroke="black" points="146.5,-76.5 146.5,-95.5 198.5,-95.5 198.5,-76.5 146.5,-76.5"/>
<text text-anchor="middle" x="172.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::end</text>
</a>
@@ -66,7 +66,7 @@
<!-- 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=" ">
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
<polygon fill="white" stroke="black" points="145.5,-38.5 145.5,-57.5 199.5,-57.5 199.5,-38.5 145.5,-38.5"/>
<text text-anchor="middle" x="172.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
</a>
@@ -81,7 +81,7 @@
<!-- 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=" ">
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/equal#" xlink:title=" ">
<polygon fill="white" stroke="black" points="143,-0.5 143,-19.5 202,-19.5 202,-0.5 143,-0.5"/>
<text text-anchor="middle" x="172.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::equal</text>
</a>

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB