1#ifndef STAN_MATH_PRIM_FUN_DIAG_MATRIX_HPP
2#define STAN_MATH_PRIM_FUN_DIAG_MATRIX_HPP
19template <
typename EigVec, require_eigen_vector_t<EigVec>* =
nullptr>
20inline Eigen::Matrix<value_type_t<EigVec>, Eigen::Dynamic, Eigen::Dynamic>
22 return v.asDiagonal();
auto diag_matrix(T_x &&x)
Return a square diagonal matrix with the specified vector of coefficients as the diagonal values.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...