fix : fixing warnings

This commit is contained in:
Ameya Chawla 2021-10-23 11:08:03 +05:30 committed by GitHub
parent 4eefaf44ca
commit 9b2efd2f37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,9 +51,9 @@ std::complex<double>* FastFourierTransform(std::complex<double>*p,uint8_t n)
std::complex<double> om=std::complex<double>(cos(2*pi/n),sin(2*pi/n)); ///Calculating value of omega
auto *pe= new std::complex<double>[n/2]; /// Coefficients of even power
std::complex<double> *pe= new std::complex<double>[n/2]; /// Coefficients of even power
auto *po= new std::complex<double>[n/2]; ///Coefficients of odd power
std::complex<double> *po= new std::complex<double>[n/2]; ///Coefficients of odd power
int k1=0,k2=0;
for(int j=0;j<n;j++)
@ -67,11 +67,11 @@ std::complex<double>* FastFourierTransform(std::complex<double>*p,uint8_t n)
}
auto *ye=FastFourierTransform(pe,n/2); ///Recursive Call
std::complex<double> *ye=FastFourierTransform(pe,n/2); ///Recursive Call
auto *yo=FastFourierTransform(po,n/2); ///Recursive Call
std::complex<double> *yo=FastFourierTransform(po,n/2); ///Recursive Call
auto *y=new std::complex<double>[n]; /// Final value representation list
std::complex<double> *y=new std::complex<double>[n]; /// Final value representation list
k1=0,k2=0;
@ -103,8 +103,8 @@ std::complex<double>* FastFourierTransform(std::complex<double>*p,uint8_t n)
static void test() {
/* descriptions of the following test */
auto *t1= new std::complex<double>[2]; /// Test case 1
auto *t2= new std::complex<double>[4];; /// Test case 2
std::complex<double> *t1= new std::complex<double>[2]; /// Test case 1
std::complex<double> *t2= new std::complex<double>[4];; /// Test case 2
t1[0]={1,0};
t1[1]={2,0};
@ -121,8 +121,8 @@ std::complex<double>* FastFourierTransform(std::complex<double>*p,uint8_t n)
std::vector<std::complex<double>> r2 = {
{10, 0}, {-2, -2}, {-2, 0}, {-2, 2}}; /// True Answer for test case 2
auto *o1 = numerical_methods::FastFourierTransform(t1, n1);
auto *o2 = numerical_methods::FastFourierTransform(t2, n2);
std::complex<double> *o1 = numerical_methods::FastFourierTransform(t1, n1);
std::complex<double> *o2 = numerical_methods::FastFourierTransform(t2, n2);
for (uint8_t i = 0; i < n1; i++) {
assert((r1[i].real() - o1->real() < 0.000000000001) &&