From 33a160efd68f59fbd0fcb47b7acac20e769e1f37 Mon Sep 17 00:00:00 2001 From: DanielVandH Date: Fri, 5 Jul 2024 13:53:57 +0100 Subject: [PATCH] Ambiguities on LTS --- src/ArrayLayouts.jl | 2 ++ test/test_layoutarray.jl | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ArrayLayouts.jl b/src/ArrayLayouts.jl index 500d870..586898e 100644 --- a/src/ArrayLayouts.jl +++ b/src/ArrayLayouts.jl @@ -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) diff --git a/test/test_layoutarray.jl b/test/test_layoutarray.jl index a99d2d7..b0942f8 100644 --- a/test/test_layoutarray.jl +++ b/test/test_layoutarray.jl @@ -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