Warning, file /include/boost/math/special_functions/polygamma.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef _BOOST_POLYGAMMA_2013_07_30_HPP_
0012 #define _BOOST_POLYGAMMA_2013_07_30_HPP_
0013
0014 #include <boost/math/special_functions/factorials.hpp>
0015 #include <boost/math/special_functions/detail/polygamma.hpp>
0016 #include <boost/math/special_functions/trigamma.hpp>
0017
0018 namespace boost { namespace math {
0019
0020
0021 template<class T, class Policy>
0022 inline typename tools::promote_args<T>::type polygamma(const int n, T x, const Policy& pol)
0023 {
0024
0025
0026
0027 if(n == 0)
0028 return boost::math::digamma(x, pol);
0029 if(n == 1)
0030 return boost::math::trigamma(x, pol);
0031
0032
0033
0034
0035
0036 BOOST_FPU_EXCEPTION_GUARD
0037
0038
0039
0040
0041 typedef typename tools::promote_args<T>::type result_type;
0042
0043
0044
0045
0046 typedef typename policies::evaluation<result_type, Policy>::type value_type;
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057 typedef typename policies::normalise<
0058 Policy,
0059 policies::promote_float<false>,
0060 policies::promote_double<false>,
0061 policies::discrete_quantile<>,
0062 policies::assert_undefined<> >::type forwarding_policy;
0063
0064
0065
0066
0067
0068
0069 return policies::checked_narrowing_cast<result_type, forwarding_policy>(
0070 detail::polygamma_imp(n, static_cast<value_type>(x), forwarding_policy()),
0071 "boost::math::polygamma<%1%>(int, %1%)");
0072 }
0073
0074 template<class T>
0075 inline typename tools::promote_args<T>::type polygamma(const int n, T x)
0076 {
0077 return boost::math::polygamma(n, x, policies::policy<>());
0078 }
0079
0080 } }
0081
0082 #endif
0083