Skip to content

Commit aeb6ef2

Browse files
committed
increase coverage
1 parent edcf060 commit aeb6ef2

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/lmul.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,5 +169,6 @@ for Typ in (:QRCompactWYQ, :QRPackedQ)
169169
LinearAlgebra.rmul!(V::AbstractMatrix, Q::$Typ{<:Any,<:LayoutMatrix}) = rmul!(V, Q)
170170
LinearAlgebra.rmul!(V::LayoutMatrices, Q::AdjointQ{<:Any,<:$Typ{<:Any,<:LayoutMatrix}}) = rmul!(V, Q)
171171
LinearAlgebra.rmul!(V::AbstractMatrix, Q::AdjointQ{<:Any,<:$Typ{<:Any,<:LayoutMatrix}}) = rmul!(V, Q)
172+
LinearAlgebra.rmul!(V::StridedVecOrMat{T}, Q::AdjointQ{<:Any,<:$Typ{T,<:LayoutMatrix}}) where T<:BlasReal = rmul!(V, Q)
172173
end
173174
end

test/test_layoutarray.jl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,15 @@ Base.copy(A::MyVector) = MyVector(copy(A.A))
603603
@test mul!(copy(B), A, D, 2.0, 3.0) mul!(copy(B), V, D, 2.0, 3.0) 2A * D + 3B
604604
end
605605

606+
@testset "Diagonal * Q" begin
607+
A = randn(10,5)
608+
= qr(A).Q
609+
Q = LinearAlgebra.QRCompactWYQ(MyMatrix(Q̃.factors), Q̃.T)
610+
D = Diagonal(1:10)
611+
@test ArrayLayouts.mul(D, Q) ArrayLayouts.mul(D, Q̃) D*Q
612+
@test ArrayLayouts.mul(Q, D) ArrayLayouts.mul(Q̃, D) Q*D
613+
end
614+
606615
@testset "QR" begin
607616
A = randn(10,5)
608617
= qr(A).Q
@@ -616,7 +625,12 @@ Base.copy(A::MyVector) = MyVector(copy(A.A))
616625

617626
@test B'Q B' rmul!(copy(B'),Q) rmul!(MyMatrix(copy(B')), Q)
618627
@test B'Q' B'' rmul!(copy(B'),Q') rmul!(MyMatrix(copy(B')), Q')
619-
628+
629+
@test_throws ErrorException lmul!(Q, big.(B))
630+
@test_throws ErrorException lmul!(Q', big.(B))
631+
@test_throws ErrorException rmul!(big.(B'),Q')
632+
@test_throws ErrorException rmul!(big.(B'),Q)
633+
620634
@test_broken Q*b lmul!(Q̃, MyVector(copy(b))) # broken due to commented out code for ambiguity with MatrixFactorizations.jl
621635
end
622636
end

0 commit comments

Comments
 (0)