From 2ababfcca5b23393c66f8c1f1a6a1e8c82ca71ee Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Mon, 9 Sep 2024 20:54:11 +0000 Subject: [PATCH] build based on b44bbb4 --- dev/.documenter-siteinfo.json | 2 +- dev/about/index.html | 2 +- dev/index.html | 2 +- dev/lib/methods/index.html | 8 ++++---- dev/lib/types/index.html | 10 +++++----- dev/objects.inv | Bin 1036 -> 1036 bytes dev/references/index.html | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index c0d74ae..dc3ef14 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-09T20:50:43","documenter_version":"1.7.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-09T20:54:06","documenter_version":"1.7.0"}} \ No newline at end of file diff --git a/dev/about/index.html b/dev/about/index.html index f6a26ee..abf2f7d 100644 --- a/dev/about/index.html +++ b/dev/about/index.html @@ -1,4 +1,4 @@ About · IntervalMatrices.jl

About

This page contains some general information about this project, and recommendations about contributing.

Contributing

If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation or propose new features.

Below we detail some of the guidelines that should be followed when contributing to this package. Further information can be found in the JuliaReachDevDocs site.

Branches

Each pull request (PR) should be pushed in a new branch with the name of the author followed by a descriptive name, e.g. mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g. mforets/7.

Unit testing and continuous integration (CI)

This project is synchronized with GitHub Actions such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to make all unit tests pass.

To run the unit tests locally, you can do:

julia> using Pkg
 
-julia> Pkg.test("IntervalMatrices")

We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.

Contributing to the documentation

This documentation is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. To build the docs, run make.jl:

$ julia --color=yes docs/make.jl

Credits

These persons have contributed to IntervalMatrices.jl (in alphabetic order):

+julia> Pkg.test("IntervalMatrices")

We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.

Contributing to the documentation

This documentation is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. To build the docs, run make.jl:

$ julia --color=yes docs/make.jl

Credits

These persons have contributed to IntervalMatrices.jl (in alphabetic order):

diff --git a/dev/index.html b/dev/index.html index 4c4f264..5c88269 100644 --- a/dev/index.html +++ b/dev/index.html @@ -23,4 +23,4 @@ [-4.0, 2.50001] [-1.0, 9.0]

However, that result is not tight. The computation can be performed exactly via single-use expressions implemented in this library:

julia> quadratic_expansion(A, 1.0, 0.5)
 2×2 IntervalMatrix{Float64, Interval{Float64}, Matrix{Interval{Float64}}}:
   [1.0, 4.50001]  [-2.0, 1.0]
- [-3.0, 1.50001]   [1.0, 7.0]

We now obtain an interval matrix that is strictly included in the one obtained from the naive multiplication.

An overapproximation and an underapproximation method at a given order for $e^{At}$, where $A$ is an interval matrix, are also available. See the Methods section for details.

Library Outline

Explore the types and methods defined in this library by following the links below, or use the search bar in the left to look for a specific keyword in the documentation.

References

+ [-3.0, 1.50001] [1.0, 7.0]

We now obtain an interval matrix that is strictly included in the one obtained from the naive multiplication.

An overapproximation and an underapproximation method at a given order for $e^{At}$, where $A$ is an interval matrix, are also available. See the Methods section for details.

Library Outline

Explore the types and methods defined in this library by following the links below, or use the search bar in the left to look for a specific keyword in the documentation.

References

diff --git a/dev/lib/methods/index.html b/dev/lib/methods/index.html index 7621793..dd45512 100644 --- a/dev/lib/methods/index.html +++ b/dev/lib/methods/index.html @@ -1,7 +1,7 @@ -Methods · IntervalMatrices.jl

Methods

This section describes systems methods implemented in IntervalMatrices.jl.

Common functions

IntervalArithmetic.infFunction
inf(A::IntervalMatrix{T}) where {T}

Return the infimum of an interval matrix A, which corresponds to taking the element-wise infimum of A.

Input

  • A – interval matrix

Output

A scalar matrix whose coefficients are the infima of each element in A.

source
IntervalArithmetic.supFunction
sup(A::IntervalMatrix{T}) where {T}

Return the supremum of an interval matrix A, which corresponds to taking the element-wise supremum of A.

Input

  • A – interval matrix

Output

A scalar matrix whose coefficients are the suprema of each element in A.

source
IntervalArithmetic.midFunction
mid(A::IntervalMatrix{T}) where {T}

Return the midpoint of an interval matrix A, which corresponds to taking the element-wise midpoint of A.

Input

  • A – interval matrix

Output

A scalar matrix whose coefficients are the midpoints of each element in A.

source
IntervalArithmetic.diamFunction
diam(A::IntervalMatrix{T}) where {T}

Return a matrix whose entries describe the diameters of the intervals.

Input

  • A – interval matrix

Output

A matrix B of the same shape as A such that B[i, j] == diam(A[i, j]) for each i and j.

source
IntervalArithmetic.radiusFunction
radius(A::IntervalMatrix{T}) where {T}

Return the radius of an interval matrix A, which corresponds to taking the element-wise radius of A.

Input

  • A – interval matrix

Output

A scalar matrix whose coefficients are the radii of each element in A.

source
IntervalArithmetic.midpoint_radiusFunction
midpoint_radius(A::IntervalMatrix{T}) where {T}

Split an interval matrix $A$ into two scalar matrices $C$ and $S$ such that $A = C + [-S, S]$.

Input

  • A – interval matrix

Output

A pair (C, S) such that the entries of C are the central points and the entries of S are the (nonnegative) radii of the intervals in A.

source
Base.randFunction
rand(::Type{IntervalMatrix}, m::Int=2, [n]::Int=m;
-     N=Float64, rng::AbstractRNG=GLOBAL_RNG)

Return a random interval matrix of the given size and numeric type.

Input

  • IntervalMatrix – type, used for dispatch
  • m – (optional, default: 2) number of rows
  • n – (optional, default: m) number of columns
  • rng – (optional, default: GLOBAL_RNG) random-number generator

Output

An interval matrix of size $m × n$ whose coefficients are normally-distributed intervals of type N with mean 0 and standard deviation 1.

Notes

If this function is called with only one argument, it creates a square matrix, because the number of columns defaults to the number of rows.

source
IntervalMatrices.sampleFunction
sample(A::IntervalMatrix{T}; rng::AbstractRNG=GLOBAL_RNG) where {T}

Return a sample of the given random interval matrix.

Input

  • A – interval matrix
  • m – (optional, default: 2) number of rows
  • n – (optional, default: 2) number of columns
  • rng – (optional, default: GLOBAL_RNG) random-number generator

Output

An interval matrix of size $m × n$ whose coefficients are normally-distributed intervals of type N with mean 0 and standard deviation 1.

source
Base.:∈Function
∈(M::AbstractMatrix, A::AbstractIntervalMatrix)

Check whether a concrete matrix is an instance of an interval matrix.

Input

  • M – concrete matrix
  • A – interval matrix

Output

true iff M is an instance of A

Algorithm

We check for each entry in M whether it belongs to the corresponding interval in A.

source
IntervalArithmetic.:±Function
±(C::MT, S::MT) where {T, MT<:AbstractMatrix{T}}

Return an interval matrix such that the center and radius of the intervals is given by the matrices C and S respectively.

Input

  • C – center matrix
  • S – radii matrix

Output

An interval matrix M such that M[i, j] corresponds to the interval whose center is C[i, j] and whose radius is S[i, j], for each i and j. That is, $M = C + [-S, S]$.

Notes

The radii matrix should be nonnegative, i.e. S[i, j] ≥ 0 for each i and j.

Examples

julia> [1 2; 3 4] ± [1 2; 4 5]
+Methods · IntervalMatrices.jl

Methods

This section describes systems methods implemented in IntervalMatrices.jl.

Common functions

IntervalArithmetic.infFunction
inf(A::IntervalMatrix{T}) where {T}

Return the infimum of an interval matrix A, which corresponds to taking the element-wise infimum of A.

Input

  • A – interval matrix

Output

A scalar matrix whose coefficients are the infima of each element in A.

source
IntervalArithmetic.supFunction
sup(A::IntervalMatrix{T}) where {T}

Return the supremum of an interval matrix A, which corresponds to taking the element-wise supremum of A.

Input

  • A – interval matrix

Output

A scalar matrix whose coefficients are the suprema of each element in A.

source
IntervalArithmetic.midFunction
mid(A::IntervalMatrix{T}) where {T}

Return the midpoint of an interval matrix A, which corresponds to taking the element-wise midpoint of A.

Input

  • A – interval matrix

Output

A scalar matrix whose coefficients are the midpoints of each element in A.

source
IntervalArithmetic.diamFunction
diam(A::IntervalMatrix{T}) where {T}

Return a matrix whose entries describe the diameters of the intervals.

Input

  • A – interval matrix

Output

A matrix B of the same shape as A such that B[i, j] == diam(A[i, j]) for each i and j.

source
IntervalArithmetic.radiusFunction
radius(A::IntervalMatrix{T}) where {T}

Return the radius of an interval matrix A, which corresponds to taking the element-wise radius of A.

Input

  • A – interval matrix

Output

A scalar matrix whose coefficients are the radii of each element in A.

source
IntervalArithmetic.midpoint_radiusFunction
midpoint_radius(A::IntervalMatrix{T}) where {T}

Split an interval matrix $A$ into two scalar matrices $C$ and $S$ such that $A = C + [-S, S]$.

Input

  • A – interval matrix

Output

A pair (C, S) such that the entries of C are the central points and the entries of S are the (nonnegative) radii of the intervals in A.

source
Base.randFunction
rand(::Type{IntervalMatrix}, m::Int=2, [n]::Int=m;
+     N=Float64, rng::AbstractRNG=GLOBAL_RNG)

Return a random interval matrix of the given size and numeric type.

Input

  • IntervalMatrix – type, used for dispatch
  • m – (optional, default: 2) number of rows
  • n – (optional, default: m) number of columns
  • rng – (optional, default: GLOBAL_RNG) random-number generator

Output

An interval matrix of size $m × n$ whose coefficients are normally-distributed intervals of type N with mean 0 and standard deviation 1.

Notes

If this function is called with only one argument, it creates a square matrix, because the number of columns defaults to the number of rows.

source
IntervalMatrices.sampleFunction
sample(A::IntervalMatrix{T}; rng::AbstractRNG=GLOBAL_RNG) where {T}

Return a sample of the given random interval matrix.

Input

  • A – interval matrix
  • m – (optional, default: 2) number of rows
  • n – (optional, default: 2) number of columns
  • rng – (optional, default: GLOBAL_RNG) random-number generator

Output

An interval matrix of size $m × n$ whose coefficients are normally-distributed intervals of type N with mean 0 and standard deviation 1.

source
Base.:∈Function
∈(M::AbstractMatrix, A::AbstractIntervalMatrix)

Check whether a concrete matrix is an instance of an interval matrix.

Input

  • M – concrete matrix
  • A – interval matrix

Output

true iff M is an instance of A

Algorithm

We check for each entry in M whether it belongs to the corresponding interval in A.

source
IntervalArithmetic.:±Function
±(C::MT, S::MT) where {T, MT<:AbstractMatrix{T}}

Return an interval matrix such that the center and radius of the intervals is given by the matrices C and S respectively.

Input

  • C – center matrix
  • S – radii matrix

Output

An interval matrix M such that M[i, j] corresponds to the interval whose center is C[i, j] and whose radius is S[i, j], for each i and j. That is, $M = C + [-S, S]$.

Notes

The radii matrix should be nonnegative, i.e. S[i, j] ≥ 0 for each i and j.

Examples

julia> [1 2; 3 4] ± [1 2; 4 5]
 2×2 IntervalMatrix{Float64, Interval{Float64}, Matrix{Interval{Float64}}}:
   [0.0, 2.0]   [0.0, 4.0]
- [-1.0, 7.0]  [-1.0, 9.0]
source
Base.:⊆Function
⊆(A::AbstractIntervalMatrix, B::AbstractIntervalMatrix)

Check whether an interval matrix is contained in another interval matrix.

Input

  • A – interval matrix
  • B – interval matrix

Output

true iff A[i, j] ⊆ B[i, j] for all i, j.

source
Base.:∩Function
∩(A::IntervalMatrix, B::IntervalMatrix)

Intersect two interval matrices.

Input

  • A – interval matrix
  • B – interval matrix (of the same shape as A)

Output

A new matrix C of the same shape as A such that C[i, j] = A[i, j] ∩ B[i, j] for each i and j.

source
Base.:∪Function
∪(A::IntervalMatrix, B::IntervalMatrix)

Finds the interval union (hull) of two interval matrices. This is equivalent to hull.

Input

  • A – interval matrix
  • B – interval matrix (of the same shape as A)

Output

A new matrix C of the same shape as A such that C[i, j] = A[i, j] ∪ B[i, j] for each i and j.

source
IntervalArithmetic.hullFunction
hull(A::IntervalMatrix, B::IntervalMatrix)

Finds the interval hull of two interval matrices. This is equivalent to .

Input

  • A – interval matrix
  • B – interval matrix (of the same shape as A)

Output

A new matrix C of the same shape as A such that C[i, j] = hull(A[i, j], B[i, j]) for each i and j.

source

Arithmetic

IntervalMatrices.squareFunction
square(A::IntervalMatrix)

Compute the square of an interval matrix.

Input

  • A – interval matrix

Output

An interval matrix equivalent to A * A.

Algorithm

We follow [1, Section 6].

[1] Kosheleva, Kreinovich, Mayer, Nguyen. Computing the cube of an interval matrix is NP-hard. SAC 2005.

source
IntervalMatrices.scaleFunction
scale(A::IntervalMatrix{T}, α::T) where {T}

Return a new interval matrix whose entries are scaled by the given factor.

Input

  • A – interval matrix
  • α – scaling factor

Output

A new matrix B of the same shape as A such that B[i, j] = α*A[i, j] for each i and j.

Notes

See scale! for the in-place version of this function.

source
IntervalMatrices.scale!Function
scale!(A::IntervalMatrix{T}, α::T) where {T}

Modifies the given interval matrix, scaling its entries by the given factor.

Input

  • A – interval matrix
  • α – scaling factor

Output

The matrix A such that for each i and j, the new value of A[i, j] is α*A[i, j].

Notes

This is the in-place version of scale.

source
IntervalMatrices.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.
    • :fast – computes an enclosure of the matrix product using the midpoint-radius notation of the matrix [RUM10].
:fast option no longer supported

:fast support was removed in IntervalArithmetic v0.22.

Notes

  • By default, :slow 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

Matrix power

IntervalMatrices.increment!Function
increment!(pow::IntervalMatrixPower; [algorithm=default_algorithm])

Increment a matrix power in-place (i.e., storing the result in pow).

Input

  • pow – wrapper of a matrix power (modified in this function)
  • algorithm – (optional; default: default_algorithm) algorithm to compute the matrix power; available options:
    • "multiply" – fast computation using * from the previous result
    • "power" – recomputation using ^
    • "decompose_binary" – decompose k = 2a + b
    • "intersect" – combination of "multiply"/"power"/"decompose_binary"

Output

The next matrix power, reflected in the modified wrapper.

Notes

Independent of "algorithm", if the index is a power of two, we compute the exact result using squaring.

source
IntervalMatrices.incrementFunction
increment(pow::IntervalMatrixPower; [algorithm=default_algorithm])

Increment a matrix power without modifying pow.

Input

  • pow – wrapper of a matrix power
  • algorithm – (optional; default: default_algorithm) algorithm to compute the matrix power; see increment! for available options

Output

The next matrix power.

source
IntervalMatrices.matrixFunction
matrix(pow::IntervalMatrixPower)

Return the matrix represented by a wrapper of a matrix power.

Input

  • pow – wrapper of a matrix power

Output

The matrix power represented by the wrapper.

source
IntervalMatrices.baseFunction
base(pow::IntervalMatrixPower)

Return the original matrix represented by a wrapper of a matrix power.

Input

  • pow – wrapper of a matrix power

Output

The matrix $M$ being the basis of the matrix power $M^k$ represented by the wrapper.

source
IntervalMatrices.indexFunction
index(pow::IntervalMatrixPower)

Return the current index of the wrapper of a matrix power.

Input

  • pow – wrapper of a matrix power

Output

The index k of the wrapper representing $M^k$.

source

Matrix exponential

Algorithms

IntervalMatrices.HornerType
Horner <: AbstractExponentiationMethod

Matrix exponential using Horner's method.

Fields

  • K – number of expansions in the Horner scheme
source

Implementations

IntervalMatrices.exp_overapproximationFunction
exp_overapproximation(A::IntervalMatrix{T}, t, p)

Overapproximation of the exponential of an interval matrix, exp(A*t), using a truncated Taylor series.

Input

  • A – interval matrix
  • t – exponentiation factor
  • p – order of the approximation

Output

A matrix enclosure of exp(A*t), i.e. an interval matrix M = (m_{ij}) such that [exp(A*t)]_{ij} ⊆ m_{ij}.

Algorithm

See Theorem 1 in Reachability Analysis of Linear Systems with Uncertain Parameters and Inputs by M. Althoff, O. Stursberg, M. Buss.

source
IntervalMatrices.hornerFunction
horner(A::IntervalMatrix{T}, K::Integer; [validate]::Bool=true)

Compute the matrix exponential using the Horner scheme.

Input

  • A – interval matrix
  • K – number of expansions in the Horner scheme
  • validate – (optional; default: true) option to validate the precondition of the algorithm

Algorithm

We use the algorithm in [1, Section 4.2].

[1] Goldsztejn, Alexandre, Arnold Neumaier. "On the exponentiation of interval matrices". Reliable Computing. 2014.

source
IntervalMatrices.scale_and_squareFunction
scale_and_square(A::IntervalMatrix{T}, l::Integer, t, p;
-                 [validate]::Bool=true)

Compute the matrix exponential using scaling and squaring.

Input

  • A – interval matrix
  • l – scaling-and-squaring order
  • t – non-negative time value
  • p – order of the approximation
  • validate – (optional; default: true) option to validate the precondition of the algorithm

Algorithm

We use the algorithm in [1, Section 4.3], which first scales A by factor $2^{-l}$, computes the matrix exponential for the scaled matrix, and then squares the result $l$ times.

\[ \exp(A * 2^{-l})^{2^l}\]

[1] Goldsztejn, Alexandre, Arnold Neumaier. "On the exponentiation of interval matrices". Reliable Computing. 2014.

source
IntervalMatrices.exp_underapproximationFunction
exp_underapproximation(A::IntervalMatrix{T}, t, p) where {T}

Underapproximation of the exponential of an interval matrix, exp(A*t), using a truncated Taylor series expansion.

Input

  • A – interval matrix
  • t – exponentiation factor
  • p – order of the approximation

Output

An underapproximation of exp(A*t), i.e. an interval matrix M = (m_{ij}) such that m_{ij} ⊆ [exp(A*t)]_{ij}.

Algorithm

See Theorem 2 in Reachability Analysis of Linear Systems with Uncertain Parameters and Inputs by M. Althoff, O. Stursberg, M. Buss.

source

Finite expansions

IntervalMatrices.quadratic_expansionFunction
quadratic_expansion(A::IntervalMatrix, α::Real, β::Real)

Compute the quadratic expansion of an interval matrix, $αA + βA^2$, using interval arithmetic.

Input

  • A – interval matrix
  • α – linear coefficient
  • β – quadratic coefficient

Output

An interval matrix that encloses $B := αA + βA^2$.

Algorithm

This a variation of the algorithm in [1, Section 6]. If $A = (aᵢⱼ)$ and $B := αA + βA^2 = (bᵢⱼ)$, the idea is to compute each $bᵢⱼ$ by factoring out repeated expressions (thus the term single-use expressions).

First, let $i = j$. In this case,

\[bⱼⱼ = β\sum_\{k, k ≠ j} a_{jk} a_{kj} + (α + βa_{jj}) a_{jj}.\]

Now consider $i ≠ j$. Then,

\[bᵢⱼ = β\sum_\{k, k ≠ i, k ≠ j} a_{ik} a_{kj} + (α + βa_{ii} + βa_{jj}) a_{ij}.\]

[1] Kosheleva, Kreinovich, Mayer, Nguyen. Computing the cube of an interval matrix is NP-hard. SAC 2005.

source

Correction terms

IntervalMatrices.correction_hullFunction
correction_hull(A::IntervalMatrix{T}, t, p) where {T}

Compute the correction term for the convex hull of a point and its linear map with an interval matrix in order to contain all trajectories of a linear system.

Input

  • A – interval matrix
  • t – non-negative time value
  • p – order of the approximation

Output

An interval matrix representing the correction term.

Algorithm

See Theorem 3 in [1].

[1] M. Althoff, O. Stursberg, M. Buss. Reachability Analysis of Linear Systems with Uncertain Parameters and Inputs. CDC 2007.

source
IntervalMatrices.input_correctionFunction
input_correction(A::IntervalMatrix{T}, t, p) where {T}

Compute the input correction matrix for discretizing an inhomogeneous affine dynamical system with an interval matrix and an input domain not containing the origin.

Input

  • A – interval matrix
  • t – non-negative time value
  • p – order of the Taylor approximation

Output

An interval matrix representing the correction matrix.

Algorithm

See Proposition 3.4 in [1].

[1] M. Althoff. Reachability analysis and its application to the safety assessment of autonomous cars. 2010.

source

Norms

LinearAlgebra.opnormFunction
opnorm(A::IntervalMatrix, p::Real=Inf)

The matrix norm of an interval matrix.

Input

  • A – interval matrix
  • p – (optional, default: Inf) the class of p-norm

Notes

The matrix $p$-norm of an interval matrix $A$ is defined as

\[ ‖A‖_p := ‖\max(|\text{inf}(A)|, |\text{sup}(A)|)‖_p\]

where $\max$ and $|·|$ are taken elementwise.

source
IntervalMatrices.diam_normFunction
diam_norm(A::IntervalMatrix, p=Inf)

Return the diameter norm of the interval matrix.

Input

  • A – interval matrix
  • p – (optional, default: Inf) the p-norm used; valid options are: 1, 2, Inf

Output

The operator norm, in the p-norm, of the scalar matrix obtained by taking the element-wise diam function, where diam(x) := sup(x) - inf(x) for an interval x.

Notes

This function gives a measure of the width of the interval matrix.

source
+ [-1.0, 7.0] [-1.0, 9.0]
source
Base.:⊆Function
⊆(A::AbstractIntervalMatrix, B::AbstractIntervalMatrix)

Check whether an interval matrix is contained in another interval matrix.

Input

  • A – interval matrix
  • B – interval matrix

Output

true iff A[i, j] ⊆ B[i, j] for all i, j.

source
Base.:∩Function
∩(A::IntervalMatrix, B::IntervalMatrix)

Intersect two interval matrices.

Input

  • A – interval matrix
  • B – interval matrix (of the same shape as A)

Output

A new matrix C of the same shape as A such that C[i, j] = A[i, j] ∩ B[i, j] for each i and j.

source
Base.:∪Function
∪(A::IntervalMatrix, B::IntervalMatrix)

Finds the interval union (hull) of two interval matrices. This is equivalent to hull.

Input

  • A – interval matrix
  • B – interval matrix (of the same shape as A)

Output

A new matrix C of the same shape as A such that C[i, j] = A[i, j] ∪ B[i, j] for each i and j.

source
IntervalArithmetic.hullFunction
hull(A::IntervalMatrix, B::IntervalMatrix)

Finds the interval hull of two interval matrices. This is equivalent to .

Input

  • A – interval matrix
  • B – interval matrix (of the same shape as A)

Output

A new matrix C of the same shape as A such that C[i, j] = hull(A[i, j], B[i, j]) for each i and j.

source

Arithmetic

IntervalMatrices.squareFunction
square(A::IntervalMatrix)

Compute the square of an interval matrix.

Input

  • A – interval matrix

Output

An interval matrix equivalent to A * A.

Algorithm

We follow [1, Section 6].

[1] Kosheleva, Kreinovich, Mayer, Nguyen. Computing the cube of an interval matrix is NP-hard. SAC 2005.

source
IntervalMatrices.scaleFunction
scale(A::IntervalMatrix{T}, α::T) where {T}

Return a new interval matrix whose entries are scaled by the given factor.

Input

  • A – interval matrix
  • α – scaling factor

Output

A new matrix B of the same shape as A such that B[i, j] = α*A[i, j] for each i and j.

Notes

See scale! for the in-place version of this function.

source
IntervalMatrices.scale!Function
scale!(A::IntervalMatrix{T}, α::T) where {T}

Modifies the given interval matrix, scaling its entries by the given factor.

Input

  • A – interval matrix
  • α – scaling factor

Output

The matrix A such that for each i and j, the new value of A[i, j] is α*A[i, j].

Notes

This is the in-place version of scale.

source
IntervalMatrices.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.
    • :fast – computes an enclosure of the matrix product using the midpoint-radius notation of the matrix [RUM10].
:fast option no longer supported

:fast support was removed in IntervalArithmetic v0.22.

Notes

  • By default, :slow 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

Matrix power

IntervalMatrices.increment!Function
increment!(pow::IntervalMatrixPower; [algorithm=default_algorithm])

Increment a matrix power in-place (i.e., storing the result in pow).

Input

  • pow – wrapper of a matrix power (modified in this function)
  • algorithm – (optional; default: default_algorithm) algorithm to compute the matrix power; available options:
    • "multiply" – fast computation using * from the previous result
    • "power" – recomputation using ^
    • "decompose_binary" – decompose k = 2a + b
    • "intersect" – combination of "multiply"/"power"/"decompose_binary"

Output

The next matrix power, reflected in the modified wrapper.

Notes

Independent of "algorithm", if the index is a power of two, we compute the exact result using squaring.

source
IntervalMatrices.incrementFunction
increment(pow::IntervalMatrixPower; [algorithm=default_algorithm])

Increment a matrix power without modifying pow.

Input

  • pow – wrapper of a matrix power
  • algorithm – (optional; default: default_algorithm) algorithm to compute the matrix power; see increment! for available options

Output

The next matrix power.

source
IntervalMatrices.matrixFunction
matrix(pow::IntervalMatrixPower)

Return the matrix represented by a wrapper of a matrix power.

Input

  • pow – wrapper of a matrix power

Output

The matrix power represented by the wrapper.

source
IntervalMatrices.baseFunction
base(pow::IntervalMatrixPower)

Return the original matrix represented by a wrapper of a matrix power.

Input

  • pow – wrapper of a matrix power

Output

The matrix $M$ being the basis of the matrix power $M^k$ represented by the wrapper.

source
IntervalMatrices.indexFunction
index(pow::IntervalMatrixPower)

Return the current index of the wrapper of a matrix power.

Input

  • pow – wrapper of a matrix power

Output

The index k of the wrapper representing $M^k$.

source

Matrix exponential

Algorithms

IntervalMatrices.HornerType
Horner <: AbstractExponentiationMethod

Matrix exponential using Horner's method.

Fields

  • K – number of expansions in the Horner scheme
source

Implementations

IntervalMatrices.exp_overapproximationFunction
exp_overapproximation(A::IntervalMatrix{T}, t, p)

Overapproximation of the exponential of an interval matrix, exp(A*t), using a truncated Taylor series.

Input

  • A – interval matrix
  • t – exponentiation factor
  • p – order of the approximation

Output

A matrix enclosure of exp(A*t), i.e. an interval matrix M = (m_{ij}) such that [exp(A*t)]_{ij} ⊆ m_{ij}.

Algorithm

See Theorem 1 in Reachability Analysis of Linear Systems with Uncertain Parameters and Inputs by M. Althoff, O. Stursberg, M. Buss.

source
IntervalMatrices.hornerFunction
horner(A::IntervalMatrix{T}, K::Integer; [validate]::Bool=true)

Compute the matrix exponential using the Horner scheme.

Input

  • A – interval matrix
  • K – number of expansions in the Horner scheme
  • validate – (optional; default: true) option to validate the precondition of the algorithm

Algorithm

We use the algorithm in [1, Section 4.2].

[1] Goldsztejn, Alexandre, Arnold Neumaier. "On the exponentiation of interval matrices". Reliable Computing. 2014.

source
IntervalMatrices.scale_and_squareFunction
scale_and_square(A::IntervalMatrix{T}, l::Integer, t, p;
+                 [validate]::Bool=true)

Compute the matrix exponential using scaling and squaring.

Input

  • A – interval matrix
  • l – scaling-and-squaring order
  • t – non-negative time value
  • p – order of the approximation
  • validate – (optional; default: true) option to validate the precondition of the algorithm

Algorithm

We use the algorithm in [1, Section 4.3], which first scales A by factor $2^{-l}$, computes the matrix exponential for the scaled matrix, and then squares the result $l$ times.

\[ \exp(A * 2^{-l})^{2^l}\]

[1] Goldsztejn, Alexandre, Arnold Neumaier. "On the exponentiation of interval matrices". Reliable Computing. 2014.

source
IntervalMatrices.exp_underapproximationFunction
exp_underapproximation(A::IntervalMatrix{T}, t, p) where {T}

Underapproximation of the exponential of an interval matrix, exp(A*t), using a truncated Taylor series expansion.

Input

  • A – interval matrix
  • t – exponentiation factor
  • p – order of the approximation

Output

An underapproximation of exp(A*t), i.e. an interval matrix M = (m_{ij}) such that m_{ij} ⊆ [exp(A*t)]_{ij}.

Algorithm

See Theorem 2 in Reachability Analysis of Linear Systems with Uncertain Parameters and Inputs by M. Althoff, O. Stursberg, M. Buss.

source

Finite expansions

IntervalMatrices.quadratic_expansionFunction
quadratic_expansion(A::IntervalMatrix, α::Real, β::Real)

Compute the quadratic expansion of an interval matrix, $αA + βA^2$, using interval arithmetic.

Input

  • A – interval matrix
  • α – linear coefficient
  • β – quadratic coefficient

Output

An interval matrix that encloses $B := αA + βA^2$.

Algorithm

This a variation of the algorithm in [1, Section 6]. If $A = (aᵢⱼ)$ and $B := αA + βA^2 = (bᵢⱼ)$, the idea is to compute each $bᵢⱼ$ by factoring out repeated expressions (thus the term single-use expressions).

First, let $i = j$. In this case,

\[bⱼⱼ = β\sum_\{k, k ≠ j} a_{jk} a_{kj} + (α + βa_{jj}) a_{jj}.\]

Now consider $i ≠ j$. Then,

\[bᵢⱼ = β\sum_\{k, k ≠ i, k ≠ j} a_{ik} a_{kj} + (α + βa_{ii} + βa_{jj}) a_{ij}.\]

[1] Kosheleva, Kreinovich, Mayer, Nguyen. Computing the cube of an interval matrix is NP-hard. SAC 2005.

source

Correction terms

IntervalMatrices.correction_hullFunction
correction_hull(A::IntervalMatrix{T}, t, p) where {T}

Compute the correction term for the convex hull of a point and its linear map with an interval matrix in order to contain all trajectories of a linear system.

Input

  • A – interval matrix
  • t – non-negative time value
  • p – order of the approximation

Output

An interval matrix representing the correction term.

Algorithm

See Theorem 3 in [1].

[1] M. Althoff, O. Stursberg, M. Buss. Reachability Analysis of Linear Systems with Uncertain Parameters and Inputs. CDC 2007.

source
IntervalMatrices.input_correctionFunction
input_correction(A::IntervalMatrix{T}, t, p) where {T}

Compute the input correction matrix for discretizing an inhomogeneous affine dynamical system with an interval matrix and an input domain not containing the origin.

Input

  • A – interval matrix
  • t – non-negative time value
  • p – order of the Taylor approximation

Output

An interval matrix representing the correction matrix.

Algorithm

See Proposition 3.4 in [1].

[1] M. Althoff. Reachability analysis and its application to the safety assessment of autonomous cars. 2010.

source

Norms

LinearAlgebra.opnormFunction
opnorm(A::IntervalMatrix, p::Real=Inf)

The matrix norm of an interval matrix.

Input

  • A – interval matrix
  • p – (optional, default: Inf) the class of p-norm

Notes

The matrix $p$-norm of an interval matrix $A$ is defined as

\[ ‖A‖_p := ‖\max(|\text{inf}(A)|, |\text{sup}(A)|)‖_p\]

where $\max$ and $|·|$ are taken elementwise.

source
IntervalMatrices.diam_normFunction
diam_norm(A::IntervalMatrix, p=Inf)

Return the diameter norm of the interval matrix.

Input

  • A – interval matrix
  • p – (optional, default: Inf) the p-norm used; valid options are: 1, 2, Inf

Output

The operator norm, in the p-norm, of the scalar matrix obtained by taking the element-wise diam function, where diam(x) := sup(x) - inf(x) for an interval x.

Notes

This function gives a measure of the width of the interval matrix.

source
diff --git a/dev/lib/types/index.html b/dev/lib/types/index.html index 629aa96..6eaa038 100644 --- a/dev/lib/types/index.html +++ b/dev/lib/types/index.html @@ -1,5 +1,5 @@ -Types · IntervalMatrices.jl

Types

This section describes systems types implemented in IntervalMatrices.jl.

Abstract interval operators

Interval matrix

IntervalMatrices.IntervalMatrixType
IntervalMatrix{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])
+Types · IntervalMatrices.jl

Types

This section describes systems types implemented in IntervalMatrices.jl.

Abstract interval operators

Interval matrix

IntervalMatrices.IntervalMatrixType
IntervalMatrix{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
@@ -19,7 +19,7 @@
   [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.

source

Interval-matrix-power wrapper

IntervalMatrices.IntervalMatrixPowerType
IntervalMatrixPower{T}

A wrapper for the matrix power that can be incremented.

Fields

  • M – the original matrix
  • Mᵏ – 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)])
+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.

source

Interval-matrix-power wrapper

IntervalMatrices.IntervalMatrixPowerType
IntervalMatrixPower{T}

A wrapper for the matrix power that can be incremented.

Fields

  • M – the original matrix
  • Mᵏ – 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]
@@ -48,14 +48,14 @@
 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]
-
source

Affine interval matrix

IntervalMatrices.AffineIntervalMatrix1Type
AffineIntervalMatrix1{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 – matrix
  • A1 – matrix
  • λ – interval

Examples

The matrix $I + [1 1; -1 1] * interval(0, 1)$ is:

julia> using LinearAlgebra
+
source

Affine interval matrix

IntervalMatrices.AffineIntervalMatrix1Type
AffineIntervalMatrix1{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 – matrix
  • A1 – 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]
source
IntervalMatrices.AffineIntervalMatrixType
AffineIntervalMatrix{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 – matrix
  • A – 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
+ [-1.0, 0.0]  [1.0, 2.0]
source
IntervalMatrices.AffineIntervalMatrixType
AffineIntervalMatrix{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 – matrix
  • A – 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);
 
@@ -66,4 +66,4 @@
 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]
source
+ [1.0, 3.0] [1.0, 2.0]
source
diff --git a/dev/objects.inv b/dev/objects.inv index 237db473bf34609d523a098bec5db3d745952759..7a94cf1deae0659945a56f2993de600df39ba7ae 100644 GIT binary patch delta 12 TcmeC-=;4^)#b~(E`yev_8D9hS delta 12 TcmeC-=;4^)#b~h6`yev_8CnDM diff --git a/dev/references/index.html b/dev/references/index.html index 7f2eca1..a11cce2 100644 --- a/dev/references/index.html +++ b/dev/references/index.html @@ -18,4 +18,4 @@ pages={534--554}, year={1999}, publisher={Springer} -} +}