1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

add C++14 constexpr fft/ifft

This commit is contained in:
bolero-MURAKAMI 2014-04-18 11:34:28 +09:00
parent 6a6fdd41ec
commit 07b5f69ebb
5 changed files with 205 additions and 4 deletions

View file

@ -23,16 +23,26 @@ namespace sprout {
// 26.4.7, values:
template<typename T>
inline SPROUT_CONSTEXPR T
inline SPROUT_CONSTEXPR T const&
real(sprout::complex<T> const& x) {
return x.real();
}
template<typename T>
inline SPROUT_CONSTEXPR T
inline SPROUT_CONSTEXPR T const&
imag(sprout::complex<T> const& x) {
return x.imag();
}
template<typename T>
inline SPROUT_CXX14_CONSTEXPR T&
real(sprout::complex<T>& x) {
return x.real();
}
template<typename T>
inline SPROUT_CXX14_CONSTEXPR T&
imag(sprout::complex<T>& x) {
return x.imag();
}
template<typename T>
inline SPROUT_CONSTEXPR T
abs(sprout::complex<T> const& x) {
return sprout::sqrt(sprout::norm(x));