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

◆ check_cov_matrix() [2/2]

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

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
StdVecA standard vector with inner type either 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)
ystandard vector of matrices 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 52 of file check_cov_matrix.hpp.