TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
for assert More...
Functions | |
double | babylonian_method (double radicand) |
Babylonian methods is an iterative function which returns square root of radicand. | |
std::complex< double > * | FastFourierTransform (std::complex< double > *p, uint8_t n) |
FastFourierTransform is a recursive function which returns list of complex numbers. | |
std::complex< double > * | InverseFastFourierTransform (std::complex< double > *p, uint8_t n) |
InverseFastFourierTransform is a recursive function which returns list of complex numbers. | |
for assert
Numerical Methods.
for std::map container
for storing points and coefficents
for io operations
for math functions
for IO operations
Numerical algorithms/methods
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 IO operations for std::vector
Numerical algorithms/methods
for std::array for assert for fabs
Numerical Methods algorithms
for assert for math functions for integer allocation for std::atof for std::function for IO operations
Numerical algorithms/methods
double numerical_methods::babylonian_method | ( | double | radicand | ) |
Babylonian methods is an iterative function which returns square root of radicand.
radicand | is the radicand |
To find initial root or rough approximation
Real Initial value will be i-1 as loop stops on +1 value
Storing previous value for comparison
Storing calculated value for comparison
Temp variable to x0 and x1
Newly calculated root
Returning final root
Definition at line 30 of file babylonian_method.cpp.
std::complex< double > * numerical_methods::FastFourierTransform | ( | std::complex< double > * | p, |
uint8_t | n ) |
FastFourierTransform is a recursive function which returns list of complex numbers.
p | List of Coefficents in form of complex numbers |
n | Count of elements in list p |
Base Case To return
Declaring value of pi
Calculating value of omega
Coefficients of even power
Coefficients of odd power
Assigning values of even Coefficients
Assigning value of odd Coefficients
Recursive Call
Recursive Call
Final value representation list
Updating the first n/2 elements
Updating the last n/2 elements
Deleting dynamic array ye
Deleting dynamic array yo
Definition at line 42 of file fast_fourier_transform.cpp.
std::complex< double > * numerical_methods::InverseFastFourierTransform | ( | std::complex< double > * | p, |
uint8_t | n ) |
InverseFastFourierTransform is a recursive function which returns list of complex numbers.
p | List of Coefficents in form of complex numbers |
n | Count of elements in list p |
Base Case To return
Declaring value of pi
Calculating value of omega
One change in comparison with DFT
One change in comparison with DFT
Coefficients of even power
Coefficients of odd power
Assigning values of even Coefficients
Assigning value of odd Coefficients
Recursive Call
Recursive Call
Final value representation list
Updating the first n/2 elements
Updating the last n/2 elements
Deleting dynamic array ye
Deleting dynamic array yo
Definition at line 34 of file inverse_fast_fourier_transform.cpp.