Skip to content

Commit

Permalink
Merge pull request #527 from JuliaReach/schillic/expm
Browse files Browse the repository at this point in the history
#121 - Fix 'expm' deprecation
  • Loading branch information
schillic authored Aug 12, 2018
2 parents 3bb074d + e079b0a commit c4768cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ if VERSION < v"0.7-"
@inline function _At_mul_B(A, B)
return At_mul_B(A, B)
end
expmat = expm
else
using SparseArrays, LinearAlgebra
import LinearAlgebra: norm, checksquare, LAPACKException, SingularException,
eye, ×
@inline function _At_mul_B(A, B)
return transpose(A) * B
end
expmat = exp
end
4 changes: 2 additions & 2 deletions test/unit_ExponentialMap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ for N in [Float64, Float32]
σ(sparsevec(d), emap)

# check consistency with respect to explicit computation of the matrix exponential
svec_explicit = σ(d, expm(Matrix(m)) * b)
svec_explicit = σ(d, expmat(Matrix(m)) * b)
if N == Float64
# precision with Float32 is not sufficient
@test svec svec_explicit
Expand Down Expand Up @@ -114,7 +114,7 @@ for N in [Float64, Float32]
σ(sparsevec(d), projmap)

# check consistency with respect to explicit computation of the matrix exponential
P = L * expm(Matrix(m)) * R
P = L * expmat(Matrix(m)) * R
svec_explicit = σ(d, P*b)
@test svec svec_explicit
end

0 comments on commit c4768cd

Please sign in to comment.