Skip to content

Commit

Permalink
Ambiguities on LTS
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVandH committed Jul 5, 2024
1 parent b04f5bf commit 33a160e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/ArrayLayouts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ end
*(A::Diagonal{<:Any,<:LayoutVector}, B::Diagonal{<:Any,<:LayoutVector}) = mul(A, B)
*(A::Diagonal{<:Any,<:LayoutVector}, B::AbstractMatrix) = mul(A, B)
*(A::AbstractMatrix, B::Diagonal{<:Any,<:LayoutVector}) = mul(A, B)
*(A::Union{Bidiagonal, Tridiagonal}, B::Diagonal{<:Any, <:LayoutVector}) = mul(A, B) # ambiguity
*(A::Diagonal{<:Any, <:LayoutVector}, B::Union{Bidiagonal, Tridiagonal}) = mul(A, B) # ambiguity
*(A::Diagonal{<:Any,<:LayoutVector}, B::LayoutMatrix) = mul(A, B)
*(A::LayoutMatrix, B::Diagonal{<:Any,<:LayoutVector}) = mul(A, B)
*(A::UpperTriangular, B::Diagonal{<:Any,<:LayoutVector}) = mul(A, B)
Expand Down
6 changes: 3 additions & 3 deletions test/test_layoutarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -625,10 +625,10 @@ using .InfiniteArrays
tup = InfSymTridiagonal(), InfTridiagonal(), InfBidiagonal('U'),
InfBidiagonal('L'),
InfUnitUpperTriangular(), InfUnitLowerTriangular(),
InfUpperTriangular(), InfLowerTriangular(), InfDiagonal()
for A in tup
InfUpperTriangular(), InfLowerTriangular(), InfDiagonal();
for (i, A) in enumerate(tup)
A_up, A_lo = A isa Union{UpperTriangular,UnitUpperTriangular}, A isa Union{LowerTriangular,UnitLowerTriangular}
for B in tup
for (j, B) in enumerate(tup)
B_up, B_lo = B isa Union{UpperTriangular,UnitUpperTriangular}, B isa Union{LowerTriangular,UnitLowerTriangular}
((A_up && B_lo) || (A_lo && B_up)) && continue
C = A * B
Expand Down

0 comments on commit 33a160e

Please sign in to comment.