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

◆ check_cov_matrix() [1/2]

template<typename Mat , require_matrix_t< Mat > * = nullptr>
void stan::math::check_cov_matrix ( const char *  function,
const char *  name,
const Mat &  y 
)
inline

Throw an exception if the specified matrix is not a valid covariance matrix.

A valid covariance matrix is a square, symmetric matrix that is positive definite.

Template Parameters
MatType inheriting from MatrixBase with neither rows or columns defined at compile time to be equal to 1 or a var_value with the var's inner type inheriting from Eigen::MatrixBase with neither rows or columns defined at compile time to be equal to 1
Parameters
functionFunction name (for error messages)
nameVariable name (for error messages)
yMatrix to test
Exceptions
`std::invalid_argument`if the matrix is not square or if the matrix is 0x0
`std::domain_error`if the matrix is not symmetric, if the matrix is not positive definite, or if any element of the matrix is NaN

Definition at line 29 of file check_cov_matrix.hpp.