Stan Math Library  2.14.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 
8 
9 namespace stan {
10  namespace math {
30  template <typename T_y>
31  inline void
32  check_cholesky_factor(const char* function,
33  const char* name,
34  const Eigen::Matrix<T_y, Eigen::Dynamic, Eigen::Dynamic>& y) {
35  check_less_or_equal(function, "columns and rows of Cholesky factor",
36  y.cols(), y.rows());
37  check_positive(function, "columns of Cholesky factor", y.cols());
38  check_lower_triangular(function, name, y);
39  for (int i = 0; i < y.cols(); ++i)
40  // FIXME: should report row
41  check_positive(function, name, y(i, i));
42  }
43 
44  }
45 }
46 #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–2016, Stan Development Team.