1 #ifndef STAN_MATH_PRIM_SCAL_ERR_CHECK_NONNEGATIVE_HPP 2 #define STAN_MATH_PRIM_SCAL_ERR_CHECK_NONNEGATIVE_HPP 13 template <
typename T_y,
bool is_vec>
15 static void check(
const char*
function,
const char* name,
const T_y& y) {
18 if (!std::is_unsigned<T_y>::value && !(y >= 0))
19 domain_error(
function, name, y,
"is ",
", but must be >= 0!");
23 template <
typename T_y>
25 static void check(
const char*
function,
const char* name,
const T_y& y) {
45 template <
typename T_y>
static void check(const char *function, const char *name, const T_y &y)
size_t length(const std::vector< T > &x)
Returns the length of the provided std::vector.
void domain_error_vec(const char *function, const char *name, const T &y, size_t i, const char *msg1, const char *msg2)
Throw a domain error with a consistently formatted message.
void check_nonnegative(const char *function, const char *name, const T_y &y)
Check if y is non-negative.
T get(const std::vector< T > &x, size_t n)
Returns the n-th element of the provided std::vector.
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.
static void check(const char *function, const char *name, const T_y &y)
Primary template class for metaprogram to compute the type of values stored in a container.