From e18164bf60913a445c70a2a77dd1bc4a23267174 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Sun, 16 Aug 2020 16:38:54 +0000 Subject: [PATCH] Documentation for 9adf7f465cea1bbbfe43ef418392ab66a05c00fa --- d4/d86/large__number_8h_source.html | 5 +- d9/d89/fibonacci_8cpp.html | 77 +++++++++++++++++-- d9/d89/fibonacci_8cpp.js | 5 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 5 ++ ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 1 + ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 52 +++++++++++++ globals_f.html | 2 +- globals_func_f.html | 2 +- globals_func_t.html | 35 +++++---- globals_t.html | 33 ++++---- navtreedata.js | 6 +- navtreeindex2.js | 6 +- navtreeindex3.js | 6 +- navtreeindex4.js | 8 +- navtreeindex5.js | 3 +- search/all_14.js | 2 +- search/all_6.js | 2 +- search/functions_14.js | 2 +- search/functions_6.js | 2 +- 19 files changed, 189 insertions(+), 65 deletions(-) create mode 100644 d9/d89/fibonacci_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map create mode 100644 d9/d89/fibonacci_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 create mode 100644 d9/d89/fibonacci_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg diff --git a/d4/d86/large__number_8h_source.html b/d4/d86/large__number_8h_source.html index bed19f3c4..550e14814 100644 --- a/d4/d86/large__number_8h_source.html +++ b/d4/d86/large__number_8h_source.html @@ -404,6 +404,7 @@ $(document).ready(function(){initNavTree('d4/d86/large__number_8h_source.html','
Graph::getAdjList
std::remove_reference< AdjList >::type const & getAdjList() const
Definition: cycle_check_directed_graph.cpp:103
CycleCheck::isCyclicBFS
static bool isCyclicBFS(Graph const &graph)
Definition: cycle_check_directed_graph.cpp:249
std::strlen
T strlen(T... args)
+
fibonacci
unsigned int fibonacci(unsigned int n)
Definition: fibonacci.cpp:17
quadratic_probing::removalInfo
void removalInfo(int key)
Definition: quadratic_probing_hash_table.cpp:222
graph::is_graph_bipartite::Graph::nax
static const int nax
stores the side of the vertex
Definition: is_graph_bipartite.cpp:57
Graph::getVertices
unsigned int getVertices() const
Definition: cycle_check_directed_graph.cpp:110
@@ -426,7 +427,7 @@ $(document).ready(function(){initNavTree('d4/d86/large__number_8h_source.html','
gcd
int gcd(int num1, int num2)
Definition: gcd_iterative_euclidean.cpp:15
Complex
Class Complex to represent complex numbers as a field.
Definition: complex_numbers.cpp:20
std::move
T move(T... args)
-
main
int main()
Main function.
Definition: fibonacci.cpp:28
+
main
int main()
Main function.
Definition: fibonacci.cpp:59
operator+
std::vector< T > operator+(std::vector< T > const &A, std::vector< T > const &B)
Definition: ordinary_least_squares_regressor.cpp:204
large_number::operator<<
friend std::ostream & operator<<(std::ostream &out, const large_number &a)
Definition: large_number.h:146
large_number::large_number
large_number(std::vector< unsigned char > &vec)
Definition: large_number.h:51
@@ -548,13 +549,13 @@ $(document).ready(function(){initNavTree('d4/d86/large__number_8h_source.html','
main
int main(int argc, char **argv)
Definition: kohonen_som_trace.cpp:457
Complex::real
double real() const
Member function to get real value of our complex number. Member function (getter) to access the class...
Definition: complex_numbers.cpp:64
large_number::large_number
large_number(const large_number &a)
Definition: large_number.h:48
-
fibonacci
int fibonacci(unsigned int n)
Definition: fibonacci.cpp:17
Trie::insert
void insert(const std::string &word)
Definition: trie_modern.cpp:109
operator<<
std::ostream & operator<<(std::ostream &out, std::vector< std::vector< T >> const &v)
Definition: ordinary_least_squares_regressor.cpp:22
CycleCheck::isCyclicDFS
static bool isCyclicDFS(Graph const &graph)
Definition: cycle_check_directed_graph.cpp:212
test3
void test3()
Definition: kohonen_som_topology.cpp:537
createNode
node * createNode(int data)
Definition: avltree.cpp:21
CycleCheck
Definition: cycle_check_directed_graph.cpp:158
+
test
static void test()
Definition: fibonacci.cpp:32
graph::RootedTree::parent
std::vector< int > parent
Stores parent of every vertex and for root its own index. The root is technically not its own parent,...
Definition: lowest_common_ancestor.cpp:103
CycleCheck::isCyclicDFSHelper
static bool isCyclicDFSHelper(AdjList const &adjList, std::vector< nodeStates > *state, unsigned int node)
Definition: cycle_check_directed_graph.cpp:170
large_number::operator*=
large_number & operator*=(const T n)
Definition: large_number.h:238
diff --git a/d9/d89/fibonacci_8cpp.html b/d9/d89/fibonacci_8cpp.html index d58ce3460..721ce7a4f 100644 --- a/d9/d89/fibonacci_8cpp.html +++ b/d9/d89/fibonacci_8cpp.html @@ -110,8 +110,10 @@ Include dependency graph for fibonacci.cpp: - - + + + + @@ -124,14 +126,14 @@ int 

Functions

int fibonacci (unsigned int n)
 
unsigned int fibonacci (unsigned int n)
 
static void test ()
 
int main ()
 Main function.
See also
fibonacci_large.cpp, fibonacci_fast.cpp, string_fibonacci.cpp

Function Documentation

- -

◆ fibonacci()

+ +

◆ fibonacci()

- + @@ -140,21 +142,80 @@ int 
int fibonacci unsigned int fibonacci ( unsigned int  n)

Recursively compute sequences

-
17  {
+
17  {
18  /* If the input is 0 or 1 just return the same
19  This will set the first 2 values of the sequence */
20  if (n <= 1)
21  return n;
22 
23  /* Add the last 2 values of the sequence to get next */
-
24  return fibonacci(n - 1) + fibonacci(n - 2);
+
24  return fibonacci(n - 1) + fibonacci(n - 2);
25 }
+
+ + +

◆ test()

+ +
+
+ + + + + +
+ + + + + + + +
static void test ()
+
+static
+
+

Function for testing the fibonacci() function with a few test cases and assert statement.

Returns
void
+
32  {
+
33  unsigned int test_case_1 = fibonacci(0);
+
34  assert(test_case_1 == 0);
+
35  std::cout << "Passed Test 1!" << std::endl;
+
36 
+
37  unsigned int test_case_2 = fibonacci(1);
+
38  assert(test_case_2 == 1);
+
39  std::cout << "Passed Test 2!" << std::endl;
+
40 
+
41  unsigned int test_case_3 = fibonacci(2);
+
42  assert(test_case_3 == 1);
+
43  std::cout << "Passed Test 3!" << std::endl;
+
44 
+
45  unsigned int test_case_4 = fibonacci(3);
+
46  assert(test_case_4 == 2);
+
47  std::cout << "Passed Test 4!" << std::endl;
+
48 
+
49  unsigned int test_case_5 = fibonacci(4);
+
50  assert(test_case_5 == 3);
+
51  std::cout << "Passed Test 5!" << std::endl;
+
52 
+
53  unsigned int test_case_6 = fibonacci(15);
+
54  assert(test_case_6 == 610);
+
55  std::cout << "Passed Test 6!" << std::endl << std::endl;
+
56 }
+
+Here is the call graph for this function:
+
+
+
+
+
-
int fibonacci(unsigned int n)
Definition: fibonacci.cpp:17
+
unsigned int fibonacci(unsigned int n)
Definition: fibonacci.cpp:17
+ +
T endl(T... args)