Here is what I am trying to accomplish. I have a function which implements a FFT. (called four1, its signature is listed in the code snippet section).
I also have a function called timeTestFunction_clock (also listed in code snippet) which I want to run the four1 function. So I pass the address of the four1 function, and its parameters to my timeTestFunction_clock.
What I want to have happen is for the timeTestFunction_clock function to run the function I pass it, and then return how long it takes. I am having a problem in how I call timeTestFunction_clock though.
This is how I call it:
double d = timeTestFunction_clock(fou
r1, complexData-1, SIZE, 1);
And this is the complie error I get on the above line of code:
error: invalid conversion from `void (*)(double*, int, int)' to `void (*)()'
error: initializing argument 1 of `double timeTestFunction_clock(voi
d (*)(), double*, int, int)'
Could somebody help me fix the way I am calling it (or whatever other mistake I may be making?)
double timeTestFunction_clock(TestFunction_t func, double data, int i1, int i2)
start = clock();
func(data, i1, i2);
end = clock();
return ((double) (end-start))/CLOCKS_PER_SEC;
The signature of the function four1 is:
d = timeTestFunction_clock(four1, complexData-1, SIZE, 1);