#include #include "nr.h" using namespace std; void NR::cosft1(Vec_IO_DP &y) { const DP PI=3.141592653589793238; int j; DP sum,y1,y2,theta,wi=0.0,wpi,wpr,wr=1.0,wtemp; int n=y.size()-1; Vec_DP yy(n); theta=PI/n; wtemp=sin(0.5*theta); wpr = -2.0*wtemp*wtemp; wpi=sin(theta); sum=0.5*(y[0]-y[n]); yy[0]=0.5*(y[0]+y[n]); for (j=1;j