1 #ifndef STAN_MATH_PRIM_MAT_ERR_CHECK_MATCHING_DIMS_HPP 2 #define STAN_MATH_PRIM_MAT_ERR_CHECK_MATCHING_DIMS_HPP 32 template <
typename T1,
typename T2,
int R1,
int C1,
int R2,
int C2>
34 const Eigen::Matrix<T1, R1, C1>& y1,
36 const Eigen::Matrix<T2, R2, C2>& y2) {
63 template <
bool check_compile,
typename T1,
typename T2,
int R1,
int C1,
int R2,
66 const Eigen::Matrix<T1, R1, C1>& y1,
68 const Eigen::Matrix<T2, R2, C2>& y2) {
69 if (check_compile && (R1 != R2 || C1 != C2)) {
70 std::ostringstream msg;
71 msg <<
"Static rows and cols of " << name1 <<
" and " << name2
72 <<
" must match in size.";
73 std::string msg_str(msg.str());
void check_size_match(const char *function, const char *name_i, T_size1 i, const char *name_j, T_size2 j)
Check if the provided sizes match.
void check_matching_dims(const char *function, const char *name1, const matrix_cl &y1, const char *name2, const matrix_cl &y2)
Check if two matrix_cls have the same dimensions.
void invalid_argument(const char *function, const char *name, const T &y, const char *msg1, const char *msg2)
Throw an invalid_argument exception with a consistently formatted message.