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>
23 [](
auto&& v_) {
return std::forward<decltype(v_)>(v_).asDiagonal(); },
24 std::forward<EigVec>(v));
auto make_holder(F &&func, Args &&... args)
Calls given function with given arguments.
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 ...