Skip to content

Commit 74aa788

Browse files
committed
tests for banded * diagonal
1 parent 0f9c465 commit 74aa788

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/InfiniteLinearAlgebra.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import BlockBandedMatrices: _BlockSkylineMatrix, _BandedMatrix, AbstractBlockSiz
2323

2424

2525
# Fix ∞ BandedMatrix
26-
ApplyStyle(::typeof(*), ::Type{<:BandedMatrix{<:Any,<:Any,<:OneToInf}}, _::Type{<:AbstractArray}...) =
27-
LazyArrayApplyStyle()
26+
# ApplyStyle(::typeof(*), ::Type{<:BandedMatrix{<:Any,<:Any,<:OneToInf}}, _::Type{<:AbstractArray}...) =
27+
# LazyArrayApplyStyle()
2828

2929
# BroadcastStyle(::Type{<:BandedMatrix{<:Any,<:Any,<:OneToInf}}) = LazyArrayStyle{2}()
3030

test/runtests.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,26 @@ import BandedMatrices: bandeddata, _BandedMatrix
4747
@test (A^2)[1:10,1:10] == (A*A)[1:10,1:10] == (A[1:100,1:100]^2)[1:10,1:10]
4848
@test (A^3)[1:10,1:10] == (A*A*A)[1:10,1:10] == (A[1:100,1:100]^3)[1:10,1:10]
4949

50+
@testset "Diagonal" begin
51+
A = _BandedMatrix(Ones(1,∞),∞,-1,1)
52+
@test 1.0 .* A isa BandedMatrix{Float64,<:Fill}
53+
@test_skip Ones(∞) .* A
54+
@test 2.0 .* A isa BandedMatrix{Float64,<:Fill}
55+
@test A .* 2.0 isa BandedMatrix{Float64,<:Fill}
56+
@test Eye(∞)*A isa BandedMatrix{Float64,<:Fill}
57+
@test A*Eye(∞) isa BandedMatrix{Float64,<:Fill}
58+
A = _BandedMatrix((1:∞)',∞,-1,1)
59+
@test 2.0 .* A isa BandedMatrix{Float64,<:Adjoint}
60+
@test A .* 2.0 isa BandedMatrix{Float64,<:Adjoint}
61+
@test Eye(∞)*A isa BandedMatrix{Float64,<:Adjoint}
62+
@test A*Eye(∞) isa BandedMatrix{Float64,<:Adjoint}
63+
A = _BandedMatrix(Vcat((1:∞)',Ones(1,∞)),∞,0,1)
64+
@test 2.0 .* A isa BandedMatrix
65+
@test A .* 2.0 isa BandedMatrix
66+
@test Eye(∞) * A isa BandedMatrix
67+
@test A * Eye(∞) isa BandedMatrix
68+
end
69+
5070
@testset "Triangle OP recurrences" begin
5171
mortar((n -> 1:n).(1:∞))
5272
end

0 commit comments

Comments
 (0)