Stan Math Library  2.20.0
reverse mode automatic differentiation
check_cholesky_factor.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_ERR_CHECK_CHOLESKY_FACTOR_HPP
2 #define STAN_MATH_PRIM_MAT_ERR_CHECK_CHOLESKY_FACTOR_HPP
3 
9 
10 namespace stan {
11 namespace math {
12 
27 template <typename T_y>
29  const char* function, const char* name,
30  const Eigen::Matrix<T_y, Eigen::Dynamic, Eigen::Dynamic>& y) {
31  check_less_or_equal(function, "columns and rows of Cholesky factor", y.cols(),
32  y.rows());
33  check_positive(function, "columns of Cholesky factor", y.cols());
34  check_lower_triangular(function, name, y);
35  for (int i = 0; i < y.cols(); ++i)
36  // FIXME: should report row
37  check_positive(function, name, y(i, i));
38 }
39 
40 } // namespace math
41 } // namespace stan
42 #endif
void check_lower_triangular(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Check if the specified matrix is lower triangular.
void check_less_or_equal(const char *function, const char *name, const T_y &y, const T_high &high)
Check if y is less or equal to high.
void check_cholesky_factor(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Check if the specified matrix is a valid Cholesky factor.
void check_positive(const char *function, const char *name, const T_y &y)
Check if y is positive.

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