From 948e8007af97c54572a0aa8c571b8f01f022bb35 Mon Sep 17 00:00:00 2001 From: schillic Date: Tue, 5 Mar 2024 20:49:01 +0100 Subject: [PATCH] fix ambiguities with \ --- src/operations/arithmetic.jl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/operations/arithmetic.jl b/src/operations/arithmetic.jl index 32a3b6c4..6e7dc41a 100644 --- a/src/operations/arithmetic.jl +++ b/src/operations/arithmetic.jl @@ -35,8 +35,14 @@ import Base: +, -, *, /, \ # left-division methods to avoid a stack overflow with the default behavior # (there exist more precise approaches but are currently not implemented here) \(M1::IntervalMatrix, M2::IntervalMatrix) = IntervalMatrix(M1.mat \ M2.mat) -\(M1::IntervalMatrix, M2::AbstractMatrix) = IntervalMatrix(M1.mat \ M2) -\(M1::AbstractMatrix, M2::IntervalMatrix) = IntervalMatrix(M1 \ M2.mat) +for T in (:AbstractMatrix, :Diagonal, :(Union{UpperTriangular,LowerTriangular}), + :(Union{UnitUpperTriangular,UnitLowerTriangular}), :SymTridiagonal, :Bidiagonal, + :(LinearAlgebra.HermOrSym), :(LinearAlgebra.AdjOrTrans{<:Any,<:Bidiagonal})) + @eval begin + \(M1::IntervalMatrix, M2::$T) = IntervalMatrix(M1.mat \ M2) + \(M1::$T, M2::IntervalMatrix) = IntervalMatrix(M1 \ M2.mat) + end +end """ square(A::IntervalMatrix)