1#ifndef STAN_MATH_PRIM_FUN_EIGENDECOMPOSE_SYM_HPP
2#define STAN_MATH_PRIM_FUN_EIGENDECOMPOSE_SYM_HPP
21template <
typename EigMat, require_eigen_t<EigMat>* =
nullptr,
22 require_not_st_var<EigMat>* =
nullptr>
23std::tuple<Eigen::Matrix<value_type_t<EigMat>, -1, -1>,
24 Eigen::Matrix<value_type_t<EigMat>, -1, 1>>
31 decltype(
auto) m_ref =
to_ref(std::forward<EigMat>(m));
34 Eigen::SelfAdjointEigenSolver<PlainMat> solver(
35 std::forward<
decltype(m_ref)>(m_ref));
36 return std::make_tuple(std::move(solver.eigenvectors()),
37 std::move(solver.eigenvalues()));
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.
std::tuple< Eigen::Matrix< value_type_t< EigMat >, -1, -1 >, Eigen::Matrix< value_type_t< EigMat >, -1, 1 > > eigendecompose_sym(EigMat &&m)
Return the eigendecomposition of the specified symmetric matrix.
ref_type_t< T && > to_ref(T &&a)
This evaluates expensive Eigen expressions.
typename plain_type< std::decay_t< T > >::type plain_type_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...