Skip to content

Commit 7a146a8

Browse files
authored
ambiguity in copy with banded * diagonal (#384)
* ambiguity in copy with banded * diagonal * Update bandedtests.jl
1 parent 04d24fb commit 7a146a8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

ext/LazyArraysBandedMatricesExt.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,7 @@ simplifiable(M::Mul{<:Union{AbstractStridedLayout,DualLayout{<:AbstractStridedLa
647647
simplifiable(M::Mul{<:BandedLayouts, <:AbstractStridedLayout}) = Val(true)
648648

649649
copy(L::Ldiv{ApplyBandedLayout{typeof(*)}, Lay}) where Lay = copy(Ldiv{ApplyLayout{typeof(*)},Lay}(L.A, L.B))
650+
copy(L::Ldiv{ApplyBandedLayout{typeof(*)}, Lay}) where Lay<:DiagonalLayout = copy(Ldiv{ApplyLayout{typeof(*)},Lay}(L.A, L.B))
650651
copy(L::Ldiv{ApplyBandedLayout{typeof(*)}, Lay}) where {Lay<:AbstractLazyLayout} = copy(Ldiv{ApplyLayout{typeof(*)},Lay}(L.A, L.B))
651652
copy(L::Ldiv{ApplyBandedLayout{typeof(*)}, Lay}) where Lay<:BroadcastBandedLayout = copy(Ldiv{ApplyLayout{typeof(*)},Lay}(L.A, L.B))
652653
copy(L::Ldiv{ApplyBandedLayout{typeof(*)}, Lay}) where Lay<:Union{PaddedColumns,AbstractStridedLayout} = copy(Ldiv{ApplyLayout{typeof(*)},Lay}(L.A, L.B))

test/bandedtests.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,14 @@ LinearAlgebra.lmul!(β::Number, A::PseudoBandedMatrix) = (lmul!(β, A.data); A)
959959
@test rowsupport(invL, 1) == 1:1
960960
@test rowsupport(invL, 4) == 1:4
961961
end
962+
963+
@testset "banded \\ diagonal (#384)" begin
964+
B = brand(5,5,2,1)
965+
A = ApplyArray(*, B, B)
966+
D = Diagonal(1:5)
967+
@test A\D (B*B)\D
968+
@test D\A D\(B*B)
969+
end
962970
end
963971

964972
end # module

0 commit comments

Comments
 (0)