Skip to content

Commit 603f4b6

Browse files
committed
fix perf in exp(::Matrix)
1 parent 999bcc5 commit 603f4b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stdlib/LinearAlgebra/src/dense.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -541,10 +541,10 @@ function exp!(A::StridedMatrix{T}) where T<:BlasFloat
541541
A2 = A * A
542542
A4 = A2 * A2
543543
A6 = A2 * A4
544-
U = A * (A6 * (CC[14]*A6 + CC[12]*A4 + CC[10]*A2) +
545-
CC[8]*A6 + CC[6]*A4 + CC[4]*A2 + CC[2]*Inn)
546-
V = A6 * (CC[13]*A6 + CC[11]*A4 + CC[9]*A2) +
547-
CC[7]*A6 + CC[5]*A4 + CC[3]*A2 + CC[1]*Inn
544+
U = A * (A6 * (CC[14].*A6 .+ CC[12].*A4 .+ CC[10].*A2) .+
545+
CC[8].*A6 .+ CC[6].*A4 .+ CC[4].*A2 .+ CC[2].*Inn)
546+
V = A6 * (CC[13].*A6 .+ CC[11].*A4 .+ CC[9].*A2) .+
547+
CC[7].*A6 .+ CC[5].*A4 .+ CC[3].*A2 .+ CC[1].*Inn
548548

549549
X = V + U
550550
LAPACK.gesv!(V-U, X)

0 commit comments

Comments
 (0)