Skip to content

Commit 40dc4f3

Browse files
authored
Disambiguate FillMatrix * LayoutVector (#245)
* Disambiguate FillMatrix * LayoutVector * Restore behavior * Return FillArray * Use invoke function instead of macro * transpose and adjoint vector
1 parent a77697d commit 40dc4f3

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ArrayLayouts"
22
uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
33
authors = ["Sheehan Olver <solver@mac.com>"]
4-
version = "1.10.2"
4+
version = "1.10.3"
55

66
[deps]
77
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"

src/mul.jl

+5
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,11 @@ end
347347
*(A::Transpose{<:Any,<:LayoutVector}, B::Adjoint{<:Any,<:LayoutMatrix}) = mul(A,B)
348348
*(A::Transpose{<:Any,<:LayoutVector}, B::Transpose{<:Any,<:LayoutMatrix}) = mul(A,B)
349349

350+
# Disambiguation with FillArrays
351+
*(A::AbstractFill{<:Any,2}, B::LayoutVector) = invoke(*, Tuple{AbstractFill{<:Any,2}, AbstractVector}, A, B)
352+
*(A::Adjoint{<:Any, <:LayoutVector}, B::AbstractFill{<:Any,2}) = invoke(*, Tuple{Adjoint{<:Any, <:AbstractVector}, AbstractFill{<:Any,2}}, A, B)
353+
*(A::Transpose{<:Any, <:LayoutVector}, B::AbstractFill{<:Any,2}) = invoke(*, Tuple{Transpose{<:Any, <:AbstractVector}, AbstractFill{<:Any,2}}, A, B)
354+
350355
## special routines introduced in v0.9. We need to avoid these to support ∞-arrays
351356

352357
*(x::Adjoint{<:Any,<:LayoutVector}, D::Diagonal{<:Any,<:LayoutVector}) = mul(x, D)

test/test_layoutarray.jl

+9
Original file line numberDiff line numberDiff line change
@@ -638,4 +638,13 @@ using .InfiniteArrays
638638
end
639639
end
640640

641+
@testset "disambiguation with FillArrays" begin
642+
v = [1,2,3]
643+
lv = MyVector(v)
644+
F = Fill(2, 3, 3)
645+
@test F * lv == F * v
646+
@test lv' * F == v' * F
647+
@test transpose(lv) * F == transpose(v) * F
648+
end
649+
641650
end

0 commit comments

Comments
 (0)