I am using fftw for a fourier transform in c++. There is the standard data type fftw_complex, which is basically a double[2]. I want to make an array of fftw_complex. I do this with
typedef fftw_complex fftw_complex_16[65536];
I set everything to zero in the array. Then I have another function which should check if an fftw_complex_16 is empty.
bool is_empty_fftw_complex_16(fftw_complex_16 *thecomplex){
std::cout<<"Test\n"<<::vowels["a:"][0][0]<<std::endl;
for (unsigned long i=0; i<65536; i++){
if(thecomplex[i][0] != 0 || thecomplex[i][1] != 0){
std::cout<<"Huch!"<<i<<std::endl;
std::cout<<thecomplex[i][0]<<" -- "<<thecomplex[i][1]<<std::endl;
std::cout<<*thecomplex[i][0]<<" -- "<<*thecomplex[i][1]<<std::endl;
return 1;
}
}
return 0;
}
Forget about the couts, they are only for debugging. The only thing the function should do is return true if the array the pointer argument points to is empty and false otherwise. It does not work. The function says the array is not empty when it is! Please help, what am I doing wrong?