1 #ifndef STAN__MATH__ERROR_HANDLING__MATRIX__CHECK_LDLT_FACTOR_HPP
2 #define STAN__MATH__ERROR_HANDLING__MATRIX__CHECK_LDLT_FACTOR_HPP
23 template <
typename T,
int R,
int C,
typename T_result>
29 std::ostringstream message;
30 message <<
"underlying matrix is not positive definite. "
31 << name <<
"last conditional variance is %1%.";
32 std::string msg(message.str());
33 const T_result too_small = A.
vectorD().tail(1)(0);
34 return dom_err(
function,too_small,name,msg.c_str(),
"",result);
Eigen::Matrix< T, Eigen::Dynamic, 1 > vectorD() const
bool dom_err(const char *function, const T &y, const char *name, const char *error_msg, const T_msg error_msg2, T_result *result)
bool check_ldlt_factor(const char *function, stan::math::LDLT_factor< T, R, C > &A, const char *name, T_result *result)
Return true if the underlying matrix is positive definite.
LDLT_factor is a thin wrapper on Eigen::LDLT to allow for reusing factorizations and efficient autodi...