-
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.
Merge pull request #770 from JuliaReach/schillic/init
Fix optional packages in Exponentiation module
- Loading branch information
Showing
7 changed files
with
48 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using .ExponentialUtilities: phiv!, arnoldi!, KrylovSubspace | ||
|
||
function _phiv(A, b, NSTEPS, dt; hermitian=false, m=min(30, size(A, 1)), tol=1e-7) | ||
# initialization of the krylov subspace | ||
TA, Tb = eltype(A), eltype(b) | ||
T = promote_type(TA, Tb) | ||
Ks = KrylovSubspace{T,real(T)}(length(b), m) | ||
arnoldi!(Ks, A, b; m=m, ishermitian=hermitian, tol=tol) | ||
|
||
out = Matrix{Float64}(undef, size(A, 1), 3) | ||
phiv!(out, NSTEPS * dt, Ks, 2) | ||
|
||
return view(out, :, 3) .* dt^2 | ||
end | ||
|
||
# # Compute out <- exp(A * NSTEPS * dt) * b (currently not used) | ||
# using .ExponentialUtilities: expv! | ||
# function _expv(A, b, NSTEPS, dt; hermitian=false, m=min(30, size(A, 1)), tol=1e-7) | ||
# # initialization of the krylov subspace | ||
# TA, Tb = eltype(A), eltype(b) | ||
# T = promote_type(TA, Tb) | ||
# Ks = KrylovSubspace{T,real(T)}(length(b), m) | ||
# arnoldi!(Ks, A, b; m=m, ishermitian=hermitian, tol=tol) | ||
# | ||
# out = similar(b) | ||
# expv!(out, NSTEPS * dt, Ks) | ||
# | ||
# return out | ||
# 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,31 +1,4 @@ | ||
using .ExponentialUtilities: expv!, phiv!, arnoldi!, KrylovSubspace | ||
|
||
# Compute out <- exp(A * NSTEPS * dt) * b | ||
function _expv(A, b, NSTEPS, dt; hermitian=false, m=min(30, size(A, 1)), tol=1e-7) | ||
# initialization of the krylov subspace | ||
TA, Tb = eltype(A), eltype(b) | ||
T = promote_type(TA, Tb) | ||
Ks = KrylovSubspace{T,real(T)}(length(b), m) | ||
arnoldi!(Ks, A, b; m=m, ishermitian=hermitian, tol=tol) | ||
|
||
out = similar(b) | ||
expv!(out, NSTEPS * dt, Ks) | ||
|
||
return out | ||
end | ||
|
||
function _phiv(A, b, NSTEPS, dt; hermitian=false, m=min(30, size(A, 1)), tol=1e-7) | ||
# initialization of the krylov subspace | ||
TA, Tb = eltype(A), eltype(b) | ||
T = promote_type(TA, Tb) | ||
Ks = KrylovSubspace{T,real(T)}(length(b), m) | ||
arnoldi!(Ks, A, b; m=m, ishermitian=hermitian, tol=tol) | ||
|
||
out = Matrix{Float64}(undef, size(A, 1), 3) | ||
phiv!(out, NSTEPS * dt, Ks, 2) | ||
|
||
return view(out, :, 3) .* dt^2 | ||
end | ||
using .ExponentialUtilities: expv!, arnoldi!, KrylovSubspace | ||
|
||
eval(load_krylov_LGG09_homog()) | ||
eval(load_krylov_LGG09_inhomog()) |
This file was deleted.
Oops, something went wrong.
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