Skip to content

Commit b2cbf31

Browse files
authored
Merge pull request #23835 from Sacha0/nixfullqr
eliminate uses of full from base/linalg/qr.jl
2 parents 30d9413 + 02f111b commit b2cbf31

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

base/linalg/qr.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,13 @@ qr(A::Union{Number, AbstractMatrix}, pivot::Union{Val{false}, Val{true}}=Val(fal
321321
_qr(A, pivot, thin=thin)
322322
function _qr(A::Union{Number, AbstractMatrix}, ::Val{false}; thin::Bool=true)
323323
F = qrfact(A, Val(false))
324-
full(getq(F), thin=thin), F[:R]::Matrix{eltype(F)}
324+
Q, R = getq(F), F[:R]::Matrix{eltype(F)}
325+
return (thin ? Array(Q) : A_mul_B!(Q, eye(eltype(Q), size(Q.factors, 1)))), R
325326
end
326327
function _qr(A::Union{Number, AbstractMatrix}, ::Val{true}; thin::Bool=true)
327328
F = qrfact(A, Val(true))
328-
full(getq(F), thin=thin), F[:R]::Matrix{eltype(F)}, F[:p]::Vector{BlasInt}
329+
Q, R, p = getq(F), F[:R]::Matrix{eltype(F)}, F[:p]::Vector{BlasInt}
330+
return (thin ? Array(Q) : A_mul_B!(Q, eye(eltype(Q), size(Q.factors, 1)))), R, p
329331
end
330332

331333
"""

0 commit comments

Comments
 (0)