\HeaderA{expm}{Matrix Exponential}{expm}
\aliasA{expm,ddiMatrix-method}{expm}{expm,ddiMatrix.Rdash.method}
\aliasA{expm,dgeMatrix-method}{expm}{expm,dgeMatrix.Rdash.method}
\aliasA{expm,dMatrix-method}{expm}{expm,dMatrix.Rdash.method}
\aliasA{expm,Matrix-method}{expm}{expm,Matrix.Rdash.method}
\aliasA{expm,matrix-method}{expm}{expm,matrix.Rdash.method}
\aliasA{expm,symmetricMatrix-method}{expm}{expm,symmetricMatrix.Rdash.method}
\aliasA{expm,triangularMatrix-method}{expm}{expm,triangularMatrix.Rdash.method}
\keyword{algebra}{expm}
\keyword{math}{expm}
\begin{Description}\relax
Compute the exponential of a matrix.
\end{Description}
\begin{Usage}
\begin{verbatim}
expm(x)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a matrix, typically inheriting from the
\code{\LinkA{dMatrix}{dMatrix.Rdash.class}} class.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The exponential of a matrix is defined as the infinite Taylor
series \code{expm(A) = I + A + A\textasciicircum{}2/2! + A\textasciicircum{}3/3! + ...} (although this is
definitely not the way to compute it).  The method for the
\code{dgeMatrix} class uses Ward's diagonal Pade' approximation with
three step preconditioning.
\end{Details}
\begin{Value}
The matrix exponential of \code{x}.
\end{Value}
\begin{Author}\relax
This is a translation of the implementation of the corresponding
Octave function contributed to the Octave project by
A. Scottedward Hodel \email{A.S.Hodel@Eng.Auburn.EDU}.  A bug in there
has been fixed by Martin Maechler.
\end{Author}
\begin{References}\relax
\url{http://en.wikipedia.org/wiki/Matrix_exponential}

Cleve Moler and Charles Van Loan (2003)
Nineteen dubious ways to compute the exponential of a matrix,
twenty-five years later. \emph{SIAM Review} \bold{45}, 1, 3--49.

Eric W. Weisstein et al. (1999) \emph{Matrix Exponential}.
From MathWorld, \url{http://mathworld.wolfram.com/MatrixExponential.html}
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{Schur}{Schur}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
(m1 <- Matrix(c(1,0,1,1), nc = 2))
(e1 <- expm(m1)) ; e <- exp(1)
stopifnot(all.equal(e1@x, c(e,0,e,e), tol = 1e-15))
(m2 <- Matrix(c(-49, -64, 24, 31), nc = 2))
(e2 <- expm(m2))
(m3 <- Matrix(cbind(0,rbind(6*diag(3),0))))# sparse!
(e3 <- expm(m3)) # upper triangular
\end{ExampleCode}
\end{Examples}

