18 #ifndef IPPL_FFT_FFTPACK_FFT_H
19 #define IPPL_FFT_FFTPACK_FFT_H
27 void cffti (
size_t n,
double& wsave);
28 void cfftf (
size_t n,
double& r,
double& wsave);
29 void cfftb (
size_t n,
double& r,
double& wsave);
31 void rffti (
size_t n,
double& wsave);
32 void rfftf (
size_t n,
double& r,
double& wsave);
33 void rfftb (
size_t n,
double& r,
double& wsave);
35 void sinti (
size_t n,
double& wsave);
36 void sint (
size_t n,
double& r,
double& wsave);
38 void fcffti (
size_t n,
float& wsave);
39 void fcfftf (
size_t n,
float& r,
float& wsave);
40 void fcfftb (
size_t n,
float& r,
float& wsave);
42 void frffti (
size_t n,
float& wsave);
43 void frfftf (
size_t n,
float& r,
float& wsave);
44 void frfftb (
size_t n,
float& r,
float& wsave);
46 void fsinti (
size_t n,
float& wsave);
47 void fsint (
size_t n,
float& r,
float& wsave);
68 static void ccfftf(
size_t n,
float* r,
float* wsave) {
fcfftf (n, *r, *wsave); }
69 static void ccfftb(
size_t n,
float* r,
float* wsave) {
fcfftb (n, *r, *wsave); }
71 static void rcfftf(
size_t n,
float* r,
float* wsave) {
frfftf (n, *r, *wsave); }
72 static void rcfftb(
size_t n,
float* r,
float* wsave) {
frfftb (n, *r, *wsave); }
74 static void rrfft(
size_t n,
float* r,
float* wsave) {
fsint (n, *r, *wsave); }
89 static void ccfftf(
size_t n,
double* r,
double* wsave) {
cfftf (n, *r, *wsave);}
90 static void ccfftb(
size_t n,
double* r,
double* wsave) {
cfftb (n, *r, *wsave);}
92 static void rcfftf(
size_t n,
double* r,
double* wsave) {
rfftf (n, *r, *wsave);}
93 static void rcfftb(
size_t n,
double* r,
double* wsave) {
rfftb (n, *r, *wsave);}
95 static void rrfft(
size_t n,
double* r,
double* wsave) {
sint (n, *r, *wsave); }
117 void setup(
unsigned numTransformDims,
const int* transformTypes,
118 const int* axisLengths);
124 void callFFT(
unsigned transformDim,
int direction,
T* data);
143 for (
unsigned d=0; d<numTransformDims_m; ++d)
146 delete [] transformType_m;
147 delete [] axisLength_m;
154 const int* axisLengths) {
157 numTransformDims_m = numTransformDims;
158 transformType_m =
new int[numTransformDims_m];
159 axisLength_m =
new int[numTransformDims_m];
161 for (d=0; d<numTransformDims_m; ++d) {
162 transformType_m[d] = transformTypes[d];
163 axisLength_m[d] = axisLengths[d];
167 trig_m =
new T*[numTransformDims_m];
168 for (d=0; d<numTransformDims_m; ++d) {
169 switch (transformType_m[d]) {
171 trig_m[d] =
new T[4 * axisLength_m[d] + 15];
175 trig_m[d] =
new T[2 * axisLength_m[d] + 15];
179 trig_m[d] =
new T[
static_cast<int>(2.5 * axisLength_m[d] + 0.5) + 15];
202 T* rdata =
reinterpret_cast<T*
>(data);
205 switch (transformType_m[transformDim]) {
207 if (direction == +1) {
210 trig_m[transformDim]);
215 trig_m[transformDim]);
219 if (direction == +1) {
222 trig_m[transformDim]);
224 int clen = axisLength_m[transformDim]/2 + 1;
225 data[clen-1] = Complex_t(
imag(data[clen-2]),0.0);
226 for (
int i = clen-2; i > 0; --i)
227 data[i] = Complex_t(
imag(data[i-1]),
real(data[i]));
228 data[0] = Complex_t(
real(data[0]),0.0);
232 int clen = axisLength_m[transformDim]/2 + 1;
233 data[0] = Complex_t(
real(data[0]),
real(data[1]));
234 for (
int i = 1; i < clen-1; ++i)
235 data[i] = Complex_t(
imag(data[i]),
real(data[i+1]));
238 trig_m[transformDim]);
242 ERRORMSG(
"Input for real-to-real FFT should be real!!" <<
endl);
265 switch (transformType_m[transformDim]) {
267 ERRORMSG(
"Input for complex-to-complex FFT should be complex!!" <<
endl);
270 ERRORMSG(
"real-to-complex FFT uses complex input!!" <<
endl);
275 trig_m[transformDim]);
284 #endif // IPPL_FFT_FFTPACK_FFT_H
void frffti(size_t n, float &wsave)
void sint(size_t n, double x[], double wsave[])
std::complex< T > Complex_t
void sinti(size_t n, double wsave[])
static void ccffti(size_t n, float *wsave)
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
static void rrfft(size_t n, float *r, float *wsave)
static void rcfftf(size_t n, float *r, float *wsave)
void fsinti(size_t n, float &wsave)
FLieGenerator< T, N > imag(const FLieGenerator< std::complex< T >, N > &)
Take imaginary part of a complex generator.
void cfftb(size_t n, double c[], double wsave[])
static void rrffti(size_t n, double *wsave)
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
void callFFT(unsigned transformDim, int direction, Complex_t *data)
Inform & endl(Inform &inf)
void fcffti(size_t n, float &wsave)
void frfftf(size_t n, float &r, float &wsave)
void rfftb(size_t n, double r[], double wsave[])
static void ccfftf(size_t n, float *r, float *wsave)
static void ccfftb(size_t n, float *r, float *wsave)
static void ccfftf(size_t n, double *r, double *wsave)
static void rcffti(size_t n, float *wsave)
static void ccffti(size_t n, double *wsave)
void cfftf(size_t n, double c[], double wsave[])
static void rrffti(size_t n, float *wsave)
void rffti(size_t n, double wsave[])
static void rrfft(size_t n, double *r, double *wsave)
static void rcfftf(size_t n, double *r, double *wsave)
static void rcfftb(size_t n, double *r, double *wsave)
static void ccfftb(size_t n, double *r, double *wsave)
void cffti(size_t n, double wsave[])
void fcfftb(size_t n, float &r, float &wsave)
static void rcffti(size_t n, double *wsave)
void rfftf(size_t n, double r[], double wsave[])
void setup(unsigned numTransformDims, const int *transformTypes, const int *axisLengths)
void fsint(size_t n, float &r, float &wsave)
void frfftb(size_t n, float &r, float &wsave)
FLieGenerator< T, N > real(const FLieGenerator< std::complex< T >, N > &)
Take real part of a complex generator.
static void rcfftb(size_t n, float *r, float *wsave)
void fcfftf(size_t n, float &r, float &wsave)
unsigned numTransformDims_m