1#ifndef STAN_MATH_OPENCL_PRIM_DIAG_MATRIX_HPP
2#define STAN_MATH_OPENCL_PRIM_DIAG_MATRIX_HPP
23template <
typename T_x,
24 require_all_kernel_expressions_and_none_scalar_t<T_x>* =
nullptr>
auto constant(const T a, int rows, int cols)
Matrix of repeated values in kernel generator expressions.
typename value_type< T >::type value_type_t
Helper function for accessing underlying type.
auto add_diag(T_m &&mat, T_a &&to_add)
Returns a Matrix with values added along the main diagonal.
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 ...