]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/accumulators/test/error_of.cpp
1 // (C) Copyright Eric Niebler 2005.
2 // Use, modification and distribution are subject to the
3 // Boost Software License, Version 1.0. (See accompanying file
4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #include <boost/test/unit_test.hpp>
7 #include <boost/test/floating_point_comparison.hpp>
8 #include <boost/accumulators/accumulators.hpp>
9 #include <boost/accumulators/statistics/stats.hpp>
10 #include <boost/accumulators/statistics/with_error.hpp>
11 #include <boost/accumulators/statistics/error_of_mean.hpp>
13 using namespace boost
;
14 using namespace unit_test
;
15 using namespace accumulators
;
17 ///////////////////////////////////////////////////////////////////////////////
22 accumulator_set
<double, stats
<tag::error_of
<tag::mean(lazy
)> > > acc
;
26 BOOST_CHECK_CLOSE(0.057735, accumulators::error_of
<tag::mean(lazy
)>(acc
), 1e-4);
28 accumulator_set
<double, stats
<tag::error_of
<tag::mean(immediate
)> > > acc2
;
32 BOOST_CHECK_CLOSE(0.057735, accumulators::error_of
<tag::mean(immediate
)>(acc2
), 1e-4);
34 accumulator_set
<double, stats
<with_error
<tag::mean(lazy
)> > > acc3
;
38 BOOST_CHECK_CLOSE(0.057735, accumulators::error_of
<tag::mean(lazy
)>(acc3
), 1e-4);
40 accumulator_set
<double, stats
<with_error
<tag::mean(immediate
)> > > acc4
;
44 BOOST_CHECK_CLOSE(0.057735, accumulators::error_of
<tag::mean(immediate
)>(acc4
), 1e-4);
47 ///////////////////////////////////////////////////////////////////////////////
48 // init_unit_test_suite
50 test_suite
* init_unit_test_suite( int argc
, char* argv
[] )
52 test_suite
*test
= BOOST_TEST_SUITE("mean test");
54 test
->add(BOOST_TEST_CASE(&test_stat
));