isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
FFTPlanBase.h
1 #pragma once
2 
3 #include <complex>
4 #include <memory>
5 #include <type_traits>
6 
7 #include "FFTWWrapper.h"
8 #include "Threads.h"
9 
10 namespace isce3 { namespace fft { namespace detail {
11 
12 template<int Sign, typename T>
13 class FFTPlanBase {
14 public:
15 
16  static_assert( Sign == FFTW_FORWARD || Sign == FFTW_BACKWARD, "" );
17  static_assert( std::is_same<T, float>::value || std::is_same<T, double>::value, "" );
18 
19  FFTPlanBase();
20 
21  FFTPlanBase(std::complex<T> * out,
22  std::complex<T> * in,
23  int n,
24  int batch = 1,
25  unsigned flags = FFTW_MEASURE,
26  int threads = getMaxThreads());
27 
28  template<int Rank>
29  FFTPlanBase(std::complex<T> * out,
30  std::complex<T> * in,
31  const int (&n)[Rank],
32  int batch = 1,
33  unsigned flags = FFTW_MEASURE,
34  int threads = getMaxThreads());
35 
36  FFTPlanBase(std::complex<T> * out,
37  std::complex<T> * in,
38  int n,
39  int nembed,
40  int stride,
41  int dist,
42  int batch = 1,
43  unsigned flags = FFTW_MEASURE,
44  int threads = getMaxThreads());
45 
46  template<int Rank>
47  FFTPlanBase(std::complex<T> * out,
48  std::complex<T> * in,
49  const int (&n)[Rank],
50  const int (&nembed)[Rank],
51  int stride,
52  int dist,
53  int batch = 1,
54  unsigned flags = FFTW_MEASURE,
55  int threads = getMaxThreads());
56 
57  FFTPlanBase(std::complex<T> * out,
58  std::complex<T> * in,
59  int n,
60  int inembed,
61  int istride,
62  int idist,
63  int onembed,
64  int ostride,
65  int odist,
66  int batch = 1,
67  unsigned flags = FFTW_MEASURE,
68  int threads = getMaxThreads());
69 
70  template<int Rank>
71  FFTPlanBase(std::complex<T> * out,
72  std::complex<T> * in,
73  const int (&n)[Rank],
74  const int (&inembed)[Rank],
75  int istride,
76  int idist,
77  const int (&onembed)[Rank],
78  int ostride,
79  int odist,
80  int batch = 1,
81  unsigned flags = FFTW_MEASURE,
82  int threads = getMaxThreads());
83 
84  explicit operator bool() const { return *_plan; }
85 
86  void execute() const;
87 
88 protected:
89 
90  using fftw_plan_t = typename FFTWPlanType<T>::plan_t;
91 
92  template<typename U, typename V>
93  FFTPlanBase(U * out,
94  V * in,
95  const int * n,
96  const int * inembed,
97  int istride,
98  int idist,
99  const int * onembed,
100  int ostride,
101  int odist,
102  int batch,
103  unsigned flags,
104  int rank,
105  int sign,
106  int threads);
107 
108  std::shared_ptr<fftw_plan_t> _plan;
109 };
110 
111 template<int N>
112 int product(const int (&arr)[N]);
113 
114 }}}
115 
116 #define ISCE_FFT_DETAIL_FFTPLANBASE_ICC
117 #include "FFTPlanBase.icc"
118 #undef ISCE_FFT_DETAIL_FFTPLANBASE_ICC
Definition: FFTWWrapper.h:8
Definition: FFTPlanBase.h:13

Generated for ISCE3.0 by doxygen 1.8.5.