aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/test/FFTW.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unsupported/test/FFTW.cpp')
-rw-r--r--unsupported/test/FFTW.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/unsupported/test/FFTW.cpp b/unsupported/test/FFTW.cpp
index 838ddb238..131b4b762 100644
--- a/unsupported/test/FFTW.cpp
+++ b/unsupported/test/FFTW.cpp
@@ -225,8 +225,29 @@ void test_complex2d()
}
*/
+
+void test_return_by_value(int len)
+{
+ 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<float>() );
+ in1 = fft.inv(out1);
+ VERIFY( (in1-in).norm() < test_precision<float>() );
+}
+
void test_FFTW()
{
+ 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) );
@@ -237,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) );