Automatic Differentiation
 
Loading...
Searching...
No Matches
bessel_first_kind.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_BESSEL_FIRST_KIND_HPP
2#define STAN_MATH_PRIM_FUN_BESSEL_FIRST_KIND_HPP
3
6#include <boost/math/special_functions/bessel.hpp>
8
9namespace stan {
10namespace math {
11
38template <typename T2, require_arithmetic_t<T2>* = nullptr>
39inline T2 bessel_first_kind(int v, const T2 z) {
40 check_not_nan("bessel_first_kind", "z", z);
41 return boost::math::cyl_bessel_j(v, z);
42}
43
54template <typename T1, typename T2, require_any_container_t<T1, T2>* = nullptr,
55 require_not_var_matrix_t<T2>* = nullptr>
56inline auto bessel_first_kind(const T1& a, const T2& b) {
57 return apply_scalar_binary(a, b, [&](const auto& c, const auto& d) {
58 return bessel_first_kind(c, d);
59 });
60}
61
62} // namespace math
63} // namespace stan
64#endif
void check_not_nan(const char *function, const char *name, const T_y &y)
Check if y is not NaN.
auto apply_scalar_binary(const T1 &x, const T2 &y, const F &f)
Base template function for vectorization of binary scalar functions defined by applying a functor to ...
fvar< T > bessel_first_kind(int v, const fvar< T > &z)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...