Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ add_diag() [2/3]

template<typename T_m , typename T_a , require_all_nonscalar_prim_or_rev_kernel_expression_t< T_m > * = nullptr, require_all_prim_or_rev_kernel_expression_t< T_a > * = nullptr, require_any_var_t< T_m, T_a > * = nullptr>
auto stan::math::add_diag ( const T_m &  mat,
const T_a &  to_add 
)
inline

Returns a Matrix with values added along the main diagonal.

Template Parameters
T_mtype of input kernel generator expression for the input matrix
T_atype of input kernel generator expression to add along the diagonal
Parameters
matinput kernel generator expression
to_addscalar value or input kernel generator expression to add along the diagonal
Returns
a kernel generator expressio with to_add added along main diagonal

Definition at line 31 of file add_diag.hpp.