Skip to content

Commit

Permalink
fix ambiguities with matrix multiplication
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Sep 9, 2024
1 parent b915821 commit 2de78d1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 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
6 changes: 4 additions & 2 deletions test/Aqua.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ 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,),
ambiguities=false,
# the piracies should be resolved in the future
piracies=(broken=true,))

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

0 comments on commit 2de78d1

Please sign in to comment.