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

◆ matrix_power() [2/4]

template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > stan::math::matrix_power ( const var_value< T > &  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 29 of file matrix_power.hpp.