mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
fix : updated the documentation
This commit is contained in:
parent
89b2ce7b10
commit
748ba48e9d
@ -1,7 +1,9 @@
|
||||
/**
|
||||
* @fast_fourier_transform.cpp
|
||||
* @brief A fast Fourier transform (FFT) is an algorithm that computes the
|
||||
* discrete Fourier transform (DFT) of a sequence, or its inverse (IDFT).
|
||||
* discrete Fourier transform (DFT) of a sequence , or its inverse (IDFT) , this algorithm
|
||||
* has application in use case scenario where a user wants to find points of a function
|
||||
* in short period time by just using the coefficents of the polynomial function.
|
||||
* @details
|
||||
* https://medium.com/@aiswaryamathur/understanding-fast-fourier-transform-from-scratch-to
|
||||
-solve-polynomial-multiplication-8018d511162f
|
||||
@ -65,6 +67,8 @@ complex<double>* FastFourierTransform(complex<double>*p,int n)
|
||||
|
||||
/**
|
||||
* @brief Self-test implementations
|
||||
*declaring two test cases and checking for the error
|
||||
*in predicted and true value is less than 0.000000000001.
|
||||
* @returns void
|
||||
*/
|
||||
static void test() {
|
||||
@ -91,13 +95,13 @@ static void test() {
|
||||
|
||||
for(int i=0;i<n1;i++)
|
||||
{
|
||||
assert(r1[i].real()-o1->real()<0.000000000001 and r1[i].imag()-o1->imag()<0.000000000001 );
|
||||
assert(r1[i].real()-o1->real()<0.000000000001 and r1[i].imag()-o1->imag()<0.000000000001 );/// Comparing for both real and imaginary values for test case 1
|
||||
o1++;
|
||||
}
|
||||
|
||||
for(int i=0;i<n2;i++)
|
||||
{
|
||||
assert(r2[i].real()-o2->real()<0.000000000001 and r2[i].imag()-o2->imag()<0.000000000001 );
|
||||
assert(r2[i].real()-o2->real()<0.000000000001 and r2[i].imag()-o2->imag()<0.000000000001 );/// Comparing for both real and imaginary values for test case 2
|
||||
o2++;
|
||||
}
|
||||
|
||||
@ -108,6 +112,7 @@ static void test() {
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* calls automated test function to test the working of fast fourier transform.
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user