summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/m.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/utils/m.h b/utils/m.h
index b25248c2..5e45efee 100644
--- a/utils/m.h
+++ b/utils/m.h
@@ -3,6 +3,7 @@
#include <cassert>
#include <cmath>
+#include <boost/math/special_functions/digamma.hpp>
template <typename F>
struct M {
@@ -81,6 +82,11 @@ struct M {
}
}
+ // digamma is the first derivative of the log-gamma function
+ static inline F digamma(const F& x) {
+ return boost::math::digamma(x);
+ }
+
};
typedef M<double> Md;