Skip to content

Commit

Permalink
Merge pull request #246 from JuliaReach/schillic/240
Browse files Browse the repository at this point in the history
Fix ambiguities with `\`
  • Loading branch information
schillic authored Sep 9, 2024
2 parents 15eac87 + 948e800 commit 6cb7281
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/operations/arithmetic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@
# 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)
Expand Down

0 comments on commit 6cb7281

Please sign in to comment.