1 #ifndef STAN_MATH_PRIM_MAT_ERR_CHECK_SYMMETRIC_HPP
2 #define STAN_MATH_PRIM_MAT_ERR_CHECK_SYMMETRIC_HPP
36 template <
typename T_y>
40 const Eigen::Matrix<T_y, Dynamic, Dynamic>& y) {
50 size_type k = y.rows();
53 for (size_type m = 0; m < k; ++m) {
54 for (size_type n = m + 1; n < k; ++n) {
57 std::ostringstream msg1;
58 msg1 <<
"is not symmetric. "
61 std::string msg1_str(msg1.str());
62 std::ostringstream msg2;
67 std::string msg2_str(msg2.str());
69 msg1_str.c_str(), msg2_str.c_str());
fvar< T > fabs(const fvar< T > &x)
T value_of(const fvar< T > &v)
Return the value of the specified variable.
bool check_symmetric(const char *function, const char *name, const Eigen::Matrix< T_y, Dynamic, Dynamic > &y)
Return true if the specified matrix is symmetric.
const double CONSTRAINT_TOLERANCE
The tolerance for checking arithmetic bounds In rank and in simplexes.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >::Index size_type
Type for sizes and indexes in an Eigen matrix with double e.
Primary template class for the metaprogram to compute the index type of a container.
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_square(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Return true if the specified matrix is square.