From fac82f37259194b656b0e185c5f664f05c6f6651 Mon Sep 17 00:00:00 2001 From: "Michael F. Herbst" Date: Tue, 20 Aug 2019 13:36:23 +0200 Subject: [PATCH] Fix AbstractQ conversion to different-typed matrix --- stdlib/LinearAlgebra/src/qr.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/LinearAlgebra/src/qr.jl b/stdlib/LinearAlgebra/src/qr.jl index 0ed76560e68a7..c201194e02450 100644 --- a/stdlib/LinearAlgebra/src/qr.jl +++ b/stdlib/LinearAlgebra/src/qr.jl @@ -502,7 +502,7 @@ AbstractMatrix{T}(Q::QRPackedQ) where {T} = QRPackedQ{T}(Q) QRCompactWYQ{S}(Q::QRCompactWYQ) where {S} = QRCompactWYQ(convert(AbstractMatrix{S}, Q.factors), convert(AbstractMatrix{S}, Q.T)) AbstractMatrix{S}(Q::QRCompactWYQ{S}) where {S} = Q AbstractMatrix{S}(Q::QRCompactWYQ) where {S} = QRCompactWYQ{S}(Q) -Matrix{T}(Q::AbstractQ) where {T} = lmul!(Q, Matrix{T}(I, size(Q, 1), min(size(Q.factors)...))) +Matrix{T}(Q::AbstractQ{S}) where {T,S} = Matrix{T}(lmul!(Q, Matrix{S}(I, size(Q, 1), min(size(Q.factors)...)))) Matrix(Q::AbstractQ{T}) where {T} = Matrix{T}(Q) Array{T}(Q::AbstractQ) where {T} = Matrix{T}(Q) Array(Q::AbstractQ) = Matrix(Q)