1 #ifndef STAN__MATH__ERROR_HANDLING_CHECK_POSITIVE_HPP
2 #define STAN__MATH__ERROR_HANDLING_CHECK_POSITIVE_HPP
4 #include <boost/type_traits/is_unsigned.hpp>
16 template <
typename T_y,
typename T_result,
bool is_vec>
18 static bool check(
const char*
function,
24 if (!boost::is_unsigned<T_y>::value && !(y > 0))
26 " is %1%, but must be > 0!",
"",
32 template <
typename T_y,
typename T_result>
33 struct positive<T_y, T_result, true> {
34 static bool check(
const char*
function,
39 for (
size_t n = 0; n <
length(y); n++) {
40 if (!boost::is_unsigned<
typename value_type<T_y>::type>::value
43 " is %1%, but must be > 0!",
"",
53 template <
typename T_y,
typename T_result>
58 return positive<T_y,T_result,is_vector_like<T_y>::value>
59 ::check(
function, y, 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_positive(const char *function, const T_y &y, const char *name, T_result *result)
T get(const T &x, size_t n)