diff options
author | Mark Borgerding <mark@borgerding.net> | 2010-03-07 23:46:26 -0500 |
---|---|---|
committer | Mark Borgerding <mark@borgerding.net> | 2010-03-07 23:46:26 -0500 |
commit | 101cc03176d6705e27b8576a4ce6fbb86c8f3055 (patch) | |
tree | c9de0f65908ec6fc55d1b8a23a536f744a18bfdc /unsupported/test/FFTW.cpp | |
parent | e31929337e8732a32aca21b0343dae22fbced510 (diff) | |
parent | 9fe040ad29400f152b392fff9dc1493a6b9c14aa (diff) |
merge
Diffstat (limited to 'unsupported/test/FFTW.cpp')
-rw-r--r-- | unsupported/test/FFTW.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/unsupported/test/FFTW.cpp b/unsupported/test/FFTW.cpp index 1cc8b156f..131b4b762 100644 --- a/unsupported/test/FFTW.cpp +++ b/unsupported/test/FFTW.cpp @@ -226,29 +226,28 @@ void test_complex2d() */ -template <typename T,int nrows,int ncols> -void test_return_by_value() +void test_return_by_value(int len) { - 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; + VectorXf in; + VectorXf in1; + in = in.Random( len ); + VectorXcf out1,out2; + FFT<float> fft; fft.SetFlag(fft.HalfSpectrum ); fft.fwd(out1,in); out2 = fft.fwd(in); - VERIFY( (out1-out2).norm() < test_precision<T>() ); + VERIFY( (out1-out2).norm() < test_precision<float>() ); in1 = fft.inv(out1); - VERIFY( (in1-in).norm() < test_precision<T>() ); + VERIFY( (in1-in).norm() < test_precision<float>() ); } void test_FFTW() { - test_return_by_value<float,1,32>(); - test_return_by_value<double,1,32>(); + cout << "testing return-by-value\n"; + CALL_SUBTEST( test_return_by_value(32) ); + cout << "testing complex\n"; //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) ); @@ -259,6 +258,7 @@ void test_FFTW() CALL_SUBTEST( test_complex<float>(2*3*4*5) ); CALL_SUBTEST( test_complex<double>(2*3*4*5) ); CALL_SUBTEST( test_complex<long double>(2*3*4*5) ); CALL_SUBTEST( test_complex<float>(2*3*4*5*7) ); CALL_SUBTEST( test_complex<double>(2*3*4*5*7) ); CALL_SUBTEST( test_complex<long double>(2*3*4*5*7) ); + cout << "testing scalar\n"; CALL_SUBTEST( test_scalar<float>(32) ); CALL_SUBTEST( test_scalar<double>(32) ); CALL_SUBTEST( test_scalar<long double>(32) ); CALL_SUBTEST( test_scalar<float>(45) ); CALL_SUBTEST( test_scalar<double>(45) ); CALL_SUBTEST( test_scalar<long double>(45) ); CALL_SUBTEST( test_scalar<float>(50) ); CALL_SUBTEST( test_scalar<double>(50) ); CALL_SUBTEST( test_scalar<long double>(50) ); |