1#ifndef STAN_MATH_PRIM_FUN_LGAMMA_HPP
2#define STAN_MATH_PRIM_FUN_LGAMMA_HPP
15#if !__MINGW32__ && !_BOOST_LGAMMA
20 "stan-math requires _REENTRANT being defined during compilation" \
21 "to make lgamma_r available."
28#include <boost/math/special_functions/gamma.hpp>
64#if !__MINGW32__ && !_BOOST_LGAMMA
66 return ::lgamma_r(x, &
sign);
69 return std::numeric_limits<double>::infinity();
83#if !__MINGW32__ && !_BOOST_LGAMMA
85 return ::lgamma_r(x, &
sign);
88 return std::numeric_limits<double>::infinity();
102 template <
typename T>
103 static inline auto fun(
const T& x) {
117template <
typename T, require_not_var_matrix_t<T>* =
nullptr,
118 require_not_nonscalar_prim_or_rev_kernel_expression_t<T>* =
nullptr>
auto sign(const T &x)
Returns signs of the arguments.
fvar< T > lgamma(const fvar< T > &x)
Return the natural logarithm of the gamma function applied to the specified argument.
boost::math::policies::policy< boost::math::policies::overflow_error< boost::math::policies::errno_on_error >, boost::math::policies::pole_error< boost::math::policies::errno_on_error >, boost::math::policies::promote_double< false >, boost::math::policies::digits2< B > > boost_policy_t
Boost policy that overrides the defaults to match the built-in C++ standard library functions.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Base template class for vectorization of unary scalar functions defined by a template class F to a sc...
static auto fun(const T &x)
Structure to wrap lgamma() so that it can be vectorized.