Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions stdlib/LinearAlgebra/src/abstractq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ qsize_check(Q::AbstractQ, P::AbstractQ) =
size(Q, 2) == size(P, 1) ||
throw(DimensionMismatch("second dimension of A, $(size(Q,2)), must coincide with first dimension of B, $(size(P,1))"))

# mimic the AbstractArray fallback
*(Q::AbstractQ{<:Number}) = Q

(*)(Q::AbstractQ, J::UniformScaling) = Q*J.λ
function (*)(Q::AbstractQ, b::Number)
T = promote_type(eltype(Q), typeof(b))
Expand Down
1 change: 1 addition & 0 deletions stdlib/LinearAlgebra/test/abstractq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ n = 5
T <: Complex && @test_throws ErrorException transpose(Q)
@test convert(AbstractQ{complex(T)}, Q) isa MyQ{complex(T)}
@test convert(AbstractQ{complex(T)}, Q') isa AdjointQ{<:complex(T),<:MyQ{complex(T)}}
@test *(Q) == Q
@test Q*I ≈ Q.Q*I rtol=2eps(real(T))
@test Q'*I ≈ Q.Q'*I rtol=2eps(real(T))
@test I*Q ≈ Q.Q*I rtol=2eps(real(T))
Expand Down