Skip to content

Commit

Permalink
Fix ambiguity copy(::Mul{<:LazyLayout, <:BandedLayout}) (#331)
Browse files Browse the repository at this point in the history
* Fix ambiguity

* Fix cov

* arraylayouts
  • Loading branch information
DanielVandH authored Jul 4, 2024
1 parent a7df659 commit f2ed399
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
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 @@ const BandedLazyLayouts = Union{AbstractLazyBandedLayout, BandedColumns{LazyLayo
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)
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

2 comments on commit f2ed399

@dlfivefifty
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/110430

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v2.1.4 -m "<description of version>" f2ed39925bad206351cd4fd7c0978310aacd52cc
git push origin v2.1.4

Please sign in to comment.