]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/accumulators/test/moment.cpp
b91d0af7bcb209d3cd6ee21dc769c5f2479ed279
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/moment.hpp>
12 using namespace boost
;
13 using namespace unit_test
;
14 using namespace accumulators
;
16 ///////////////////////////////////////////////////////////////////////////////
21 accumulator_set
<int, stats
<tag::moment
<2> > > acc1
;
28 BOOST_CHECK_CLOSE(15., accumulators::moment
<2>(acc1
), 1e-5);
30 accumulator_set
<int, stats
<tag::moment
<5> > > acc2
;
38 BOOST_CHECK_CLOSE(1106., accumulators::moment
<5>(acc2
), 1e-5);
41 ///////////////////////////////////////////////////////////////////////////////
42 // init_unit_test_suite
44 test_suite
* init_unit_test_suite( int argc
, char* argv
[] )
46 test_suite
*test
= BOOST_TEST_SUITE("moment test");
48 test
->add(BOOST_TEST_CASE(&test_stat
));