log_rising_factorial.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_PRIM_SCAL_FUN_LOG_RISING_FACTORIAL_HPP
#define STAN_MATH_PRIM_SCAL_FUN_LOG_RISING_FACTORIAL_HPP
#include <stan/math/prim/scal/err/check_positive.hpp>
#include <stan/math/prim/scal/fun/is_nan.hpp>
#include <stan/math/prim/scal/fun/lgamma.hpp>
#include <limits>
namespace stan {
namespace math {
template<typename T1, typename T2>
inline typename boost::math::tools::promote_args<T1, T2>::type
log_rising_factorial(const T1& x, const T2& n) {
if (is_nan(x) || is_nan(n))
return std::numeric_limits<double>::quiet_NaN();
static const char* fun = "log_rising_factorial";
check_positive(fun, "first argument", x);
return lgamma(x + n) - lgamma(x);
}
}
}
#endif
lgamma.hpp
stan::math::lgamma
fvar< T > lgamma(const fvar< T > &x)
Return the natural logarithm of the gamma function applied to the specified argument.
Definition: lgamma.hpp:20
is_nan.hpp
check_positive.hpp
stan
Definition: log_sum_exp.hpp:8
stan::math::log_rising_factorial
fvar< T > log_rising_factorial(const fvar< T > &x, const fvar< T > &n)
Definition: log_rising_factorial.hpp:13
stan::math::check_positive
void check_positive(const char *function, const char *name, const T_y &y)
Check if y is positive.
Definition: check_positive.hpp:63
stan::math::is_nan
int is_nan(const fvar< T > &x)
Returns 1 if the input&#39;s value is NaN and 0 otherwise.
Definition: is_nan.hpp:21

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