Berkeley Nuclear Data Software
FFT1D.H
Go to the documentation of this file.
1 #ifndef _FFT1D_H_
2 #define _FFT1D_H_
3 #include <cmath>
4 #include <complex>
5 #include <vector>
6 #include <cstdio>
7 #include <iostream>
8 #include "PowerItoI.H"
9 class FFT1D
10 {
11  public:
12  // Interface class for complex-to-complex power-of-two FFT on the
13  // unit interval.
14  FFT1D(){};
15  // Constructor. argument a_M specifies number of points is N= 2^{a_M}
16  FFT1D(unsigned int a_M){m_M = a_M; m_N = Power(2,m_M);}
17  virtual ~FFT1D() { }
18  // Forward FFT: a_fHat[k] = \sum_j=0^{N-1} a_f[j] z^{j k}, z = e^{-2
19  // \pi \iota /m_N}
20  virtual void
21  forwardFFTCC(std::vector<std::complex<double> > & a_fHat,
22  const std::vector<std::complex<double> >& f) const = 0;
23  // inverse FFT: a_f[j] = \sum_{k=0}^{N-1} a_fHat[k] z^{j k}, z =
24  // e^{2 \pi \iota /m_N}
25  virtual void
26  inverseFFTCC(std::vector<std::complex<double> > & a_f,
27  const std::vector<std::complex<double> > & a_fHat) const = 0;
28  // Access functions.
29  const unsigned int& getN(){return m_N;}
30  const unsigned int& getM(){return m_M;}
31  protected:
32  unsigned int m_M, m_N;
33 };
34 #endif
unsigned int Power(unsigned int a_x, unsigned int a_n)
Definition: PowerItoI.cpp:3
Definition: FFT1D.H:10
virtual ~FFT1D()
Definition: FFT1D.H:17
FFT1D(unsigned int a_M)
Definition: FFT1D.H:16
const unsigned int & getM()
Definition: FFT1D.H:30
virtual void forwardFFTCC(std::vector< std::complex< double > > &a_fHat, const std::vector< std::complex< double > > &f) const =0
unsigned int m_M
Definition: FFT1D.H:32
const unsigned int & getN()
Definition: FFT1D.H:29
unsigned int m_N
Definition: FFT1D.H:32
FFT1D()
Definition: FFT1D.H:14
virtual void inverseFFTCC(std::vector< std::complex< double > > &a_f, const std::vector< std::complex< double > > &a_fHat) const =0