LinearAlgebra
Interval matrices support standard linear algebra operations from the LinearAlgebra standard library.
julia> using IntervalArithmetic, LinearAlgebrajulia> A = interval.([1.0 0.5; 0.5 2.0], 0.1; format = :midpoint)2×2 Matrix{Interval{Float64}}: [0.899999, 1.1]_com [0.399999, 0.600001]_com [0.399999, 0.600001]_com [1.9, 2.1]_comEigenvalues and eigenvectors
The eigenvalues (eigvals) and the eigendecomposition (eigen) are computed by one of several algorithms, all subtypes of AbstractIntervalEigenAlg, which can be selected via the alg keyword argument:
| Algorithm | eigvals | eigen |
|---|---|---|
IntervalEigen (default) | Gershgorin circle theorem intersected with Rohn | contraction mapping theorem, falls back to eigvals and NaI eigenvectors |
IntervalEigenContraction | contraction mapping theorem | contraction mapping theorem |
IntervalEigenRohn | Rohn enclosure | Rohn enclosure, NaI eigenvectors |
IntervalEigenHertz | Hertz exact hull (exponential complexity) | Hertz exact hull, NaI eigenvectors |
The Gershgorin circle theorem and the contraction mapping theorem enclose each eigenvalue individually, but only succeed when the interval radii are small enough. The Rohn and Hertz methods return a single interval enclosing all the eigenvalues, and are valid for any interval radius. As neither the Gershgorin circle theorem nor the Rohn enclosure is always tighter than the other, the default takes their intersection.
julia> eigvals(A)2-element Vector{Interval{Float64}}: [0.592893, 1.13432]_com [1.86568, 2.40711]_comjulia> eigen(A)LinearAlgebra.Eigen{Complex{Interval{Float64}}, Interval{Float64}, Matrix{Complex{Interval{Float64}}}, Vector{Interval{Float64}}}values:2-element Vector{Interval{Float64}}: [0.592893, 1.13432]_com [1.86568, 2.40711]_comvectors:2×2 Matrix{Complex{Interval{Float64}}}: NaI + im*NaI NaI + im*NaI NaI + im*NaI NaI + im*NaIjulia> eigvals(Symmetric(A); alg = IntervalArithmetic.IntervalEigenRohn())2-element Vector{Interval{Float64}}: [0.592893, 2.40711]_com [0.592893, 2.40711]_comjulia> eigvals(Symmetric(A); alg = IntervalArithmetic.IntervalEigenHertz())2-element Vector{Interval{Float64}}: [0.618975, 2.38103]_com [0.618975, 2.38103]_comWhen the algorithm fails, the eigenvalues and eigenvectors are NaIs.
julia> eigen(interval.([1.0 0.5; 0.5 2.0], 1.0; format = :midpoint); alg = IntervalArithmetic.IntervalEigenContraction())LinearAlgebra.Eigen{Complex{Interval{Float64}}, Complex{Interval{Float64}}, Matrix{Complex{Interval{Float64}}}, Vector{Complex{Interval{Float64}}}}values:2-element Vector{Complex{Interval{Float64}}}: NaI + im*NaI NaI + im*NaIvectors:2×2 Matrix{Complex{Interval{Float64}}}: NaI + im*NaI NaI + im*NaI NaI + im*NaI NaI + im*NaIA matrix of intervals contains non-symmetric matrices, even if its entries are symmetric. Use the Symmetric and Hermitian wrappers to only consider the symmetric and Hermitian matrices: their eigenvalues are real, and the Rohn and Hertz enclosures are tighter.
julia> eigvals(A; alg = IntervalArithmetic.IntervalEigenRohn())2-element Vector{Complex{Interval{Float64}}}: [0.592893, 2.40711]_com + im*[-0.200001, 0.200001]_com [0.592893, 2.40711]_com + im*[-0.200001, 0.200001]_comjulia> eigvals(Symmetric(A))2-element Vector{Interval{Float64}}: [0.592893, 1.13432]_com [1.86568, 2.40711]_comThe matrix functions of LinearAlgebra for Symmetric and Hermitian matrices (e.g. sqrt, cos, svd) assume that the eigenvectors are orthonormal and that the eigenvalues are accurate up to roundoff errors. They throw an ArgumentError for interval matrices, except exp, log and integer powers, which have rigorous implementations.
IntervalArithmetic.AbstractIntervalEigenAlg — Type
AbstractIntervalEigenAlgAbstract supertype for interval eigendecomposition algorithms.
See also: IntervalEigen, IntervalEigenContraction, IntervalEigenRohn, IntervalEigenHertz.
IntervalArithmetic.IntervalEigen — Type
IntervalEigenDefault eigendecomposition algorithm for interval matrices:
eigvalsuses the Gershgorin circle theorem, after a similarity transform by the approximate eigenvectors of the midpoint matrix, intersected withIntervalEigenRohn. When the Gershgorin circle theorem fails (e.g. when interval radii are too large), it returns the enclosure ofIntervalEigenRohn.eigenuses the contraction mapping theorem, asIntervalEigenContraction. When it fails, it returns the eigenvalues ofeigvalsandnaieigenvectors.
IntervalArithmetic.IntervalEigenContraction — Type
IntervalEigenContractionEigendecomposition via the contraction mapping theorem only, which gives tight bounds when the interval radii are small and the eigenvalues are simple. Returns nai if the contraction fails (e.g. when interval radii are too large).
IntervalArithmetic.IntervalEigenRohn — Type
IntervalEigenRohnRohn eigenvalue enclosure (fast, O(n³)). Returns a single interval enclosing all eigenvalues and, when called with eigen, nai eigenvectors. Valid for any interval radius.
IntervalArithmetic.IntervalEigenHertz — Type
IntervalEigenHertzHertz exact hull of eigenvalues (exponential O(2ⁿ) complexity). Returns a single interval enclosing all eigenvalues and, when called with eigen, nai eigenvectors.