Closed
Description
The matrix exponential exp!(A::StridedMatrix{T})
can be improved by appropriate use of Inn=UniformScaling(one(T))
instead of
This should ....
- Lessen the cost of some matrix additions (e.g. in
U = A * (A6 * (CC[14].*A6 .+ CC[12].*A4 .+ CC[10].*A2) .+ CC[8].*A6 .+ CC[6].*A4 .+ CC[4].*A2 .+ CC[2].*Inn)
- Lessen the cost of some scalar multiplication e.g.
P = copy(Inn); U = C[2] * P
- (Most importantly) Reduce the number of matrix-matrix multiplications since in the first round in this loop,
P=I
:
https://github.com/JuliaLang/julia/blob/697e782ab86bfcdd7fd15550241fe162c51d9f98/stdlib/LinearAlgebra/src/dense.jl#L581-L583