|
From: Paul A B. <pbr...@us...> - 2007-03-16 15:16:21
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/math_functions/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30841/boost-sandbox/libs/math_functions/test Modified Files: Tag: math_toolkit test_lognormal.cpp Log Message: added tests (possibly not quite right) for ranges. Index: test_lognormal.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/math_functions/test/Attic/test_lognormal.cpp,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -d -r1.1.2.3 -r1.1.2.4 --- test_lognormal.cpp 20 Dec 2006 15:33:43 -0000 1.1.2.3 +++ test_lognormal.cpp 16 Mar 2007 15:16:00 -0000 1.1.2.4 @@ -242,6 +242,10 @@ kurtosis_excess(dist) , static_cast<RealType>(4312295840576300.2363383232038251L), tolerance); + BOOST_CHECK_CLOSE( + range(dist).first + , static_cast<RealType>(0), tolerance); + // // Special cases: // @@ -270,6 +274,14 @@ boost::math::lognormal myf1(1., 2); // Using typedef lognormal_distribution<> myf2(1., 2); // Using default RealType double. + // Test range and support using double only, + // because it supports numeric_limits max for a pseudo-infinity. + BOOST_CHECK_EQUAL(range(myf2).first, 0); // range 0 to +infinity + BOOST_CHECK_EQUAL(range(myf2).second, numeric_limits<double>::max()); + BOOST_CHECK_EQUAL(support(myf2).first, 0); // support 0 to + infinity. + BOOST_CHECK_EQUAL(support(myf2).second, numeric_limits<double>::max()); + + // Basic sanity-check spot values. // (Parameter value, arbitrarily zero, only communicates the floating point type). test_spots(0.0F); // Test float. OK at decdigits = 0 tolerance = 0.0001 % |