diff options
author | Mark Borgerding <mark@borgerding.net> | 2010-03-07 21:31:06 -0500 |
---|---|---|
committer | Mark Borgerding <mark@borgerding.net> | 2010-03-07 21:31:06 -0500 |
commit | 5b2c8b77df14001b29b507b97a00c1194655bf5e (patch) | |
tree | 332eda5ddd21cd4a583a37aac1798eebadd38bf0 /unsupported/test/FFTW.cpp | |
parent | b528b747c1ce1e4b53763bab7e05e327b8d192e7 (diff) |
created FFT::fwd and FFT::inv with ReturnByValue
Diffstat (limited to 'unsupported/test/FFTW.cpp')
-rw-r--r-- | unsupported/test/FFTW.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/unsupported/test/FFTW.cpp b/unsupported/test/FFTW.cpp index 838ddb238..66ffbae38 100644 --- a/unsupported/test/FFTW.cpp +++ b/unsupported/test/FFTW.cpp @@ -225,8 +225,28 @@ void test_complex2d() } */ + +template <typename T,int nrows,int ncols> +void test_return_by_value() +{ + Matrix<complex<T>,nrows,ncols> in; + Matrix<complex<T>,nrows,ncols> in1; + in.Random(); + Matrix<complex<T>,nrows,ncols> out1; + Matrix<complex<T>,nrows,ncols> out2; + FFT<T> fft; + fft.fwd(out1,in); + out2 = fft.fwd(in); + VERIFY( (out1-out2).norm() < test_precision<T>() ); + in1 = fft.inv(out1); + VERIFY( (in1-in).norm() < test_precision<T>() ); +} + void test_FFTW() { + test_return_by_value<float,1,32>(); + test_return_by_value<double,1,32>(); + //test_return_by_value<long double,1,32>(); //CALL_SUBTEST( ( test_complex2d<float,4,8> () ) ); CALL_SUBTEST( ( test_complex2d<double,4,8> () ) ); //CALL_SUBTEST( ( test_complex2d<long double,4,8> () ) ); CALL_SUBTEST( test_complex<float>(32) ); CALL_SUBTEST( test_complex<double>(32) ); CALL_SUBTEST( test_complex<long double>(32) ); |