Automatic Differentiation
 
Loading...
Searching...
No Matches
diag_matrix.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_DIAG_MATRIX_HPP
2#define STAN_MATH_PRIM_FUN_DIAG_MATRIX_HPP
3
6
7namespace stan {
8namespace math {
9
19template <typename EigVec, require_eigen_vector_t<EigVec>* = nullptr>
20inline Eigen::Matrix<value_type_t<EigVec>, Eigen::Dynamic, Eigen::Dynamic>
21diag_matrix(const EigVec& v) {
22 return v.asDiagonal();
23}
24
25} // namespace math
26} // namespace stan
27
28#endif
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 ...
Definition fvar.hpp:9