Automatic Differentiation
 
Loading...
Searching...
No Matches
check_cov_matrix.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_ERR_CHECK_COV_MATRIX_HPP
2#define STAN_MATH_PRIM_ERR_CHECK_COV_MATRIX_HPP
3
9
10namespace stan {
11namespace math {
28template <typename Mat, require_matrix_t<Mat>* = nullptr>
29inline void check_cov_matrix(const char* function, const char* name,
30 const Mat& y) {
31 check_pos_definite(function, name, y);
32}
33
51template <typename StdVec, require_std_vector_t<StdVec>* = nullptr>
52void check_cov_matrix(const char* function, const char* name, const StdVec& y) {
53 for (auto&& y_i : y) {
54 check_cov_matrix(function, name, y_i);
55 }
56}
57
58} // namespace math
59} // namespace stan
60#endif
void check_pos_definite(const char *function, const char *name, const EigMat &y)
Check if the specified square, symmetric matrix is positive definite.
void check_cov_matrix(const char *function, const char *name, const Mat &y)
Throw an exception if the specified matrix is not a valid covariance matrix.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9