Miscellaneous

Other possibly useful functionalities.

Matrix multiplication API

IntervalLinearAlgebra.set_multiplication_modeFunction
set_multiplication_mode(multype)

Sets the algorithm used to perform matrix multiplication with interval matrices.

Input

  • multype – symbol describing the algorithm used
    • :slow – uses traditional matrix multiplication algorithm.
    • :rank1 – uses rank1 update
    • :fast – computes an enclosure of the matrix product using the midpoint-radius notation of the matrix [RUM10].

Notes

  • By default, :fast is used.
  • Using fast is generally significantly faster, but it may return larger intervals, especially if midpoint and radius have the same order of magnitude (50% overestimate at most) [RUM99].
source

Symbolic Interface

IntervalLinearAlgebra.@affinevarsMacro
@affinevars(x...)

Macro to construct the variables used to represent AffineExpression.

Examples

julia> @affinevars x
1-element Vector{AffineExpression{Int64}}:
 x

julia> @affinevars x y z
3-element Vector{AffineExpression{Int64}}:
 x
 y
 z

julia> @affinevars x[1:4]
4-element Vector{AffineExpression{Int64}}:
 x1
 x2
 x3
 x4
source
IntervalLinearAlgebra.AffineExpressionType
AffineExpression{T}

Data structure to represent affine expressions, such as $x+2y+z+4$.

Examples

julia> @affinevars x y z
3-element Vector{AffineExpression{Int64}}:
 x
 y
 z

julia> p1 = x + 2y + z + 4
x+2y+z+4
source
IntervalLinearAlgebra.AffineParametricArrayType
AffineParametricArray{T, N, MT<:AbstractArray{T, N}}

Array whose elements have an affine dependency on a set of parameteres $p₁, p₂, …, pₙ$.

Fields

  • coeffs::Vector{MT} – vector of arrays, corresponds to the coefficients of each variable.

Example

julia> @affinevars x y z
3-element Vector{AffineExpression{Int64}}:
 x
 y
 z

julia> A = AffineParametricArray([x+y x-1;x+y+z 1])
2×2 AffineParametricMatrix{Int64, Matrix{Int64}}:
 x+y    x-1
 x+y+z  1
source

Others

IntervalLinearAlgebra.OrthantsType
Orthants

Iterator to go through all the $2ⁿ$ vectors of length $n$ with elements $±1$. This is equivalento to going through the orthants of an $n$-dimensional euclidean space.

Fields

n::Int – dimension of the vector space

Example

julia> for or in Orthants(2)
       @show or
       end
or = [1, 1]
or = [-1, 1]
or = [1, -1]
or = [-1, -1]
source
IntervalLinearAlgebra.comparison_matrixMethod
comparison_matrix(A::AbstractMatrix{T}) where {T<:Interval}

Computes the comparison matrix $⟨A⟩$ of the given interval matrix $A$ according to the definition $⟨A⟩ᵢᵢ = mig(Aᵢᵢ)$ and $⟨A⟩ᵢⱼ = -mag(Aᵢⱼ)$ if $i≠j$.

Examples

julia> A = [2..4 -1..1; -1..1 2..4]
2×2 Matrix{Interval{Float64}}:
  [2, 4]  [-1, 1]
 [-1, 1]   [2, 4]

julia> comparison_matrix(A)
2×2 Matrix{Float64}:
  2.0  -1.0
 -1.0   2.0
source
IntervalLinearAlgebra.encloseMethod
enclose(A::AbstractMatrix{T}, b::AbstractVector{T}) where {T<:Interval}

Computes an enclosure of the solution of the interval linear system $Ax=b$ using the algorithm described in sec. 5.7.1 of [HOR19].

source
IntervalLinearAlgebra.interval_isapproxMethod
interval_isapprox(a::Interval, b::Interval; kwargs)

Checks whether the intervals $a$ and $b$ are approximate equal, that is both their lower and upper bound are approximately equal.

Keywords

Same of Base.isapprox

Example

julia> a = 1..2
[1, 2]

julia> b = a + 1e-10
[1, 2.00001]

julia> interval_isapprox(a, b)
true

julia> interval_isapprox(a, b; atol=1e-15)
false
source
IntervalLinearAlgebra.interval_normMethod
interval_norm(A::AbstractMatrix{T}) where {T<:Interval}

computes the infinity norm of interval matrix $A$.

Examples

julia> A = [2..4 -1..1; -1..1 2..4]
2×2 Matrix{Interval{Float64}}:
  [2, 4]  [-1, 1]
 [-1, 1]   [2, 4]

julia> interval_norm(A)
5.0
source
IntervalLinearAlgebra.interval_normMethod
interval_norm(A::AbstractVector{T}) where {T<:Interval}

computes the infinity norm of interval vector $v$.

Examples

julia> b = [-2..2, -3..2]
2-element Vector{Interval{Float64}}:
 [-2, 2]
 [-3, 2]

julia> interval_norm(b)
3.0
source
IntervalLinearAlgebra.rrefMethod
rref(A::AbstractMatrix{T}) where {T<:Interval}

Computes the reduced row echelon form of the interval matrix A using maximum mignitude as pivoting strategy.

Examples

julia> A = [2..4 -1..1; -1..1 2..4]
2×2 Matrix{Interval{Float64}}:
  [2, 4]  [-1, 1]
 [-1, 1]   [2, 4]

julia> rref(A)
2×2 Matrix{Interval{Float64}}:
 [2, 4]  [-1, 1]
 [0, 0]       [1.5, 4.5]
source