8 #include <forward_list> 12 #include <boost/test/unit_test.hpp> 23 bool res = std::is_same<tde_result_type::record_type, test_tde_result>::value;
25 res ==
true,
"tde_result<array_type> is not multi array float");
31 array_type a(boost::extents[M][P][Q]);
34 tde_result_type tde(a);
38 tde.size() == M * P,
"tde has an incorrect size=" << tde.size());
41 std::size_t counter = 0;
42 for (
int i = 0; i != M; ++i) {
43 for (
int j = 0; j != P; ++j) {
44 tde[counter] = counter;
51 for (
int i = 0; i != M; ++i) {
52 for (
int j = 0; j != P; ++j) {
54 tde[counter] == counter,
"tde[" << counter <<
"] != " << counter);
69 bool res = std::is_same<tde_result_type::record_type, test_tde_result>::value;
71 res ==
true,
"tde_result<array_type> is not multi array float");
77 array_type a(boost::extents[M][P][Q]);
80 tde_result_type tde(a);
84 tde.size() == M * P,
"tde has an incorrect size=" << tde.size());
87 std::size_t counter = 0;
88 for (
int i = 0; i != M; ++i) {
89 for (
int j = 0; j != P; ++j) {
90 tde[counter] = counter;
97 for (
int i = 0; i != M; ++i) {
98 for (
int j = 0; j != P; ++j) {
100 tde[counter] == counter,
"tde[" << counter <<
"] != " << counter);
111 using value_type = std::complex<double>;
117 bool res = std::is_same<tde_result_type::record_type, test_tde_result>::value;
119 res ==
true,
"tde_result<array_type> is not multi array complex type");
125 array_type a(boost::extents[M][P][Q]);
128 tde_result_type tde(a);
132 tde.size() == M * P,
"tde has an incorrect size=" << tde.size());
135 std::size_t counter = 0;
136 for (
int i = 0; i != M; ++i) {
137 for (
int j = 0; j != P; ++j) {
138 tde[counter] = value_type(counter, counter);
145 for (
int i = 0; i != M; ++i) {
146 for (
int j = 0; j != P; ++j) {
148 tde[counter] == value_type(counter, counter),
149 "tde[" << counter <<
"] != " << counter);
165 bool res = std::is_same<tde_result_type::record_type, test_tde_result>::value;
167 res ==
true,
"tde_result<array_type> is not multi array float");
172 array_type a(boost::extents[M][P]);
175 tde_result_type tde(a);
179 tde.size() == M,
"tde has an incorrect size=" << tde.size());
182 std::size_t counter = 0;
183 for (
int i = 0; i != M; ++i) {
184 tde[counter] = counter;
190 for (
int i = 0; i != M; ++i) {
192 tde[counter] == counter,
"tde[" << counter <<
"] != " << counter);
203 using test_tde_result = std::size_t;
207 bool res = std::is_same<tde_result_type::record_type, test_tde_result>::value;
208 BOOST_CHECK_MESSAGE(res ==
true,
"tde_result<array_type> is not std:size_t");
212 array_type a(boost::extents[M]);
215 tde_result_type tde(a);
219 tde.size() == 1,
"tde has an incorrect size=" << tde.size());
225 BOOST_CHECK_MESSAGE(tde[0] == 10,
"tde[0] != 10");
234 using array_type = std::array<float, M>;
235 using test_tde_result = std::size_t;
239 bool res = std::is_same<tde_result_type::record_type, test_tde_result>::value;
240 BOOST_CHECK_MESSAGE(res ==
true,
"tde_result<array_type> is not std:size_t");
246 tde_result_type tde(a);
250 tde.size() == 1,
"tde has an incorrect size=" << tde.size());
256 BOOST_CHECK_MESSAGE(tde[0] == 10,
"tde[0] != 10");
264 using array_type = std::vector<float>;
265 using test_tde_result = std::size_t;
269 bool res = std::is_same<tde_result_type::record_type, test_tde_result>::value;
270 BOOST_CHECK_MESSAGE(res ==
true,
"tde_result<array_type> is not std:size_t");
277 tde_result_type tde(a);
281 tde.size() == 1,
"tde has an incorrect size=" << tde.size());
287 BOOST_CHECK_MESSAGE(tde[0] == 10,
"tde[0] != 10");
295 using array_type = std::deque<float>;
296 using test_tde_result = std::size_t;
300 bool res = std::is_same<tde_result_type::record_type, test_tde_result>::value;
301 BOOST_CHECK_MESSAGE(res ==
true,
"tde_result<array_type> is not std:size_t");
308 tde_result_type tde(a);
312 tde.size() == 1,
"tde has an incorrect size=" << tde.size());
318 BOOST_CHECK_MESSAGE(tde[0] == 10,
"tde[0] != 10");
326 using array_type = std::forward_list<float>;
327 using test_tde_result = std::size_t;
331 bool res = std::is_same<tde_result_type::record_type, test_tde_result>::value;
332 BOOST_CHECK_MESSAGE(res ==
true,
"tde_result<array_type> is not std:size_t");
339 tde_result_type tde(a);
343 tde.size() == 1,
"tde has an incorrect size=" << tde.size());
349 BOOST_CHECK_MESSAGE(tde[0] == 10,
"tde[0] != 10");
356 using array_type = std::list<float>;
357 using test_tde_result = std::size_t;
361 bool res = std::is_same<tde_result_type::record_type, test_tde_result>::value;
362 BOOST_CHECK_MESSAGE(res ==
true,
"tde_result<array_type> is not std:size_t");
369 tde_result_type tde(a);
373 tde.size() == 1,
"tde has an incorrect size=" << tde.size());
379 BOOST_CHECK_MESSAGE(tde[0] == 10,
"tde[0] != 10");
A time-delay estimator (TDE) is an algorithm to compare two families of timeseries and return the est...
boost::multi_array< value_type, num_dims, jb::fftw::allocator< value_type > > aligned_multi_array
Alias boost::multi_array with properly allocated storage for FFTW3.
BOOST_AUTO_TEST_CASE(fftw_tde_result_2_dim_usage)