Skip to content

Commit

Permalink
Merge pull request #255 from JuliaReach/schillic/240
Browse files Browse the repository at this point in the history
Fix ambiguities with matrix multiplication
  • Loading branch information
schillic authored Sep 9, 2024
2 parents 744ab9c + dbeb52e commit 3ea3db0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
12 changes: 9 additions & 3 deletions src/operations/mult.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ function set_multiplication_mode(multype)
type = MultiplicationType{multype}()
@eval *(A::IntervalMatrix, B::IntervalMatrix) = *($type, A, B)

@eval *(A::AbstractMatrix, B::IntervalMatrix) = *($type, A, B)

@eval *(A::IntervalMatrix, B::AbstractMatrix) = *($type, A, B)
# AbstractMatrix, incl. disambiguations
for T in (:AbstractMatrix, :(LinearAlgebra.AbstractTriangular),
:(Transpose{T, <:AbstractVector} where T), :Diagonal,
:(LinearAlgebra.Adjoint{T, <:AbstractVector} where T))
@eval begin
*(A::IntervalMatrix, B::$T) = *($type, A, B)
*(A::$T, B::IntervalMatrix) = *($type, A, B)
end
end

return config[:multiplication] = multype
end
Expand Down
8 changes: 4 additions & 4 deletions test/Aqua.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import PkgVersion, Aqua
end

Aqua.test_all(IntervalMatrices; stale_deps=stale_deps, undefined_exports=undefined_exports,
# the ambiguities should be resolved in the future
ambiguities=(broken=true,),
# the piracies should be resolved in the future
piracies=piracies)
ambiguities=false, piracies=piracies)

# do not warn about ambiguities in dependencies
Aqua.detect_ambiguities(IntervalMatrices)
end

0 comments on commit 3ea3db0

Please sign in to comment.