Skip to content

Commit bce5c92

Browse files
authored
Fix ambiguity in Diagonal(::Fill) * InfToeplitz (#214)
1 parent 4bed11c commit bce5c92

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "InfiniteArrays"
22
uuid = "4858937d-0d70-526a-a4dd-2d5cb5dd786c"
3-
version = "0.15.4"
3+
version = "0.15.5"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"

ext/InfiniteArraysBandedMatricesExt.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,15 @@ mulreduce(M::Mul{<:InfToeplitzLayouts,<:PaddedColumns}) = MulAdd(M)
398398
mulreduce(M::Mul{<:Any, <:InfToeplitzLayouts}) = ApplyArray(M)
399399
mulreduce(M::Mul{<:AbstractQLayout, <:InfToeplitzLayouts}) = ApplyArray(M)
400400
simplifiable(::Mul{<:DiagonalLayout, <:InfToeplitzLayouts}) = Val(true)
401+
simplifiable(::Mul{<:DiagonalLayout{<:AbstractFillLayout}, <:InfToeplitzLayouts}) = Val(true)
401402
simplifiable(::Mul{<:InfToeplitzLayouts, <:DiagonalLayout}) = Val(true)
403+
simplifiable(::Mul{<:InfToeplitzLayouts, <:DiagonalLayout{<:AbstractFillLayout}}) = Val(true)
402404
mulreduce(M::Mul{<:DiagonalLayout, <:InfToeplitzLayouts}) = Lmul(M)
403405
mulreduce(M::Mul{<:InfToeplitzLayouts, <:DiagonalLayout}) = Rmul(M)
404406
copy(M::Mul{<:DiagonalLayout, <:InfToeplitzLayouts}) = copy(mulreduce(M))
407+
copy(M::Mul{<:DiagonalLayout{<:AbstractFillLayout}, <:InfToeplitzLayouts}) = copy(mulreduce(M))
405408
copy(M::Mul{<:InfToeplitzLayouts, <:DiagonalLayout}) = copy(mulreduce(M))
409+
copy(M::Mul{<:InfToeplitzLayouts, <:DiagonalLayout{<:AbstractFillLayout}}) = copy(mulreduce(M))
406410
copy(M::Mul{<:InfToeplitzLayouts, <:DiagonalLayout{<:OnesLayout}}) = _copy_oftype(M.A, eltype(M))
407411
copy(M::Mul{<:DiagonalLayout{<:OnesLayout}, <:InfToeplitzLayouts}) = _copy_oftype(M.B, eltype(M))
408412

test/test_infbanded.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,19 @@ const InfBandCartesianIndices = InfiniteArraysBandedMatricesExt.InfBandCartesian
107107
@testset "Toep * Diag" begin
108108
A = BandedMatrix(1 => Fill(2im,∞), 2 => Fill(-1,∞), 3 => Fill(2,∞), -2 => Fill(-4,∞), -3 => Fill(-2im,∞))
109109
D = Diagonal(1:∞)
110+
F = Diagonal(Fill(2,∞))
110111
@test D*A isa BroadcastMatrix
111112
@test A*D isa BroadcastMatrix
113+
@test F*A isa BandedMatrix
114+
@test A*F isa BandedMatrix
115+
@test Eye(∞)*A isa BandedMatrix
116+
@test A*Eye(∞) isa BandedMatrix
112117
@test simplifiable(*, D, A) == Val(true)
113118
@test simplifiable(*, A, D) == Val(true)
119+
@test simplifiable(*, F, A) == Val(true)
120+
@test simplifiable(*, A, F) == Val(true)
121+
@test simplifiable(*, Eye(∞), A) == Val(true)
122+
@test simplifiable(*, A, Eye(∞)) == Val(true)
114123
end
115124

116125
@testset "change bands" begin

0 commit comments

Comments
 (0)