Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
check_spsd_matrix.hpp
Go to the documentation of this file.
1 #ifndef STAN__MATH__ERROR_HANDLING__MATRIX__CHECK_SPSD_MATRIX_HPP
2 #define STAN__MATH__ERROR_HANDLING__MATRIX__CHECK_SPSD_MATRIX_HPP
3 
4 #include <sstream>
10 
11 namespace stan {
12  namespace math {
13 
27  // FIXME: update warnings
28  template <typename T_y, typename T_result>
29  inline bool check_spsd_matrix(const char* function,
30  const Eigen::Matrix<T_y,Eigen::Dynamic,Eigen::Dynamic>& y,
31  const char* name,
32  T_result* result) {
33  check_square(function, y, name, result);
34  check_positive(function, y.rows(), "rows", result);
35  check_symmetric(function, y, name, result);
36  check_pos_semidefinite(function, y, name, result);
37  return true;
38  }
39 
40  }
41 }
42 #endif
bool check_spsd_matrix(const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result)
Return true if the specified matrix is a square, symmetric, and positive semi-definite.
bool check_pos_semidefinite(const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result)
Return true if the specified matrix is positive definite.
bool check_symmetric(const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result)
Return true if the specified matrix is symmetric.
bool check_positive(const char *function, const T_y &y, const char *name, T_result *result)
bool check_square(const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result)
Return true if the specified matrix is square.

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