// (C) Copyright 2005 Daniel Egloff, Eric Niebler // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #pragma warning(disable: 4786) #pragma warning(disable: 4996) #pragma warning(disable: 4819) #pragma warning(disable: 4018) #pragma warning(disable: 4267) #define BOOST_NUMERIC_FUNCTIONAL_STD_VECTOR_SUPPORT #include //#include #include #include #include #include //#include //#include "renamed_covariance.hpp" #include "covariance2.hpp" using namespace boost; using namespace unit_test; using namespace accumulators; /////////////////////////////////////////////////////////////////////////////// // test_stat // void test_stat() { accumulator_set > > acc(p_square_cumulative_distribution_num_cells=10); // double - double { acc(1., covariate1 = 2.); acc(1., covariate1 = 4.); acc(2., covariate1 = 3.); acc(6., covariate1 = 1.); } double epsilon = 1e-6; BOOST_CHECK_CLOSE((covariance(acc)), -1.75, epsilon); } /////////////////////////////////////////////////////////////////////////////// // init_unit_test_suite // test_suite* init_unit_test_suite( int argc, char* argv[] ) { test_suite *test = BOOST_TEST_SUITE("covariance test"); test->add(BOOST_TEST_CASE(&test_stat)); return test; }