]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/math/test/test_rayleigh.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / math / test / test_rayleigh.cpp
index df8abf5a86188491f37b035861802aaa8826c5f1..aed71668c0eca2e6de042edc7f2c44d482a01d86 100644 (file)
@@ -19,7 +19,7 @@
 
 #define BOOST_TEST_MAIN
 #include <boost/test/unit_test.hpp> // Boost.Test
-#include <boost/test/floating_point_comparison.hpp>
+#include <boost/test/tools/floating_point_comparison.hpp>
 #include "test_out_of_range.hpp"
 
 #include <iostream>
@@ -213,6 +213,13 @@ void test_spots(RealType T)
       ::boost::math::kurtosis_excess(rayleigh_distribution<RealType>(2)),
       ::boost::math::kurtosis(rayleigh_distribution<RealType>(2)) -3,
          tolerance* 100); // %
+
+
+   RealType expected_entropy = 1 + log(boost::math::constants::root_two<RealType>()) + boost::math::constants::euler<RealType>()/2;
+   BOOST_CHECK_CLOSE(
+      ::boost::math::entropy(rayleigh_distribution<RealType>(2)),
+      expected_entropy,
+         tolerance* 100);
    return;
 
 } // template <class RealType>void test_spots(RealType)
@@ -302,7 +309,7 @@ BOOST_AUTO_TEST_CASE( test_main )
   test_spots(0.0); // Test double. OK at decdigits 7, tolerance = 1e07 %
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
   test_spots(0.0L); // Test long double.
-#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
+#if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x582))
   test_spots(boost::math::concepts::real_concept(0.)); // Test real concept.
 #endif
 #else