1 #ifndef STAN__MATH__ERROR_HANDLING__MATRIX__CHECK_SYMMETRIC_HPP
2 #define STAN__MATH__ERROR_HANDLING__MATRIX__CHECK_SYMMETRIC_HPP
29 template <
typename T_y,
typename T_result>
32 const Eigen::Matrix<T_y,Eigen::Dynamic,Eigen::Dynamic>& y,
39 size_type k = y.rows();
42 for (size_type m = 0; m < k; ++m) {
43 for (size_type n = m + 1; n < k; ++n) {
45 std::ostringstream message;
46 message << name <<
" is not symmetric. "
51 <<
"] element is " << y(n,m);
52 std::string msg(message.str());
53 return dom_err(
function,y(m,n),name,
fvar< T > fabs(const fvar< T > &x)
bool dom_err(const char *function, const T &y, const char *name, const char *error_msg, const T_msg error_msg2, T_result *result)
const double CONSTRAINT_TOLERANCE
The tolerance for checking arithmetic bounds In rank and in simplexes.
bool check_symmetric(const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result)
Return true if the specified matrix is symmetric.
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.