#include #include "nr.h" using namespace std; void NR::dftint(DP func(const DP), const DP a, const DP b, const DP w, DP &cosint, DP &sinint) { static int init=0; static DP (*funcold)(const DP); static DP aold = -1.e30,bold = -1.e30,delta; const int M=64,NDFT=1024,MPOL=6; const DP TWOPI=6.283185307179586476; int j,nn; DP c,cdft,cerr,corfac,corim,corre,en,s,sdft,serr; static Vec_DP data(NDFT),endpts(8); Vec_DP cpol(MPOL),spol(MPOL),xpol(MPOL); if (init != 1 || a != aold || b != bold || func != funcold) { init=1; aold=a; bold=b; funcold=func; delta=(b-a)/M; for (j=0;j