template<bool check_compile, typename Mat1 , typename Mat2 , typename = require_all_eigen_t<Mat1, Mat2>>
| void stan::math::check_matching_dims |
( |
const char * |
function, |
|
|
const char * |
name1, |
|
|
const Mat1 & |
y1, |
|
|
const char * |
name2, |
|
|
const Mat2 & |
y2 |
|
) |
| |
|
inline |
Check if the two matrices are of the same size.
This function checks the runtime sizes and can also check the static sizes as well. For example, a 4x1 matrix is not the same as a vector with 4 elements.
- Template Parameters
-
| check_compile | Whether to check the static sizes |
| Mat1 | type of the first matrix |
| Mat2 | type of the second matrix |
- Parameters
-
| function | name of function (for error messages) |
| name1 | variable name for the first matrix (for error messages) |
| y1 | first matrix to test |
| name2 | variable name for the second matrix (for error messages) |
| y2 | second matrix to test |
- Exceptions
-
| <code>std::invalid_argument</code> | if the dimensions of the matrices do not match |
Definition at line 139 of file check_matching_dims.hpp.