Skip to content

Commit ea00ef7

Browse files
committed
don't deprecate collect, mention in docs
1 parent 9da1662 commit ea00ef7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

stdlib/LinearAlgebra/src/abstractq.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ convert(::Type{AbstractQ{T}}, adjQ::AdjointQ{T}) where {T} = adjQ
3535
convert(::Type{AbstractQ{T}}, adjQ::AdjointQ) where {T} = convert(AbstractQ{T}, adjQ.Q)'
3636

3737
# ... to matrix
38+
collect(Q::AbstractQ) = copyto!(Matrix{eltype(Q)}(undef, size(Q)), Q)
3839
Matrix{T}(Q::AbstractQ) where {T} = convert(Matrix{T}, Q*I) # generic fallback, yields square matrix
3940
Matrix{T}(adjQ::AdjointQ{S}) where {T,S} = convert(Matrix{T}, lmul!(adjQ, Matrix{S}(I, size(adjQ))))
4041
Matrix(Q::AbstractQ{T}) where {T} = Matrix{T}(Q)
@@ -44,7 +45,6 @@ convert(::Type{T}, Q::AbstractQ) where {T<:AbstractArray} = T(Q)
4445
# legacy
4546
@deprecate(convert(::Type{AbstractMatrix{T}}, Q::AbstractQ) where {T},
4647
convert(LinearAlgebra.AbstractQ{T}, Q))
47-
@deprecate(collect(Q::AbstractQ), copyto!(Matrix{eltype(Q)}(undef, size(Q)), Q))
4848

4949
function size(Q::AbstractQ, dim::Integer)
5050
if dim < 1

stdlib/LinearAlgebra/src/qr.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ Multiplication with respect to either full/square or non-full/square `Q` is allo
379379
and `F.Q*A` are supported. A `Q` matrix can be converted into a regular matrix with
380380
[`Matrix`](@ref). This operation returns the "thin" Q factor, i.e., if `A` is `m`×`n` with `m>=n`, then
381381
`Matrix(F.Q)` yields an `m`×`n` matrix with orthonormal columns. To retrieve the "full" Q factor, an
382-
`m`×`m` orthogonal matrix, use `F.Q*I`. If `m<=n`, then `Matrix(F.Q)` yields an `m`×`m`
382+
`m`×`m` orthogonal matrix, use `F.Q*I` or `collect(F.Q)`. If `m<=n`, then `Matrix(F.Q)` yields an `m`×`m`
383383
orthogonal matrix.
384384
385385
The block size for QR decomposition can be specified by keyword argument

0 commit comments

Comments
 (0)