diff --git a/numerical_methods/fast_fourier_transform.cpp b/numerical_methods/fast_fourier_transform.cpp index 4e099e6bf..427b8b814 100644 --- a/numerical_methods/fast_fourier_transform.cpp +++ b/numerical_methods/fast_fourier_transform.cpp @@ -103,8 +103,15 @@ std::complex* FastFourierTransform(std::complex*p,uint64_t n) static void test() { /* descriptions of the following test */ - std::complex t1[2]={1,2}; /// Test case 1 - std::complex t2[4]={1,2,3,4}; /// Test case 2 + auto *t1= new std::complex[2]; /// Test case 1 + auto *t2= new std::complex[4];; /// Test case 2 + + t1[0]={1,0}; + t1[1]={2,0}; + t2[0]={1,0}; + t2[1]={2,0}; + t2[2]={3,0}; + t2[3]={4,0}; uint64_t n1 = 2; uint64_t n2 = 4; @@ -133,6 +140,8 @@ std::complex* FastFourierTransform(std::complex*p,uint64_t n) o2++; } + delete[] t1; + delete[] t2; }