From e079b0a541c23dab3acd3514a31f287f86a37250 Mon Sep 17 00:00:00 2001 From: schillic Date: Sat, 11 Aug 2018 22:19:35 +0200 Subject: [PATCH] add function 'expmat' ('expm' in <= v0.6, 'exp' in >= v0.7) --- src/compat.jl | 2 ++ test/unit_ExponentialMap.jl | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compat.jl b/src/compat.jl index 1f3365b73c..e95a2254a8 100644 --- a/src/compat.jl +++ b/src/compat.jl @@ -15,6 +15,7 @@ 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, @@ -22,4 +23,5 @@ else @inline function _At_mul_B(A, B) return transpose(A) * B end + expmat = exp end diff --git a/test/unit_ExponentialMap.jl b/test/unit_ExponentialMap.jl index 75a515b7ee..ce529a4a56 100644 --- a/test/unit_ExponentialMap.jl +++ b/test/unit_ExponentialMap.jl @@ -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 @@ -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