This source file includes following definitions.
- kern_r4_cmplx_n_f
- kern_r4_cmplx_n_b
- fftss_r4_cmplx_n_f
- fftss_r4_cmplx_n_b
#include "libfftss.h"
#if defined(HAVE_COMPLEX_H)
#include <complex.h>
static inline void
kern_r4_cmplx_n_f(double complex *restrict o0,
double complex *restrict o1,
double complex *restrict o2,
double complex *restrict o3,
double complex *i0,
double complex *i1,
double complex *i2,
double complex *i3,
double complex *w,
long bsize, long blocks)
{
long i, j;
for (i = 0; i < blocks; i++) {
double complex w1, w2, w3;
w1 = w[i * bsize];
w2 = w[2 * i * bsize];
w3 = w[3 * i * bsize];
for (j = 0; j < bsize; j++) {
double complex p1, p2, p3;
double complex q0, q1, q2, q3;
p1 = creal(i1[j]) * creal(w1) + cimag(i1[j]) * cimag(w1)
+ (cimag(i1[j]) * creal(w1) - creal(i1[j]) * cimag(w1)) * I;
p2 = creal(i2[j]) * creal(w2) + cimag(i2[j]) * cimag(w2)
+ (cimag(i2[j]) * creal(w2) - creal(i2[j]) * cimag(w2)) * I;
p3 = creal(i3[j]) * creal(w3) + cimag(i3[j]) * cimag(w3)
+ (cimag(i3[j]) * creal(w3) - creal(i3[j]) * cimag(w3)) * I;
q0 = i0[j] + p2;
q2 = i0[j] - p2;
q1 = p1 + p3;
q3 = -I * (p1 - p3);
o0[j] = q0 + q1;
o2[j] = q0 - q1;
o1[j] = q2 + q3;
o3[j] = q2 - q3;
}
i0 += 4 * bsize; i1 += 4 * bsize;
i2 += 4 * bsize; i3 += 4 * bsize;
o0 += bsize; o1 += bsize;
o2 += bsize; o3 += bsize;
}
}
static inline void
kern_r4_cmplx_n_b(double complex *restrict o0,
double complex *restrict o1,
double complex *restrict o2,
double complex *restrict o3,
double complex *i0,
double complex *i1,
double complex *i2,
double complex *i3,
double complex *w,
long bsize, long blocks)
{
long i, j;
for (i = 0; i < blocks; i++) {
double complex w1, w2, w3;
w1 = w[i * bsize];
w2 = w[2 * i * bsize];
w3 = w[3 * i * bsize];
for (j = 0; j < bsize; j++) {
double complex p1, p2, p3;
double complex q0, q1, q2, q3;
p1 = i1[j] * w1;
p2 = i2[j] * w2;
p3 = i3[j] * w3;
q0 = i0[j] + p2;
q2 = i0[j] - p2;
q1 = p1 + p3;
q3 = I * (p1 - p3);
o0[j] = q0 + q1;
o2[j] = q0 - q1;
o1[j] = q2 + q3;
o3[j] = q2 - q3;
}
i0 += 4 * bsize; i1 += 4 * bsize;
i2 += 4 * bsize; i3 += 4 * bsize;
o0 += bsize; o1 += bsize;
o2 += bsize; o3 += bsize;
}
}
void fftss_r4_cmplx_n_f(double *in, double *out, double *w,
long bsize, long blocks)
{
kern_r4_cmplx_n_f((double complex *)out,
(double complex *)out + bsize * blocks,
(double complex *)out + bsize * blocks * 2,
(double complex *)out + bsize * blocks * 3,
(double complex *)in,
(double complex *)in + bsize,
(double complex *)in + bsize * 2,
(double complex *)in + bsize * 3,
(double complex *)w, bsize, blocks);
}
void fftss_r4_cmplx_n_b(double *in, double *out, double *w,
long bsize, long blocks)
{
kern_r4_cmplx_n_b((double complex *)out,
(double complex *)out + bsize * blocks,
(double complex *)out + bsize * blocks * 2,
(double complex *)out + bsize * blocks * 3,
(double complex *)in,
(double complex *)in + bsize,
(double complex *)in + bsize * 2,
(double complex *)in + bsize * 3,
(double complex *)w, bsize, blocks);
}
#endif