1 #ifndef STAN_MATH_PRIM_MAT_ERR_IS_POS_DEFINITE_HPP 2 #define STAN_MATH_PRIM_MAT_ERR_IS_POS_DEFINITE_HPP 26 template <
typename T_y>
34 Eigen::LDLT<Eigen::MatrixXd> cholesky =
value_of_rec(y).ldlt();
35 if (cholesky.info() != Eigen::Success || !cholesky.isPositive()
36 || (cholesky.vectorD().array() <= 0.0).any())
50 template <
typename Derived>
52 return cholesky.info() == Eigen::Success && cholesky.isPositive()
53 && (cholesky.vectorD().array() > 0.0).all();
65 template <
typename Derived>
67 return cholesky.info() == Eigen::Success
68 && (cholesky.matrixLLT().diagonal().array() > 0.0).all();
double value_of_rec(const fvar< T > &v)
Return the value of the specified variable.
const double CONSTRAINT_TOLERANCE
The tolerance for checking arithmetic bounds In rank and in simplexes.
bool is_positive(const T_y &y)
Return true if y is positive.
bool is_pos_definite(const Eigen::Matrix< T_y, -1, -1 > &y)
Return true if the matrix is square or if the matrix has non-zero size, or if the matrix is symmetric...
bool is_symmetric(const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Return true if the matrix is square, and no element not on the main diagonal is NaN.
bool is_not_nan(const T_y &y)
Return true if y is not NaN.