23 void inline ComplexMult(
const double x,
const double y,
const double u,
const double v,
24 double* real_result,
double* imag_result) {
25 *real_result = x * u - y * v;
26 *imag_result = x * v - y * u;
46 return (m * (bigL + 1) - ((m * (m - 1)) / 2) + (l - m));
48 return (((bigL * (bigL + 3)) / 2) + 1 + ((bigL + m) * (bigL + m + 1) / 2) + (l - abs(m)));
68 void TransMult(
double* rdatacoeffs,
double* idatacoeffs,
double* rfiltercoeffs,
double* ifiltercoeffs,
double* rres,
69 double* ires,
const int bw) {
70 double* rdptr = rdatacoeffs;
71 double* idptr = idatacoeffs;
75 for (
int m = 0; m < bw; ++m) {
76 for (
int l = m; l < bw; ++l) {
77 ComplexMult(rfiltercoeffs[l], ifiltercoeffs[l], rdptr[l - m], idptr[l - m], rrptr + l - m, irptr + l - m);
79 rrptr[l - m] *= sqrt(4. * M_PI / (2. * l + 1.));
80 irptr[l - m] *= sqrt(4. * M_PI / (2. * l + 1.));
89 for (
int m = bw + 1; m < size; ++m) {
90 for (
int l = size - m; l < bw; ++l) {
91 ComplexMult(rfiltercoeffs[l], ifiltercoeffs[l], rdptr[l - size + m], idptr[l - size + m],
92 rrptr + l - size + m, irptr + l - size + m);
94 rrptr[l - size + m] *= sqrt(4. * M_PI / (2. * l + 1.));
95 irptr[l - size + m] *= sqrt(4. * M_PI / (2. * l + 1.));