Skip to content

Commit f2ed399

Browse files
authored
Fix ambiguity copy(::Mul{<:LazyLayout, <:BandedLayout}) (#331)
* Fix ambiguity * Fix cov * arraylayouts
1 parent a7df659 commit f2ed399

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "LazyArrays"
22
uuid = "5078a376-72f3-5289-bfd5-ec5146d43c02"
3-
version = "2.1.3"
3+
version = "2.1.4"
44

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

2828
[compat]
2929
Aqua = "0.8"
30-
ArrayLayouts = "1.10"
30+
ArrayLayouts = "1.10.1"
3131
BandedMatrices = "1.6.2"
3232
Base64 = "1"
3333
BlockArrays = "1.0"

ext/LazyArraysBandedMatricesExt.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ const BandedLazyLayouts = Union{AbstractLazyBandedLayout, BandedColumns{LazyLayo
547547
copy(M::Mul{<:BandedLazyLayouts, <:BandedLazyLayouts}) = simplify(M)
548548
copy(M::Mul{<:BandedLazyLayouts}) = simplify(M)
549549
copy(M::Mul{<:BandedLazyLayouts, <:LazyLayouts}) = simplify(M)
550+
copy(M::Mul{<:LazyLayouts, <:BandedLazyLayouts}) = simplify(M)
550551
copy(M::Mul{<:Any, <:BandedLazyLayouts}) = simplify(M)
551552
copy(M::Mul{<:BandedLazyLayouts, <:AbstractLazyLayout}) = simplify(M)
552553
copy(M::Mul{<:AbstractLazyLayout, <:BandedLazyLayouts}) = simplify(M)

test/multests.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Test, LinearAlgebra, LazyArrays, StaticArrays, FillArrays, Base64, Random
1+
using Test, LinearAlgebra, LazyArrays, StaticArrays, FillArrays, Base64, Random, BandedMatrices
22
import LazyArrays: MulAdd, MemoryLayout, DenseColumnMajor, DiagonalLayout, SymTridiagonalLayout, Add, AddArray,
33
MulStyle, MulAddStyle, Applied, ApplyStyle, Lmul, ApplyArrayBroadcastStyle, DefaultArrayApplyStyle,
44
Rmul, ApplyLayout, arguments, colsupport, rowsupport, lazymaterialize
@@ -1180,3 +1180,10 @@ end
11801180
@test LazyArrays.simplify(Applied(*, A, A)) == A*A
11811181
end
11821182
end
1183+
1184+
@testset "Issue #330" begin
1185+
A = UpperTriangular(ApplyArray(inv, rand(5, 5)))
1186+
v1, v2 = ApplyVector(+, rand(5), rand(5)), ApplyVector(+, rand(4), rand(4))
1187+
B = Tridiagonal(v2, v1, v2)
1188+
@test copy(Mul(A, B)) Matrix(A) * Matrix(B)
1189+
end

0 commit comments

Comments
 (0)