1#ifndef STAN_MATH_PRIM_FUN_LOG_DETERMINANT_SPD_HPP
2#define STAN_MATH_PRIM_FUN_LOG_DETERMINANT_SPD_HPP
23template <
typename EigMat, require_eigen_t<EigMat>* =
nullptr,
24 require_not_vt_var<EigMat>* =
nullptr>
26 const auto& m_ref =
to_ref(m);
31 return sum(
log(m_ref.ldlt().vectorD().array()));
void check_symmetric(const char *function, const char *name, const matrix_cl< T > &y)
Check if the matrix_cl is symmetric.
typename value_type< T >::type value_type_t
Helper function for accessing underlying type.
value_type_t< EigMat > log_determinant_spd(const EigMat &m)
Returns the log absolute determinant of the specified square matrix.
fvar< T > log(const fvar< T > &x)
ref_type_t< T && > to_ref(T &&a)
This evaluates expensive Eigen expressions.
auto sum(const std::vector< T > &m)
Return the sum of the entries of the specified standard vector.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...