1 #ifndef STAN_MATH_PRIM_MAT_ERR_CHECK_CORR_MATRIX_HPP
2 #define STAN_MATH_PRIM_MAT_ERR_CHECK_CORR_MATRIX_HPP
44 template <
typename T_y>
48 const Eigen::Matrix<T_y, Eigen::Dynamic, Eigen::Dynamic>& y) {
52 T_y, Eigen::Dynamic, Eigen::Dynamic> >::type size_t;
55 "Rows of correlation matrix", y.rows(),
56 "columns of correlation matrix", y.cols());
60 for (
size_t k = 0; k < y.rows(); ++k) {
62 std::ostringstream msg;
63 msg <<
"is not a valid correlation matrix. "
67 std::string msg_str(msg.str());
70 ", but should be near 1.0");
fvar< T > fabs(const fvar< T > &x)
bool check_positive_size(const char *function, const char *name, const char *expr, const int size)
Return true if size is positive.
const double CONSTRAINT_TOLERANCE
The tolerance for checking arithmetic bounds In rank and in simplexes.
Primary template class for the metaprogram to compute the index type of a container.
bool check_size_match(const char *function, const char *name_i, T_size1 i, const char *name_j, T_size2 j)
Return true if the provided sizes match.
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.
bool check_corr_matrix(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Return true if the specified matrix is a valid correlation matrix.
bool check_pos_definite(const char *function, const char *name, const Eigen::Matrix< T_y,-1,-1 > &y)
Return true if the specified square, symmetric matrix is positive definite.
bool check_symmetric(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Return true if the specified matrix is symmetric.