All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
lmgamma.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_PRIM_SCAL_FUN_LMGAMMA_HPP
#define STAN_MATH_PRIM_SCAL_FUN_LMGAMMA_HPP
#include <boost/math/tools/promotion.hpp>
#include <stan/math/prim/scal/fun/constants.hpp>
#include <boost/math/special_functions/gamma.hpp>
namespace stan {
namespace math {
template <typename T>
inline typename boost::math::tools::promote_args<T>::type
lmgamma(const int k, T x) {
using boost::math::lgamma;
typename boost::math::tools::promote_args<T>::type result
= k * (k - 1) * LOG_PI_OVER_FOUR;
for (int j = 1; j <= k; ++j)
result += lgamma(x + (1.0 - j) / 2.0);
return result;
}
}
}
#endif
stan::math::lgamma
fvar< T > lgamma(const fvar< T > &x)
Definition: lgamma.hpp:15
stan::math::LOG_PI_OVER_FOUR
const double LOG_PI_OVER_FOUR
Log pi divided by 4 .
Definition: constants.hpp:79
constants.hpp
stan::math::lmgamma
fvar< typename stan::return_type< T, int >::type > lmgamma(int x1, const fvar< T > &x2)
Definition: lmgamma.hpp:16

[ Stan Home Page ] © 2011–2015, Stan Development Team.