1 #ifndef STAN__MATH__ERROR_HANDLING_CHECK_LESS_OR_EQUAL_HPP
2 #define STAN__MATH__ERROR_HANDLING_CHECK_LESS_OR_EQUAL_HPP
11 template <
typename T_y,
typename T_high,
typename T_result,
bool is_vec>
12 struct less_or_equal {
13 static bool check(
const char*
function,
19 VectorView<const T_high> high_vec(high);
20 for (
size_t n = 0; n <
length(high); n++) {
21 if (!(y <= high_vec[n]))
23 " is %1%, but must be less than or equal to ",
30 template <
typename T_y,
typename T_high,
typename T_result>
31 struct less_or_equal<T_y, T_high, T_result, true> {
32 static bool check(
const char*
function,
38 VectorView<const T_high> high_vec(high);
39 for (
size_t n = 0; n <
length(y); n++) {
42 " is %1%, but must be less than or equal to ",
51 template <
typename T_y,
typename T_high,
typename T_result>
57 return less_or_equal<T_y,T_high,T_result,is_vector_like<T_y>::value>
58 ::check(
function,y,high,name,result);
bool dom_err(const char *function, const T &y, const char *name, const char *error_msg, const T_msg error_msg2, T_result *result)
bool dom_err_vec(const size_t i, const char *function, const T &y, const char *name, const char *error_msg, const T_msg error_msg2, T_result *result)
bool check_less_or_equal(const char *function, const T_y &y, const T_high &high, const char *name, T_result *result)
T get(const T &x, size_t n)