Skip to content

Commit fcf9063

Browse files
mfherbstandreasnoack
authored andcommitted
Fix AbstractQ conversion to different-typed matrix (#32979)
1 parent 64be75f commit fcf9063

File tree

1 file changed

+1
-1
lines changed
  • stdlib/LinearAlgebra/src

1 file changed

+1
-1
lines changed

stdlib/LinearAlgebra/src/qr.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ AbstractMatrix{T}(Q::QRPackedQ) where {T} = QRPackedQ{T}(Q)
502502
QRCompactWYQ{S}(Q::QRCompactWYQ) where {S} = QRCompactWYQ(convert(AbstractMatrix{S}, Q.factors), convert(AbstractMatrix{S}, Q.T))
503503
AbstractMatrix{S}(Q::QRCompactWYQ{S}) where {S} = Q
504504
AbstractMatrix{S}(Q::QRCompactWYQ) where {S} = QRCompactWYQ{S}(Q)
505-
Matrix{T}(Q::AbstractQ) where {T} = lmul!(Q, Matrix{T}(I, size(Q, 1), min(size(Q.factors)...)))
505+
Matrix{T}(Q::AbstractQ{S}) where {T,S} = Matrix{T}(lmul!(Q, Matrix{S}(I, size(Q, 1), min(size(Q.factors)...))))
506506
Matrix(Q::AbstractQ{T}) where {T} = Matrix{T}(Q)
507507
Array{T}(Q::AbstractQ) where {T} = Matrix{T}(Q)
508508
Array(Q::AbstractQ) = Matrix(Q)

0 commit comments

Comments
 (0)