/* * This file is part of libfftpack. * * libfftpack is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * libfftpack is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with libfftpack; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* * libfftpack is being developed at the Max-Planck-Institut fuer Astrophysik * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt * (DLR). */ /* fftpack.c : A set of FFT routines in C. Algorithmically based on Fortran-77 FFTPACK by Paul N. Swarztrauber (Version 4, 1985). C port by Martin Reinecke (2010) */ #ifdef BACKWARD #define PSIGN + #define PMSIGNC(a,b,c,d) { a.r=c.r+d.r; a.i=c.i+d.i; b.r=c.r-d.r; b.i=c.i-d.i; } /* a = b*c */ #define MULPMSIGNC(a,b,c) { a.r=b.r*c.r-b.i*c.i; a.i=b.r*c.i+b.i*c.r; } #else #define PSIGN - #define PMSIGNC(a,b,c,d) { a.r=c.r-d.r; a.i=c.i-d.i; b.r=c.r+d.r; b.i=c.i+d.i; } /* a = conj(b)*c */ #define MULPMSIGNC(a,b,c) { a.r=b.r*c.r+b.i*c.i; a.i=b.r*c.i-b.i*c.r; } #endif static void X(2) (size_t ido, size_t l1, const cmplx *cc, cmplx *ch, const cmplx *wa) { const size_t cdim=2; size_t k,i; cmplx t; if (ido==1) for (k=0;kip) iang-=ip; abr.r += ccl[l ].r*wal[iang].r; abr.i += ccl[l ].i*wal[iang].r; abi.r += ccl[lc].r*wal[iang].i; abi.i += ccl[lc].i*wal[iang].i; } #ifndef BACKWARD { abi.i=-abi.i; abi.r=-abi.r; } #endif CONJFLIPC(abi) PMC(CH(i,k,j),CH(i,k,jc),abr,abi) } } DEALLOC(tarr); if (ido==1) return; for (j=1; j