MADNESS  0.10.1
cfft.h
Go to the documentation of this file.
1 // fft.h - declaration of class
2 // of fast Fourier transform - FFT
3 //
4 // The code is property of LIBROW
5 // You can use it on your own
6 // When utilizing credit LIBROW site
7 
8 #ifndef MADNESS_MISC_CFFT_H__INCLUDED
9 #define MADNESS_MISC_CFFT_H__INCLUDED
10 
11 // Include complex numbers header
12 #include <complex>
13 
14 typedef std::complex<double> double_complex;
15 
16 class CFFT
17 {
18 public:
19  // FORWARD FOURIER TRANSFORM
20  // Input - input data
21  // Output - transform result
22  // N - length of both input data and result
23  static bool Forward(const double_complex *const Input, double_complex *const Output, const unsigned int N);
24 
25  // FORWARD FOURIER TRANSFORM, INPLACE VERSION
26  // Data - both input data and output
27  // N - length of input data
28  static bool Forward(double_complex *const Data, const unsigned int N);
29 
30  // INVERSE FOURIER TRANSFORM
31  // Input - input data
32  // Output - transform result
33  // N - length of both input data and result
34  // Scale - if to scale result
35  static bool Inverse(const double_complex *const Input, double_complex *const Output, const unsigned int N, const bool Scale = true);
36 
37  // INVERSE FOURIER TRANSFORM, INPLACE VERSION
38  // Data - both input data and output
39  // N - length of both input data and result
40  // Scale - if to scale result
41  static bool Inverse(double_complex *const Data, const unsigned int N, const bool Scale = true);
42 
43 protected:
44  // Rearrange function and its inplace version
45  static void Rearrange(const double_complex *const Input, double_complex *const Output, const unsigned int N);
46  static void Rearrange(double_complex *const Data, const unsigned int N);
47 
48  // FFT implementation
49  static void Perform(double_complex *const Data, const unsigned int N, const bool Inverse = false);
50 
51  // Scaling of inverse FFT result
52  static void Scale(double_complex *const Data, const unsigned int N);
53 };
54 
55 #endif // MADNESS_MISC_CFFT_H__INCLUDED
std::complex< double > double_complex
Definition: cfft.h:14
Definition: cfft.h:17
static void Rearrange(const double_complex *const Input, double_complex *const Output, const unsigned int N)
Definition: cfft.cc:92
static bool Inverse(const double_complex *const Input, double_complex *const Output, const unsigned int N, const bool Scale=true)
Definition: cfft.cc:55
static bool Forward(const double_complex *const Input, double_complex *const Output, const unsigned int N)
Definition: cfft.cc:21
static void Perform(double_complex *const Data, const unsigned int N, const bool Inverse=false)
Definition: cfft.cc:140
static void Scale(double_complex *const Data, const unsigned int N)
Definition: cfft.cc:178
#define N
Definition: testconv.cc:37