1 #ifndef STAN_MATH_PRIM_MAT_FUN_MATRIX_EXP_PADE_HPP 2 #define STAN_MATH_PRIM_MAT_FUN_MATRIX_EXP_PADE_HPP 4 #include <stan/math/prim/mat/fun/MatrixExponential.h> 19 template <
typename MatrixType>
24 Eigen::matrix_exp_computeUV<MatrixType>::run(arg, U, V, squarings,
28 MatrixType numer = U + V;
29 MatrixType denom = -U + V;
30 MatrixType pade_approximation = denom.partialPivLu().solve(numer);
31 for (
int i = 0; i < squarings; ++i)
32 pade_approximation *= pade_approximation;
34 return pade_approximation;
MatrixType matrix_exp_pade(const MatrixType &arg)
Computes the matrix exponential, using a Pade approximation, coupled with scaling and squaring...