Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ambiguity copy(::Mul{<:LazyLayout, <:BandedLayout}) #331

Merged
merged 4 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "LazyArrays"
uuid = "5078a376-72f3-5289-bfd5-ec5146d43c02"
version = "2.1.3"
version = "2.1.4"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Expand All @@ -27,7 +27,7 @@ LazyArraysStaticArraysExt = "StaticArrays"

[compat]
Aqua = "0.8"
ArrayLayouts = "1.10"
ArrayLayouts = "1.10.1"
BandedMatrices = "1.6.2"
Base64 = "1"
BlockArrays = "1.0"
Expand Down
1 change: 1 addition & 0 deletions ext/LazyArraysBandedMatricesExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@
copy(M::Mul{<:BandedLazyLayouts, <:BandedLazyLayouts}) = simplify(M)
copy(M::Mul{<:BandedLazyLayouts}) = simplify(M)
copy(M::Mul{<:BandedLazyLayouts, <:LazyLayouts}) = simplify(M)
copy(M::Mul{<:LazyLayouts, <:BandedLazyLayouts}) = simplify(M)

Check warning on line 550 in ext/LazyArraysBandedMatricesExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/LazyArraysBandedMatricesExt.jl#L550

Added line #L550 was not covered by tests
copy(M::Mul{<:Any, <:BandedLazyLayouts}) = simplify(M)
copy(M::Mul{<:BandedLazyLayouts, <:AbstractLazyLayout}) = simplify(M)
copy(M::Mul{<:AbstractLazyLayout, <:BandedLazyLayouts}) = simplify(M)
Expand Down
9 changes: 8 additions & 1 deletion test/multests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Test, LinearAlgebra, LazyArrays, StaticArrays, FillArrays, Base64, Random
using Test, LinearAlgebra, LazyArrays, StaticArrays, FillArrays, Base64, Random, BandedMatrices
import LazyArrays: MulAdd, MemoryLayout, DenseColumnMajor, DiagonalLayout, SymTridiagonalLayout, Add, AddArray,
MulStyle, MulAddStyle, Applied, ApplyStyle, Lmul, ApplyArrayBroadcastStyle, DefaultArrayApplyStyle,
Rmul, ApplyLayout, arguments, colsupport, rowsupport, lazymaterialize
Expand Down Expand Up @@ -1180,3 +1180,10 @@ end
@test LazyArrays.simplify(Applied(*, A, A)) == A*A
end
end

@testset "Issue #330" begin
A = UpperTriangular(ApplyArray(inv, rand(5, 5)))
v1, v2 = ApplyVector(+, rand(5), rand(5)), ApplyVector(+, rand(4), rand(4))
B = Tridiagonal(v2, v1, v2)
@test copy(Mul(A, B)) ≈ Matrix(A) * Matrix(B)
end
Loading