Automatic Differentiation
 
Loading...
Searching...
No Matches
check_not_nan.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_ERR_CHECK_NOT_NAN_HPP
2#define STAN_MATH_PRIM_ERR_CHECK_NOT_NAN_HPP
3
10
11namespace stan {
12namespace math {
13
25template <typename T_y>
26inline void check_not_nan(const char* function, const char* name,
27 const T_y& y) {
28 elementwise_check([](double x) { return !std::isnan(x); }, function, name, y,
29 "not nan");
30}
31
32} // namespace math
33} // namespace stan
34#endif
void elementwise_check(const F &is_good, const char *function, const char *name, const T &x, const char *must_be, const Indexings &... indexings)
Check that the predicate holds for the value of x.
void check_not_nan(const char *function, const char *name, const T_y &y)
Check if y is not NaN.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
bool isnan(const stan::math::var &a)
Checks if the given number is NaN.
Definition std_isnan.hpp:18