-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added algorithms to bound eigenvalues of interval matrices (#77)
* added algorithms to bound eigenvalues of interval matrices * updated function signature * added docstring to documentation
- Loading branch information
1 parent
ebcd849
commit df773b9
Showing
7 changed files
with
156 additions
and
3 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,10 @@ | ||
```@index | ||
Pages = ["eigenvalues.md"] | ||
``` | ||
|
||
```@autodocs | ||
Modules=[IntervalLinearAlgebra] | ||
Pages=["interval_eigenvalues.jl"] | ||
Private=false | ||
``` | ||
|
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,70 @@ | ||
""" | ||
eigenbox(A) | ||
Returns an enclosure of all the eigenvalues of `A`. If `A` is symmetric, than the | ||
output is a real interval, otherwise it is a complex interval. | ||
### Algorithm | ||
The algorithms used by the function are described in [[HLA13]](@ref). | ||
### Notes | ||
The enclosure is not rigorous, meaning that the real eigenvalue problems solved internally | ||
utilize normal floating point computations. | ||
### Examples | ||
```jldoctest | ||
julia> A = [0 -1 -1;2 -1.399.. -0.001 0;1 0.5 -1] | ||
3×3 Matrix{Interval{Float64}}: | ||
[0, 0] [-1, -1] [-1, -1] | ||
[2, 2] [-1.39901, -0.000999999] [0, 0] | ||
[1, 1] [0.5, 0.5] [-1, -1] | ||
julia> eigenbox(A) | ||
[-1.90679, 0.970154] + [-2.51903, 2.51903]im | ||
``` | ||
""" | ||
function eigenbox(A::Symmetric{Interval{T}, Matrix{Interval{T}}}) where {T} | ||
|
||
AΔ = Symmetric(radius.(A)) | ||
Ac = Symmetric(mid.(A)) | ||
|
||
ρ = eigmax(AΔ) | ||
λmax = eigmax(Ac) | ||
λmin = eigmin(Ac) | ||
return Interval(λmin - ρ, λmax + ρ) | ||
|
||
end | ||
|
||
function eigenbox(A::AbstractMatrix{Interval{T}}) where {T} | ||
|
||
λ = eigenbox(Symmetric(0.5*(A + A'))) | ||
|
||
n = checksquare(A) | ||
μ = eigenbox(Symmetric([zeros(n, n) 0.5*(A - A'); | ||
0.5*(A' - A) zeros(n, n)])) | ||
|
||
return λ + μ*im | ||
end | ||
|
||
function eigenbox(M::AbstractMatrix{Complex{Interval{T}}}) where {T} | ||
A = real.(M) | ||
B = imag.(M) | ||
λ = eigenbox(Symmetric(0.5*[A+A' B'-B; | ||
B-B' A+A'])) | ||
|
||
μ = eigenbox(Symmetric(0.5*[B+B' A-A'; | ||
A'-A B+B'])) | ||
|
||
return λ + μ*im | ||
end | ||
|
||
|
||
function eigenbox(M::Hermitian{Complex{Interval{T}}, Matrix{Complex{Interval{T}}}}) where T | ||
A = real(M) | ||
B = imag(M) | ||
return eigenbox(Symmetric([A B';B A])) | ||
|
||
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 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,36 @@ | ||
@testset "Eigenvalues of interval matrices" begin | ||
|
||
# symmetrix matrix | ||
A = Symmetric([-1 0 -1..1; | ||
0 -1 -1..1; | ||
-1..1 -1..1 0.1]) | ||
|
||
ev = eigenbox(A) | ||
@test interval_isapprox(ev, -2.4143..1.5143; atol=1e-3) | ||
|
||
# real matrix | ||
A = [-3.. -2 4..5 4..6 -1..1.5; | ||
-4.. -3 -4.. -3 -4.. -3 1..2; | ||
-5.. -4 2..3 -5.. -4 -1..0; | ||
-1..0.1 0..1 1..2 -4..2.5] | ||
|
||
ev = eigenbox(A) | ||
@test interval_isapprox(real(ev), -8.8221..3.4408; atol=1e-3) | ||
@test interval_isapprox(imag(ev), -10.7497..10.7497; atol=1e-3) | ||
|
||
|
||
# hermitian matrix | ||
A = Hermitian([1..2 (5..9)+(2..5)*im (3..5)+(2..4)im; | ||
(5..9)+(-5.. -2)*im 2..3 (7..8)+(6..10)im; | ||
(3..5)+(-4.. -2)*im (7..8)+(-10.. -6)*im 3..4]) | ||
|
||
ev = eigenbox(A) | ||
@test interval_isapprox(ev, -15.4447..24.3359; atol=1e-3) | ||
|
||
# complex matrix | ||
A = [(1..2)+(3..4)*im 3..4;1+(2..3)*im 4..5] | ||
|
||
ev = eigenbox(A) | ||
@test interval_isapprox(real(ev), -1.28812..7.28812; atol=1e-3) | ||
@test interval_isapprox(imag(ev), -2.04649..5.54649; atol=1e-3) | ||
end |