Stan Math Library  2.20.0
reverse mode automatic differentiation
rising_factorial.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_FUN_RISING_FACTORIAL_HPP
2 #define STAN_MATH_PRIM_SCAL_FUN_RISING_FACTORIAL_HPP
3 
5 #include <boost/math/special_functions/factorials.hpp>
9 #include <limits>
10 
11 namespace stan {
12 namespace math {
13 
64 template <typename T>
65 inline typename boost::math::tools::promote_args<T>::type rising_factorial(
66  const T& x, int n) {
67  static const char* function = "rising_factorial";
68  check_not_nan(function, "first argument", x);
69  check_nonnegative(function, "second argument", n);
71 }
72 } // namespace math
73 } // namespace stan
74 #endif
void check_nonnegative(const char *function, const char *name, const T_y &y)
Check if y is non-negative.
var rising_factorial(const var &a, int b)
void check_not_nan(const char *function, const char *name, const T_y &y)
Check if y is not NaN.
fvar< T > rising_factorial(const fvar< T > &x, int n)
Return autodiff variable with the gradient and result of the rising factorial function applied to the...
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_policy_t
Boost policy that overrides the defaults to match the built-in C++ standard library functions...

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