54 if (x.size() == 0 || n == 0)
59 const auto necessaryInputPoints = n / 2 + 1;
61 if (x.size() > necessaryInputPoints)
65 else if (x.size() < necessaryInputPoints)
75 auto realN = 2 * (input.size() - 1);
76 realN += n % 2 == 1 ? 1 : 0;
80 fullOutput.begin() + input.size(),
82 [](
const auto& value) { return std::conj(value); });
99 template<
typename dtype>
108 const auto data = nc::complex<dtype, double>(inArray);
113 const auto data = nc::complex<dtype, double>(inArray);
114 const auto&
shape = inArray.shape();
116 const auto dataColSlice = data.cSlice();
117 const auto resultColSlice = result.cSlice();
119 for (
uint32 row = 0; row < data.numRows(); ++row)
121 const auto rowData = data(row, dataColSlice);
123 result.put(row, resultColSlice, rowResult);
151 template<
typename dtype>
160 return irfft(inArray, 2 * (inArray.size() - 1), inAxis);
164 return irfft(inArray, 2 * (inArray.numCols() - 1), inAxis);
168 return irfft(inArray, 2 * (inArray.numRows() - 1), inAxis);
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:37
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:39
self_type transpose() const
Definition: NdArrayCore.hpp:4963
self_type flatten() const
Definition: NdArrayCore.hpp:2927
uint32 rows
Definition: Core/shape.hpp:44
A Class for slicing into NdArrays.
Definition: Slice.hpp:45
NdArray< std::complex< double > > ifft_internal(const NdArray< std::complex< double > > &x, uint32 n)
Definition: ifft.hpp:50
NdArray< double > irfft_internal(const NdArray< std::complex< double > > &x, uint32 n)
Definition: irfft.hpp:52
Definition: FFT/fft.hpp:40
NdArray< double > irfft(const NdArray< std::complex< dtype > > &inArray, uint32 inN, Axis inAxis=Axis::NONE)
Definition: irfft.hpp:100
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
Definition: StlAlgorithms.hpp:776
OutputIt copy(InputIt first, InputIt last, OutputIt destination) noexcept
Definition: StlAlgorithms.hpp:98
Axis
Enum To describe an axis.
Definition: Enums.hpp:36
auto real(const std::complex< dtype > &inValue)
Definition: real.hpp:48
NdArray< dtype > zeros(uint32 inSquareSize)
Definition: zeros.hpp:48
Shape shape(const NdArray< dtype > &inArray) noexcept
Definition: Functions/shape.hpp:42
std::uint32_t uint32
Definition: Types.hpp:40