ei_pocketfft_impl.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // This Source Code Form is subject to the terms of the Mozilla
5 // Public License v. 2.0. If a copy of the MPL was not distributed
6 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 
8 using namespace pocketfft;
9 using namespace pocketfft::detail;
10 
11 namespace Eigen {
12 
13 namespace internal {
14 
15 template <typename _Scalar>
17  typedef _Scalar Scalar;
18  typedef std::complex<Scalar> Complex;
19 
20  inline void clear() {}
21 
22  inline void fwd(Complex* dst, const Scalar* src, int nfft) {
23  const shape_t shape_{static_cast<size_t>(nfft)};
24  const shape_t axes_{0};
25  const stride_t stride_in{sizeof(Scalar)};
26  const stride_t stride_out{sizeof(Complex)};
27  r2c(shape_, stride_in, stride_out, axes_, FORWARD, src, dst, static_cast<Scalar>(1));
28  }
29 
30  inline void fwd(Complex* dst, const Complex* src, int nfft) {
31  const shape_t shape_{static_cast<size_t>(nfft)};
32  const shape_t axes_{0};
33  const stride_t stride_{sizeof(Complex)};
34  c2c(shape_, stride_, stride_, axes_, FORWARD, src, dst, static_cast<Scalar>(1));
35  }
36 
37  inline void inv(Scalar* dst, const Complex* src, int nfft) {
38  const shape_t shape_{static_cast<size_t>(nfft)};
39  const shape_t axes_{0};
40  const stride_t stride_in{sizeof(Complex)};
41  const stride_t stride_out{sizeof(Scalar)};
42  c2r(shape_, stride_in, stride_out, axes_, BACKWARD, src, dst, static_cast<Scalar>(1));
43  }
44 
45  inline void inv(Complex* dst, const Complex* src, int nfft) {
46  const shape_t shape_{static_cast<size_t>(nfft)};
47  const shape_t axes_{0};
48  const stride_t stride_{sizeof(Complex)};
49  c2c(shape_, stride_, stride_, axes_, BACKWARD, src, dst, static_cast<Scalar>(1));
50  }
51 
52  inline void fwd2(Complex* dst, const Complex* src, int nfft0, int nfft1) {
53  const shape_t shape_{static_cast<size_t>(nfft0), static_cast<size_t>(nfft1)};
54  const shape_t axes_{0, 1};
55  const stride_t stride_{static_cast<ptrdiff_t>(sizeof(Complex) * nfft1), static_cast<ptrdiff_t>(sizeof(Complex))};
56  c2c(shape_, stride_, stride_, axes_, FORWARD, src, dst, static_cast<Scalar>(1));
57  }
58 
59  inline void inv2(Complex* dst, const Complex* src, int nfft0, int nfft1) {
60  const shape_t shape_{static_cast<size_t>(nfft0), static_cast<size_t>(nfft1)};
61  const shape_t axes_{0, 1};
62  const stride_t stride_{static_cast<ptrdiff_t>(sizeof(Complex) * nfft1), static_cast<ptrdiff_t>(sizeof(Complex))};
63  c2c(shape_, stride_, stride_, axes_, BACKWARD, src, dst, static_cast<Scalar>(1));
64  }
65 };
66 
67 } // namespace internal
68 } // namespace Eigen
SCALAR Scalar
Definition: bench_gemm.cpp:45
std::complex< RealScalar > Complex
Definition: common.h:71
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
Definition: Eigen_Colamd.h:49
Definition: ei_pocketfft_impl.h:16
void inv2(Complex *dst, const Complex *src, int nfft0, int nfft1)
Definition: ei_pocketfft_impl.h:59
void clear()
Definition: ei_pocketfft_impl.h:20
void inv(Scalar *dst, const Complex *src, int nfft)
Definition: ei_pocketfft_impl.h:37
void fwd2(Complex *dst, const Complex *src, int nfft0, int nfft1)
Definition: ei_pocketfft_impl.h:52
void inv(Complex *dst, const Complex *src, int nfft)
Definition: ei_pocketfft_impl.h:45
std::complex< Scalar > Complex
Definition: ei_pocketfft_impl.h:18
void fwd(Complex *dst, const Scalar *src, int nfft)
Definition: ei_pocketfft_impl.h:22
_Scalar Scalar
Definition: ei_pocketfft_impl.h:17
void fwd(Complex *dst, const Complex *src, int nfft)
Definition: ei_pocketfft_impl.h:30