Skip to content

Commit ecedd14

Browse files
authored
Fix ambiguity in x'A' (#97)
1 parent 43b2ee2 commit ecedd14

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
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 <[email protected]>"]
4-
version = "0.8.7"
4+
version = "0.8.8"
55

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

src/mul.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,10 @@ macro layoutmul(Typ)
252252
end
253253

254254
@veclayoutmul LayoutVector
255+
*(A::Adjoint{<:Any,<:LayoutVector}, B::Adjoint{<:Any,<:LayoutMatrix}) = mul(A,B)
256+
*(A::Adjoint{<:Any,<:LayoutVector}, B::Transpose{<:Any,<:LayoutMatrix}) = mul(A,B)
257+
*(A::Transpose{<:Any,<:LayoutVector}, B::Adjoint{<:Any,<:LayoutMatrix}) = mul(A,B)
258+
*(A::Transpose{<:Any,<:LayoutVector}, B::Transpose{<:Any,<:LayoutMatrix}) = mul(A,B)
255259

256260

257261
###

test/test_layoutarray.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,14 @@ MemoryLayout(::Type{MyVector}) = DenseColumnMajor()
335335
@test axes(UpperTriangular(A)) == axes(UpperTriangular(view(A,1:5,1:5))) == axes(A)
336336
@test axes(Diagonal(x)) == axes(Diagonal(Vector(x)))
337337
end
338+
339+
@testset "adjtrans *" begin
340+
A = MyMatrix(rand(5,5))
341+
x = MyVector(rand(5))
342+
343+
@test x'A transpose(x)A x.A'A.A
344+
@test x'A' x'transpose(A) transpose(x)A' transpose(x)transpose(A) x.A'A.A'
345+
end
338346
end
339347

340348
struct MyUpperTriangular{T} <: AbstractMatrix{T}

0 commit comments

Comments
 (0)