Skip to content

Commit df773b9

Browse files
authored
added algorithms to bound eigenvalues of interval matrices (#77)
* added algorithms to bound eigenvalues of interval matrices * updated function signature * added docstring to documentation
1 parent ebcd849 commit df773b9

File tree

7 files changed

+156
-3
lines changed

7 files changed

+156
-3
lines changed

docs/make.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ makedocs(;
2727
],
2828
"API" => [
2929
"Interval matrices classification" => "api/classify.md",
30-
"solver interface" => "api/solve.md",
30+
"Solver interface" => "api/solve.md",
3131
"Interval linear systems" => "api/algorithms.md",
3232
"Preconditioners" => "api/precondition.md",
3333
"Verified real linear systems" => "api/epsilon_inflation.md",
34+
"Eigenvalues" => "api/eigenvalues.md",
3435
"Miscellaneous" => "api/misc.md"
3536
],
3637
"References" => "references.md",

docs/src/api/eigenvalues.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
```@index
2+
Pages = ["eigenvalues.md"]
3+
```
4+
5+
```@autodocs
6+
Modules=[IntervalLinearAlgebra]
7+
Pages=["interval_eigenvalues.jl"]
8+
Private=false
9+
```
10+

docs/src/references.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
# [References](@id all_ref)
22

3+
#### [HLA13]
4+
5+
```@raw html
6+
<ul><li>
7+
```
8+
M. Hladík. Bounds on eigenvalues of real and complex interval matrices. Appl. Math. Comput., 219(10):5584–5591, 2013.
9+
```@raw html
10+
<li style="list-style: none"><details>
11+
<summary>bibtex</summary>
12+
```
13+
```
14+
@article{Hla2013a,
15+
author = "Milan Hlad\'{\i}k",
16+
title = "Bounds on eigenvalues of real and complex interval matrices",
17+
journal = "Appl. Math. Comput.",
18+
fjournal = "Applied Mathematics and Computation",
19+
volume = "219",
20+
number = "10",
21+
pages = "5584-5591",
22+
year = "2013",
23+
issn = "0096-3003",
24+
doi = "10.1016/j.amc.2012.11.075",
25+
}
26+
```
27+
```@raw html
28+
</details></li></ul>
29+
```
30+
---
31+
32+
333
#### [HOR19]
434

535
```@raw html

src/IntervalLinearAlgebra.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module IntervalLinearAlgebra
22

33
using StaticArrays, Requires, Reexport
4+
using LinearAlgebra: checksquare
45

56
import Base: *
67
import CommonSolve: solve
78
import IntervalArithmetic: mid
8-
using LinearAlgebra: checksquare
99

1010
function __init__()
1111
@require IntervalConstraintProgramming = "138f1668-1576-5ad7-91b9-7425abbf3153" include("linear_systems/oettli_nonlinear.jl")
@@ -23,7 +23,8 @@ export
2323
solve, enclose, epsilon_inflation,
2424
comparison_matrix, interval_norm, interval_isapprox, Orthants,
2525
is_H_matrix, is_strongly_regular, is_strictly_diagonally_dominant, is_Z_matrix, is_M_matrix,
26-
rref
26+
rref,
27+
eigenbox
2728

2829

2930
include("linear_systems/enclosures.jl")
@@ -35,4 +36,6 @@ include("multiplication.jl")
3536
include("utils.jl")
3637
include("classify.jl")
3738
include("rref.jl")
39+
40+
include("eigenvalues/interval_eigenvalues.jl")
3841
end
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
"""
2+
eigenbox(A)
3+
4+
Returns an enclosure of all the eigenvalues of `A`. If `A` is symmetric, than the
5+
output is a real interval, otherwise it is a complex interval.
6+
7+
### Algorithm
8+
9+
The algorithms used by the function are described in [[HLA13]](@ref).
10+
11+
### Notes
12+
13+
The enclosure is not rigorous, meaning that the real eigenvalue problems solved internally
14+
utilize normal floating point computations.
15+
16+
### Examples
17+
18+
```jldoctest
19+
julia> A = [0 -1 -1;2 -1.399.. -0.001 0;1 0.5 -1]
20+
3×3 Matrix{Interval{Float64}}:
21+
[0, 0] [-1, -1] [-1, -1]
22+
[2, 2] [-1.39901, -0.000999999] [0, 0]
23+
[1, 1] [0.5, 0.5] [-1, -1]
24+
25+
julia> eigenbox(A)
26+
[-1.90679, 0.970154] + [-2.51903, 2.51903]im
27+
```
28+
"""
29+
function eigenbox(A::Symmetric{Interval{T}, Matrix{Interval{T}}}) where {T}
30+
31+
= Symmetric(radius.(A))
32+
Ac = Symmetric(mid.(A))
33+
34+
ρ = eigmax(AΔ)
35+
λmax = eigmax(Ac)
36+
λmin = eigmin(Ac)
37+
return Interval(λmin - ρ, λmax + ρ)
38+
39+
end
40+
41+
function eigenbox(A::AbstractMatrix{Interval{T}}) where {T}
42+
43+
λ = eigenbox(Symmetric(0.5*(A + A')))
44+
45+
n = checksquare(A)
46+
μ = eigenbox(Symmetric([zeros(n, n) 0.5*(A - A');
47+
0.5*(A' - A) zeros(n, n)]))
48+
49+
return λ + μ*im
50+
end
51+
52+
function eigenbox(M::AbstractMatrix{Complex{Interval{T}}}) where {T}
53+
A = real.(M)
54+
B = imag.(M)
55+
λ = eigenbox(Symmetric(0.5*[A+A' B'-B;
56+
B-B' A+A']))
57+
58+
μ = eigenbox(Symmetric(0.5*[B+B' A-A';
59+
A'-A B+B']))
60+
61+
return λ + μ*im
62+
end
63+
64+
65+
function eigenbox(M::Hermitian{Complex{Interval{T}}, Matrix{Complex{Interval{T}}}}) where T
66+
A = real(M)
67+
B = imag(M)
68+
return eigenbox(Symmetric([A B';B A]))
69+
70+
end

test/runtests.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ include("test_classify.jl")
77
include("test_multiplication.jl")
88
include("test_utils.jl")
99

10+
11+
include("test_eigenvalues/test_interval_eigenvalues.jl")
12+
1013
include("test_solvers/test_enclosures.jl")
1114
include("test_solvers/test_epsilon_inflation.jl")
1215
include("test_solvers/test_oettli_prager.jl")
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@testset "Eigenvalues of interval matrices" begin
2+
3+
# symmetrix matrix
4+
A = Symmetric([-1 0 -1..1;
5+
0 -1 -1..1;
6+
-1..1 -1..1 0.1])
7+
8+
ev = eigenbox(A)
9+
@test interval_isapprox(ev, -2.4143..1.5143; atol=1e-3)
10+
11+
# real matrix
12+
A = [-3.. -2 4..5 4..6 -1..1.5;
13+
-4.. -3 -4.. -3 -4.. -3 1..2;
14+
-5.. -4 2..3 -5.. -4 -1..0;
15+
-1..0.1 0..1 1..2 -4..2.5]
16+
17+
ev = eigenbox(A)
18+
@test interval_isapprox(real(ev), -8.8221..3.4408; atol=1e-3)
19+
@test interval_isapprox(imag(ev), -10.7497..10.7497; atol=1e-3)
20+
21+
22+
# hermitian matrix
23+
A = Hermitian([1..2 (5..9)+(2..5)*im (3..5)+(2..4)im;
24+
(5..9)+(-5.. -2)*im 2..3 (7..8)+(6..10)im;
25+
(3..5)+(-4.. -2)*im (7..8)+(-10.. -6)*im 3..4])
26+
27+
ev = eigenbox(A)
28+
@test interval_isapprox(ev, -15.4447..24.3359; atol=1e-3)
29+
30+
# complex matrix
31+
A = [(1..2)+(3..4)*im 3..4;1+(2..3)*im 4..5]
32+
33+
ev = eigenbox(A)
34+
@test interval_isapprox(real(ev), -1.28812..7.28812; atol=1e-3)
35+
@test interval_isapprox(imag(ev), -2.04649..5.54649; atol=1e-3)
36+
end

0 commit comments

Comments
 (0)