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

◆ matrix_power() [1/4]

template<typename T_m , require_all_kernel_expressions_and_none_scalar_t< T_m > * = nullptr>
plain_type_t< T_m > stan::math::matrix_power ( T_m &&  M,
const int  n 
)
inline

Returns the nth power of the specific matrix.

M^n = M * M * ... * M.

Template Parameters
Ttype of the matrix
Parameters
[in]Ma square matrix
[in]nexponent
Returns
nth power of M
Exceptions
std::domain_errorif the matrix contains NaNs or infinities.
std::invalid_argumentif the exponent is negative or the matrix is not square.

Definition at line 27 of file matrix_power.hpp.