-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Pade approximation and test _exp
- Loading branch information
Showing
6 changed files
with
48 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
eval(load_expokit_pade()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using SparseArrays | ||
using ReachabilityAnalysis: _exp | ||
|
||
@testset "Exponentiation" begin | ||
A = [10.0 0; 0 20] | ||
δ = 0.1 | ||
expAδ = [exp(1) 0; 0 exp(2)] | ||
|
||
# default algorithm | ||
@test _exp(A, δ) == expAδ | ||
|
||
# base algorithm | ||
@test _exp(A, δ, RA.BaseExpAlg()) == expAδ | ||
|
||
# Krylov algorithm | ||
@test _exp(sparse(A), δ, RA.LazyExpAlg()) == expAδ | ||
|
||
# interval matrix | ||
@test all((_exp(A, δ, RA.IntervalExpAlg()) .- IntervalMatrix(expAδ)) .<= 1e-4) | ||
|
||
# Padé approximation | ||
@test_throws ArgumentError _exp(A, δ, RA.PadeExpAlg()) | ||
@test _exp(sparse(A), δ, RA.PadeExpAlg()) ≈ expAδ | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters