#include #include #include #include #include #include #include #include "gsl_fft.hpp" #include using namespace std; template void vector_out(ostream& stream, const T& v){ stream< dtype ; int main (void){ const int n=128; const int n1= 10; // must be less than n! vector data(n,0.0); ofstream myfile("result"); // pulse: // begin n1+1 end-n1 end //1 ------------------- ----------------- //0 ---------------------- for_each(data.begin(),data.begin()+n1+1,[&](dtype & d){d=1.0;}); //lambda function for_each(data.end()-n1,data.end(),[&](dtype & d){d=1.0;}); cout<<"before fft :\n"; vector_out(cout,data); vector_out(myfile,data); myfile<