| Stan Math Library 2.11.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
4 #include <stan/math/prim/mat/fun/Eigen.hpp>
5 #include <stan/math/prim/scal/err/check_positive_size.hpp>
6 #include <stan/math/prim/mat/err/check_pos_semidefinite.hpp>
7 #include <stan/math/prim/mat/err/check_symmetric.hpp>
8 #include <stan/math/prim/mat/err/check_square.hpp>
9
10 namespace stan {
11 namespace math {
29 template <typename T_y>
30 inline bool
31 check_spsd_matrix(
32 const char* function,
33 const char* name,
34 const Eigen::Matrix<T_y, Eigen::Dynamic, Eigen::Dynamic>& y
35 ) {
36 check_square(function, name, y);
37 check_positive_size(function, name, "rows()", y.rows());
38 check_symmetric(function, name, y);
39 check_pos_semidefinite(function, name, y);
40 return true;
41 }
42
43 }
44 }
45 #endif
stan::math::check_positive_size
bool check_positive_size(const char *function, const char *name, const char *expr, const int size)
Return true if size is positive.
Definition: check_positive_size.hpp:23
stan
Definition: log_sum_exp.hpp:8
check_pos_semidefinite.hpp
check_symmetric.hpp
stan::math::check_spsd_matrix
bool check_spsd_matrix(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Return true if the specified matrix is a square, symmetric, and positive semi-definite.
Definition: check_spsd_matrix.hpp:31
stan::math::check_pos_semidefinite
bool check_pos_semidefinite(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Return true if the specified matrix is positive definite.
Definition: check_pos_semidefinite.hpp:35
Eigen.hpp
stan::math::check_symmetric
bool check_symmetric(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Return true if the specified matrix is symmetric.
Definition: check_symmetric.hpp:37
stan::math::check_square
bool check_square(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Return true if the specified matrix is square.
Definition: check_square.hpp:28
check_positive_size.hpp
check_square.hpp

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