Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ check_matching_dims() [2/2]

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_compileWhether to check the static sizes
Mat1type of the first matrix
Mat2type of the second matrix
Parameters
functionname of function (for error messages)
name1variable name for the first matrix (for error messages)
y1first matrix to test
name2variable name for the second matrix (for error messages)
y2second 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.