From 3e71d633809934f7e08c7e2bc685d4f6cd3d39fe Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Sun, 7 Nov 2021 17:56:58 +0000 Subject: [PATCH] Documentation for e64e3df18fecaecb535738cbc417e8e14105de63 --- d0/d01/smallest__circle_8cpp.html | 2 +- d0/d5a/skip__list_8cpp.html | 2 +- d1/d2a/knight__tour_8cpp.html | 2 +- ...1heavy__light__decomposition_1_1_tree.html | 2 +- d1/d83/classuint256__t.html | 2 +- d1/d9a/hopcroft__karp_8cpp.html | 2 +- d1/da6/rungekutta_8cpp.html | 4 +- d1/db3/structcompare.html | 2 +- d1/de0/namespacenumerical__methods.html | 247 +++++++++--------- ...a__structures_1_1linked__list_1_1list.html | 51 ++-- ...2d20da40d800897c31a649799d5e43d_cgraph.map | 3 +- ...2d20da40d800897c31a649799d5e43d_cgraph.md5 | 2 +- ...2d20da40d800897c31a649799d5e43d_cgraph.svg | 39 +-- d2/d05/class_min_heap.html | 4 +- d2/d26/count__inversions_8cpp.html | 2 +- d2/d3b/namespaceqr__algorithm.html | 2 +- ...heavy__light__decomposition_1_1_h_l_d.html | 2 +- d3/dfe/horspool_8cpp.html | 2 +- d4/d08/babylonian__method_8cpp__incl.map | 6 +- d4/d08/babylonian__method_8cpp__incl.md5 | 2 +- d4/d08/babylonian__method_8cpp__incl.svg | 32 +-- d4/d18/composite__simpson__rule_8cpp.html | 227 ++++++++-------- d4/def/kohonen__som__topology_8cpp.html | 2 +- ...1_1neural__network_1_1_neural_network.html | 2 +- d5/d33/gram__schmidt_8cpp.html | 4 +- d5/d4c/group__sorting.html | 2 +- d5/d96/md5_8cpp.html | 2 +- d5/def/stairs__pattern_8cpp.html | 2 +- d6/d05/reverse__a__linked__list_8cpp.html | 58 ++-- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 10 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 60 ++--- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 10 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 60 ++--- d6/d7a/golden__search__extrema_8cpp.html | 2 +- ..._1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html | 2 +- d8/d72/class_r_btree.html | 2 +- d8/d7a/sha1_8cpp.html | 2 +- d8/d9a/fast__fourier__transform_8cpp.html | 67 ++--- d8/db1/binomial__calculate_8cpp.html | 2 +- ...nverse__fast__fourier__transform_8cpp.html | 65 +++-- d9/d69/median__search_8cpp.html | 2 +- da/d24/sqrt__double_8cpp.html | 2 +- ...es_1_1sparse__table_1_1_sparse__table.html | 4 +- da/d41/uint128__t_8hpp_source.html | 2 +- da/d7b/primality__test_8cpp.html | 2 +- da/da3/uint256__t_8hpp_source.html | 2 +- da/dc3/linked__list_8cpp.html | 2 +- ...ibonacci__matrix__exponentiation_8cpp.html | 2 +- da/df2/durand__kerner__roots_8cpp.html | 2 +- db/d01/brent__method__extrema_8cpp.html | 2 +- db/d40/integral__approximation2_8cpp.html | 2 +- db/d9a/classuint128__t.html | 4 +- dc/d9c/babylonian__method_8cpp.html | 70 ++--- ...ical_methods_2rungekutta_8cpp-example.html | 4 +- dd/d29/false__position_8cpp.html | 2 +- de/d75/qr__eigen__values_8cpp.html | 2 +- de/d9b/prime__numbers_8cpp.html | 2 +- df/d11/midpoint__integral__method_8cpp.html | 2 +- df/d82/breadth__first__search_8cpp.html | 2 +- df/dce/namespacegraph.html | 2 +- df/dd5/binary__search_8cpp.html | 2 +- namespaces.html | 2 +- 64 files changed, 545 insertions(+), 570 deletions(-) diff --git a/d0/d01/smallest__circle_8cpp.html b/d0/d01/smallest__circle_8cpp.html index 3dabe67d4..e288f5a3e 100644 --- a/d0/d01/smallest__circle_8cpp.html +++ b/d0/d01/smallest__circle_8cpp.html @@ -226,7 +226,7 @@ The function returns the radius of the circle and prints the coordinated of the
150 return minR;
151}
std::cout
-
numerical_methods::simpson_method::k
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
numerical_methods::simpson_method::k
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
std::endl
T endl(T... args)
std::vector::size
T size(T... args)
LenghtLine
double LenghtLine(const Point &A, const Point &B)
Definition: smallest_circle.cpp:37
diff --git a/d0/d5a/skip__list_8cpp.html b/d0/d5a/skip__list_8cpp.html index 79e74b4d1..cb31f7a82 100644 --- a/d0/d5a/skip__list_8cpp.html +++ b/d0/d5a/skip__list_8cpp.html @@ -183,7 +183,7 @@ constexpr float data_struc
Definition: skip_list.cpp:55
void insertElement(int key, void *value)
Definition: skip_list.cpp:90
void displayList()
Definition: skip_list.cpp:191
-
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
constexpr int MAX_LEVEL
Maximum level of skip list.
Definition: skip_list.cpp:27
T rand(T... args)
T srand(T... args)
diff --git a/d1/d2a/knight__tour_8cpp.html b/d1/d2a/knight__tour_8cpp.html index 6ef3ebd9a..cc185de9f 100644 --- a/d1/d2a/knight__tour_8cpp.html +++ b/d1/d2a/knight__tour_8cpp.html @@ -344,7 +344,7 @@ template<size_t V>
78 }
79 return false;
80}
-
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
void mov(tower *From, tower *To)
Definition: tower_of_hanoi.cpp:39
Here is the call graph for this function:
diff --git a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html index 8ea17e1da..def32b4de 100644 --- a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html +++ b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html @@ -407,7 +407,7 @@ template<typename X >
131 }
132 }
void dfs_lca(int u, int p=-1)
Utility function to populate the t_par vector.
Definition: heavy_light_decomposition.cpp:116
-
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
Here is the call graph for this function:
diff --git a/d1/d83/classuint256__t.html b/d1/d83/classuint256__t.html index 1ccecde61..a69e5dd66 100644 --- a/d1/d83/classuint256__t.html +++ b/d1/d83/classuint256__t.html @@ -847,7 +847,7 @@ Here is the call graph for this function:
429 tmp <<= left;
430 uint256_t quotient(0);
431 uint256_t zero(0);
-
432 while (left >= 0 && tmp2 >= p) {
+
432 while (tmp2 >= p) {
433 uint16_t shf = tmp2._lez() - tmp._lez();
434 if (shf) {
435 tmp >>= shf;
diff --git a/d1/d9a/hopcroft__karp_8cpp.html b/d1/d9a/hopcroft__karp_8cpp.html index d12c15296..6c4cc1145 100644 --- a/d1/d9a/hopcroft__karp_8cpp.html +++ b/d1/d9a/hopcroft__karp_8cpp.html @@ -197,7 +197,7 @@ Algorithm
Represents Bipartite graph for Hopcroft Karp implementation.
Definition: hopcroft_karp.cpp:67
-
double g(double x)
Another test function.
Definition: composite_simpson_rule.cpp:113
+
double g(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
void tests()
Definition: hopcroft_karp.cpp:255
Here is the call graph for this function:
diff --git a/d1/da6/rungekutta_8cpp.html b/d1/da6/rungekutta_8cpp.html index d05d8c70f..8ba011e34 100644 --- a/d1/da6/rungekutta_8cpp.html +++ b/d1/da6/rungekutta_8cpp.html @@ -112,7 +112,7 @@ Include dependency graph for rungekutta.cpp:

Namespaces

namespace  numerical_methods - for IO operations
+ for assert
  namespace  runge_kutta  Functions for Runge Kutta fourth order method.
@@ -307,7 +307,7 @@ Here is the call graph for this function:
90
91 return y;
92}
-
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
int h(int key)
Definition: hash_search.cpp:45
static double change(double x, double y)
for using the vector container
Definition: rungekutta.cpp:33
diff --git a/d1/db3/structcompare.html b/d1/db3/structcompare.html index dffeb0504..30b1e64ba 100644 --- a/d1/db3/structcompare.html +++ b/d1/db3/structcompare.html @@ -139,7 +139,7 @@ Public Member Functions
31 {
32 return (l->freq > r->freq);
33 }
-
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
+
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:119
diff --git a/d1/de0/namespacenumerical__methods.html b/d1/de0/namespacenumerical__methods.html index 565dba89f..a69b41671 100644 --- a/d1/de0/namespacenumerical__methods.html +++ b/d1/de0/namespacenumerical__methods.html @@ -96,7 +96,7 @@ $(document).ready(function(){initNavTree('d1/de0/namespacenumerical__methods.htm
-

for IO operations +

for assert More...

@@ -112,18 +112,21 @@ Functions

 

Detailed Description

-

for IO operations

+

for assert

Numerical Methods.

+

for std::map container

for std::vector

for io operations

-

for std::map container

-

for assert

+

for math functions

+

for IO operations

Numerical algorithms/methods

-

for assert for math functions for integer allocation for std::atof for std::function for IO operations

+

for assert for integer allocation for std::atof for std::function for IO operations for std::map container

Numerical algorithms/methods

for math operations

Numerical methods

for assert for mathematical-related functions for storing points and coefficents for IO operations

+

Numerical algorithms/methods

+

for assert for math functions for integer allocation for std::atof for std::function for IO operations

Numerical algorithms/methods

Function Documentation

@@ -157,28 +160,28 @@ Functions

Temp variable to x0 and x1

Newly calculated root

Returning final root

-
31 {
-
32 int i = 1; /// To find initial root or rough approximation
-
33
-
34 while (i * i <= radicand) {
-
35 i++;
-
36 }
-
37
-
38 i--; /// Real Initial value will be i-1 as loop stops on +1 value
-
39
-
40 double x0 = i; /// Storing previous value for comparison
-
41 double x1 =
-
42 (radicand / x0 + x0) / 2; /// Storing calculated value for comparison
-
43 double temp = NAN; /// Temp variable to x0 and x1
-
44
-
45 while (std::max(x0, x1) - std::min(x0, x1) < 0.0001) {
-
46 temp = (radicand / x1 + x1) / 2; /// Newly calculated root
-
47 x0 = x1;
-
48 x1 = temp;
-
49 }
-
50
-
51 return x1; /// Returning final root
-
52}
+
30 {
+
31 int i = 1; /// To find initial root or rough approximation
+
32
+
33 while (i * i <= radicand) {
+
34 i++;
+
35 }
+
36
+
37 i--; /// Real Initial value will be i-1 as loop stops on +1 value
+
38
+
39 double x0 = i; /// Storing previous value for comparison
+
40 double x1 =
+
41 (radicand / x0 + x0) / 2; /// Storing calculated value for comparison
+
42 double temp = NAN; /// Temp variable to x0 and x1
+
43
+
44 while (std::max(x0, x1) - std::min(x0, x1) < 0.0001) {
+
45 temp = (radicand / x1 + x1) / 2; /// Newly calculated root
+
46 x0 = x1;
+
47 x1 = temp;
+
48 }
+
49
+
50 return x1; /// Returning final root
+
51}
T max(T... args)
T min(T... args)
@@ -241,54 +244,53 @@ y if n!=1

Updating the last n/2 elements

Deleting dynamic array ye

Deleting dynamic array yo

-
40 {
-
41 if (n == 1) {
-
42 return p; /// Base Case To return
-
43 }
-
44
-
45 double pi = 2 * asin(1.0); /// Declaring value of pi
-
46
- -
48 cos(2 * pi / n), sin(2 * pi / n)); /// Calculating value of omega
-
49
-
50 auto *pe = new std::complex<double>[n / 2]; /// Coefficients of even power
-
51
-
52 auto *po = new std::complex<double>[n / 2]; /// Coefficients of odd power
-
53
-
54 int k1 = 0, k2 = 0;
-
55 for (int j = 0; j < n; j++) {
-
56 if (j % 2 == 0) {
-
57 pe[k1++] = p[j]; /// Assigning values of even Coefficients
-
58
-
59 } else
-
60 po[k2++] = p[j]; /// Assigning value of odd Coefficients
-
61 }
-
62
- -
64 FastFourierTransform(pe, n / 2); /// Recursive Call
-
65
- -
67 FastFourierTransform(po, n / 2); /// Recursive Call
-
68
-
69 auto *y = new std::complex<double>[n]; /// Final value representation list
+
41 {
+
42 if (n == 1) {
+
43 return p; /// Base Case To return
+
44 }
+
45
+
46 double pi = 2 * asin(1.0); /// Declaring value of pi
+
47
+ +
49 cos(2 * pi / n), sin(2 * pi / n)); /// Calculating value of omega
+
50
+
51 auto *pe = new std::complex<double>[n / 2]; /// Coefficients of even power
+
52
+
53 auto *po = new std::complex<double>[n / 2]; /// Coefficients of odd power
+
54
+
55 int k1 = 0, k2 = 0;
+
56 for (int j = 0; j < n; j++) {
+
57 if (j % 2 == 0) {
+
58 pe[k1++] = p[j]; /// Assigning values of even Coefficients
+
59
+
60 } else {
+
61 po[k2++] = p[j]; /// Assigning value of odd Coefficients
+
62 }
+
63 }
+
64
+ +
66 FastFourierTransform(pe, n / 2); /// Recursive Call
+
67
+ +
69 FastFourierTransform(po, n / 2); /// Recursive Call
70
-
71 k1 = 0, k2 = 0;
+
71 auto *y = new std::complex<double>[n]; /// Final value representation list
72
-
73 for (int i = 0; i < n / 2; i++) {
-
74 y[i] =
-
75 ye[k1] + pow(om, i) * yo[k2]; /// Updating the first n/2 elements
-
76 y[i + n / 2] =
-
77 ye[k1] - pow(om, i) * yo[k2]; /// Updating the last n/2 elements
-
78
-
79 k1++;
-
80 k2++;
-
81 }
-
82
-
83 if(n!=2){
-
84
-
85 delete[] pe;
-
86 delete[] po;
-
87
+
73 k1 = 0, k2 = 0;
+
74
+
75 for (int i = 0; i < n / 2; i++) {
+
76 y[i] =
+
77 ye[k1] + pow(om, i) * yo[k2]; /// Updating the first n/2 elements
+
78 y[i + n / 2] =
+
79 ye[k1] - pow(om, i) * yo[k2]; /// Updating the last n/2 elements
+
80
+
81 k1++;
+
82 k2++;
+
83 }
+
84
+
85 if (n != 2) {
+
86 delete[] pe;
+
87 delete[] po;
88 }
89
90 delete[] ye; /// Deleting dynamic array ye
@@ -296,7 +298,7 @@ y if n!=1
92 return y;
93}
-
std::complex< double > * FastFourierTransform(std::complex< double > *p, uint8_t n)
FastFourierTransform is a recursive function which returns list of complex numbers.
Definition: fast_fourier_transform.cpp:40
+
std::complex< double > * FastFourierTransform(std::complex< double > *p, uint8_t n)
FastFourierTransform is a recursive function which returns list of complex numbers.
Definition: fast_fourier_transform.cpp:41
T pow(T... args)
Here is the call graph for this function:
@@ -360,57 +362,56 @@ y if n!=1

Updating the last n/2 elements

Deleting dynamic array ye

Deleting dynamic array yo

-
33 {
-
34 if (n == 1) {
-
35 return p; /// Base Case To return
-
36 }
-
37
-
38 double pi = 2 * asin(1.0); /// Declaring value of pi
-
39
- -
41 cos(2 * pi / n), sin(2 * pi / n)); /// Calculating value of omega
-
42
-
43 om.real(om.real()/n); /// One change in comparison with DFT
-
44 om.imag(om.imag()/n); /// One change in comparison with DFT
-
45
-
46 auto *pe = new std::complex<double>[n / 2]; /// Coefficients of even power
-
47
-
48 auto *po = new std::complex<double>[n / 2]; /// Coefficients of odd power
-
49
-
50 int k1 = 0, k2 = 0;
-
51 for (int j = 0; j < n; j++) {
-
52 if (j % 2 == 0) {
-
53 pe[k1++] = p[j]; /// Assigning values of even Coefficients
-
54
-
55 } else
-
56 po[k2++] = p[j]; /// Assigning value of odd Coefficients
-
57 }
-
58
- -
60 InverseFastFourierTransform(pe, n / 2); /// Recursive Call
-
61
- -
63 InverseFastFourierTransform(po, n / 2); /// Recursive Call
-
64
-
65 auto *y = new std::complex<double>[n]; /// Final value representation list
+
34 {
+
35 if (n == 1) {
+
36 return p; /// Base Case To return
+
37 }
+
38
+
39 double pi = 2 * asin(1.0); /// Declaring value of pi
+
40
+ +
42 cos(2 * pi / n), sin(2 * pi / n)); /// Calculating value of omega
+
43
+
44 om.real(om.real() / n); /// One change in comparison with DFT
+
45 om.imag(om.imag() / n); /// One change in comparison with DFT
+
46
+
47 auto *pe = new std::complex<double>[n / 2]; /// Coefficients of even power
+
48
+
49 auto *po = new std::complex<double>[n / 2]; /// Coefficients of odd power
+
50
+
51 int k1 = 0, k2 = 0;
+
52 for (int j = 0; j < n; j++) {
+
53 if (j % 2 == 0) {
+
54 pe[k1++] = p[j]; /// Assigning values of even Coefficients
+
55
+
56 } else {
+
57 po[k2++] = p[j]; /// Assigning value of odd Coefficients
+
58 }
+
59 }
+
60
+ +
62 InverseFastFourierTransform(pe, n / 2); /// Recursive Call
+
63
+ +
65 InverseFastFourierTransform(po, n / 2); /// Recursive Call
66
-
67 k1 = 0, k2 = 0;
+
67 auto *y = new std::complex<double>[n]; /// Final value representation list
68
-
69 for (int i = 0; i < n / 2; i++) {
-
70 y[i] =
-
71 ye[k1] + pow(om, i) * yo[k2]; /// Updating the first n/2 elements
-
72 y[i + n / 2] =
-
73 ye[k1] - pow(om, i) * yo[k2]; /// Updating the last n/2 elements
-
74
-
75 k1++;
-
76 k2++;
-
77 }
-
78
-
79 if(n!=2){
-
80
-
81 delete[] pe;
-
82 delete[] po;
-
83
+
69 k1 = 0, k2 = 0;
+
70
+
71 for (int i = 0; i < n / 2; i++) {
+
72 y[i] =
+
73 ye[k1] + pow(om, i) * yo[k2]; /// Updating the first n/2 elements
+
74 y[i + n / 2] =
+
75 ye[k1] - pow(om, i) * yo[k2]; /// Updating the last n/2 elements
+
76
+
77 k1++;
+
78 k2++;
+
79 }
+
80
+
81 if (n != 2) {
+
82 delete[] pe;
+
83 delete[] po;
84 }
85
86 delete[] ye; /// Deleting dynamic array ye
diff --git a/d1/def/classdata__structures_1_1linked__list_1_1list.html b/d1/def/classdata__structures_1_1linked__list_1_1list.html index ceac35048..33c3d07ae 100644 --- a/d1/def/classdata__structures_1_1linked__list_1_1list.html +++ b/d1/def/classdata__structures_1_1linked__list_1_1list.html @@ -584,19 +584,17 @@ Here is the call graph for this function:

Utility function to find the top element of the list.

Returns
the top element of the list
123 {
-
124 try {
-
125 if (!isEmpty()) {
-
126 return head->val;
-
127 }
-
128 } catch (const std::exception &e) {
-
129 std::cerr << "List is empty" << e.what() << '\n';
-
130 }
-
131}
- +
124 if (!isEmpty()) {
+
125 return head->val;
+
126 } else {
+
127 throw std::logic_error("List is empty");
+
128 }
+
129}
+
Here is the call graph for this function:
-
+
@@ -620,22 +618,23 @@ Here is the call graph for this function:

Utility function to find the i th element of the list.

Returns
the i th element of the list
-
153 {
-
154 Node *current = head;
-
155
-
156 int count = 0;
-
157 while (current != nullptr) {
-
158 if (count == index) {
-
159 return (current->val);
-
160 }
-
161 count++;
-
162 current = current->next;
-
163 }
-
164
-
165 /* if we get to this line,the caller was asking for a non-existent element
-
166 so we assert fail */
-
167 assert(0);
-
168}
+
149 {
+
150 Node *current = head;
+
151
+
152 int count = 0;
+
153 while (current != nullptr) {
+
154 if (count == index) {
+
155 return (current->val);
+
156 }
+
157 count++;
+
158 current = current->next;
+
159 }
+
160
+
161 /* if we get to this line,the caller was asking for a non-existent element
+
162 so we assert fail */
+
163 exit(1);
+
164}
+
T exit(T... args)
diff --git a/d1/def/classdata__structures_1_1linked__list_1_1list_ab2d20da40d800897c31a649799d5e43d_cgraph.map b/d1/def/classdata__structures_1_1linked__list_1_1list_ab2d20da40d800897c31a649799d5e43d_cgraph.map index 2a4109019..162a2369b 100644 --- a/d1/def/classdata__structures_1_1linked__list_1_1list_ab2d20da40d800897c31a649799d5e43d_cgraph.map +++ b/d1/def/classdata__structures_1_1linked__list_1_1list_ab2d20da40d800897c31a649799d5e43d_cgraph.map @@ -1,5 +1,4 @@ - + - diff --git a/d1/def/classdata__structures_1_1linked__list_1_1list_ab2d20da40d800897c31a649799d5e43d_cgraph.md5 b/d1/def/classdata__structures_1_1linked__list_1_1list_ab2d20da40d800897c31a649799d5e43d_cgraph.md5 index a1f73cbbb..4ee06ae56 100644 --- a/d1/def/classdata__structures_1_1linked__list_1_1list_ab2d20da40d800897c31a649799d5e43d_cgraph.md5 +++ b/d1/def/classdata__structures_1_1linked__list_1_1list_ab2d20da40d800897c31a649799d5e43d_cgraph.md5 @@ -1 +1 @@ -99819564c3f1df64f69186810114c1fa \ No newline at end of file +7e56dece2cf801910cf5c5ed381175da \ No newline at end of file diff --git a/d1/def/classdata__structures_1_1linked__list_1_1list_ab2d20da40d800897c31a649799d5e43d_cgraph.svg b/d1/def/classdata__structures_1_1linked__list_1_1list_ab2d20da40d800897c31a649799d5e43d_cgraph.svg index f250a95c8..cc6a7c792 100644 --- a/d1/def/classdata__structures_1_1linked__list_1_1list_ab2d20da40d800897c31a649799d5e43d_cgraph.svg +++ b/d1/def/classdata__structures_1_1linked__list_1_1list_ab2d20da40d800897c31a649799d5e43d_cgraph.svg @@ -4,18 +4,18 @@ - - + + data_structures::linked_list::list::top - + Node1 - -data_structures::linked -_list::list::top + +data_structures::linked +_list::list::top @@ -23,32 +23,17 @@ Node2 - -data_structures::linked -_list::list::isEmpty + +data_structures::linked +_list::list::isEmpty Node1->Node2 - - - - - -Node3 - - -std::exception::what - - - - - -Node1->Node3 - - + + diff --git a/d2/d05/class_min_heap.html b/d2/d05/class_min_heap.html index ae46db735..9e038f46b 100644 --- a/d2/d05/class_min_heap.html +++ b/d2/d05/class_min_heap.html @@ -378,7 +378,7 @@ Here is the call graph for this function:
70 }
71}
-
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
Here is the call graph for this function:
@@ -448,7 +448,7 @@ Here is the call graph for this function:
125}
int left(int i)
Definition: binaryheap.cpp:31
int right(int i)
Definition: binaryheap.cpp:34
-
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
+
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:119
Here is the call graph for this function:
diff --git a/d2/d26/count__inversions_8cpp.html b/d2/d26/count__inversions_8cpp.html index ba95df4b6..f85788abd 100644 --- a/d2/d26/count__inversions_8cpp.html +++ b/d2/d26/count__inversions_8cpp.html @@ -342,7 +342,7 @@ template<typename T >
111 }
112 return inv_count;
113}
-
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
T left(T... args)
diff --git a/d2/d3b/namespaceqr__algorithm.html b/d2/d3b/namespaceqr__algorithm.html index 28cf5bad6..32d11104b 100644 --- a/d2/d3b/namespaceqr__algorithm.html +++ b/d2/d3b/namespaceqr__algorithm.html @@ -466,7 +466,7 @@ template<typename T >
205 }
206 }
207}
-
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
T sum(const std::vector< std::valarray< T > > &A)
Definition: vector_ops.hpp:232
std::valarray< T > vector_proj(const std::valarray< T > &a, const std::valarray< T > &b)
Definition: qr_decompose.h:104
double vector_mag(const std::valarray< T > &a)
Definition: qr_decompose.h:92
diff --git a/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html index c4355225f..a49dcffd3 100644 --- a/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html +++ b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html @@ -318,7 +318,7 @@ template<typename X >
X sret_init
inital query return value
Definition: heavy_light_decomposition.cpp:264
std::vector< int > t_depth
a vector to store the depth of a node,
Definition: heavy_light_decomposition.cpp:88
std::vector< std::vector< int > > t_par
a matrix to store every node's 2^kth parent
Definition: heavy_light_decomposition.cpp:87
-
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
+
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:119
T swap(T... args)
Here is the call graph for this function:
diff --git a/d3/dfe/horspool_8cpp.html b/d3/dfe/horspool_8cpp.html index 30342a85e..64a8e7c37 100644 --- a/d3/dfe/horspool_8cpp.html +++ b/d3/dfe/horspool_8cpp.html @@ -266,7 +266,7 @@ false if text string does not contain prototype string
90 }
91 return false;
92}
-
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
std::unordered_map< char, int > findShiftTable(const std::string &prototype)
Definition: horspool.cpp:26
Here is the call graph for this function:
diff --git a/d4/d08/babylonian__method_8cpp__incl.map b/d4/d08/babylonian__method_8cpp__incl.map index 9eb91ab14..cfe880124 100644 --- a/d4/d08/babylonian__method_8cpp__incl.map +++ b/d4/d08/babylonian__method_8cpp__incl.map @@ -1,6 +1,6 @@ - + - - + + diff --git a/d4/d08/babylonian__method_8cpp__incl.md5 b/d4/d08/babylonian__method_8cpp__incl.md5 index 93b2e9ad6..4dec7aeb7 100644 --- a/d4/d08/babylonian__method_8cpp__incl.md5 +++ b/d4/d08/babylonian__method_8cpp__incl.md5 @@ -1 +1 @@ -006111d22b19eae1139acf05ad55a8b4 \ No newline at end of file +f05fe7c29b7d5338e15065a7a3a89e38 \ No newline at end of file diff --git a/d4/d08/babylonian__method_8cpp__incl.svg b/d4/d08/babylonian__method_8cpp__incl.svg index 513c58902..0aca176f1 100644 --- a/d4/d08/babylonian__method_8cpp__incl.svg +++ b/d4/d08/babylonian__method_8cpp__incl.svg @@ -4,18 +4,18 @@ - + numerical_methods/babylonian_method.cpp - + Node1 - -numerical_methods/babylonian -_method.cpp + +numerical_methods/babylonian +_method.cpp @@ -31,38 +31,38 @@ Node1->Node2 - - + + Node3 - -iostream + +cmath Node1->Node3 - - + + Node4 - -math.h + +iostream Node1->Node4 - - + + diff --git a/d4/d18/composite__simpson__rule_8cpp.html b/d4/d18/composite__simpson__rule_8cpp.html index d3689606f..e1b422f13 100644 --- a/d4/d18/composite__simpson__rule_8cpp.html +++ b/d4/d18/composite__simpson__rule_8cpp.html @@ -116,7 +116,7 @@ Include dependency graph for composite_simpson_rule.cpp:

Namespaces

namespace  numerical_methods - for IO operations
+ for assert
  namespace  simpson_method  Contains the Simpson's method implementation.
@@ -124,8 +124,8 @@ Namespaces - - + + @@ -158,8 +158,8 @@ Functions

Add sample function by replacing one of the f, g, k, l and the assert

Author
ggkogkou

Function Documentation

- -

◆ evaluate_by_simpson()

+ +

◆ evaluate_by_simpson()

@@ -185,7 +185,7 @@ Functions
- + @@ -195,43 +195,44 @@ Functions

Functions

double numerical_methods::simpson_method::evaluate_by_simpson (std::int32_t N, double h, double a, std::function< double(double)> func)
 
double numerical_methods::simpson_method::evaluate_by_simpson (std::int32_t N, double h, double a, const std::function< double(double)> &func)
 
double numerical_methods::simpson_method::f (double x)
 A function f(x) that will be used to test the method. More...
 
std::function< double(double)> const std::function< double(double)> &  func 
-
67 {
- -
69 data_table; // Contains the data points. key: i, value: f(xi)
-
70 double xi = a; // Initialize xi to the starting point x0 = a
-
71
-
72 // Create the data table
-
73 double temp;
-
74 for (std::int32_t i = 0; i <= N; i++) {
-
75 temp = func(xi);
-
76 data_table.insert(
-
77 std::pair<std::int32_t, double>(i, temp)); // add i and f(xi)
-
78 xi += h; // Get the next point xi for the next iteration
-
79 }
-
80
-
81 // Evaluate the integral.
-
82 // Remember: f(x0) + 4*f(x1) + 2*f(x2) + ... + 2*f(xN-2) + 4*f(xN-1) + f(xN)
-
83 double evaluate_integral = 0;
-
84 for (std::int32_t i = 0; i <= N; i++) {
-
85 if (i == 0 || i == N)
-
86 evaluate_integral += data_table.at(i);
-
87 else if (i % 2 == 1)
-
88 evaluate_integral += 4 * data_table.at(i);
-
89 else
-
90 evaluate_integral += 2 * data_table.at(i);
-
91 }
-
92
-
93 // Multiply by the coefficient h/3
-
94 evaluate_integral *= h / 3;
-
95
-
96 // If the result calculated is nan, then the user has given wrong input
-
97 // interval.
-
98 assert(!std::isnan(evaluate_integral) &&
-
99 "The definite integral can't be evaluated. Check the validity of "
-
100 "your input.\n");
-
101 // Else return
-
102 return evaluate_integral;
-
103}
+
68 {
+ +
70 data_table; // Contains the data points. key: i, value: f(xi)
+
71 double xi = a; // Initialize xi to the starting point x0 = a
+
72
+
73 // Create the data table
+
74 double temp = NAN;
+
75 for (std::int32_t i = 0; i <= N; i++) {
+
76 temp = func(xi);
+
77 data_table.insert(
+
78 std::pair<std::int32_t, double>(i, temp)); // add i and f(xi)
+
79 xi += h; // Get the next point xi for the next iteration
+
80 }
+
81
+
82 // Evaluate the integral.
+
83 // Remember: f(x0) + 4*f(x1) + 2*f(x2) + ... + 2*f(xN-2) + 4*f(xN-1) + f(xN)
+
84 double evaluate_integral = 0;
+
85 for (std::int32_t i = 0; i <= N; i++) {
+
86 if (i == 0 || i == N) {
+
87 evaluate_integral += data_table.at(i);
+
88 } else if (i % 2 == 1) {
+
89 evaluate_integral += 4 * data_table.at(i);
+
90 } else {
+
91 evaluate_integral += 2 * data_table.at(i);
+
92 }
+
93 }
+
94
+
95 // Multiply by the coefficient h/3
+
96 evaluate_integral *= h / 3;
+
97
+
98 // If the result calculated is nan, then the user has given wrong input
+
99 // interval.
+
100 assert(!std::isnan(evaluate_integral) &&
+
101 "The definite integral can't be evaluated. Check the validity of "
+
102 "your input.\n");
+
103 // Else return
+
104 return evaluate_integral;
+
105}
T at(T... args)
constexpr uint32_t N
A struct to represent sparse table for min() as their invariant function, for the given array A....
Definition: sparse_table.cpp:47
int h(int key)
Definition: hash_search.cpp:45
@@ -267,7 +268,7 @@ Functions
Returns
the value of the dependent variable yi = f(xi)
-
111{ return std::sqrt(x) + std::log(x); }
+
113{ return std::sqrt(x) + std::log(x); }
T log(T... args)
T sqrt(T... args)
@@ -296,7 +297,7 @@ Here is the call graph for this function:

Another test function.

-
113{ return std::exp(-x) * (4 - std::pow(x, 2)); }
+
115{ return std::exp(-x) * (4 - std::pow(x, 2)); }
T exp(T... args)
T pow(T... args)
@@ -327,7 +328,7 @@ Here is the call graph for this function:

Another test function.

Examples
/Users/runner/work/C-Plus-Plus/C-Plus-Plus/numerical_methods/rungekutta.cpp.
-
115{ return std::sqrt(2 * std::pow(x, 3) + 3); }
+
117{ return std::sqrt(2 * std::pow(x, 3) + 3); }
Here is the call graph for this function:
@@ -354,7 +355,7 @@ Here is the call graph for this function:

Another test function.

-
117{ return x + std::log(2 * x + 1); }
+
119{ return x + std::log(2 * x + 1); }
Here is the call graph for this function:
@@ -402,45 +403,47 @@ Here is the call graph for this function:

Number of intervals to divide the integration interval. MUST BE EVEN

Starting and ending point of the integration in the real axis

Step, calculated by a, b and N

-
168 {
-
169 std::int32_t N = 16; /// Number of intervals to divide the integration
-
170 /// interval. MUST BE EVEN
-
171 double a = 1, b = 3; /// Starting and ending point of the integration in
-
172 /// the real axis
-
173 double h; /// Step, calculated by a, b and N
-
174
-
175 bool used_argv_parameters =
-
176 false; // If argv parameters are used then the assert must be omitted
-
177 // for the tst cases
-
178
-
179 // Get user input (by the command line parameters or the console after
-
180 // displaying messages)
-
181 if (argc == 4) {
-
182 N = std::atoi(argv[1]);
-
183 a = (double)std::atof(argv[2]);
-
184 b = (double)std::atof(argv[3]);
-
185 // Check if a<b else abort
-
186 assert(a < b && "a has to be less than b");
-
187 assert(N > 0 && "N has to be > 0");
-
188 if (N < 16 || a != 1 || b != 3)
-
189 used_argv_parameters = true;
-
190 std::cout << "You selected N=" << N << ", a=" << a << ", b=" << b
-
191 << std::endl;
-
192 } else
-
193 std::cout << "Default N=" << N << ", a=" << a << ", b=" << b
+
170 {
+
171 std::int32_t N = 16; /// Number of intervals to divide the integration
+
172 /// interval. MUST BE EVEN
+
173 double a = 1, b = 3; /// Starting and ending point of the integration in
+
174 /// the real axis
+
175 double h = NAN; /// Step, calculated by a, b and N
+
176
+
177 bool used_argv_parameters =
+
178 false; // If argv parameters are used then the assert must be omitted
+
179 // for the tst cases
+
180
+
181 // Get user input (by the command line parameters or the console after
+
182 // displaying messages)
+
183 if (argc == 4) {
+
184 N = std::atoi(argv[1]);
+
185 a = std::atof(argv[2]);
+
186 b = std::atof(argv[3]);
+
187 // Check if a<b else abort
+
188 assert(a < b && "a has to be less than b");
+
189 assert(N > 0 && "N has to be > 0");
+
190 if (N < 16 || a != 1 || b != 3) {
+
191 used_argv_parameters = true;
+
192 }
+
193 std::cout << "You selected N=" << N << ", a=" << a << ", b=" << b
194 << std::endl;
-
195
-
196 // Find the step
-
197 h = (b - a) / N;
-
198
-
199 test(N, h, a, b, used_argv_parameters); // run self-test implementations
-
200
-
201 return 0;
-
202}
+
195 } else {
+
196 std::cout << "Default N=" << N << ", a=" << a << ", b=" << b
+
197 << std::endl;
+
198 }
+
199
+
200 // Find the step
+
201 h = (b - a) / N;
+
202
+
203 test(N, h, a, b, used_argv_parameters); // run self-test implementations
+
204
+
205 return 0;
+
206}
T atof(T... args)
T atoi(T... args)
-
static void test(std::int32_t N, double h, double a, double b, bool used_argv_parameters)
Self-test implementations.
Definition: composite_simpson_rule.cpp:130
+
static void test(std::int32_t N, double h, double a, double b, bool used_argv_parameters)
Self-test implementations.
Definition: composite_simpson_rule.cpp:132
T endl(T... args)
Here is the call graph for this function:
@@ -514,36 +517,36 @@ Here is the call graph for this function:
-
131 {
-
132 // Call the functions and find the integral of each function
-
133 double result_f = numerical_methods::simpson_method::evaluate_by_simpson(
-
134 N, h, a, numerical_methods::simpson_method::f);
-
135 assert((used_argv_parameters || (result_f >= 4.09 && result_f <= 4.10)) &&
-
136 "The result of f(x) is wrong");
-
137 std::cout << "The result of integral f(x) on interval [" << a << ", " << b
-
138 << "] is equal to: " << result_f << std::endl;
-
139
-
140 double result_g = numerical_methods::simpson_method::evaluate_by_simpson(
-
141 N, h, a, numerical_methods::simpson_method::g);
-
142 assert((used_argv_parameters || (result_g >= 0.27 && result_g <= 0.28)) &&
-
143 "The result of g(x) is wrong");
-
144 std::cout << "The result of integral g(x) on interval [" << a << ", " << b
-
145 << "] is equal to: " << result_g << std::endl;
-
146
-
147 double result_k = numerical_methods::simpson_method::evaluate_by_simpson(
-
148 N, h, a, numerical_methods::simpson_method::k);
-
149 assert((used_argv_parameters || (result_k >= 9.06 && result_k <= 9.07)) &&
-
150 "The result of k(x) is wrong");
-
151 std::cout << "The result of integral k(x) on interval [" << a << ", " << b
-
152 << "] is equal to: " << result_k << std::endl;
-
153
-
154 double result_l = numerical_methods::simpson_method::evaluate_by_simpson(
-
155 N, h, a, numerical_methods::simpson_method::l);
-
156 assert((used_argv_parameters || (result_l >= 7.16 && result_l <= 7.17)) &&
-
157 "The result of l(x) is wrong");
-
158 std::cout << "The result of integral l(x) on interval [" << a << ", " << b
-
159 << "] is equal to: " << result_l << std::endl;
-
160}
+
133 {
+
134 // Call the functions and find the integral of each function
+
135 double result_f = numerical_methods::simpson_method::evaluate_by_simpson(
+
136 N, h, a, numerical_methods::simpson_method::f);
+
137 assert((used_argv_parameters || (result_f >= 4.09 && result_f <= 4.10)) &&
+
138 "The result of f(x) is wrong");
+
139 std::cout << "The result of integral f(x) on interval [" << a << ", " << b
+
140 << "] is equal to: " << result_f << std::endl;
+
141
+
142 double result_g = numerical_methods::simpson_method::evaluate_by_simpson(
+
143 N, h, a, numerical_methods::simpson_method::g);
+
144 assert((used_argv_parameters || (result_g >= 0.27 && result_g <= 0.28)) &&
+
145 "The result of g(x) is wrong");
+
146 std::cout << "The result of integral g(x) on interval [" << a << ", " << b
+
147 << "] is equal to: " << result_g << std::endl;
+
148
+
149 double result_k = numerical_methods::simpson_method::evaluate_by_simpson(
+
150 N, h, a, numerical_methods::simpson_method::k);
+
151 assert((used_argv_parameters || (result_k >= 9.06 && result_k <= 9.07)) &&
+
152 "The result of k(x) is wrong");
+
153 std::cout << "The result of integral k(x) on interval [" << a << ", " << b
+
154 << "] is equal to: " << result_k << std::endl;
+
155
+
156 double result_l = numerical_methods::simpson_method::evaluate_by_simpson(
+
157 N, h, a, numerical_methods::simpson_method::l);
+
158 assert((used_argv_parameters || (result_l >= 7.16 && result_l <= 7.17)) &&
+
159 "The result of l(x) is wrong");
+
160 std::cout << "The result of integral l(x) on interval [" << a << ", " << b
+
161 << "] is equal to: " << result_l << std::endl;
+
162}
diff --git a/d4/def/kohonen__som__topology_8cpp.html b/d4/def/kohonen__som__topology_8cpp.html index d0e980d76..2f23bf909 100644 --- a/d4/def/kohonen__som__topology_8cpp.html +++ b/d4/def/kohonen__som__topology_8cpp.html @@ -336,7 +336,7 @@ Here is the call graph for this function:
398 kohonen_som(X, &W, 1e-4); // train the SOM
399 save_u_matrix("w12.csv", W); // save the resultant weights
400}
-
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
constexpr uint32_t N
A struct to represent sparse table for min() as their invariant function, for the given array A....
Definition: sparse_table.cpp:47
int save_2d_data(const char *fname, const std::vector< std::valarray< double > > &X)
Definition: kohonen_som_topology.cpp:65
double _random(double a, double b)
Definition: kohonen_som_topology.cpp:53
diff --git a/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html b/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html index 6af5c5f9c..2954b5831 100644 --- a/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html +++ b/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html @@ -452,7 +452,7 @@ Here is the call graph for this function:
297 }
298 return details;
299 }
-
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
+
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:119
T emplace_back(T... args)
std::vector< std::valarray< T > > multiply(const std::vector< std::valarray< T > > &A, const std::vector< std::valarray< T > > &B)
Definition: vector_ops.hpp:460
std::vector< std::valarray< T > > apply_function(const std::vector< std::valarray< T > > &A, T(*func)(const T &))
Definition: vector_ops.hpp:329
diff --git a/d5/d33/gram__schmidt_8cpp.html b/d5/d33/gram__schmidt_8cpp.html index 6243a18f7..0269b3964 100644 --- a/d5/d33/gram__schmidt_8cpp.html +++ b/d5/d33/gram__schmidt_8cpp.html @@ -366,8 +366,8 @@ Here is the call graph for this function:
173 display(r, c, B); // for displaying orthogoanlised vectors
174}
-
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
-
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
+
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
+
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:119
double projection(const std::array< double, 10 > &x, const std::array< double, 10 > &y, const int &c)
Definition: gram_schmidt.cpp:79
Here is the call graph for this function:
diff --git a/d5/d4c/group__sorting.html b/d5/d4c/group__sorting.html index 34bbfcd15..42fda6587 100644 --- a/d5/d4c/group__sorting.html +++ b/d5/d4c/group__sorting.html @@ -421,7 +421,7 @@ template<typename T >
57 delete[] L;
58 delete[] R;
59}
-
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
diff --git a/d5/d96/md5_8cpp.html b/d5/d96/md5_8cpp.html index 493f91810..06f93b7c4 100644 --- a/d5/d96/md5_8cpp.html +++ b/d5/d96/md5_8cpp.html @@ -393,7 +393,7 @@ Here is the call graph for this function:
280 return sig;
281}
-
double g(double x)
Another test function.
Definition: composite_simpson_rule.cpp:113
+
double g(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
T copy(T... args)
uint32_t toLittleEndian32(uint32_t n)
Sets 32-bit integer to little-endian if needed.
Definition: md5.cpp:89
uint64_t toLittleEndian64(uint64_t n)
Sets 64-bit integer to little-endian if needed.
Definition: md5.cpp:102
diff --git a/d5/def/stairs__pattern_8cpp.html b/d5/def/stairs__pattern_8cpp.html index 0d11320f9..62a1eb30f 100644 --- a/d5/def/stairs__pattern_8cpp.html +++ b/d5/def/stairs__pattern_8cpp.html @@ -160,7 +160,7 @@ Functions
35}
-
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
+
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:119
T endl(T... args)
Here is the call graph for this function:
diff --git a/d6/d05/reverse__a__linked__list_8cpp.html b/d6/d05/reverse__a__linked__list_8cpp.html index 61649c3f6..21d7db521 100644 --- a/d6/d05/reverse__a__linked__list_8cpp.html +++ b/d6/d05/reverse__a__linked__list_8cpp.html @@ -163,11 +163,11 @@ Algorithm

Main function.

Returns
0 on exit
-
205 {
-
206 test(); // run self-test implementations
-
207 return 0;
-
208}
-
static void test()
Self-test implementations.
Definition: reverse_a_linked_list.cpp:177
+
201 {
+
202 test(); // run self-test implementations
+
203 return 0;
+
204}
+
static void test()
Self-test implementations.
Definition: reverse_a_linked_list.cpp:173
Here is the call graph for this function:
@@ -202,36 +202,36 @@ Here is the call graph for this function:

Self-test implementations.

Returns
void
-
177 {
- -
179 // 1st test
-
180 L.insert(11);
-
181 L.insert(12);
-
182 L.insert(15);
-
183 L.insert(10);
-
184 L.insert(-12);
-
185 L.insert(-20);
-
186 L.insert(18);
-
187 assert(L.top() == 11);
-
188 assert(L.last() == 18);
-
189 L.reverseList();
-
190 // Reversal Testing
-
191 assert(L.top() == 18);
-
192 assert(L.traverse(1) == -20);
-
193 assert(L.traverse(2) == -12);
-
194 assert(L.traverse(3) == 10);
-
195 assert(L.traverse(4) == 15);
-
196 assert(L.traverse(5) == 12);
-
197 assert(L.last() == 11);
-
198 std::cout << "All tests have successfully passed!" << std::endl;
-
199}
+
173 {
+ +
175 // 1st test
+
176 L.insert(11);
+
177 L.insert(12);
+
178 L.insert(15);
+
179 L.insert(10);
+
180 L.insert(-12);
+
181 L.insert(-20);
+
182 L.insert(18);
+
183 assert(L.top() == 11);
+
184 assert(L.last() == 18);
+
185 L.reverseList();
+
186 // Reversal Testing
+
187 assert(L.top() == 18);
+
188 assert(L.traverse(1) == -20);
+
189 assert(L.traverse(2) == -12);
+
190 assert(L.traverse(3) == 10);
+
191 assert(L.traverse(4) == 15);
+
192 assert(L.traverse(5) == 12);
+
193 assert(L.last() == 11);
+
194 std::cout << "All tests have successfully passed!" << std::endl;
+
195}
Definition: linked_list.cpp:81
void insert(int32_t new_elem)
Utility function that adds a new element at the end of the list.
Definition: reverse_a_linked_list.cpp:82
void reverseList()
Utility function for reversing a list.
Definition: reverse_a_linked_list.cpp:107
int32_t top()
Utility function to find the top element of the list.
Definition: reverse_a_linked_list.cpp:123
std::shared_ptr< link > last
last link on the list
Definition: linked_list.cpp:84
-
int32_t traverse(int32_t index)
Utility function to find the i th element of the list.
Definition: reverse_a_linked_list.cpp:153
+
int32_t traverse(int32_t index)
Utility function to find the i th element of the list.
Definition: reverse_a_linked_list.cpp:149
T endl(T... args)
Here is the call graph for this function:
diff --git a/d6/d05/reverse__a__linked__list_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/d6/d05/reverse__a__linked__list_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map index 1ae8ea09b..0d035be95 100644 --- a/d6/d05/reverse__a__linked__list_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map +++ b/d6/d05/reverse__a__linked__list_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -1,10 +1,10 @@ - - - + + + - - + + diff --git a/d6/d05/reverse__a__linked__list_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/d6/d05/reverse__a__linked__list_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 index 88ff704a3..d53700549 100644 --- a/d6/d05/reverse__a__linked__list_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 +++ b/d6/d05/reverse__a__linked__list_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -1 +1 @@ -f1e114e15585fa05c3aba62652f450ee \ No newline at end of file +b9bf8c84af8d49acd889c037b6723d64 \ No newline at end of file diff --git a/d6/d05/reverse__a__linked__list_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d6/d05/reverse__a__linked__list_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index e5647be9a..8134b4cd7 100644 --- a/d6/d05/reverse__a__linked__list_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/d6/d05/reverse__a__linked__list_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -37,49 +37,49 @@ Node3 - -data_structures::linked -_list::list::insert + +data_structures::linked +_list::list::insert Node1->Node3 - - + + Node6 - -data_structures::linked -_list::list::reverseList + +data_structures::linked +_list::list::reverseList Node1->Node6 - - + + Node7 - -data_structures::linked -_list::list::top + +data_structures::linked +_list::list::top Node1->Node7 - - + + @@ -92,7 +92,7 @@ - + Node1->Node8 @@ -101,44 +101,38 @@ Node4 - -data_structures::linked -_list::list::isEmpty + +data_structures::linked +_list::list::isEmpty Node3->Node4 - - + + Node5 - -std::bad_alloc::what + +std::bad_alloc::what Node3->Node5 - - + + Node7->Node4 - - - - - -Node7->Node5 - - + + diff --git a/d6/d05/reverse__a__linked__list_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d6/d05/reverse__a__linked__list_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index 6d9371450..c59dece8e 100644 --- a/d6/d05/reverse__a__linked__list_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d6/d05/reverse__a__linked__list_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -2,10 +2,10 @@ - - - + + + - - + + diff --git a/d6/d05/reverse__a__linked__list_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d6/d05/reverse__a__linked__list_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index d761d0356..bb24ffd51 100644 --- a/d6/d05/reverse__a__linked__list_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d6/d05/reverse__a__linked__list_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -0e3cda2cc47e596fb649684c4d05a331 \ No newline at end of file +220cc9ddae23bd3adb849883aef05ad7 \ No newline at end of file diff --git a/d6/d05/reverse__a__linked__list_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d6/d05/reverse__a__linked__list_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 76fb274ba..71db5a301 100644 --- a/d6/d05/reverse__a__linked__list_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d6/d05/reverse__a__linked__list_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -52,49 +52,49 @@ Node4 - -data_structures::linked -_list::list::insert + +data_structures::linked +_list::list::insert Node2->Node4 - - + + Node7 - -data_structures::linked -_list::list::reverseList + +data_structures::linked +_list::list::reverseList Node2->Node7 - - + + Node8 - -data_structures::linked -_list::list::top + +data_structures::linked +_list::list::top Node2->Node8 - - + + @@ -107,7 +107,7 @@ - + Node2->Node9 @@ -116,44 +116,38 @@ Node5 - -data_structures::linked -_list::list::isEmpty + +data_structures::linked +_list::list::isEmpty Node4->Node5 - - + + Node6 - -std::bad_alloc::what + +std::bad_alloc::what Node4->Node6 - - + + Node8->Node5 - - - - - -Node8->Node6 - - + + diff --git a/d6/d7a/golden__search__extrema_8cpp.html b/d6/d7a/golden__search__extrema_8cpp.html index 405582ab8..2baceb8d5 100644 --- a/d6/d7a/golden__search__extrema_8cpp.html +++ b/d6/d7a/golden__search__extrema_8cpp.html @@ -233,7 +233,7 @@ Functions
69 return prev_mean;
70}
-
double f(double x)
A function f(x) that will be used to test the method.
Definition: composite_simpson_rule.cpp:111
+
double f(double x)
A function f(x) that will be used to test the method.
Definition: composite_simpson_rule.cpp:113
#define EPSILON
solution accuracy limit
Definition: golden_search_extrema.cpp:17
T infinity(T... args)
T sqrt(T... args)
diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html index 82da3a7d9..bd602fe93 100644 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html +++ b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html @@ -292,7 +292,7 @@ Here is the call graph for this function:
83 return res;
84 }
85 }
-
double g(double x)
Another test function.
Definition: composite_simpson_rule.cpp:113
+
double g(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
Here is the call graph for this function:
diff --git a/d8/d72/class_r_btree.html b/d8/d72/class_r_btree.html index 79c5e094c..082592ff3 100644 --- a/d8/d72/class_r_btree.html +++ b/d8/d72/class_r_btree.html @@ -575,7 +575,7 @@ Private Attributes
131 root->color = 'b';
132 }
133}
-
double g(double x)
Another test function.
Definition: composite_simpson_rule.cpp:113
+
double g(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
diff --git a/d8/d7a/sha1_8cpp.html b/d8/d7a/sha1_8cpp.html index 72c513134..3f3dddd34 100644 --- a/d8/d7a/sha1_8cpp.html +++ b/d8/d7a/sha1_8cpp.html @@ -350,7 +350,7 @@ Here is the call graph for this function:
202 return sig;
203}
-
double g(double x)
Another test function.
Definition: composite_simpson_rule.cpp:113
+
double g(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
T copy(T... args)
uint32_t leftRotate32bits(uint32_t n, std::size_t rotate)
Rotates the bits of a 32-bit unsigned integer.
Definition: md5.cpp:66
diff --git a/d8/d9a/fast__fourier__transform_8cpp.html b/d8/d9a/fast__fourier__transform_8cpp.html index 214c23044..0452bf7a0 100644 --- a/d8/d9a/fast__fourier__transform_8cpp.html +++ b/d8/d9a/fast__fourier__transform_8cpp.html @@ -114,7 +114,7 @@ Include dependency graph for fast_fourier_transform.cpp:

Namespaces

namespace  numerical_methods - for IO operations
+ for assert
 
Returns
0 on exit
-
161 {
-
162 test(); // run self-test implementations
-
163 // with 2 defined test cases
-
164 return 0;
-
165}
+
162 {
+
163 test(); // run self-test implementations
+
164 // with 2 defined test cases
+
165 return 0;
+
166}
static void test()
Self-test implementations.
Definition: fast_fourier_transform.cpp:104
Here is the call graph for this function:
@@ -238,36 +238,37 @@ Here is the call graph for this function:
123 {10, 0}, {-2, -2}, {-2, 0}, {-2, 2}}; /// True Answer for test case 2
124
125 std::complex<double> *o1 = numerical_methods::FastFourierTransform(t1, n1);
-
126 std::complex<double> *t3=o1; /// Temporary variable used to delete memory location of o1
-
127 std::complex<double> *o2 = numerical_methods::FastFourierTransform(t2, n2);
-
128 std::complex<double> *t4=o2; /// Temporary variable used to delete memory location of o2
-
129 for (uint8_t i = 0; i < n1; i++) {
-
130 assert((r1[i].real() - o1->real() < 0.000000000001) &&
-
131 (r1[i].imag() - o1->imag() <
-
132 0.000000000001)); /// Comparing for both real and imaginary
-
133 /// values for test case 1
-
134 o1++;
-
135 }
-
136
-
137 for (uint8_t i = 0; i < n2; i++) {
-
138 assert((r2[i].real() - o2->real() < 0.000000000001) &&
-
139 (r2[i].imag() - o2->imag() <
-
140 0.000000000001)); /// Comparing for both real and imaginary
-
141 /// values for test case 2
-
142 o2++;
-
143 }
-
144
-
145
-
146 delete[] t1;
-
147 delete[] t2;
-
148 delete[] t3;
-
149 delete[] t4;
-
150 std::cout << "All tests have successfully passed!\n";
-
151}
+
126 std::complex<double> *t3 =
+
127 o1; /// Temporary variable used to delete memory location of o1
+
128 std::complex<double> *o2 = numerical_methods::FastFourierTransform(t2, n2);
+
129 std::complex<double> *t4 =
+
130 o2; /// Temporary variable used to delete memory location of o2
+
131 for (uint8_t i = 0; i < n1; i++) {
+
132 assert((r1[i].real() - o1->real() < 0.000000000001) &&
+
133 (r1[i].imag() - o1->imag() <
+
134 0.000000000001)); /// Comparing for both real and imaginary
+
135 /// values for test case 1
+
136 o1++;
+
137 }
+
138
+
139 for (uint8_t i = 0; i < n2; i++) {
+
140 assert((r2[i].real() - o2->real() < 0.000000000001) &&
+
141 (r2[i].imag() - o2->imag() <
+
142 0.000000000001)); /// Comparing for both real and imaginary
+
143 /// values for test case 2
+
144 o2++;
+
145 }
+
146
+
147 delete[] t1;
+
148 delete[] t2;
+
149 delete[] t3;
+
150 delete[] t4;
+
151 std::cout << "All tests have successfully passed!\n";
+
152}
T imag(T... args)
-
std::complex< double > * FastFourierTransform(std::complex< double > *p, uint8_t n)
FastFourierTransform is a recursive function which returns list of complex numbers.
Definition: fast_fourier_transform.cpp:40
+
std::complex< double > * FastFourierTransform(std::complex< double > *p, uint8_t n)
FastFourierTransform is a recursive function which returns list of complex numbers.
Definition: fast_fourier_transform.cpp:41
T real(T... args)
diff --git a/d8/db1/binomial__calculate_8cpp.html b/d8/db1/binomial__calculate_8cpp.html index 67fffd61b..b7c1f0ce3 100644 --- a/d8/db1/binomial__calculate_8cpp.html +++ b/d8/db1/binomial__calculate_8cpp.html @@ -187,7 +187,7 @@ Functions
46
47 return result;
48}
-
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
uint64_t result(uint64_t n)
Definition: fibonacci_sum.cpp:76
Here is the call graph for this function:
diff --git a/d9/d37/inverse__fast__fourier__transform_8cpp.html b/d9/d37/inverse__fast__fourier__transform_8cpp.html index b0ac23115..d6d4ade72 100644 --- a/d9/d37/inverse__fast__fourier__transform_8cpp.html +++ b/d9/d37/inverse__fast__fourier__transform_8cpp.html @@ -114,7 +114,7 @@ Include dependency graph for inverse_fast_fourier_transform.cpp: - +

@@ -168,11 +168,11 @@ Functions

Namespaces

namespace  numerical_methods
 for IO operations
 for assert
 
Returns
0 on exit
-
157 {
-
158 test(); // run self-test implementations
-
159 // with 2 defined test cases
-
160 return 0;
-
161}
+
156 {
+
157 test(); // run self-test implementations
+
158 // with 2 defined test cases
+
159 return 0;
+
160}
static void test()
Self-test implementations.
Definition: inverse_fast_fourier_transform.cpp:100
Here is the call graph for this function:
@@ -235,33 +235,32 @@ Here is the call graph for this function:
118 std::vector<std::complex<double>> r2 = {
119 {1, 0}, {2, 0}, {3, 0}, {4, 0}}; /// True Answer for test case 2
120
-
121 std::complex<double> *o1 = numerical_methods::InverseFastFourierTransform(t1, n1);
-
122
-
123 std::complex<double> *o2 = numerical_methods::InverseFastFourierTransform(t2, n2);
-
124
-
125 for (uint8_t i = 0; i < n1; i++) {
-
126 assert((r1[i].real() - o1[i].real() < 0.000000000001) &&
-
127 (r1[i].imag() - o1[i].imag() <
-
128 0.000000000001)); /// Comparing for both real and imaginary
-
129 /// values for test case 1
-
130
-
131 }
-
132
-
133 for (uint8_t i = 0; i < n2; i++) {
-
134 assert((r2[i].real() - o2[i].real() < 0.000000000001) &&
-
135 (r2[i].imag() - o2[i].imag() <
-
136 0.000000000001)); /// Comparing for both real and imaginary
-
137 /// values for test case 2
-
138
-
139 }
-
140
-
141
-
142 delete[] t1;
-
143 delete[] t2;
-
144 delete[] o1;
-
145 delete[] o2;
-
146 std::cout << "All tests have successfully passed!\n";
-
147}
+
121 std::complex<double> *o1 =
+
122 numerical_methods::InverseFastFourierTransform(t1, n1);
+
123
+
124 std::complex<double> *o2 =
+
125 numerical_methods::InverseFastFourierTransform(t2, n2);
+
126
+
127 for (uint8_t i = 0; i < n1; i++) {
+
128 assert((r1[i].real() - o1[i].real() < 0.000000000001) &&
+
129 (r1[i].imag() - o1[i].imag() <
+
130 0.000000000001)); /// Comparing for both real and imaginary
+
131 /// values for test case 1
+
132 }
+
133
+
134 for (uint8_t i = 0; i < n2; i++) {
+
135 assert((r2[i].real() - o2[i].real() < 0.000000000001) &&
+
136 (r2[i].imag() - o2[i].imag() <
+
137 0.000000000001)); /// Comparing for both real and imaginary
+
138 /// values for test case 2
+
139 }
+
140
+
141 delete[] t1;
+
142 delete[] t2;
+
143 delete[] o1;
+
144 delete[] o2;
+
145 std::cout << "All tests have successfully passed!\n";
+
146}
std::complex< double > * InverseFastFourierTransform(std::complex< double > *p, uint8_t n)
InverseFastFourierTransform is a recursive function which returns list of complex numbers.
Definition: inverse_fast_fourier_transform.cpp:33
diff --git a/d9/d69/median__search_8cpp.html b/d9/d69/median__search_8cpp.html index 9bd47bef6..5c700afd9 100644 --- a/d9/d69/median__search_8cpp.html +++ b/d9/d69/median__search_8cpp.html @@ -267,7 +267,7 @@ Here is the call graph for this function:
99 }
100}
T begin(T... args)
-
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
T end(T... args)
T min(T... args)
T push_back(T... args)
diff --git a/da/d24/sqrt__double_8cpp.html b/da/d24/sqrt__double_8cpp.html index 441df0a59..e5d0f3431 100644 --- a/da/d24/sqrt__double_8cpp.html +++ b/da/d24/sqrt__double_8cpp.html @@ -195,7 +195,7 @@ Here is the call graph for this function:
37 }
38 return -1;
39}
-
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
+
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:119
Here is the call graph for this function:
diff --git a/da/d37/structdata__structures_1_1sparse__table_1_1_sparse__table.html b/da/d37/structdata__structures_1_1sparse__table_1_1_sparse__table.html index 6f05b4bfa..61d4b8bfc 100644 --- a/da/d37/structdata__structures_1_1sparse__table_1_1_sparse__table.html +++ b/da/d37/structdata__structures_1_1sparse__table_1_1_sparse__table.html @@ -181,8 +181,8 @@ size_t 
117 return (A[x] <= A[y] ? x : y); ///< represents minimum value over
118 ///< the whole range [l,r]
119 }
-
double g(double x)
Another test function.
Definition: composite_simpson_rule.cpp:113
-
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
+
double g(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:119
std::array< int64_t, N > LOG
where floor(log2(i)) are precomputed.
Definition: sparse_table.cpp:59
std::array< int64_t, N > A
input array to perform RMQ.
Definition: sparse_table.cpp:56
std::array< std::array< int64_t, N >, M > ST
the sparse table storing min() values for given interval.
Definition: sparse_table.cpp:58
diff --git a/da/d41/uint128__t_8hpp_source.html b/da/d41/uint128__t_8hpp_source.html index bcba16b8d..0a6f0199c 100644 --- a/da/d41/uint128__t_8hpp_source.html +++ b/da/d41/uint128__t_8hpp_source.html @@ -557,7 +557,7 @@ $(document).ready(function(){initNavTree('da/d41/uint128__t_8hpp_source.html','.
462 tmp <<= left;
463 uint128_t quotient(0);
464 uint128_t zero(0);
-
465 while (left >= 0 && tmp2 >= p) {
+
465 while (tmp2 >= p) {
466 uint16_t shf = tmp2._lez() - tmp._lez();
467 if (shf) {
468 tmp >>= shf;
diff --git a/da/d7b/primality__test_8cpp.html b/da/d7b/primality__test_8cpp.html index 1545f837f..890747ac3 100644 --- a/da/d7b/primality__test_8cpp.html +++ b/da/d7b/primality__test_8cpp.html @@ -153,7 +153,7 @@ Functions
26 }
27 return true;
28}
-
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
diff --git a/da/da3/uint256__t_8hpp_source.html b/da/da3/uint256__t_8hpp_source.html index cd758941c..f41934bab 100644 --- a/da/da3/uint256__t_8hpp_source.html +++ b/da/da3/uint256__t_8hpp_source.html @@ -524,7 +524,7 @@ $(document).ready(function(){initNavTree('da/da3/uint256__t_8hpp_source.html','.
429 tmp <<= left;
430 uint256_t quotient(0);
431 uint256_t zero(0);
-
432 while (left >= 0 && tmp2 >= p) {
+
432 while (tmp2 >= p) {
433 uint16_t shf = tmp2._lez() - tmp._lez();
434 if (shf) {
435 tmp >>= shf;
diff --git a/da/dc3/linked__list_8cpp.html b/da/dc3/linked__list_8cpp.html index 7994dc2a4..f2eb28048 100644 --- a/da/dc3/linked__list_8cpp.html +++ b/da/dc3/linked__list_8cpp.html @@ -261,7 +261,7 @@ Here is the call graph for this function:
Definition: linked_list.cpp:81
-
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
+
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:119
T endl(T... args)
T stoi(T... args)
diff --git a/da/dc9/fibonacci__matrix__exponentiation_8cpp.html b/da/dc9/fibonacci__matrix__exponentiation_8cpp.html index 6ce4f50c1..11c74368e 100644 --- a/da/dc9/fibonacci__matrix__exponentiation_8cpp.html +++ b/da/dc9/fibonacci__matrix__exponentiation_8cpp.html @@ -217,7 +217,7 @@ Functions
81 }
82 return ((result[0]%mod*Identity[0][0]%mod)%mod+(result[1]%mod*Identity[1][0]%mod)%mod)%mod;
83}
-
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
uint64_t result(uint64_t n)
Definition: fibonacci_sum.cpp:76
diff --git a/da/df2/durand__kerner__roots_8cpp.html b/da/df2/durand__kerner__roots_8cpp.html index 3017baea9..311665a41 100644 --- a/da/df2/durand__kerner__roots_8cpp.html +++ b/da/df2/durand__kerner__roots_8cpp.html @@ -150,7 +150,7 @@ Functions
1206647803780373360 -3599979517947607200 8037811822645051776
-12870931245150988800 13803759753640704000 -8752948036761600000
2432902008176640000
-
for IO operations
+
for assert

Sample implementation results to compute approximate roots of the equation \(x^4-1=0\):
Error evolution during root approximations computed every
 iteration. Roots evolution - shows the initial approximation of the
diff --git a/db/d01/brent__method__extrema_8cpp.html b/db/d01/brent__method__extrema_8cpp.html
index 5a1c97ec0..1d29d485b 100644
--- a/db/d01/brent__method__extrema_8cpp.html
+++ b/db/d01/brent__method__extrema_8cpp.html
@@ -314,7 +314,7 @@ Functions</h2></td></tr>
 <div class= 135}

#define EPSILON
system accuracy limit
Definition: brent_method_extrema.cpp:23
-
double f(double x)
A function f(x) that will be used to test the method.
Definition: composite_simpson_rule.cpp:111
+
double f(double x)
A function f(x) that will be used to test the method.
Definition: composite_simpson_rule.cpp:113
T swap(T... args)
Here is the call graph for this function:
diff --git a/db/d40/integral__approximation2_8cpp.html b/db/d40/integral__approximation2_8cpp.html index f52946bac..6dfb8ebe2 100644 --- a/db/d40/integral__approximation2_8cpp.html +++ b/db/d40/integral__approximation2_8cpp.html @@ -453,7 +453,7 @@ Here is the call graph for this function:
208 << std::endl;
209}
-
double f(double x)
A function f(x) that will be used to test the method.
Definition: composite_simpson_rule.cpp:111
+
double f(double x)
A function f(x) that will be used to test the method.
Definition: composite_simpson_rule.cpp:113
T endl(T... args)
T exp(T... args)
diff --git a/db/d9a/classuint128__t.html b/db/d9a/classuint128__t.html index 32054763a..9bfd546e1 100644 --- a/db/d9a/classuint128__t.html +++ b/db/d9a/classuint128__t.html @@ -704,7 +704,7 @@ Here is the call graph for this function:
153 return r;
154#endif
155 }
-
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
+
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:119
@@ -796,7 +796,7 @@ Here is the call graph for this function:
462 tmp <<= left;
463 uint128_t quotient(0);
464 uint128_t zero(0);
-
465 while (left >= 0 && tmp2 >= p) {
+
465 while (tmp2 >= p) {
466 uint16_t shf = tmp2._lez() - tmp._lez();
467 if (shf) {
468 tmp >>= shf;
diff --git a/dc/d9c/babylonian__method_8cpp.html b/dc/d9c/babylonian__method_8cpp.html index 682e28069..9abb04613 100644 --- a/dc/d9c/babylonian__method_8cpp.html +++ b/dc/d9c/babylonian__method_8cpp.html @@ -100,19 +100,19 @@ $(document).ready(function(){initNavTree('dc/d9c/babylonian__method_8cpp.html','

A babylonian method (BM) is an algorithm that computes the square root. More...

#include <cassert>
+#include <cmath>
#include <iostream>
-#include "math.h"
Include dependency graph for babylonian_method.cpp:
-
+

@@ -168,11 +168,11 @@ Functions

n = 0
- +

Namespaces

namespace  numerical_methods
 for IO operations
 for assert
 
Returns
0 on exit
-
97 {
-
98 test(); // run self-test implementations
-
99 // with 2 defined test cases
-
100 return 0;
-
101}
-
static void test()
Self-test implementations.
Definition: babylonian_method.cpp:63
+
96 {
+
97 test(); // run self-test implementations
+
98 // with 2 defined test cases
+
99 return 0;
+
100}
+
static void test()
Self-test implementations.
Definition: babylonian_method.cpp:62
Here is the call graph for this function:
@@ -214,35 +214,35 @@ Here is the call graph for this function:

Test result for testcase 2

Testing for test Case 1

Testing for test Case 2

-
63 {
-
64 /* descriptions of the following test */
-
65
-
66 auto testcase1 = 125348; /// Testcase 1
-
67 auto testcase2 = 752080; /// Testcase 2
-
68
-
69 auto real_output1 = 354.045194855; /// Real Output 1
-
70 auto real_output2 = 867.225460881; /// Real Output 2
-
71
-
72 auto test_result1 = numerical_methods::babylonian_method(testcase1);
-
73 /// Test result for testcase 1
-
74 auto test_result2 = numerical_methods::babylonian_method(testcase2);
-
75 /// Test result for testcase 2
-
76
-
77 assert(std::max(test_result1, real_output1) -
-
78 std::min(test_result1, real_output1) <
-
79 0.0001);
-
80 /// Testing for test Case 1
-
81 assert(std::max(test_result2, real_output2) -
-
82 std::min(test_result2, real_output2) <
-
83 0.0001);
-
84 /// Testing for test Case 2
-
85
-
86 std::cout << "All tests have successfully passed!\n";
-
87}
+
62 {
+
63 /* descriptions of the following test */
+
64
+
65 auto testcase1 = 125348; /// Testcase 1
+
66 auto testcase2 = 752080; /// Testcase 2
+
67
+
68 auto real_output1 = 354.045194855; /// Real Output 1
+
69 auto real_output2 = 867.225460881; /// Real Output 2
+
70
+
71 auto test_result1 = numerical_methods::babylonian_method(testcase1);
+
72 /// Test result for testcase 1
+
73 auto test_result2 = numerical_methods::babylonian_method(testcase2);
+
74 /// Test result for testcase 2
+
75
+
76 assert(std::max(test_result1, real_output1) -
+
77 std::min(test_result1, real_output1) <
+
78 0.0001);
+
79 /// Testing for test Case 1
+
80 assert(std::max(test_result2, real_output2) -
+
81 std::min(test_result2, real_output2) <
+
82 0.0001);
+
83 /// Testing for test Case 2
+
84
+
85 std::cout << "All tests have successfully passed!\n";
+
86}
T max(T... args)
T min(T... args)
-
double babylonian_method(double radicand)
Babylonian methods is an iterative function which returns square root of radicand.
Definition: babylonian_method.cpp:31
+
double babylonian_method(double radicand)
Babylonian methods is an iterative function which returns square root of radicand.
Definition: babylonian_method.cpp:30
Here is the call graph for this function:
diff --git a/dc/dc4/_2_users_2runner_2work_2_c-_plus-_plus_2_c-_plus-_plus_2numerical_methods_2rungekutta_8cpp-example.html b/dc/dc4/_2_users_2runner_2work_2_c-_plus-_plus_2_c-_plus-_plus_2numerical_methods_2rungekutta_8cpp-example.html index 3b323ee3c..4566465b5 100644 --- a/dc/dc4/_2_users_2runner_2work_2_c-_plus-_plus_2_c-_plus-_plus_2numerical_methods_2rungekutta_8cpp-example.html +++ b/dc/dc4/_2_users_2runner_2work_2_c-_plus-_plus_2_c-_plus-_plus_2numerical_methods_2rungekutta_8cpp-example.html @@ -228,10 +228,10 @@ $(document).ready(function(){initNavTree('dc/dc4/_2_users_2runner_2work_2_c-_plu
return 0;
}
-
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
int main()
Main function.
Definition: graph_coloring.cpp:112
int h(int key)
Definition: hash_search.cpp:45
-
for IO operations
+
Functions for Runge Kutta fourth order method.
static void test()
Self-test implementations.
Definition: rat_maze.cpp:86
static double change(double x, double y)
for using the vector container
Definition: rungekutta.cpp:33
diff --git a/dd/d29/false__position_8cpp.html b/dd/d29/false__position_8cpp.html index f287b72f0..b53b6bf75 100644 --- a/dd/d29/false__position_8cpp.html +++ b/dd/d29/false__position_8cpp.html @@ -111,7 +111,7 @@ Include dependency graph for false_position.cpp:
- + diff --git a/de/d75/qr__eigen__values_8cpp.html b/de/d75/qr__eigen__values_8cpp.html index 85358bde8..b1a439233 100644 --- a/de/d75/qr__eigen__values_8cpp.html +++ b/de/d75/qr__eigen__values_8cpp.html @@ -361,7 +361,7 @@ Here is the call graph for this function:
72 }
73 }
74}
-
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
T perror(T... args)
diff --git a/de/d9b/prime__numbers_8cpp.html b/de/d9b/prime__numbers_8cpp.html index b73b038d9..3c26f82d6 100644 --- a/de/d9b/prime__numbers_8cpp.html +++ b/de/d9b/prime__numbers_8cpp.html @@ -193,7 +193,7 @@ Here is the call graph for this function:
29 }
30 return res;
31}
-
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
T emplace_back(T... args)
T max(T... args)
diff --git a/df/d11/midpoint__integral__method_8cpp.html b/df/d11/midpoint__integral__method_8cpp.html index 11c84dbf0..fc3db5a97 100644 --- a/df/d11/midpoint__integral__method_8cpp.html +++ b/df/d11/midpoint__integral__method_8cpp.html @@ -116,7 +116,7 @@ Include dependency graph for midpoint_integral_method.cpp:
- + diff --git a/df/d82/breadth__first__search_8cpp.html b/df/d82/breadth__first__search_8cpp.html index 3345b8294..2f8672246 100644 --- a/df/d82/breadth__first__search_8cpp.html +++ b/df/d82/breadth__first__search_8cpp.html @@ -198,7 +198,7 @@ Functions
static void tests()
Definition: breadth_first_search.cpp:139
Definition: breadth_first_search.cpp:64
-
double g(double x)
Another test function.
Definition: composite_simpson_rule.cpp:113
+
double g(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
T endl(T... args)
Here is the call graph for this function:
diff --git a/df/dce/namespacegraph.html b/df/dce/namespacegraph.html index d3395f707..d9b36670f 100644 --- a/df/dce/namespacegraph.html +++ b/df/dce/namespacegraph.html @@ -858,7 +858,7 @@ Here is the call graph for this function:
69 return min_path;
70}
T begin(T... args)
-
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:115
+
double k(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
T end(T... args)
T min(T... args)
T next_permutation(T... args)
diff --git a/df/dd5/binary__search_8cpp.html b/df/dd5/binary__search_8cpp.html index 4d2279e86..aea0ce4be 100644 --- a/df/dd5/binary__search_8cpp.html +++ b/df/dd5/binary__search_8cpp.html @@ -172,7 +172,7 @@ Functions
26 }
27 return -1;
28}
-
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:117
+
double l(double x)
Another test function.
Definition: composite_simpson_rule.cpp:119
diff --git a/namespaces.html b/namespaces.html index c278e8ff4..8f4b0720a 100644 --- a/namespaces.html +++ b/namespaces.html @@ -233,7 +233,7 @@ $(document).ready(function(){initNavTree('namespaces.html',''); initResizable(); - +

@@ -166,12 +166,12 @@ Functions

Namespaces

namespace  numerical_methods
 for IO operations
 for assert
 
namespace  false_position
 Functions for False Position method.

Namespaces

namespace  numerical_methods
 for IO operations
 for assert
 
namespace  midpoint_rule
 Functions for the Midpoint Integral method implementation.
 Nn_queens_optimizedFunctions for Eight Queens puzzle optimized
 Nncr_modulo_pFunctions for nCr modulo p implementation
 Nneural_networkNeural Network or Multilayer Perceptron
 Nnumerical_methodsFor IO operations
 Nnumerical_methodsFor assert
 Noperations_on_datastructuresFor std::vector