1 #ifndef STAN_MATH_PRIM_SCAL_ERR_CHECK_FINITE_HPP
2 #define STAN_MATH_PRIM_SCAL_ERR_CHECK_FINITE_HPP
9 #include <boost/math/special_functions/fpclassify.hpp>
15 template <
typename T_y,
bool is_vec>
17 static bool check(
const char*
function,
23 "is ",
", but must be finite!");
28 template <
typename T_y>
29 struct finite<T_y, true> {
30 static bool check(
const char*
function,
35 for (
size_t n = 0; n <
length(y); n++) {
38 "is ",
", but must be finite!");
61 template <
typename T_y>
65 return finite<T_y, is_vector_like<T_y>::value>
66 ::check(
function, name, y);
bool isfinite(const stan::math::var &v)
Checks if the given number has finite value.
double value_of_rec(const fvar< T > &v)
Return the value of the specified variable.
size_t length(const std::vector< T > &x)
void domain_error_vec(const char *function, const char *name, const T &y, const size_t i, const char *msg1, const char *msg2)
Throw a domain error with a consistently formatted message.
T get(const std::vector< T > &x, size_t n)
void domain_error(const char *function, const char *name, const T &y, const char *msg1, const char *msg2)
Throw a domain error with a consistently formatted message.
bool check_finite(const char *function, const char *name, const T_y &y)
Return true if y is finite.