comparison tests/TestWindow.cpp @ 336:f665f9ce2fd1

Test two-arg cut as well
author Chris Cannam <c.cannam@qmul.ac.uk>
date Tue, 01 Oct 2013 15:15:59 +0100
parents 0a632ac70945
children 4920d100b290
comparison
equal deleted inserted replaced
335:0a632ac70945 336:f665f9ce2fd1
49 double d[N]; 49 double d[N];
50 for (int i = 0; i < N; ++i) d[i] = 1.0; 50 for (int i = 0; i < N; ++i) d[i] = 1.0;
51 Window<double> w(type, N); 51 Window<double> w(type, N);
52 w.cut(d); 52 w.cut(d);
53 COMPARE_ARRAY(d, expected); 53 COMPARE_ARRAY(d, expected);
54
55 double d0[N], d1[N];
56 for (int i = 0; i < N; ++i) d0[i] = 0.5 + (1.0 / (N * 2)) * (i + 1);
57 w.cut(d0, d1);
58 for (int i = 0; i < N; ++i) {
59 BOOST_CHECK_SMALL(d1[i] - d0[i] * expected[i], 1e-4);
60 }
54 } 61 }
55 62
56 BOOST_AUTO_TEST_CASE(bartlett) 63 BOOST_AUTO_TEST_CASE(bartlett)
57 { 64 {
58 double e1[] = { 1 }; 65 double e1[] = { 1 };