Types
This section describes systems types implemented in IntervalMatrices.jl
.
Abstract interval operators
IntervalMatrices.AbstractIntervalMatrix
— TypeAbstractIntervalMatrix{IT} <: AbstractMatrix{IT}
Abstract supertype for interval matrix types.
Interval matrix
IntervalMatrices.IntervalMatrix
— TypeIntervalMatrix{T, IT, MT<:AbstractMatrix{IT}} <: AbstractIntervalMatrix{IT}
An interval matrix i.e. a matrix whose coefficients are intervals. This type is parametrized in the number field, the interval type, and the matrix type.
Fields
mat
– matrix whose entries are intervals
Examples
julia> A = IntervalMatrix([-1 .. -0.8 0 .. 0; 0 .. 0 -1 .. -0.8])
2×2 IntervalMatrix{Float64, Interval{Float64}, Matrix{Interval{Float64}}}:
[-1.0, -0.7999999] [0.0, 0.0]
[0.0, 0.0] [-1.0, -0.7999999]
An interval matrix proportional to the identity matrix can be built using the UniformScaling
operator from the standard library LinearAlgebra
. For example,
julia> using LinearAlgebra
julia> IntervalMatrix(interval(1)*I, 2)
2×2 IntervalMatrix{Float64, Interval{Float64}, Matrix{Interval{Float64}}}:
[1.0, 1.0] [0.0, 0.0]
[0.0, 0.0] [1.0, 1.0]
The number of columns can be specified as a third argument, creating a rectangular $m × n$ matrix such that only the entries in the main diagonal, $(1, 1), (2, 2), …, (k, k)$ are specified, where $k = \min(m, n)$:
julia> IntervalMatrix(interval(-1, 1)*I, 2, 3)
2×3 IntervalMatrix{Float64, Interval{Float64}, Matrix{Interval{Float64}}}:
[-1.0, 1.0] [0.0, 0.0] [0.0, 0.0]
[0.0, 0.0] [-1.0, 1.0] [0.0, 0.0]
julia> IntervalMatrix(interval(-1, 1)*I, 3, 2)
3×2 IntervalMatrix{Float64, Interval{Float64}, Matrix{Interval{Float64}}}:
[-1.0, 1.0] [0.0, 0.0]
[0.0, 0.0] [-1.0, 1.0]
[0.0, 0.0] [0.0, 0.0]
An uninitialized interval matrix can be constructed using undef
:
julia> m = IntervalMatrix{Float64}(undef, 2, 2);
julia> typeof(m)
IntervalMatrix{Float64, Interval{Float64}, Matrix{Interval{Float64}}}
Note that this constructor implicitly uses a dense matrix, Matrix{Float64}
, as the matrix (mat
) field in the new interval matrix.
Interval-matrix-power wrapper
IntervalMatrices.IntervalMatrixPower
— TypeIntervalMatrixPower{T}
A wrapper for the matrix power that can be incremented.
Fields
M
– the original matrixMᵏ
– the current matrix power, i.e., $M^k$k
– the current power index
Notes
The wrapper should only be accessed using the interface functions. The internal representation (such as the fields) are subject to future changes.
Examples
julia> A = IntervalMatrix([interval(2, 2) interval(2, 3); interval(0, 0) interval(-1, 1)])
2×2 IntervalMatrix{Float64, Interval{Float64}, Matrix{Interval{Float64}}}:
[2.0, 2.0] [2.0, 3.0]
[0.0, 0.0] [-1.0, 1.0]
julia> pow = IntervalMatrixPower(A);
julia> increment!(pow)
2×2 IntervalMatrix{Float64, Interval{Float64}, Matrix{Interval{Float64}}}:
[4.0, 4.0] [2.0, 9.0]
[0.0, 0.0] [0.0, 1.0]
julia> increment(pow)
2×2 IntervalMatrix{Float64, Interval{Float64}, Matrix{Interval{Float64}}}:
[8.0, 8.0] [-1.0, 21.0]
[0.0, 0.0] [-1.0, 1.0]
julia> matrix(pow)
2×2 IntervalMatrix{Float64, Interval{Float64}, Matrix{Interval{Float64}}}:
[4.0, 4.0] [2.0, 9.0]
[0.0, 0.0] [0.0, 1.0]
julia> index(pow)
2
julia> base(pow)
2×2 IntervalMatrix{Float64, Interval{Float64}, Matrix{Interval{Float64}}}:
[2.0, 2.0] [2.0, 3.0]
[0.0, 0.0] [-1.0, 1.0]
Affine interval matrix
IntervalMatrices.AffineIntervalMatrix1
— TypeAffineIntervalMatrix1{T, IT, MT0<:AbstractMatrix{T}, MT1<:AbstractMatrix{T}} <: AbstractIntervalMatrix{IT}
Interval matrix representing the matrix
\[A₀ + λA₁,\]
where $A₀$ and $A₁$ are real (or complex) matrices, and $λ$ is an interval.
Fields
A0
– matrixA1
– matrixλ
– interval
Examples
The matrix $I + [1 1; -1 1] * interval(0, 1)$ is:
julia> using LinearAlgebra
julia> P = AffineIntervalMatrix1(Matrix(1.0I, 2, 2), [1 1; -1 1.], interval(0, 1));
julia> P
2×2 AffineIntervalMatrix1{Float64, Interval{Float64}, Matrix{Float64}, Matrix{Float64}}:
[1.0, 2.0] [0.0, 1.0]
[-1.0, 0.0] [1.0, 2.0]
IntervalMatrices.AffineIntervalMatrix
— TypeAffineIntervalMatrix{T, IT, MT0<:AbstractMatrix{T}, MT<:AbstractMatrix{T}, MTA<:AbstractVector{MT}} <: AbstractIntervalMatrix{IT}
Interval matrix representing the matrix
\[A₀ + λ₁A₁ + λ₂A₂ + … + λₖAₖ,\]
where $A₀$ and $A₁, …, Aₖ$ are real (or complex) matrices, and $λ₁, …, λₖ$ are intervals.
Fields
A0
– matrixA
– vector of matricesλ
– vector of intervals
Notes
This type is the general case of the AffineIntervalMatrix1
, which only contains one matrix proportional to an interval.
Examples
The affine matrix $I + [1 1; -1 1] * interval(0, 1) + [0 1; 1 0] * interval(2, 3)$ is:
julia> using LinearAlgebra
julia> A0 = Matrix(1.0I, 2, 2);
julia> A1 = [1 1; -1 1.]; A2 = [0 1; 1 0];
julia> λ1 = interval(0, 1); λ2 = interval(2, 3);
julia> P = AffineIntervalMatrix(A0, [A1, A2], [λ1, λ2])
2×2 AffineIntervalMatrix{Float64, Interval{Float64}, Matrix{Float64}, Matrix{Float64}, Vector{Matrix{Float64}}, Vector{Interval{Float64}}}:
[1.0, 2.0] [2.0, 4.0]
[1.0, 3.0] [1.0, 2.0]