58 [&](
auto& resultElement)
60 const auto i = &resultElement - result.data();
61 const auto m = static_cast<double>(i / shape.cols);
62 const auto n = static_cast<double>(i % shape.cols);
63 resultElement = std::complex<double>{ 0., 0. };
64 for (
auto k = 0u; k < std::min(
shape.rows, x.numRows()); ++k)
66 for (
auto l = 0u; l < std::min(
shape.cols, x.numCols()); ++l)
70 (((
static_cast<double>(k) * m) /
static_cast<double>(
shape.rows)) +
71 ((
static_cast<double>(l) * n) /
static_cast<double>(
shape.cols)));
72 resultElement += (x(k, l) * std::polar(1.,
angle));
75 resultElement /=
shape.size();
93 template<
typename dtype>
112 template<
typename dtype>
131 template<
typename dtype>
150 template<
typename dtype>
155 return ifft2(inArray, inArray.shape());
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition StaticAsserts.hpp:39
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition NdArrayCore.hpp:139
const Shape & shape() const noexcept
Definition NdArrayCore.hpp:4591
A Shape Class for NdArrays.
Definition Core/shape.hpp:41
constexpr double twoPi
2Pi
Definition Core/Constants.hpp:40
Definition FFT/FFT.hpp:42
NdArray< std::complex< double > > ifft2_internal(const NdArray< std::complex< double > > &x, const Shape &shape)
Definition ifft2.hpp:47
Definition FFT/FFT.hpp:40
NdArray< std::complex< double > > ifft2(const NdArray< dtype > &inArray, const Shape &inShape)
Definition ifft2.hpp:94
void for_each(InputIt first, InputIt last, UnaryFunction f)
Definition StlAlgorithms.hpp:226
auto angle(const std::complex< dtype > &inValue)
Definition angle.hpp:48
auto complex(dtype inReal)
Definition complex.hpp:47
Shape shape(const NdArray< dtype > &inArray) noexcept
Definition Functions/shape.hpp:42