Automatic Differentiation
 
Loading...
Searching...
No Matches
is_not_nan.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_ERR_IS_NOT_NAN_HPP
2#define STAN_MATH_PRIM_ERR_IS_NOT_NAN_HPP
3
9
10namespace stan {
11namespace math {
12
22template <typename T_y>
23inline bool is_not_nan(const T_y& y) {
24 for (size_t n = 0; n < stan::math::size(y); ++n) {
25 if (is_nan(value_of_rec(stan::get(y, n)))) {
26 return false;
27 }
28 }
29 return true;
30}
31
32} // namespace math
33} // namespace stan
34#endif
T get(const T &x, size_t n)
Returns the provided element.
Definition get.hpp:23
int64_t size(const T &m)
Returns the size (number of the elements) of a matrix_cl or var_value<matrix_cl<T>>.
Definition size.hpp:19
double value_of_rec(const fvar< T > &v)
Return the value of the specified variable.
bool is_nan(T &&x)
Returns 1 if the input's value is NaN and 0 otherwise.
Definition is_nan.hpp:22
bool is_not_nan(const T_y &y)
Return true if y is not NaN.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...