10#ifndef EIGEN_FFT_POCKETFFT_IMPL_H
11#define EIGEN_FFT_POCKETFFT_IMPL_H
17template <
typename _Scalar>
18struct pocketfft_impl {
19 using Scalar = _Scalar;
20 using Complex = std::complex<Scalar>;
21 using shape_t = pocketfft::shape_t;
22 using stride_t = pocketfft::stride_t;
24 inline void clear() {}
26 inline void fwd(Complex* dst,
const Scalar* src,
int nfft) {
27 const shape_t shape_{
static_cast<size_t>(nfft)};
28 const shape_t axes_{0};
29 const stride_t stride_in{
sizeof(Scalar)};
30 const stride_t stride_out{
sizeof(Complex)};
31 pocketfft::r2c(shape_, stride_in, stride_out, axes_, pocketfft::FORWARD, src, dst,
static_cast<Scalar
>(1));
34 inline void fwd(Complex* dst,
const Complex* src,
int nfft) {
35 const shape_t shape_{
static_cast<size_t>(nfft)};
36 const shape_t axes_{0};
37 const stride_t stride_{
sizeof(Complex)};
38 pocketfft::c2c(shape_, stride_, stride_, axes_, pocketfft::FORWARD, src, dst,
static_cast<Scalar
>(1));
41 inline void inv(Scalar* dst,
const Complex* src,
int nfft) {
42 const shape_t shape_{
static_cast<size_t>(nfft)};
43 const shape_t axes_{0};
44 const stride_t stride_in{
sizeof(Complex)};
45 const stride_t stride_out{
sizeof(Scalar)};
46 pocketfft::c2r(shape_, stride_in, stride_out, axes_, pocketfft::BACKWARD, src, dst,
static_cast<Scalar
>(1));
49 inline void inv(Complex* dst,
const Complex* src,
int nfft) {
50 const shape_t shape_{
static_cast<size_t>(nfft)};
51 const shape_t axes_{0};
52 const stride_t stride_{
sizeof(Complex)};
53 pocketfft::c2c(shape_, stride_, stride_, axes_, pocketfft::BACKWARD, src, dst,
static_cast<Scalar
>(1));
56 inline void fwd2(Complex* dst,
const Complex* src,
int nfft0,
int nfft1) {
57 const shape_t shape_{
static_cast<size_t>(nfft0),
static_cast<size_t>(nfft1)};
58 const shape_t axes_{0, 1};
59 const stride_t stride_{
static_cast<ptrdiff_t
>(
sizeof(Complex) * nfft1),
static_cast<ptrdiff_t
>(
sizeof(Complex))};
60 pocketfft::c2c(shape_, stride_, stride_, axes_, pocketfft::FORWARD, src, dst,
static_cast<Scalar
>(1));
63 inline void inv2(Complex* dst,
const Complex* src,
int nfft0,
int nfft1) {
64 const shape_t shape_{
static_cast<size_t>(nfft0),
static_cast<size_t>(nfft1)};
65 const shape_t axes_{0, 1};
66 const stride_t stride_{
static_cast<ptrdiff_t
>(
sizeof(Complex) * nfft1),
static_cast<ptrdiff_t
>(
sizeof(Complex))};
67 pocketfft::c2c(shape_, stride_, stride_, axes_, pocketfft::BACKWARD, src, dst,
static_cast<Scalar
>(1));
Namespace containing all symbols from the Eigen library.