From 141c746fc71b3f615378c5dc01cef2582682e3bd Mon Sep 17 00:00:00 2001 From: Mark Borgerding Date: Fri, 22 Jan 2010 01:17:36 -0500 Subject: if the src.stride() != 1, then the layout is not continuous -- need to copy to temporary --- unsupported/Eigen/FFT | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'unsupported/Eigen/FFT') diff --git a/unsupported/Eigen/FFT b/unsupported/Eigen/FFT index caaf79714..6c8cf7fdd 100644 --- a/unsupported/Eigen/FFT +++ b/unsupported/Eigen/FFT @@ -185,7 +185,13 @@ class FFT dst->derived().resize( (src.size()>>1)+1); else dst->derived().resize(src.size()); - fwd( &(*dst)[0],&src[0],src.size() ); + + if (src.stride() != 1) { + Matrix tmp = src; + fwd( &(*dst)[0],&tmp[0],src.size() ); + }else{ + fwd( &(*dst)[0],&src[0],src.size() ); + } } inline @@ -219,7 +225,12 @@ class FFT int nfft = src.size(); int nout = HasFlag(HalfSpectrum) ? ((nfft>>1)+1) : nfft; dst->derived().resize( nout ); - inv( &(*dst)[0],&src[0], nfft); + if (src.stride() != 1) { + Matrix tmp = src; + inv( &(*dst)[0],&tmp[0], nfft); + }else{ + inv( &(*dst)[0],&src[0], nfft); + } } template -- cgit v1.2.3