Stan Math Library  2.15.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 
9 
10 namespace stan {
11  namespace math {
27  template <typename T_y>
28  inline void
29  check_spsd_matrix(const char* function,
30  const char* name,
31  const Eigen::Matrix<T_y, Eigen::Dynamic, Eigen::Dynamic>& y) {
32  check_square(function, name, y);
33  check_positive_size(function, name, "rows()", y.rows());
34  check_symmetric(function, name, y);
35  check_pos_semidefinite(function, name, y);
36  }
37 
38  }
39 }
40 #endif
void check_positive_size(const char *function, const char *name, const char *expr, int size)
Check if size is positive.
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_symmetric(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Check if the specified matrix is symmetric.
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_square(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Check if the specified matrix is square.

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