diff --git a/src/tests/fftw3_bare/fftw3_test.cpp b/src/tests/fftw3_bare/fftw3_test.cpp index 7bd06b04..40457a56 100644 --- a/src/tests/fftw3_bare/fftw3_test.cpp +++ b/src/tests/fftw3_bare/fftw3_test.cpp @@ -4,62 +4,71 @@ #include void fftw3_test_syntax() { - std::cout << "fftw3_test [N]" << std::endl; + std::cout << std::endl; + std::cout << "fftw3_test [N [offset]]" << std::endl; std::cout << " N: 2^N Fourier Power" << std::endl; std::cout << " default value if not given: N=13 (2^13 = 8192)" << std::endl; + std::cout << " offset: allows to have a length != 2^N, namely 2^N + offset" << std::endl; + std::cout << " default value of offset if not given is 0." << std::endl; + std::cout << std::endl; } int main(int argc, char *argv[]) { - unsigned int N=8192; - - if (argc > 2) { - fftw3_test_syntax(); - return 1; - } - - if (argc == 2) { - int a = -1.0; - int status = sscanf(argv[1], "%d", &a); - if (status != 1) { - fftw3_test_syntax(); - return 2; - } - N = (int)pow(2.0, a); - } - std::cout << "debug> N=" << N << std::endl; - - fftw_complex *in, *out; - fftw_plan my_plan; - - in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*N); - out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*N); - - // feed input - double x=0.0; - for (unsigned int i=0; i N=" << N << ", offset=" << offset << std::endl; - return 0; + fftw_complex *in, *out; + fftw_plan my_plan; + + N += offset; + in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*N); + out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*N); + + // feed input + double x=0.0; + for (unsigned int i=0; i