]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/math/distributions/gamma.hpp
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / boost / boost / math / distributions / gamma.hpp
index 9a9e2a4f52446f3ea6b066a633c4be53eda766cd..f5b265ad5a0d3d438a819a544d0f8a14dd6e9a25 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <boost/math/distributions/fwd.hpp>
 #include <boost/math/special_functions/gamma.hpp>
+#include <boost/math/special_functions/digamma.hpp>
 #include <boost/math/distributions/detail/common_error_handling.hpp>
 #include <boost/math/distributions/complement.hpp>
 
@@ -336,6 +337,15 @@ inline RealType kurtosis(const gamma_distribution<RealType, Policy>& dist)
    return kurtosis_excess(dist) + 3;
 }
 
+template <class RealType, class Policy>
+inline RealType entropy(const gamma_distribution<RealType, Policy>& dist)
+{
+   RealType k = dist.shape();
+   RealType theta = dist.scale();
+   using std::log;
+   return k + log(theta) + lgamma(k) + (1-k)*digamma(k);
+}
+
 } // namespace math
 } // namespace boost