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

◆ matrix_power() [3/4]

template<typename EigMat , require_eigen_t< EigMat > * = nullptr, require_not_vt_var< EigMat > * = nullptr>
Eigen::Matrix< value_type_t< EigMat >, EigMat::RowsAtCompileTime, EigMat::ColsAtCompileTime > stan::math::matrix_power ( const EigMat &  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 26 of file matrix_power.hpp.