1#ifndef STAN_MATH_PRIM_ERR_CHECK_LDLT_FACTOR_HPP
2#define STAN_MATH_PRIM_ERR_CHECK_LDLT_FACTOR_HPP
27 if (!(A.ldlt().info() == Eigen::Success && A.ldlt().isPositive()
28 && (A.ldlt().vectorD().array() > 0).all())) {
29 std::ostringstream msg;
30 msg <<
"is not positive definite. last conditional variance is ";
31 std::string msg_str(msg.str());
32 auto too_small = A.ldlt().vectorD().tail(1)(0);
LDLT_factor is a structure that holds a matrix of type T and the LDLT of its values.
void throw_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.
void check_ldlt_factor(const char *function, const char *name, LDLT_factor< T > &A)
Raise domain error if the specified LDLT factor is invalid.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...