Stan Math Library  2.20.0
reverse mode automatic differentiation
check_spsd_matrix.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_ERR_CHECK_SPSD_MATRIX_HPP
2 #define STAN_MATH_PRIM_MAT_ERR_CHECK_SPSD_MATRIX_HPP
3 
10 
11 namespace stan {
12 namespace math {
25 template <typename T_y>
26 inline void check_spsd_matrix(
27  const char* function, const char* name,
28  const Eigen::Matrix<T_y, Eigen::Dynamic, Eigen::Dynamic>& y) {
29  check_square(function, name, y);
30  check_positive(function, name, "rows()", y.rows());
31  check_symmetric(function, name, y);
32  check_pos_semidefinite(function, name, y);
33 }
34 
35 } // namespace math
36 } // namespace stan
37 #endif
void check_square(const char *function, const char *name, const matrix_cl &y)
Check if the matrix_cl is square.
void check_pos_semidefinite(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Check if the specified matrix is positive definite.
void check_spsd_matrix(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Check if the specified matrix is a square, symmetric, and positive semi-definite. ...
void check_positive(const char *function, const char *name, const T_y &y)
Check if y is positive.
void check_symmetric(const char *function, const char *name, const matrix_cl &y)
Check if the matrix_cl is symmetric.

     [ Stan Home Page ] © 2011–2018, Stan Development Team.