From dbdeceabdd115293a2f6a9c17079940cf5b096dd Mon Sep 17 00:00:00 2001 From: Christoph Hertzberg Date: Fri, 17 Aug 2018 16:26:11 +0200 Subject: Silence double-promotion warning (when converting double to complex) --- unsupported/Eigen/FFT | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'unsupported/Eigen/FFT') diff --git a/unsupported/Eigen/FFT b/unsupported/Eigen/FFT index 2c45b3999..d8cf3e642 100644 --- a/unsupported/Eigen/FFT +++ b/unsupported/Eigen/FFT @@ -289,6 +289,7 @@ class FFT void inv( MatrixBase & dst, const MatrixBase & src, Index nfft=-1) { typedef typename ComplexDerived::Scalar src_type; + typedef typename ComplexDerived::RealScalar real_type; typedef typename OutputDerived::Scalar dst_type; const bool realfft= (NumTraits::IsComplex == 0); EIGEN_STATIC_ASSERT_VECTOR_ONLY(OutputDerived) @@ -329,9 +330,9 @@ class FFT tmp.head(nhead) = src.head(nhead); tmp.tail(ntail) = src.tail(ntail); if (resize_input<0) { //shrinking -- create the Nyquist bin as the average of the two bins that fold into it - tmp(nhead) = ( src(nfft/2) + src( src.size() - nfft/2 ) )*src_type(.5); + tmp(nhead) = ( src(nfft/2) + src( src.size() - nfft/2 ) )*real_type(.5); }else{ // expanding -- split the old Nyquist bin into two halves - tmp(nhead) = src(nhead) * src_type(.5); + tmp(nhead) = src(nhead) * real_type(.5); tmp(tmp.size()-nhead) = tmp(nhead); } } -- cgit v1.2.3