/*============================================================================= Copyright (c) 2011-2017 Bolero MURAKAMI https://github.com/bolero-MURAKAMI/Sprout Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ #ifndef SPROUT_NUMERIC_FFT_FIXED_IFFT_HPP #define SPROUT_NUMERIC_FFT_FIXED_IFFT_HPP #include #include #include #include #include #include namespace sprout { namespace fixed { namespace detail { template inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm::type make_ifft_result_impl(sprout::array, Size> const& container, Result const& result, sprout::index_tuple) { return remake(result, sprout::size(result), (container[Indexes] / static_cast(Size))...); } template inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm::type make_ifft_result(sprout::array, Size> const& container, Result const& result) { return make_ifft_result_impl(container, result, sprout::make_index_tuple::static_size>()); } template inline SPROUT_CONSTEXPR sprout::array, Size> ifft(sprout::array, Size> const& arr) { return sprout::fixed::detail::fft_loop(arr, 1, sprout::make_ifft_coefficients()); } } // namespace detail // // ifft // Algorithm: Stockham decimation-in-time // template< typename ForwardIterator, typename Result, typename sprout::container_traits::size_type Size = sprout::container_traits::static_size > inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm::type ifft(ForwardIterator first, ForwardIterator last, Result const& result) { return sprout::fixed::detail::make_ifft_result( sprout::fixed::detail::ifft(sprout::fixed::detail::make_input(first, last)), result ); } template inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm::type ifft(ForwardIterator first, ForwardIterator last) { return sprout::fixed::ifft(first, last, sprout::pit()); } } // namespace fixed using sprout::fixed::ifft; } // namespace sprout #endif // #ifndef SPROUT_NUMERIC_FFT_FIXED_IFFT_HPP