diff --git a/d4/d86/large__number_8h_source.html b/d4/d86/large__number_8h_source.html index d90ffdcb5..51b975866 100644 --- a/d4/d86/large__number_8h_source.html +++ b/d4/d86/large__number_8h_source.html @@ -454,7 +454,7 @@ $(document).ready(function(){initNavTree('d4/d86/large__number_8h_source.html','
gcd
int gcd(int num1, int num2)
Definition: gcd_recursive_euclidean.cpp:14
large_number.h
Library to perform arithmatic operations on arbitrarily large numbers.
node
Definition: avltree.cpp:13
-
get_rand
double get_rand()
Function to get random numbers to generate our complex numbers for test.
Definition: complex_numbers.cpp:200
+
get_rand
double get_rand()
Function to get random numbers to generate our complex numbers for test.
Definition: complex_numbers.cpp:201
binExpo_alt
int binExpo_alt(int a, int b)
Definition: binary_exponent.cpp:42
graph::explore
void explore(int, vector< bool > &)
Utility function for depth first seach algorithm this function explores the vertex which is passed in...
Definition: connected_components.cpp:101
std::search
T search(T... args)
@@ -467,7 +467,7 @@ $(document).ready(function(){initNavTree('d4/d86/large__number_8h_source.html','
Graph::Graph
Graph(unsigned int vertices, std::vector< Edge > const &edges)
Definition: cycle_check_directed_graph.cpp:90
std::vector::back
T back(T... args)
machine_learning::adaline::predict
int predict(const std::vector< double > &x, double *out=nullptr)
Definition: adaline_learning.cpp:92
-
tests
void tests()
Definition: complex_numbers.cpp:205
+
tests
void tests()
Definition: complex_numbers.cpp:206
machine_learning
Machine learning algorithms.
Complex::operator=
const Complex & operator=(const Complex &other)
Operator overload of '=' on Complex class. Operator overload to be able to copy RHS instance of Compl...
Definition: complex_numbers.cpp:160
is_square
bool is_square(std::vector< std::vector< T >> const &A)
Definition: ordinary_least_squares_regressor.cpp:57
@@ -595,7 +595,7 @@ $(document).ready(function(){initNavTree('d4/d86/large__number_8h_source.html','
std::endl
T endl(T... args)
main
int main()
Definition: armstrong_number.cpp:77
get_inverse
std::vector< std::vector< float > > get_inverse(std::vector< std::vector< T >> const &A)
Definition: ordinary_least_squares_regressor.cpp:220
-
main
int main()
Definition: complex_numbers.cpp:267
+
main
int main()
Definition: complex_numbers.cpp:268
std::left
T left(T... args)
graph::adj
vector< vector< int > > adj
adj stores adjacency list representation of graph
Definition: connected_components.cpp:40
large_number::operator==
friend bool operator==(large_number const &a, large_number const &b)
Definition: large_number.h:155
diff --git a/d5/d67/complex__numbers_8cpp.html b/d5/d67/complex__numbers_8cpp.html index a6a3c8b59..38f195d15 100644 --- a/d5/d67/complex__numbers_8cpp.html +++ b/d5/d67/complex__numbers_8cpp.html @@ -156,10 +156,10 @@ double 

Main function

-
267  {
-
268  tests();
-
269  return 0;
-
270 }
+
268  {
+
269  tests();
+
270  return 0;
+
271 }
Here is the call graph for this function:
@@ -286,64 +286,64 @@ Here is the call graph for this function:

Tests Function

-
205  {
-
206  std::srand(std::time(nullptr));
-
207  double x1 = get_rand(), y1 = get_rand(), x2 = get_rand(), y2 = get_rand();
-
208  Complex num1(x1, y1), num2(x2, y2);
-
209  std::complex<double> cnum1(x1, y1), cnum2(x2, y2);
-
210  Complex result;
-
211  std::complex<double> expected;
-
212  // Test for addition
-
213  result = num1 + num2;
-
214  expected = cnum1 + cnum2;
-
215  assert(((void)"1 + 1i + 1 + 1i is equal to 2 + 2i but the addition doesn't "
-
216  "add up \n",
-
217  (result.real() == expected.real() &&
-
218  result.imag() == expected.imag())));
-
219  std::cout << "First test passes." << std::endl;
-
220  // Test for subtraction
-
221  result = num1 - num2;
-
222  expected = cnum1 - cnum2;
-
223  assert(((void)"1 + 1i - 1 - 1i is equal to 0 but the program says "
-
224  "otherwise. \n",
-
225  (result.real() == expected.real() &&
-
226  result.imag() == expected.imag())));
-
227  std::cout << "Second test passes." << std::endl;
-
228  // Test for multiplication
-
229  result = num1 * num2;
-
230  expected = cnum1 * cnum2;
-
231  assert(((void)"(1 + 1i) * (1 + 1i) is equal to 2i but the program says "
-
232  "otherwise. \n",
-
233  (result.real() == expected.real() &&
-
234  result.imag() == expected.imag())));
-
235  std::cout << "Third test passes." << std::endl;
-
236  // Test for division
-
237  result = num1 / num2;
-
238  expected = cnum1 / cnum2;
-
239  assert(((void)"(1 + 1i) / (1 + 1i) is equal to 1 but the program says "
-
240  "otherwise.\n",
-
241  (result.real() == expected.real() &&
-
242  result.imag() == expected.imag())));
-
243  std::cout << "Fourth test passes." << std::endl;
-
244  // Test for conjugates
-
245  result = ~num1;
-
246  expected = std::conj(cnum1);
-
247  assert(((void)"(1 + 1i) has a conjugate which is equal to (1 - 1i) but the "
-
248  "program says otherwise.\n",
-
249  (result.real() == expected.real() &&
-
250  result.imag() == expected.imag())));
-
251  std::cout << "Fifth test passes.\n";
-
252  // Test for Argument of our complex number
-
253  assert(((void)"(1 + 1i) has argument PI / 4 but the program differs from "
-
254  "the std::complex result.\n",
-
255  (num1.arg() == std::arg(cnum1))));
-
256  std::cout << "Sixth test passes.\n";
-
257  // Test for absolute value of our complex number
-
258  assert(((void)"(1 + 1i) has absolute value sqrt(2) but the program differs "
-
259  "from the std::complex result. \n",
-
260  (num1.abs() == std::abs(cnum1))));
-
261  std::cout << "Seventh test passes.\n";
-
262 }
+
206  {
+
207  std::srand(std::time(nullptr));
+
208  double x1 = get_rand(), y1 = get_rand(), x2 = get_rand(), y2 = get_rand();
+
209  Complex num1(x1, y1), num2(x2, y2);
+
210  std::complex<double> cnum1(x1, y1), cnum2(x2, y2);
+
211  Complex result;
+
212  std::complex<double> expected;
+
213  // Test for addition
+
214  result = num1 + num2;
+
215  expected = cnum1 + cnum2;
+
216  assert(((void)"1 + 1i + 1 + 1i is equal to 2 + 2i but the addition doesn't "
+
217  "add up \n",
+
218  (result.real() == expected.real() &&
+
219  result.imag() == expected.imag())));
+
220  std::cout << "First test passes." << std::endl;
+
221  // Test for subtraction
+
222  result = num1 - num2;
+
223  expected = cnum1 - cnum2;
+
224  assert(((void)"1 + 1i - 1 - 1i is equal to 0 but the program says "
+
225  "otherwise. \n",
+
226  (result.real() == expected.real() &&
+
227  result.imag() == expected.imag())));
+
228  std::cout << "Second test passes." << std::endl;
+
229  // Test for multiplication
+
230  result = num1 * num2;
+
231  expected = cnum1 * cnum2;
+
232  assert(((void)"(1 + 1i) * (1 + 1i) is equal to 2i but the program says "
+
233  "otherwise. \n",
+
234  (result.real() == expected.real() &&
+
235  result.imag() == expected.imag())));
+
236  std::cout << "Third test passes." << std::endl;
+
237  // Test for division
+
238  result = num1 / num2;
+
239  expected = cnum1 / cnum2;
+
240  assert(((void)"(1 + 1i) / (1 + 1i) is equal to 1 but the program says "
+
241  "otherwise.\n",
+
242  (result.real() == expected.real() &&
+
243  result.imag() == expected.imag())));
+
244  std::cout << "Fourth test passes." << std::endl;
+
245  // Test for conjugates
+
246  result = ~num1;
+
247  expected = std::conj(cnum1);
+
248  assert(((void)"(1 + 1i) has a conjugate which is equal to (1 - 1i) but the "
+
249  "program says otherwise.\n",
+
250  (result.real() == expected.real() &&
+
251  result.imag() == expected.imag())));
+
252  std::cout << "Fifth test passes.\n";
+
253  // Test for Argument of our complex number
+
254  assert(((void)"(1 + 1i) has argument PI / 4 but the program differs from "
+
255  "the std::complex result.\n",
+
256  (num1.arg() == std::arg(cnum1))));
+
257  std::cout << "Sixth test passes.\n";
+
258  // Test for absolute value of our complex number
+
259  assert(((void)"(1 + 1i) has absolute value sqrt(2) but the program differs "
+
260  "from the std::complex result. \n",
+
261  (num1.abs() == std::abs(cnum1))));
+
262  std::cout << "Seventh test passes.\n";
+
263 }
Here is the call graph for this function:
@@ -357,8 +357,8 @@ Here is the call graph for this function:
T srand(T... args)
Class Complex to represent complex numbers as a field.
Definition: complex_numbers.cpp:20
-
double get_rand()
Function to get random numbers to generate our complex numbers for test.
Definition: complex_numbers.cpp:200
-
void tests()
Definition: complex_numbers.cpp:205
+
double get_rand()
Function to get random numbers to generate our complex numbers for test.
Definition: complex_numbers.cpp:201
+
void tests()
Definition: complex_numbers.cpp:206
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
T real(T... args)
diff --git a/dc/d93/trie__modern_8cpp.html b/dc/d93/trie__modern_8cpp.html index f4a1471aa..5ea3a571b 100644 --- a/dc/d93/trie__modern_8cpp.html +++ b/dc/d93/trie__modern_8cpp.html @@ -124,7 +124,7 @@ Functions

Detailed Description

A basic implementation of trie class to store only lower-case strings.

-

Copyright 2020

Author
Anmol3299
+
Author
Anmol3299

Function Documentation

◆ main()