1 #ifndef STAN_MATH_PRIM_MAT_ERR_CHECK_RANGE_HPP
2 #define STAN_MATH_PRIM_MAT_ERR_CHECK_RANGE_HPP
33 const int nested_level,
34 const char* error_msg) {
39 std::stringstream msg;
40 msg <<
"; index position = " << nested_level;
41 std::string msg_str(msg.str());
43 out_of_range(
function, max, index, msg_str.c_str(), error_msg);
66 const char* error_msg) {
bool check_range(const char *function, const char *name, const int max, const int index, const int nested_level, const char *error_msg)
Return true if specified index is within range.
void out_of_range(const char *function, const int max, const int index, const char *msg1="", const char *msg2="")
Throw an out_of_range exception with a consistently formatted message.
int max(const std::vector< int > &x)
Returns the maximum coefficient in the specified column vector.