API - Linear Systems
Verified linear system solvers and related functions.
Triangular Systems
BallArithmetic.backward_substitution — Function
backward_substitution(A::BallMatrix, v::BallVector)
backward_substitution(A::BallMatrix, B::BallMatrix)Enclose the solution of A x = v, or of A X = B column by column, for an upper triangular A: the rows are eliminated from the last to the first, each step a ball subtraction and one ball division by the diagonal entry, so the result encloses the solution of every real or complex system whose matrix and right hand side lie in A and in v.
Both the midpoints and the radii of A are required to be upper triangular, since a nonzero radius below the diagonal would describe a matrix that is not; an ArgumentError is raised otherwise, and a DimensionMismatch when A is not square. A diagonal ball containing zero raises an ArgumentError from the division rather than returning an unbounded enclosure, so a matrix whose enclosure admits a singular member is rejected and not reported as solved.
BallArithmetic.forward_substitution — Function
forward_substitution(A::BallMatrix, v::BallVector)
forward_substitution(A::BallMatrix, B::BallMatrix)The same as backward_substitution for a lower triangular A, eliminating the rows from the first to the last; midpoints and radii are both required to be lower triangular.
Cholesky Factorization
BallArithmetic.verified_cholesky — Function
verified_cholesky([T = BigFloat,] A::AbstractMatrix; precision_bits = 256)An inclusion of the Cholesky factor of A, by Section 4 of Rump and Ogita (2024); the method is described at _rumpogita2024_cholesky. Returns a VerifiedCholeskyResult: when certified is true, A is proved positive definite and A = G*G with G upper triangular with positive diagonal, in the ball matrix returned. Positive definiteness is a conclusion and not an assumption.
When A is not Hermitian a warning is issued (above a rounding-level threshold) and the statement is for its Hermitian part (A + A*)/2, enclosed in ball arithmetic.
Arguments
T: the arithmetic of the enclosure,BigFloat(the default) orFloat64, as a leading argument. In BigFloat the computation runs atprecision_bitsand the factor is enclosed to about that precision.Float64with a BigFloat input raises.precision_bits: the BigFloat precision. A BigFloat input with more digits is rounded to it and the rounding is enclosed.
Example
B = randn(100, 100); A = B' * B + I
r = verified_cholesky(Float64, A)
r.certified # A is positive definite and its Cholesky factor lies in r.GReference
S. M. Rump and T. Ogita, Verified Error Bounds for Matrix Decompositions, SIAM J. Matrix Anal. Appl. 45(4) (2024), 2155-2183, doi 10.1137/24M165096X, Section 4.
BallArithmetic.VerifiedCholeskyResult — Type
VerifiedCholeskyResult{GM, RT}Result of verified_cholesky.
Fields
G::GM: ball matrix containing the upper triangular Cholesky factor,A = G*Gcertified::Bool: whether the verification succeeded; whenfalsethe radii are infinite and nothing is proved, in particular not thatAfails to be positive definiteresidual_norm::RT: an upper bound of‖G̃*G̃ − A‖_∞ / ‖A‖_∞over allG̃ ∈ G
Statement
When certified is true, the Hermitian part (A + A*)/2 of the input, which is the input when it is Hermitian, is proved positive definite, and its Cholesky factor, upper triangular with positive diagonal, lies in the ball matrix G.
Reference
S. M. Rump and T. Ogita, Verified Error Bounds for Matrix Decompositions, SIAM J. Matrix Anal. Appl. 45(4) (2024), 2155-2183, doi 10.1137/24M165096X, Section 4.
The flag is called certified since version 0.4 and was called success in 0.3.0; the old name still resolves, with a deprecation warning, and iscertified reads it in either version.
Gaussian Elimination
BallArithmetic.GaussianEliminationResult — Type
GaussianEliminationResult{VT, MT}The result of interval_gaussian_elimination.
Fields
solution::VT: a ball vector containing the solution of x = b̂for everyÂinAandb̂inb; its radii are infinite when notcertifiedcertified::Bool: whether the elimination ran to the end with no pivot containing zero. Then every matrix ofAis nonsingular.falsesays only that the elimination stopped: it is not a proof thatAcontains a singular matrixL::MT,U::MT: ball matrices, unit lower triangular and upper triangular. Whencertified, for everyÂinAthe rows ofÂtaken in the orderpfactor asÂ[p, :] = L̂ ÛwithL̂inLandÛinUp::Vector{Int}: the order of the rows
The flag is called certified since version 0.4 and was called success in 0.3.0; the old name still resolves, with a deprecation warning, and iscertified reads it in either version.
BallArithmetic.interval_gaussian_elimination — Function
interval_gaussian_elimination(A::BallMatrix, b::BallVector; pivoting = :partial)
-> GaussianEliminationResultGaussian elimination and backward substitution in ball arithmetic for the square real interval system A x = b: Algorithms 5.9 and 5.10 of Horáček (2019).
Elimination, for k = 1, …, n − 1: a row j ≥ k whose entry in column k does not contain zero is brought to position k; for every row j > k the entry a_jk is set to zero and
a_j,k+1:n := a_j,k+1:n − (a_jk / a_kk) a_k,k+1:n, b_j := b_j − (a_jk / a_kk) b_k.If no such row exists the elimination stops, and the result is not certified. Backward substitution: x_i := (b_i − Σ_{j>i} a_ij x_j) / a_ii for i = n, …, 1.
Why the result is an enclosure: for a fixed  in A and b̂ in b, Gaussian elimination on them with the same order of the rows evaluates the same formulae on numbers contained in the balls, and every operation on balls contains the result of the operation on their points; a pivot that does not contain zero is not zero for Â. So  is nonsingular, its solution is in solution, and its factors are in L and U.
pivoting = :partial chooses, among the rows whose entry does not contain zero, the one whose entry is farthest from zero (the largest lower bound of its absolute value). Step 2 of Algorithm 5.9 asks only for a row whose entry does not contain zero and leaves the choice free; the thesis then says that it selects "a pivot with the smallest mignitude". pivoting = :none keeps the rows in their order and stops at the first pivot that contains zero.
The enclosure may be much wider than the hull of the solution set: the radii grow with the number of operations, as Example 5.11 of the thesis shows. The thesis recommends preconditioning by the inverse of the midpoint (compute_preconditioner).
Reference
J. Horáček, "Interval linear and nonlinear systems", PhD thesis, Charles University, Prague, 2019, Section 5.6.1.
BallArithmetic.interval_gaussian_elimination_det — Function
interval_gaussian_elimination_det(A::BallMatrix) -> BallA ball containing the determinant of every matrix of the real interval matrix A, by Section 8.4.1 of Horáček (2019): the product of the diagonal of the row echelon form computed by interval_gaussian_elimination, with the sign of the permutation of the rows. The ball has infinite radius when the elimination stops at a pivot that contains zero; the elimination is then inconclusive, and the determinant may or may not vanish on A.
BallArithmetic.is_regular_gaussian_elimination — Function
is_regular_gaussian_elimination(A::BallMatrix) -> Booltrue when interval_gaussian_elimination runs to the end on the real interval matrix A, which proves that every matrix of A is nonsingular. false is inconclusive.
Iterative Methods
BallArithmetic.IterativeResult — Type
IterativeResult{T, VT}Result of interval_jacobi and interval_gauss_seidel.
Fields
solution: a box containing the part of the solution set that lies in the initial boxconverged: whether the stopping criterion of Section 5.7.2 was met withinmax_iterationsiterations: number of sweepsfinal_width: the largest radius ofsolutionconvergence_rate: the ratio of the largest radii of the last two iteratesempty:truewhen an intersection was empty, which proves that the solution set does not meet the initial box;solutionis then the last nonempty iterate and is not an enclosure
BallArithmetic.interval_initial_enclosure — Function
interval_initial_enclosure(A::BallMatrix, b::BallVector; C = inv(mid(A)), method = :auto)
-> BallVectorA box that contains the solution set of the square interval system A x = b, by Section 5.7.1 of Horáček (2019), with C a real matrix (any; the default is the floating-point inverse of the midpoint):
method = :proposition, Proposition 5.14: if⟨CA⟩u ≥ v > 0for someu ≥ 0, thenΣ ⊆ ‖Cb‖_v [−u, u], with‖x‖_v = max_i |x_i|/v_i.uis an approximate solution of⟨CA⟩u = eandva lower bound of⟨CA⟩u, as the thesis suggests.method = :norm, formula (5.4): if‖I − CA‖_∞ < 1, thenΣ ⊆ ‖Cb‖_∞/(1 − ‖I − CA‖_∞) [−e, e].method = :auto: the first, and the second where the first does not apply.
CA and Cb are formed in ball arithmetic and every bound is rounded outwards. Where the condition of the method is not established the box returned has infinite radii.
BallArithmetic.interval_gauss_seidel — Function
interval_gauss_seidel(A::BallMatrix, b::BallVector; x0 = nothing, preconditioner = nothing,
max_iterations = 20, tol = nothing) -> IterativeResultAlgorithm 5.17 of Horáček (2019), the Gauss-Seidel method: the Jacobi method (interval_jacobi, with the same arguments and the same statement) in which each component uses the components already updated in the sweep,
y_i⁽ᵏ⁺¹⁾ = (b_i − Σ_{j<i} a_ij x_j⁽ᵏ⁺¹⁾ − Σ_{j>i} a_ij x_j⁽ᵏ⁾)/a_ii.BallArithmetic.interval_jacobi — Function
interval_jacobi(A::BallMatrix, b::BallVector; x0 = nothing, preconditioner = nothing,
max_iterations = 20, tol = nothing) -> IterativeResultAlgorithm 5.15 of Horáček (2019), the Jacobi method for a real square interval system A x = b: from a box x⁽⁰⁾ containing the solution set,
y_i⁽ᵏ⁺¹⁾ = (b_i − Σ_{j≠i} a_ij x_j⁽ᵏ⁾)/a_ii, x⁽ᵏ⁺¹⁾ = x⁽ᵏ⁾ ∩ y⁽ᵏ⁺¹⁾,until the stopping criterion of Section 5.7.2: both ends of every component move by less than tol, or max_iterations sweeps (the thesis uses 20). tol = nothing takes (5.5), min_ij wid(A_ij) × 10⁻⁵.
x0: the initial box. When it contains the solution set, so does the result; when it contains only a part of it, the result contains that part.nothingtakesinterval_initial_enclosure, and where that gives none the result has infinite radii andconverged = false.preconditioner: a real matrixC; the iteration is then applied to(CA) x = Cb, formed in ball arithmetic, whose solution set contains that of the original system (Section 5.4).
A diagonal entry that contains zero leaves its component unchanged. An empty intersection is reported in the field empty.
HBR Method
BallArithmetic.HBRResult — Type
HBRResult{VT}Result of hbr_method.
Fields
solution: a box containing the solution set whencertifiedistrue; infinite radii otherwisecertified: whether the hypotheses of Theorem 5.12 were verified and the enclosure computed
The flag is called certified since version 0.4 and was called success in 0.3.0; the old name still resolves, with a deprecation warning, and iscertified reads it in either version.
BallArithmetic.hbr_method — Function
hbr_method(A::BallMatrix, b::BallVector; preconditioner = nothing) -> HBRResultTheorem 5.12 of Horáček (2019). Let A x = b be a real square interval system with A an H-matrix, ⟨A⟩ its comparison matrix,
u = ⟨A⟩⁻¹ mag(b), d_i = (⟨A⟩⁻¹)_ii, α_i = ⟨A⟩_ii − 1/d_i, β_i = u_i/d_i − mag(b_i).Then the solution set is contained in the box with components
x_i = (b_i + [−β_i, β_i]) / (A_ii + [−α_i, α_i]).When the midpoint of A is diagonal the box is the hull (the thesis, after the theorem).
The theorem is applied to the preconditioned system (CA) x = Cb, formed in ball arithmetic, whose solution set contains that of A x = b (Section 5.4). preconditioner = nothing takes C the floating-point inverse of the midpoint; a real matrix is used as given; hbr_method_simple applies the theorem to A x = b itself.
How it is verified: that the matrix is an H-matrix by is_H_matrix; ⟨A⟩⁻¹ is enclosed by verifylss, as the thesis suggests with the ε-inflation method; α_i and β_i are replaced by upper bounds, which enlarges the box, since the quotient grows with both. certified is false where one of these steps fails.
BallArithmetic.hbr_method_simple — Function
hbr_method_simple(A::BallMatrix, b::BallVector) -> HBRResultTheorem 5.12 of Horáček (2019) applied to A x = b without preconditioning; A must then be an H-matrix itself. See hbr_method.
Shaving
BallArithmetic.ShavingResult — Type
ShavingResult{T, VT}Result of interval_shaving.
Fields
solution: the shaved box; it contains every point of the solution set that the initial box containsshaved_amount: the sum of the widths removediterations: number of passes over the variablescomponents_shaved: number of slices removedempty:truewhen a slice as wide as the box was removed, which proves that the initial box contains no point of the solution set;solutionis then meaningless
BallArithmetic.interval_shaving — Function
interval_shaving(A::BallMatrix, b::BallVector, x0::BallVector; passes = 1,
improvements = 3, min_improvement = 1e-6, lp_solver = nothing) -> ShavingResultThe shaving method of Section 5.9 of Horáček (2019) for a real square interval system A x = b: slices of the box x0 that contain no point of the solution set are cut off. With x0 an enclosure of the solution set, so is the result.
For the variable i and the upper end, the slice of width α is the box with x_i restricted to [x̄_i − α, x̄_i] (5.8), and similarly at the lower end. For each of the 2n slices:
A certificate for the midpoint system (Section 5.9.1). By Lemma 5.21,
A x = b,x ∈ xhas no solution exactly whenAᵀw + y − z = 0, bᵀw + x̄ᵀy − x̲ᵀz = −1, y, z ≥ 0 (5.9)is solvable. The linear programme
min b_cᵀw + x̄ᵀy − x̲ᵀzsubject toA_cᵀw + y − z = 0,−e ≤ w ≤ e,y, z ≥ 0is solved for the slice of width zero. If its value is not negative the slice is kept.A square interval system. The entries of
yandzthat vanish at the optimum are fixed to zero; the remaining system (5.12) is completed to a square one,C v = d,C ∈ C, with an orthonormal basis of the null space of its midpoint, the right-hand sides chosen so that the normalised optimum solves it (5.13). Its solution set is enclosed byverifylss. If the componentsuof the enclosure that come fromyandzare nonnegative, (5.9) is solvable for everyA ∈ A,b ∈ b, and the slice contains no point of the solution set.The width (Section 5.9.2). The width
αenters one coefficient,C + α e_p e_qᵀ, and by Lemma 5.22 the solution becomesv − α v_q/(1 + α C⁻¹_qp) · C⁻¹_*p. Withcan enclosure ofC⁻¹_*p, the solution set ofC u = e_p, the largestαallowed is given byα < −1/c̲_qwhenc̲_q < 0(5.15) and, for every componentkofuother thanq,α ≤ u̲_k / (sup(u_q c_k) − u̲_k c̲_q)when the denominator is positive (5.16), all rounded downwards.Iterative improvement (Section 5.9.3),
improvementstimes: the coefficient is moved by the width found, the system enclosed again,cupdated byc/(1 + α c_q), with itsq-th component computed as1/(α + 1/c_q), and a further width added.
passes is the number of sweeps over the variables; a slice narrower than min_improvement times the width of its variable is not cut.
lp_solver(c, Aeq, beq, lb, ub) must return a minimiser of c'v subject to Aeq v = beq, lb ≤ v ≤ ub, or nothing. It is a heuristic: whatever it returns, a slice is cut only after step 2 has verified the certificate. nothing uses JuMP with HiGHS, which must then be loaded (using JuMP, HiGHS); see _shaving_lp.
Reference
J. Horáček, Interval linear and nonlinear systems, doctoral thesis, Charles University, Department of Applied Mathematics, Prague, 2019 ([26]), Section 5.9, Lemma 5.21 and Lemma 5.22.
BallArithmetic.sherman_morrison_inverse_update — Function
sherman_morrison_inverse_update(A_inv::Matrix{T}, u::Vector{T}, v::Vector{T}) where {T}Compute (A + uv^T)^(-1) using Sherman-Morrison formula.
Sherman-Morrison Formula
(A + uv^T)^(-1) = A^(-1) - (A^(-1)uv^T A^(-1)) / (1 + v^T A^(-1)u)This allows O(n²) update of inverse for rank-1 perturbation instead of O(n³) recomputation.
Arguments
A_inv: Inverse of base matrix A (n×n)u: First vector of rank-1 update (n)v: Second vector of rank-1 update (n)
Returns
(A + uv^T)^(-1)
Example
A = [3.0 1.0; 1.0 2.0]
A_inv = inv(A)
u = [1.0, 0.0]
v = [0.0, 1.0]
# Efficiently compute inv(A + u*v')
A_updated_inv = sherman_morrison_inverse_update(A_inv, u, v)Notes
- O(n²) complexity vs O(n³) for full inverse
- Numerically stable if |1 + v^T A^(-1)u| is not too small
- A floating-point formula: the result is an approximation, with no error bound
BallArithmetic._shaving_lp — Function
_shaving_lp(c, Aeq, beq, lb, ub) -> Vector or nothingA minimiser of c'v subject to Aeq v = beq, lb ≤ v ≤ ub, in floating point, or nothing.
The function has no method in the package itself: one is added by the extension loaded with JuMP and HiGHS, and interval_shaving raises an ArgumentError naming them when neither that extension nor an lp_solver of its own is available. Whatever the solver returns is a guess and is not verified: a slice is cut only after the square interval system of step 2 of interval_shaving has established the certificate for the whole ball.
Preconditioning
BallArithmetic.PreconditionerType — Type
PreconditionerTypeEnumeration of available preconditioning strategies.
:midpoint: C = A_c^(-1) (inverse of midpoint):lu: C from LU factorization of midpoint:ldlt: C from LDLT factorization of midpoint (symmetric matrices):identity: C = I (no preconditioning)
BallArithmetic.MidpointInverse — Constant
PreconditionerType: C = inv(mid(A)) in floating point.
BallArithmetic.LUFactorization — Constant
PreconditionerType: C the inverse of the LU factorisation of mid(A), in floating point.
BallArithmetic.LDLTFactorization — Constant
PreconditionerType: C the inverse of the LDLᵀ factorisation of the symmetric mid(A) with the pivoting of Bunch and Kaufman (bunchkaufman), in floating point.
BallArithmetic.IdentityPreconditioner — Constant
PreconditionerType: C = I.
BallArithmetic.PreconditionerResult — Type
PreconditionerResult{CT, T, F}Result from preconditioner computation. Nothing in it is verified: the preconditioner is an approximate inverse and the condition number an estimate.
Fields
preconditioner::Matrix{CT}: Approximate inverse C, real or complex as the midpoint ismethod::PreconditionerType: Method usedcondition_number::T: Estimated condition number, a real numbersuccess::Bool: Whether computation succeededfactorization: the stored factorization (for LU/LDLT),nothingotherwise
BallArithmetic.compute_preconditioner — Function
compute_preconditioner(A::BallMatrix{T};
method::Symbol=:midpoint,
check_conditioning::Bool=true) where {T}Compute preconditioner C ≈ A^(-1) for interval matrix A.
Methods
:midpoint: Direct inverse of A_c (default, simplest):lu: LU factorization of A_c (more stable):ldlt: LDLT factorization of A_c (for symmetric A):identity: Identity matrix (no preconditioning)
Arguments
A: Interval matrix to preconditionmethod: Preconditioning strategycheck_conditioning: Compute and warn about condition number
Returns
PreconditionerResult with approximate inverse and diagnostic info.
Example
A = BallMatrix([4.0 1.0; 1.0 3.0], fill(0.1, 2, 2))
# Midpoint inverse (default)
prec = compute_preconditioner(A)
C = prec.preconditioner
# LU factorization (more stable)
prec_lu = compute_preconditioner(A, method=:lu)Notes
- Midpoint inverse: O(n³), simplest but may be numerically unstable
- LU factorization: O(n³) once, O(n²) per solve, more stable
- LDLT factorization: O(n³/6) once, O(n²) per solve, only for symmetric
- Identity: O(1), use for well-conditioned or diagonally dominant matrices
BallArithmetic.apply_preconditioner — Function
apply_preconditioner(prec::PreconditionerResult{T}, v::Vector{T}) where {T}Apply preconditioner to vector: compute C * v.
If factorization is available, uses it for efficiency.
Arguments
prec: Preconditioner result fromcompute_preconditionerv: Vector to multiply
Returns
C * v
Example
A = BallMatrix([3.0 1.0; 1.0 2.0], fill(0.1, 2, 2))
prec = compute_preconditioner(A, method=:lu)
b = [5.0, 4.0]
Cb = apply_preconditioner(prec, b)apply_preconditioner(prec::PreconditionerResult{T}, M::Matrix{T}) where {T}Apply preconditioner to matrix: compute C * M.
Arguments
prec: Preconditioner resultM: Matrix to multiply
Returns
C * M
apply_preconditioner(prec::PreconditionerResult, A::BallMatrix) -> BallMatrix
apply_preconditioner(prec::PreconditionerResult, b::BallVector) -> BallVectorThe preconditioned data C A and C b of Section 5.4 of Horáček (2019), formed in ball arithmetic with C = prec.preconditioner, so that the solution set of (CA) x = Cb contains that of A x = b whatever the accuracy of C.
BallArithmetic.is_well_preconditioned — Function
is_well_preconditioned(A::BallMatrix, prec::PreconditionerResult; threshold = 0.5) -> Booltrue when ‖I − C A‖_∞ < threshold is proved for every matrix A of the ball, with C = prec.preconditioner: the product is formed in ball arithmetic and its norm bounded from above. With threshold ≤ 1 this makes CA strictly diagonally dominant (Example 4.25 of Horáček (2019)) and gives the initial enclosure (5.4). false means that the bound was not established.
Overdetermined Systems
BallArithmetic.OverdeterminedResult — Type
OverdeterminedResult{VT}Result of the routines for overdetermined interval systems.
Fields
solution: a box containing the solution set (forinterval_least_squares, the set of least squares solutions) whencertifiedistrue; infinite radii otherwisecertified: whether a finite enclosure was obtainedunsolvable:truewhen the solution set is proved empty, by an empty intersection of enclosures;solutionis then meaninglessmethod: the method usedsubsystems_checked: number of square subsystems for which an enclosure was obtained
BallArithmetic.select_subsquares — Function
select_subsquares(m, n; overlap = round(Int, n/3), rng = nothing) -> Vector{Vector{Int}}Algorithm 6.14 of Horáček (2019): row index sets of square subsystems covering the m equations of an m × n system. The first is chosen at random; each following one takes overlap equations already covered and n − overlap not yet covered; the last takes the remaining ones and completes with covered ones. Their number is (6.5), 1 + ⌈(m − n)/(n − overlap)⌉. The thesis reports overlap ≈ n/3 as a reasonable choice.
BallArithmetic.subsquares_method — Function
subsquares_method(A::BallMatrix, b::BallVector; selection = :covering, k = 10,
overlap = round(Int, n/3), solver = :hbr, rng = nothing) -> OverdeterminedResultAlgorithm 6.12 of Horáček (2019), the simple subsquares algorithm, for a real overdetermined interval system. The solution set lies in the solution set of every square subsystem (Proposition 6.5), so:
- select square subsystems:
selection = :random,krandom ones, as in the algorithm;:covering, those ofselect_subsquares(Algorithm 6.14);:all, allbinomial(m, n); - enclose the solution set of each by a method for square systems,
solver = :hbr(hbr_method),:verifylssor:gaussian_elimination; - return the intersection of the enclosures;
- if the intersection is empty, the system has no solution:
unsolvable = true.
A subsquare for which the solver gives no enclosure is skipped. certified is false when none gives one.
BallArithmetic.multi_jacobi_method — Function
multi_jacobi_method(A::BallMatrix, b::BallVector; x0 = nothing, overlap = round(Int, n/3),
max_iterations = 20, tol = nothing, rng = nothing) -> OverdeterminedResultSection 6.8.3 of Horáček (2019), the multi-Jacobi method: subsquares are selected by Algorithm 6.14 (select_subsquares); then, instead of solving each, one iteration of the Jacobi method (Algorithm 5.15) is applied to every subsquare from the current global box, the global box is intersected with all the results, and this is repeated until the stopping criterion of Section 5.7.2 or max_iterations.
x0: a box containing the solution set.nothingtakes the HBR enclosure of a subsquare, as in Example 6.15 of the thesis (the first selected subsquare for which it exists).- Each subsquare is preconditioned by the floating-point inverse of its midpoint, the products formed in ball arithmetic. The thesis does not say how the diagonal of a subsquare is kept free of zero; this is the preconditioning of Section 5.4 applied to each subsquare.
An empty intersection proves that the system has no solution (unsolvable = true). certified is false when no initial box is found.
BallArithmetic.interval_least_squares — Function
interval_least_squares(A::BallMatrix, b::BallVector; method = :supersquare,
solver = :verifylss) -> OverdeterminedResultSection 6.2 of Horáček (2019): an enclosure of the set of least squares solutions (Definition 6.3)
Σ_lsq = {x : AᵀA x = Aᵀb for some A ∈ A, b ∈ b},whose hull contains that of the solution set of A x = b; the result is nonempty also when the system has no solution.
method = :supersquare: the square system of orderm + n[I A; Aᵀ 0] [y; x] = [b; 0],enclosed by
solver, a method for square systems (:verifylss,:hbror:gaussian_elimination); the partxis returned. The two occurrences of each entry ofAare treated as independent, which the thesis notes as a source of overestimation.method = :normal_equations: the interval normal equationAᵀA x = Aᵀb, with the products formed in ball arithmetic. The thesis warns that the overestimation of the product may be huge.
certified is false when the solver gives no enclosure.
H-Matrix Systems
BallArithmetic.VerifiedLinearSystemResult — Type
VerifiedLinearSystemResultThe result of verified_linear_solve_hmatrix.
solution: the ball vector with midpointx_approxand radiuserror_bound; whencertifiedit contains the solution of every system with data in the given balls;x_approx: the approximate solutionx̃;error_bound:εwith|Â⁻¹ b̂ − x̃| ≤ εentrywise, infinite when notcertified;certified: whether the hypothesis of the theorems was proved;method: the bound that was computed;R: the approximate inverse used;v: the positive vector with⟨C⟩ v > 0, empty when none was found.
The flag is called certified since version 0.4 and was called verified in 0.3.0; the old name still resolves, with a deprecation warning, and iscertified reads it in either version.
BallArithmetic.verified_linear_solve_hmatrix — Function
verified_linear_solve_hmatrix(A::BallMatrix, b::BallVector;
method = :theorem_3_3, m = 1, R = nothing, x_approx = nothing)An entrywise bound ε of the error of an approximate solution x̃ of a real linear system: |Â⁻¹ b̂ − x̃| ≤ ε for every matrix  in A and every vector b̂ in b, together with the proof that every such  is nonsingular. Returns a VerifiedLinearSystemResult; certified is false, and the bound infinite, when the hypothesis could not be proved.
The hypothesis, common to all four bounds: with R an approximate inverse and C a ball matrix containing R  for every  in A, there is a vector v > 0 with u := ⟨C⟩ v > 0, where ⟨C⟩ is the comparison matrix (see comparison_matrix). Then C is an H-matrix,  and R are nonsingular, and |(R Â)⁻¹| ≤ ⟨C⟩⁻¹ (Theorems 2.1 and 2.3, Remark 1). Write ⟨C⟩ = D − E with D the diagonal part, G := E D⁻¹, and c for an upper bound of |R (b̂ −  x̃)|.
method selects the bound:
:theorem_3_1(Rump):ε = (D⁻¹ + v wᵀ) cwithw_k := max_i G_ik / u_i, equation (3);:theorem_3_2(Minamihata, Sekine, Ogita, Rump and Oishi 2015):ε = (D⁻¹ + v wᵀ) (I − Σ_{k=1}^m (Δ^{2k−1} − Δ^{2k})) cwithΔ := u wᵀ − G, equation (4);:theorem_3_3(the default):ε = min_{1 ≤ k ≤ m} ε^(k),ε^(k) := D⁻¹ (c^(0) + … + c^(k−1)) + max_i (c^(k)_i / u_i) v, withc^(0) := candc^(k) := G c^(k−1), equations (5) and (6);:corollary_3_2:ε = D⁻¹ r + α vwithr := ⟨mid C⟩ |ỹ| + |mid(C) ỹ − R (b̂ − Â x̃)|,α := max_i (G r)_i / u_iandỹan approximate solution ofmid(C) y = R (b − A x̃), equation (17).
m is the number of terms in Theorems 3.2 and 3.3. R defaults to the floating-point inverse of mid(A) and x_approx to R mid(b).
How it is computed. C and the residual R (b − A x̃) are products and sums of balls, so they contain what they should for every point of A and b; the residual is formed in working precision. v is the floating-point solution of ⟨C⟩ v = (1, …, 1)ᵀ, the first of the two choices named in Section 3 of the paper, and u is then enclosed, its lower end being the one that has to be positive. The bounds of Theorems 3.1, 3.3 and of Corollary 3.2 are sums and products of nonnegative numbers, rounded upwards, with u replaced by its lower end where it divides. The bound of Theorem 3.2 has terms of both signs and is evaluated in balls, w being any vector with G ≤ u wᵀ, which is all its proof uses; the upper end is returned.
What is not reproduced. The paper distinguishes two enclosures of R A, Method (a) from two products with directed rounding and Method (b) from one product and the a priori bound 2 n u |R| |A|, and proposes Corollary 3.2 for the second. Here there is one enclosure, the ball product of the package, and each of the four bounds is applied to it (Remark 5 of the paper allows Corollary 3.2 on any enclosure); the comparison of costs between the two methods does not carry over.
Reference
A. Minamihata, T. Ogita, S. M. Rump and S. Oishi, "Modified error bounds for approximate solutions of dense linear systems", Journal of Computational and Applied Mathematics 369 (2020), 112546, doi 10.1016/j.cam.2019.112546.
BallArithmetic.comparison_matrix — Function
comparison_matrix(C::BallMatrix)The comparison matrix ⟨C⟩ of Definition 2.7 of Minamihata, Ogita, Rump and Oishi (2020), in floating point: mig of the entry on the diagonal, minus mag of the entry off it. Both are rounded so that the matrix returned is entrywise below the comparison matrix of C; a positive vector that it maps to a positive vector therefore proves that C is an H-matrix (Remark 1 there).
BallArithmetic.is_H_matrix — Function
is_H_matrix(A::BallMatrix) -> Booltrue when every matrix of the ball A, real or complex, is proved to be a nonsingular H-matrix: its comparison matrix M(A), with |a_ii| on the diagonal and −|a_ij| off it, is a nonsingular M-matrix (Varga (2004), Definition C.6), which makes A nonsingular (Proposition C.7 there). The test is that of is_M_matrix on the comparison matrices of the ball; false means that this was not proved.
Reference
R. S. Varga, Geršgorin and His Circles, Springer Series in Computational Mathematics 36, Springer, Berlin, 2004, doi 10.1007/978-3-642-17798-9 ([27]), Appendix C, (C.4), Definition C.6 and Proposition C.7.
Krawczyk Operator
BallArithmetic.krawczyk_linear_system — Function
krawczyk_linear_system(A::BallMatrix, b::BallVector; max_iterations = 20) -> KrawczykResultA verified enclosure of the solution of A x = b, for every matrix of the ball A and every vector of the ball b: verifylss, which is Algorithm 10.7 of Rump (2010), with its result in the fields of a KrawczykResult.
With R a floating-point inverse of the midpoint of A and x̃ = R mid(b), the algorithm iterates X ← Z + C·Y, Z ∋ R(b − Ax̃), C ∋ I − RA, Y an inflation of X, all in ball arithmetic, and stops when X is in the interior of Y; then A and R are nonsingular and the solution is in x̃ + X (Theorem 10.8 there). This is the iteration of Krawczyk (1969) for a linear system with the inflation of Rump.
certified is the success of that test. iterations is the number of iterations, contraction_factor an upper bound of ‖I − RA‖₂ (a diagnostic: the test may succeed when it is not below one), residual_norm an upper bound of ‖A x̂ − b‖₂ over the two balls for x̂ the midpoint of the returned enclosure. When certified is false the enclosure proves nothing.
The preconditioner and the approximate solution are those of the algorithm; the keywords R, x_approx and expansion_factor of earlier versions are gone with the code that used them, which formed I − RA in floating point and left the residual out of the inclusion test.
References
S. M. Rump, Verification methods: rigorous results using floating-point arithmetic, Acta Numerica 19 (2010), 287-449, doi 10.1017/S096249291000005X ([28]), Algorithm 10.7 and Theorem 10.8.
R. Krawczyk, Newton-Algorithmen zur Bestimmung von Nullstellen mit Fehlerschranken, Computing 4(3) (1969), 187-201, doi 10.1007/BF02234767 ([29]).
BallArithmetic.KrawczykResult — Type
KrawczykResult{T, VT}Result from Krawczyk verification method.
The flag is called certified since version 0.4 and was called verified in 0.3.0; the old name still resolves, with a deprecation warning, and iscertified reads it in either version.
Epsilon Inflation
BallArithmetic.verifylss — Function
verifylss(A::BallMatrix, b; method = :rump2010, r = 0.1, ϵ = 1e-20, iter_max = 20)
-> VerifyLssResultVerified enclosure of the solution of A x = b, with b a BallVector or a BallMatrix. When the returned certified is true, every matrix in the ball A is nonsingular and the enclosure contains the solution for every A ∈ A and b ∈ b; nonsingularity is a conclusion of the method, not a hypothesis.
This function selects an algorithm and does nothing else. Each algorithm is a separate unexported function named for the paper it implements:
method | routine | what it is |
|---|---|---|
:rump2010 | _rump2010_alg10_7 | Algorithm 10.7 of Rump (2010), the algorithm behind INTLAB's verifylss |
Reference
S. M. Rump, Verification methods: rigorous results using floating-point arithmetic, Acta Numerica 19 (2010) 287-449, doi 10.1017/S096249291000005X. Algorithm 10.7 and Theorem 10.8; Rump attributes the algorithm to Rump (1980).
BallArithmetic.VerifyLssResult — Type
VerifyLssResult{T, VT}Result from epsilon-inflation linear system verification.
Fields
solution::VT: Enclosure of the solution (BallVector or BallMatrix)certified::Bool: Whether the solution is mathematically certifiediterations::Int: Number of iterations performedspectral_radius_bound::T: Upper bound on ‖I - RA‖₂ (convergence requires < 1)condition_number::T: Approximate condition number of A
Convergence Diagnostics
If certified == false, check:
spectral_radius_bound ≥ 1: Iteration matrix doesn't contract, method cannot convergecondition_number > 1/eps(T): Matrix is numerically singulariterations == iter_max: May need more iterations or smaller inflation parameters
Sylvester Equations
BallArithmetic.sylvester_miyajima_enclosure — Function
sylvester_miyajima_enclosure(A, B, C, X̃)An entrywise enclosure of the solution X* of A X + X B = C, as a BallMatrix with midpoint X̃ (an approximate solution, in floating point) and radius X^ε with |X̃ − X*| ≤ X^ε. A (m×m), B (n×n) and C may be matrices or BallMatrix; with balls, the enclosure holds for the solution of every equation with data in them.
Theorems 1 and 2 of
S. Miyajima, Fast enclosure for solutions of Sylvester equations, Linear Algebra Appl. 439 (2013), 856–878, doi:10.1016/j.laa.2012.07.001 ([3]),
Section 2.1 (spectral decomposition). The block-diagonalisation variant of Section 2.2 (Theorems 3 and 4), the accelerations of Section 3 and the refinement of Section 4 are not implemented.
The statement
Let Ṽ_A, W_A (m×m), Ṽ_B, W_B (n×n) be any matrices and D̃_A, D̃_B diagonal; in practice A ≈ Ṽ_A D̃_A Ṽ_A⁻¹, Bᵀ ≈ Ṽ_B D̃_B Ṽ_B⁻¹, W_A ≈ Ṽ_A⁻¹, W_B ≈ Ṽ_B⁻¹, all computed in floating point. E is the m×n matrix of ones, ./ and |·| are entrywise, ‖·‖_∞ is the maximum row sum and ‖·‖_M the largest entry in modulus.
R_A = W_A(Ṽ_A D̃_A − A Ṽ_A), R_B = W_B(Ṽ_B D̃_B − Bᵀ Ṽ_B),
S_A = I − W_A Ṽ_A, S_B = I − W_B Ṽ_B,
T_A = |R_A| + ‖R_A‖_∞/(1 − ‖S_A‖_∞) |S_A|, T_B likewise,
T = T_A E + E T_Bᵀ, D̃ = D̃_A E + E D̃_B, T_D = T ./ |D̃|.Theorem 1. If ‖S_A‖_∞ < 1, ‖S_B‖_∞ < 1, D̃ has no zero entry and ‖T_D‖_M < 1, the equation has a unique solution X*.
With R = A X̃ + X̃ B − C, R_W = W_A R W_Bᵀ, and ρ_i(M), κ_j(M) the largest entry in modulus of row i and of column j,
R_W⁽¹⁾ = |R_W| + 1/(1 − ‖S_B‖_∞) · diag(ρ(R_W)) E |S_B|ᵀ,
R_V⁽¹⁾ = R_W⁽¹⁾ + 1/(1 − ‖S_A‖_∞) · |S_A| E diag(κ(R_W⁽¹⁾)),
R_W⁽²⁾ = |R_W| + 1/(1 − ‖S_A‖_∞) · |S_A| E diag(κ(R_W)),
R_V⁽²⁾ = R_W⁽²⁾ + 1/(1 − ‖S_B‖_∞) · diag(ρ(R_W⁽²⁾)) E |S_B|ᵀ,
R_V = min(R_V⁽¹⁾, R_V⁽²⁾), R_D = R_V ./ |D̃|,
U = R_D + ‖R_D‖_M/(1 − ‖T_D‖_M) · T_D.Theorem 2. Under the hypotheses of Theorem 1, |X̃ − X*| ≤ X^ε := |Ṽ_A| U |Ṽ_B|ᵀ.
R_V bounds |Ṽ_A⁻¹ R Ṽ_B⁻ᵀ|, the residual in the exact inverse frames, from R_W, the one in the computed W_A, W_B.
How it is evaluated
The products of matrices are ball products, of which the entrywise upper bound is taken. The products with E are row sums ((M E)_ij is the sum of row i of M), accumulated rounded up; |D̃_ij| is bounded from below; every other operation is rounded up. Throws ArgumentError when a hypothesis of Theorem 1 is not proved.
BallArithmetic.verified_sylvester_enclosure — Function
verified_sylvester_enclosure(A, B, C; X̃ = nothing, prefer_complex_schur = true)sylvester_miyajima_enclosure with the approximate solution computed by schur_sylvester_midpoint when X̃ is not given: an entrywise enclosure of the solution of A X + X B = C for every datum of the balls, by Theorems 1 and 2 of [3].
It throws ArgumentError when the hypotheses of that enclosure are not proved, as happens for a defective A or B; the message names the condition that failed, one of ‖S_A‖_∞ < 1, ‖S_B‖_∞ < 1, a zero spectral gap or ‖T_D‖_M < 1. The candidate X̃ enters the enclosure only through the residual, so its accuracy is not a hypothesis of the theorems and a X̃ of one's own may be passed.
BallArithmetic.triangular_sylvester_miyajima_enclosure — Function
triangular_sylvester_miyajima_enclosure(T, k; sylvester_fallback = :direct)For the upper triangular T = [T₁₁ T₁₂; 0 T₂₂] with T₁₁ of size k×k, an enclosure of the solution Y of
T₂₂* Y − Y T₁₁* = T₁₂*,that is of A Y + Y B = C with A = T₂₂*, B = −T₁₁*, C = T₁₂*. T is a matrix or a BallMatrix; with a ball the enclosure holds for every matrix in it, the radii entering the residuals (no perturbation expansion is used).
An approximate solution is computed column by column, and enclosed by sylvester_miyajima_enclosure. When that does not apply (its hypotheses are not proved, typically for large triangular matrices whose eigenvector matrix is ill conditioned), the enclosure comes from the triangular structure, which requires the radii of T below the diagonal to be zero:
sylvester_fallback = :direct: the column recurrence solved by forward substitution in ball arithmetic;sylvester_fallback = :residual: the residual of the approximate solution in ball arithmetic and, column by column from the last,(A + b_jj I) e_j = R_j − Σ_{l>j} e_l b_ljfor the errore_jof columnj, so‖e_j‖₂ ≤ ‖(A + b_jj I)⁻¹‖₂ (‖R_j‖₂ + Σ_{l>j} ‖e_l‖₂ |b_lj|), the norm of the inverse of the triangular matrix bounded as intriangular_inverse_two_norm_bound. The radius is uniform in each column.
BallArithmetic.SylvesterResolventResult — Type
SylvesterResolventResult{T}The quantities of the bound of parametric_resolvent_bound that do not depend on z, for the split T = [T₁₁ T₁₂; 0 T₂₂] at index k and an approximate solution X of T₁₁X − XT₂₂ = −T₁₂.
Fields
residual_norm: upper bound of‖R‖₂,R = T₁₂ + T₁₁X − XT₂₂coupling_norm: upper bound of‖T₁₂‖₂similarity_cond: upper bound ofκ₂(S(X))reduction_factor,net_penalty: the diagnosticsresidual_norm/coupling_normand its product withsimilarity_cond, in plain floating point; they enter no boundk,n: the split index and the size ofTcertified:truewhen the bounds were obtained;false, withfailure_reason, when the structure is not the required one orXis not finiteX: the matrixXusedR: aBallMatrixcontainingR
The flag is called certified since version 0.4 and was called precomputation_success in 0.3.0; the old name still resolves, with a deprecation warning, and iscertified reads it in either version.
BallArithmetic.parametric_resolvent_bound — Function
parametric_resolvent_bound(precomp, T, z, config = config_v1(); svd_warm_start = nothing)An upper bound of ‖(zI − T)⁻¹‖₂ for the block upper triangular matrix T with exact entries, through the similarity S(X) = [I X; 0 I] of precomp = sylvester_resolvent_precompute(T, k).
The bound
With S(X)⁻¹TS(X) = [T₁₁ R; 0 T₂₂], R = T₁₂ + T₁₁X − XT₂₂ (an identity for every X), A_z = zI − T₁₁ and D_z = zI − T₂₂,
(zI − T)⁻¹ = S(X) [A_z⁻¹ A_z⁻¹RD_z⁻¹; 0 D_z⁻¹] S(X)⁻¹,
‖(zI − T)⁻¹‖₂ ≤ κ₂(S(X)) ( ‖A_z⁻¹‖₂ + ‖D_z⁻¹‖₂ + ‖A_z⁻¹RD_z⁻¹‖₂ ).It is the bound for a block triangular matrix after a similarity, so it carries the condition number κ₂(S(X)) = ψ(‖X‖₂)² (psi_squared) where the bound computed directly on T carries none; in exchange the certified singular value computation is on the k×k block only.
The terms
‖A_z⁻¹‖₂ ≤ 1/σ,σa certified lower bound of the smallest singular value of the ball matrixzI − T₁₁(rigorous_svdwith the method ofconfig).‖D_z⁻¹‖₂by theDInverseEstimatorofconfig.‖A_z⁻¹RD_z⁻¹‖₂by theCouplingEstimatorofconfig.
The moduli |z − t_ii| are rounded down, R and the residuals of the approximate solves are ball matrices, and the scalar operations are rounded up.
Returns a ParametricResolventResult. T must be the matrix precomp was computed from.
parametric_resolvent_bound(precomp, T, z_list::AbstractVector, config = config_v1())The bound at each point of z_list.
parametric_resolvent_bound(T, k::Int, z, config = config_v1(); X_oracle = nothing)Precompute for the split k and evaluate at z (a point or a vector of points). Returns (precomp, result).
BallArithmetic.ParametricResolventResult — Type
ParametricResolventResult{T}The bound of parametric_resolvent_bound at a point z and its terms: resolvent_bound (upper bound of ‖(zI − T)⁻¹‖₂), K_S (of κ₂(S(X))), M_A (of ‖(zI − T₁₁)⁻¹‖₂), M_D (of ‖(zI − T₂₂)⁻¹‖₂), r (of ‖R‖₂) and coupling_term (of ‖(zI − T₁₁)⁻¹R(zI − T₂₂)⁻¹‖₂), with the config used. When certified is false the numbers are Inf and failure_reason says which step did not apply.
The flag is called certified since version 0.4 and was called success in 0.3.0; the old name still resolves, with a deprecation warning, and iscertified reads it in either version.
The Approximate Solution and the Triangular Route
The approximate solution that the enclosures take as their midpoint, computed in floating point with no bound attached, and the enclosure used for a triangular equation when the hypotheses of Miyajima's theorems are not proved.
BallArithmetic.schur_sylvester_midpoint — Function
schur_sylvester_midpoint(A, B, C; prefer_complex_schur = true)An approximate solution of A X + X B = C in floating point: Schur forms A = Q_A T_A Q_A* and B = Q_B T_B Q_B* reduce the equation to T_A Y + Y T_B = Q_A* C Q_B, which is solved by LinearAlgebra.sylvester, and the solution is transformed back as Q_A Y Q_B*. This is the construction of Bartels and Stewart.
prefer_complex_schur = true takes the Schur forms of the complexified data, which makes T_A and T_B triangular rather than quasi-triangular.
No bound comes with the result, and nothing here is verified: the reduction, the triangular solve and the two products are all in floating point. It is the default candidate of verified_sylvester_enclosure, which is where a bound is attached to it.
Reference
R. H. Bartels and G. W. Stewart, Algorithm 432: Solution of the matrix equation AX + XB = C, Comm. ACM 15(9) (1972), 820-826, doi 10.1145/361573.361582 ([30]).
BallArithmetic._sylvester_triangular_columns — Function
_sylvester_triangular_columns(A, B, C)An approximate solution of A X + X B = C in floating point, for A and B lower triangular, computed column by column in O(m²k) operations with m = size(A, 1) and k = size(B, 1).
Sweeping j = k, k−1, …, 1, the j-th column solves
(A + B[j,j] I) x_j = c_j − Σ_{l>j} x_l B[l,j],whose coefficient matrix is lower triangular, by _forward_substitution. No bound comes with the result: it is the midpoint that the enclosures of this file take as their candidate, and _sylvester_triangular_direct_ball is the same recurrence carried in ball arithmetic.
BallArithmetic._forward_substitution — Function
_forward_substitution(L, b)The solution of L x = b for a lower triangular L, by forward substitution in floating point.
Nothing is bounded here: the rounding of the substitution is not accounted for and L[i, i] is not tested, so a zero on the diagonal gives a non-finite result rather than an error. The verified counterpart, which returns an enclosure for a lower triangular BallMatrix, is forward_substitution.
BallArithmetic._sylvester_triangular_direct_ball — Function
_sylvester_triangular_direct_ball(A, B, C)An entrywise enclosure of the solution X of A X + X B = C, for A and B lower triangular, holding for every datum of the balls A, B and C.
It is the column recurrence of _sylvester_triangular_columns carried in ball arithmetic throughout: the right-hand side c_j − Σ_{l>j} x_l B[l,j] is formed from the enclosures of the columns already computed, the diagonal of A + B[j,j] I is a sum of balls, so its rounding goes into the radius, and the column is enclosed by forward_substitution on the resulting lower triangular BallMatrix.
Nothing is assumed about the eigenvectors of A or B, which is why this route remains available where the hypotheses of sylvester_miyajima_enclosure are not proved. Where a ball on the diagonal of A + B[j,j] I contains zero no enclosure exists, and forward_substitution raises an ArgumentError naming that ball.
BallArithmetic._has_distinct_diagonal — Function
_has_distinct_diagonal(A::AbstractMatrix, tol)true when |A[i,i] − A[j,j]| > tol for every i ≠ j.
The test is run in floating point on the entries as they stand, with no rounding accounted for, and tol is a threshold rather than a bound: true is not a proof that the diagonal of any nearby matrix is distinct. It is used only to decide whether the O(n²) substitution route of triangular_eigenvectors is taken instead of a dense eigen, a choice of method that does not enter any bound.
How the Two Inner Bounds Are Taken
BallArithmetic.NormEstimator — Type
NormEstimatorThe upper bound of the spectral norm used for the matrices of the approximate solves.
OneInfNorm:√(‖·‖₁‖·‖_∞)FrobeniusNorm:‖·‖_F
BallArithmetic.OneInfNorm — Constant
NormEstimator: the spectral norm bounded by √(‖·‖₁‖·‖_∞).
BallArithmetic.FrobeniusNorm — Constant
NormEstimator: the spectral norm bounded by the Frobenius norm.
BallArithmetic.DInverseEstimator — Type
DInverseEstimatorHow ‖D_z⁻¹‖₂ is bounded for the upper triangular D_z = zI − T₂₂.
TriBacksub: the recursion oftriangular_inverse_two_norm_boundNeumannOneInf:D_z = Δ(I + N)withΔthe diagonal ofD_zandN = Δ⁻¹(D_z − Δ), so that‖D_z⁻¹‖_p ≤ ‖Δ⁻¹‖_p/(1 − ‖N‖_p)when‖N‖_p < 1, forp = 1andp = ∞, combined by‖·‖₂ ≤ √(‖·‖₁‖·‖_∞)NeumannCollatz2: the same factorisation in the spectral norm,‖N‖₂bounded bycollatz_upper_bound_L2_opnormapplied to an entrywise upper bound of|N|
BallArithmetic.TriBacksub — Constant
DInverseEstimator: ‖D_z⁻¹‖₂ by the recursion of triangular_inverse_two_norm_bound.
BallArithmetic.NeumannOneInf — Constant
DInverseEstimator: ‖D_z⁻¹‖₂ by the Neumann bound for D_z = Δ(I + N) in the norms 1 and ∞, combined by ‖·‖₂ ≤ √(‖·‖₁‖·‖_∞).
BallArithmetic.NeumannCollatz2 — Constant
DInverseEstimator: ‖D_z⁻¹‖₂ by the Neumann bound for D_z = Δ(I + N) in the spectral norm, ‖N‖₂ bounded by collatz_upper_bound_L2_opnorm.
BallArithmetic.CouplingEstimator — Type
CouplingEstimatorHow the off-diagonal term ‖A_z⁻¹ R D_z⁻¹‖₂ is bounded.
CouplingNone:‖A_z⁻¹‖₂‖R‖₂‖D_z⁻¹‖₂CouplingARSolve:‖A_z⁻¹R‖₂‖D_z⁻¹‖₂, withA_z⁻¹R = Y + A_z⁻¹(R − A_zY)for an approximate solutionYofA_zY = R, so‖A_z⁻¹R‖₂ ≤ ‖Y‖₂ + ‖A_z⁻¹‖₂‖R − A_zY‖₂CouplingOffDirect:A_z⁻¹RD_z⁻¹ = W + A_z⁻¹(R − A_zWD_z)D_z⁻¹for an approximateW, so the term is at most‖W‖₂ + ‖A_z⁻¹‖₂‖R − A_zWD_z‖₂‖D_z⁻¹‖₂
In the last two the residual is computed in ball arithmetic; when the approximate solve does not return finite numbers the first bound is used.
BallArithmetic.CouplingNone — Constant
CouplingEstimator: ‖A_z⁻¹RD_z⁻¹‖₂ ≤ ‖A_z⁻¹‖₂‖R‖₂‖D_z⁻¹‖₂.
BallArithmetic.CouplingARSolve — Constant
CouplingEstimator: ‖A_z⁻¹RD_z⁻¹‖₂ ≤ ‖A_z⁻¹R‖₂‖D_z⁻¹‖₂, with ‖A_z⁻¹R‖₂ bounded through an approximate solution of A_zY = R and its residual in ball arithmetic.
BallArithmetic.CouplingOffDirect — Constant
CouplingEstimator: ‖A_z⁻¹RD_z⁻¹‖₂ bounded through an approximate W of A_zWD_z = R and the residual R − A_zWD_z in ball arithmetic.
Matrix Regularity
BallArithmetic.RegularityResult — Type
RegularityResult{T}Result of a regularity test.
Fields
certified::Bool:truewhen regularity is proved;falsewhen the test is inconclusivemethod::Symbol: the condition that was tried lastcertificate::T: the quantity compared in that condition, as described by each routine
The conditions are sufficient: certified = false does not say that the matrix is singular.
The flag is called certified since version 0.4 and was called is_regular in 0.3.0; the old name still resolves, with a deprecation warning, and iscertified reads it in either version.
BallArithmetic.is_regular — Function
is_regular(A::BallMatrix; methods = [:diagonal_dominance, :gershgorin, :h_matrix,
:sufficient_condition, :spectral_radius], verbose = false) -> RegularityResultTry the sufficient conditions for regularity in the given order and return the first that proves it, or the last result when none does. :h_matrix is is_H_matrix (an H-matrix is regular, Section 4.4 of Horáček (2019)); the others are the routines of this file. Every one of them is sufficient only, so a certified = false result from all of them leaves the question open.
Reference
J. Horáček, Interval linear and nonlinear systems, doctoral thesis, Charles University, Department of Applied Mathematics, Prague, 2019 ([26]), Section 4.4.
BallArithmetic.is_regular_sufficient_condition — Function
is_regular_sufficient_condition(A::BallMatrix; condition = 1) -> RegularityResultTheorem 11.12 of Horáček (2019): the interval matrix A is regular if
λ_max(A_Δᵀ A_Δ) < λ_min(A_cᵀ A_c)(condition = 1), orA_cᵀ A_c − ‖A_Δᵀ A_Δ‖ Iis positive definite for some consistent matrix norm (condition = 2, evaluated with the ∞-norm).
Both are evaluated through singular values: λ_min(A_cᵀ A_c) = σ_min(A_c)² ≥ 1/b² with b ≥ ‖A_c⁻¹‖₂ from svd_bound_L2_opnorm_inverse, and λ_max(A_Δᵀ A_Δ) ≤ ν² with ν ≥ ‖A_Δ‖₂ from upper_bound_L2_opnorm, or, for the second condition, an upper bound of ‖A_Δᵀ A_Δ‖_∞ computed in ball arithmetic. The certificate is a lower bound of the difference of the two sides, and regularity is proved when it is positive.
The thesis states the theorem for real interval matrices. For a complex ball matrix the first condition still implies regularity, since σ_min(A_c + E) ≥ σ_min(A_c) − ‖E‖₂ and ‖E‖₂ ≤ ‖A_Δ‖₂ for |E| ≤ A_Δ; the second is weaker than the first.
Reference
J. Horáček, Interval linear and nonlinear systems, doctoral thesis, Charles University, Department of Applied Mathematics, Prague, 2019 ([26]), Theorem 11.12.
BallArithmetic.is_regular_gershgorin — Function
is_regular_gershgorin(A::BallMatrix) -> RegularityResultRegularity from the Geršgorin discs of the rows or of the columns: if zero lies outside every row disc of every matrix of the ball, or outside every column disc, the matrix is regular. For the rows this is strict diagonal dominance (is_regular_diagonal_dominance); for the columns it is the same condition on the transpose. The certificate is the larger of the two margins, and the condition is sufficient only.
Reference
J. Horáček, Interval linear and nonlinear systems, doctoral thesis, Charles University, Department of Applied Mathematics, Prague, 2019 ([26]), Definition 4.24 and Section 4.5.
BallArithmetic.is_regular_diagonal_dominance — Function
is_regular_diagonal_dominance(A::BallMatrix) -> RegularityResultDefinition 4.24 of Horáček (2019): A is strictly diagonally dominant when
mig(a_ii) > Σ_{k ≠ i} mag(a_ik) for every i,with mig and mag the smallest and the largest modulus over an entry. Such a matrix is an H-matrix and therefore regular (Section 4.5 of the thesis). The certificate is a lower bound of the smallest difference of the two sides over the rows, and the condition is sufficient only.
Reference
J. Horáček, Interval linear and nonlinear systems, doctoral thesis, Charles University, Department of Applied Mathematics, Prague, 2019 ([26]), Definition 4.24 and Section 4.5.
BallArithmetic.is_regular_spectral_radius — Function
is_regular_spectral_radius(A::BallMatrix; R = nothing) -> RegularityResultTheorem 4.2 of Horáček (2019): a square interval matrix A is regular if for some real matrix R
ϱ(|I − R A_c| + |R| A_Δ) < 1.R = nothing takes the floating-point inverse of the midpoint, which need not be exact: the theorem holds for any R. The matrix |I − R A_c| + |R| A_Δ is bounded above entrywise in ball arithmetic and its spectral radius by collatz_upper_bound; the certificate is that bound, and regularity is proved when it is below one. With R = A_c⁻¹ the condition is ϱ(|A_c⁻¹| A_Δ) < 1, strong regularity (Theorem 4.33 of the thesis). The condition is sufficient only: certified = false does not say that the ball contains a singular matrix.
Reference
J. Horáček, Interval linear and nonlinear systems, doctoral thesis, Charles University, Department of Applied Mathematics, Prague, 2019 ([26]), Theorem 4.2 and Theorem 4.33.
BallArithmetic.is_singular_sufficient_condition — Function
is_singular_sufficient_condition(A::BallMatrix; conditions = 1:4) -> BoolTheorem 11.13 of Horáček (2019): a real interval matrix A is singular, that is, it contains a singular matrix, if at least one of the following holds:
λ_max(A_cᵀ A_c) ≤ λ_min(A_Δᵀ A_Δ);max_j (|A_c⁻¹| A_Δ)_jj ≥ 1;(A_Δ − |A_c|)⁻¹ ≥ 0;A_Δᵀ A_Δ − A_cᵀ A_cis positive semidefinite.
Returns true when one of the conditions listed in conditions is proved, false otherwise, which does not mean that the matrix is regular. How each is evaluated:
- as
‖A_c‖₂ ‖A_Δ⁻¹‖₂ ≤ 1with upper bounds of the two norms; - with an enclosure of
A_c⁻¹byverifylss, the moduli of its entries bounded from below and the products withA_Δrounded down; - with an enclosure of the inverse of the ball matrix
A_Δ − |A_c|(the subtraction is rounded) byverifylss, all of whose lower ends must be nonnegative; an inverse with an entry equal to zero is therefore not recognised; - with enclosures of the eigenvalues of the symmetric ball matrix
A_Δᵀ A_Δ − A_cᵀ A_cbyverifyeigallon thatHermitianBallMatrix(Rump and Lange 2023), all of whose lower ends must be nonnegative.
Reference
J. Horáček, Interval linear and nonlinear systems, doctoral thesis, Charles University, Department of Applied Mathematics, Prague, 2019 ([26]), Theorem 11.13.
Determinant Bounds
BallArithmetic.DeterminantResult — Type
DeterminantResultResult of a determinant enclosure.
Fields
determinant::Ball: a ball containingdet(A)for every matrixAof the input; radiusInfwhere the method gives no boundmethod::Symbol: the method used
BallArithmetic.interval_det — Function
interval_det(A::BallMatrix; method = :auto) -> DeterminantResultAn enclosure of the determinant of the interval matrix A by
:gaussian_elimination: Section 8.4.1 of Horáček (2019), the product of the diagonal of the row echelon form (interval_gaussian_elimination_det);:gershgorin:det_gershgorin;:hadamard:det_hadamard;:cramer:det_cramer;:cofactor:det_cofactor;:auto: the cofactor expansion for orders up to three; above, Gaussian elimination for a real matrix and:cramerfor a complex one, the elimination being for real matrices.
BallArithmetic.det_hadamard — Function
det_hadamard(A::BallMatrix) -> DeterminantResultSection 8.4.3 of Horáček (2019): by Hadamard's inequality, for every matrix of the interval matrix A,
|det(A)| ≤ d = ∏_i ( Σ_j mag(A_ji)² )^(1/2),the product of the largest Euclidean norms of the columns. The same holds with the rows, and the smaller of the two bounds is returned, as the ball of centre zero and radius d. The sign of the determinant cannot be detected in this way. Real or complex input.
BallArithmetic.det_gershgorin — Function
det_gershgorin(A::BallMatrix) -> DeterminantResultSection 8.4.2 of Horáček (2019), for a real interval matrix. Every eigenvalue of every matrix of A lies in an interval Gerschgorin disc, of centre mid(A_ii) and radius rad(A_ii) + Σ_{j≠i} mag(A_ij), and a group of k discs whose union is connected (a "bunch") contains k eigenvalues. With [a, b] the projection of a bunch on the real axis, the product of its k eigenvalues lies in the interval of Figures 8.3 and 8.4 of the thesis:
[a, b]for one disc;[a^k, b^k]whena > 0; whenb < 0,[a^k, b^k]for oddkand[b^k, a^k]for evenk;- when
a ≤ 0 ≤ band|a| ≤ |b|,[a b^(k−1), b^k]; - when
a ≤ 0 ≤ band|a| > |b|,[a^(k−1) b, a^k]for evenkand[a^k, a^(k−1) b]for oddk.
Complex eigenvalues come in conjugate pairs and the product of a pair, the square of its modulus, lies between the squares of the smallest and the largest modulus of [a, b] (Figure 8.5), so the same intervals hold. The determinant is enclosed by the product of the intervals of the bunches. The ends of the discs and the powers are rounded outwards.
The thesis remarks that the overestimation may be large, and that the method suits tight intervals or a matrix close to a diagonal one. Throws on complex input, where the discs are not centred on the real axis.
BallArithmetic.det_cramer — Function
det_cramer(A::BallMatrix) -> DeterminantResultSection 8.4.4 of Horáček (2019). By Cramer's rule the first coefficient of the solution of A x = e₁ is x₁ = det(A_{2:n})/det(A), with A_{2:n} the matrix without its first row and column, so that (8.3)
det(A) ⊆ det(A_{2:n}) / x₁for an enclosure x₁ of that coefficient over the interval matrix. The rule is applied recursively down to order one. The enclosure of x₁ is that of verifylss. The method works when no enclosure of x₁ in the recursion contains zero and every solve is certified; otherwise the returned ball has radius Inf.
BallArithmetic.det_cofactor — Function
det_cofactor(A::BallMatrix) -> DeterminantResultThe Laplace expansion of the determinant along the first row, evaluated in ball arithmetic. It is not a method of the thesis; its cost is n!, and it is used by interval_det for orders up to three. For order two each entry occurs once in the formula, so the only overestimation is that of the ball product.
BallArithmetic.contains_zero — Function
contains_zero(det_result::DeterminantResult) -> BoolWhether zero lies in the enclosure of the determinant. false proves that the interval matrix is regular; true proves nothing.