Stan Math Library  2.15.0
reverse mode automatic differentiation
check_ldlt_factor.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_ERR_CHECK_LDLT_FACTOR_HPP
2 #define STAN_MATH_PRIM_MAT_ERR_CHECK_LDLT_FACTOR_HPP
3 
7 #include <sstream>
8 #include <string>
9 
10 namespace stan {
11  namespace math {
12 
32  template <typename T, int R, int C>
33  inline void check_ldlt_factor(const char* function,
34  const char* name,
36  if (!A.success()) {
37  std::ostringstream msg;
38  msg << "is not positive definite. "
39  << "last conditional variance is ";
40  std::string msg_str(msg.str());
41  const T too_small = A.vectorD().tail(1)(0);
42  domain_error(function, name, too_small,
43  msg_str.c_str(), ".");
44  }
45  }
46 
47  }
48 }
49 #endif
void check_ldlt_factor(const char *function, const char *name, LDLT_factor< T, R, C > &A)
Check if the argument is a valid LDLT_factor.
LDLT_factor is a thin wrapper on Eigen::LDLT to allow for reusing factorizations and efficient autodi...
Definition: LDLT_factor.hpp:63
void domain_error(const char *function, const char *name, const T &y, const char *msg1, const char *msg2)
Throw a domain error with a consistently formatted message.
vector_t vectorD() const

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