1 #ifndef STAN__MATH__ERROR_HANDLING__MATRIX__CHECK_POSITIVE_ORDERED_HPP
2 #define STAN__MATH__ERROR_HANDLING__MATRIX__CHECK_POSITIVE_ORDERED_HPP
28 template <
typename T_y,
typename T_result>
30 const Eigen::Matrix<T_y,Eigen::Dynamic,1>& y,
40 std::ostringstream stream;
41 stream <<
" is not a valid positive_ordered vector."
43 <<
" is %1%, but should be postive.";
44 std::string msg(stream.str());
45 return dom_err(
function,y[0],name,
49 for (size_type n = 1; n < y.size(); n++) {
50 if (!(y[n] > y[n-1])) {
51 std::ostringstream stream;
52 stream <<
" is not a valid ordered vector."
54 <<
" is %1%, but should be greater than the previous element, "
56 std::string msg(stream.str());
57 return dom_err(
function,y[n],name,
bool dom_err(const char *function, const T &y, const char *name, const char *error_msg, const T_msg error_msg2, T_result *result)
Primary template class for the metaprogram to compute the index type of a container.
index_type< Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > >::type size_type
Type for sizes and indexes in an Eigen matrix with double e.
bool check_positive_ordered(const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, 1 > &y, const char *name, T_result *result)
Return true if the specified vector contains only non-negative values and is sorted into increasing o...