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

◆ add_diag() [3/3]

template<typename T_m , typename T_a , typename = require_eigen_t<T_m>, typename = require_any_t<is_eigen_vector<T_a>, is_stan_scalar<T_a>>>
Eigen::Matrix< return_type_t< T_m, T_a >, Eigen::Dynamic, Eigen::Dynamic > 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 element in Eigen::Matrix
T_aType of element(s) to add along the diagonal
Parameters
mata matrix
to_addscalar value or column vector or row vector to add along the diagonal
Returns
a matrix with to_add added along main diagonal

Definition at line 29 of file add_diag.hpp.