Skip to content

Commit

Permalink
Deprecate full.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sacha0 committed Oct 22, 2017
1 parent 182d843 commit b889906
Show file tree
Hide file tree
Showing 24 changed files with 156 additions and 112 deletions.
16 changes: 16 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,22 @@ Deprecated or removed

* `logm` has been deprecated in favor of `log` ([#23505]).

* `full` has been deprecated in favor of more specific, better defined alternatives.
On structured matrices `A`, consider instead `Matrix(A)`, `Array(A)`,
`SparseMatrixCSC(A)`, or `sparse(A)`. On sparse arrays `S`, consider instead
`Vector(S)`, `Matrix(S)`, or `Array(S)` as appropriate. On factorizations `F`,
consider instead `Matrix(F)`, `Array(F)`, `AbstractMatrix(F)`, or `AbstractArray(F)`.
On implicit orthogonal factors `Q`, consider instead `Matrix(Q)` or `Array(Q)`; for
implicit orthogonal factors that can be recovered in square or truncated form,
see the deprecation message for square recovery instructions. On `Symmetric`,
`Hermitian`, or `AbstractTriangular` matrices `A`, consider instead `Matrix(S)`,
`Array(S)`, `SparseMatrixCSC(S)`, or `sparse(S)`. On `Symmetric` matrices `A`
particularly, consider instead `LinAlg.copytri!(copy(parent(A)), A.uplo)`. On
`Hermitian` matrices `A` particularly, consider instead
`LinAlg.copytri!(copy(parent(A)), A.uplo, true)`. On `UpperTriangular` matrices `A`
particularly, consider instead `triu!(copy(parent(A)))`. On `LowerTriangular` matrices
`A` particularly, consider instead `tril!(copy(parent(A)))` ([#24250]).

* Calling `union` with no arguments is deprecated; construct an empty set with an appropriate
element type using `Set{T}()` instead ([#23144]).

Expand Down
7 changes: 0 additions & 7 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -855,13 +855,6 @@ Represents the array `y` as an array having the same indices type as `x`.
of_indices(x, y) = similar(dims->y, oftype(indices(x), indices(y)))


"""
full(F)
Reconstruct the matrix `A` from the factorization `F=factorize(A)`.
"""
full(x::AbstractArray) = x

## range conversions ##

map(::Type{T}, r::StepRange) where {T<:Real} = T(r.start):T(r.step):T(last(r))
Expand Down
136 changes: 136 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1882,6 +1882,142 @@ end
@deprecate diagm(v::AbstractVector, k::Integer) diagm(k => v)
@deprecate diagm(x::Number) fill(x, 1, 1)

## deprecate full

# full no-op fallback
function full(A::AbstractArray)
depwarn(string(
"The no-op `full(A::AbstractArray)` fallback has been deprecated, and no more ",
"specific `full` method for $(typeof(A)) exists. Furthermore, `full` in general ",
"has been deprecated.\n\n",
"To replace `full(A)`, as appropriate consider dismabiguating with a concrete ",
"array constructor (e.g. `Array(A)`), with an abstract array constructor (e.g.`AbstractArray(A)`), ",
"instead `convert`ing to an array type (e.g `convert(Array, A)`, `convert(AbstractArray, A)`), ",
"or using another such operation that addresses your specific use case."), :full)
return A
end

# full for structured arrays
function full(A::Union{Diagonal,Bidiagonal,Tridiagonal,SymTridiagonal})
mattypestr = isa(A, Diagonal) ? "Diagonal" :
isa(A, Bidiagonal) ? "Bidiagonal" :
isa(A, Tridiagonal) ? "Tridiagonal" :
isa(A, SymTridiagonal) ? "SymTridiagonal" :
error("should not be reachable!")
depwarn(string(
"`full(A::$(mattypestr))` (and `full` in general) has been deprecated. ",
"To replace `full(A::$(mattypestr))`, consider `Matrix(A)` or, if that ",
"option is too narrow, `Array(A)`. Also consider `SparseMatrixCSC(A)` ",
"or, if that option is too narrow, `sparse(A)`."), :full)
return Matrix(A)
end

# full for sparse arrays
function full(S::Union{SparseVector,SparseMatrixCSC})
(arrtypestr, desttypestr) =
isa(S, SparseVector) ? ("SparseVector", "Vector") :
isa(S, SparseMatrixCSC) ? ("SparseMatrixCSC", "Matrix") :
error("should not be reachable!")
depwarn(string(
"`full(S::$(arrtypestr))` (and `full` in general) has been deprecated. ",
"To replace `full(S::$(arrtypestr))`, consider `$(desttypestr)(S)` or, ",
"if that option is too narrow, `Array(S)`."), :full)
return Array(S)
end

# full for factorizations
function full(F::Union{LinAlg.LU,LinAlg.LQ,LinAlg.QR,LinAlg.QRPivoted,LinAlg.QRCompactWY,
LinAlg.SVD,LinAlg.LDLt,LinAlg.Schur,LinAlg.Eigen,LinAlg.Hessenberg,
LinAlg.Cholesky,LinAlg.CholeskyPivoted})
facttypestr = isa(F, LinAlg.LU) ? "LU" :
isa(F, LinAlg.LQ) ? "LQ" :
isa(F, LinAlg.QR) ? "QR" :
isa(F, LinAlg.QRPivoted) ? "QRPivoted" :
isa(F, LinAlg.QRCompactWY) ? "QRCompactWY" :
isa(F, LinAlg.SVD) ? "SVD" :
isa(F, LinAlg.LDLt) ? "LDLt" :
isa(F, LinAlg.Schur) ? "Schur" :
isa(F, LinAlg.Eigen) ? "Eigen" :
isa(F, LinAlg.Hessenberg) ? "Hessenberg" :
isa(F, LinAlg.Cholesky) ? "Cholesky" :
isa(F, LinAlg.CholeskyPivoted) ? "CholeskyPivoted" :
error("should not be reachable!")
depwarn(string(
"`full(F::$(facttypestr))` (and `full` in general) has been deprecated. ",
"To replace `full(F::$(facttypestr))`, consider `Matrix(F)`, `AbstractMatrix(F)` or, ",
"if those options are too narrow, `Array(F)` or `AbstractArray(F)`."), :full)
return AbstractMatrix(F)
end

# full for implicit orthogonal factors
function full(Q::LinAlg.HessenbergQ)
depwarn(string(
"`full(Q::HessenbergQ)` (and `full` in general) has been deprecated. ",
"To replace `full(Q::HessenbergQ)`, consider `Matrix(Q)` or, ",
"if that option is too narrow, `Array(Q)`."), :full)
return Matrix(Q)
end
function full(Q::LinAlg.LQPackedQ; thin::Bool = true)
depwarn(string(
"`full(Q::LQPackedQ; thin::Bool = true)` (and `full` in general) ",
"has been deprecated. To replace `full(Q::LQPackedQ, true)`, ",
"consider `Matrix(Q)` or `Array(Q)`. To replace `full(Q::LQPackedQ, false)`, ",
"consider `Base.LinAlg.A_mul_B!(Q, eye(eltype(Q), size(Q.factors, 2)))`."), :full)
return thin ? Array(Q) : A_mul_B!(Q, eye(eltype(Q), size(Q.factors, 2)))
end
function full(Q::Union{LinAlg.QRPackedQ,LinAlg.QRCompactWYQ}; thin::Bool = true)
qtypestr = isa(Q, LinAlg.QRPackedQ) ? "QRPackedQ" :
isa(Q, LinAlg.QRCompactWYQ) ? "QRCompactWYQ" :
error("should not be reachable!")
depwarn(string(
"`full(Q::$(qtypestr); thin::Bool = true)` (and `full` in general) ",
"has been deprecated. To replace `full(Q::$(qtypestr), true)`, ",
"consider `Matrix(Q)` or `Array(Q)`. To replace `full(Q::$(qtypestr), false)`, ",
"consider `Base.LinAlg.A_mul_B!(Q, eye(eltype(Q), size(Q.factors, 1)))`."), :full)
return thin ? Array(Q) : A_mul_B!(Q, eye(eltype(Q), size(Q.factors, 1)))
end

# full for symmetric / hermitian / triangular wrappers
function full(A::Symmetric)
depwarn(string(
"`full(A::Symmetric)` (and `full` in general) has been deprecated. ",
"To replace `full(A::Symmetric)`, as appropriate consider `Matrix(A)`, ",
"`Array(A)`, `SparseMatrixCSC(A)`, `sparse(A)`, `copy!(similar(parent(A)), A)`, ",
"or `Base.LinAlg.copytri!(copy(parent(A)), A.uplo)`."), :full)
return Matrix(A)
end
function full(A::Hermitian)
depwarn(string(
"`full(A::Hermitian)` (and `full` in general) has been deprecated. ",
"To replace `full(A::Hermitian)`, as appropriate consider `Matrix(A)`, ",
"`Array(A)`, `SparseMatrixCSC(A)`, `sparse(A)`, `copy!(similar(parent(A)), A)`, ",
"or `Base.LinAlg.copytri!(copy(parent(A)), A.uplo, true)`."), :full)
return Matrix(A)
end
function full(A::Union{UpperTriangular,LowerTriangular})
(tritypestr, tri!str) =
isa(A, UpperTriangular) ? ("UpperTriangular", "triu!") :
isa(A, LowerTriangular) ? ("LowerTriangular", "tril!") :
error("should not be reachable!")
depwarn(string(
"`full(A::$(tritypestr))` (and `full` in general) has been deprecated. ",
"To replace `full(A::$(tritypestr))`, as appropriate consider `Matrix(A)`, ",
"`Array(A)`, `SparseMatrixCSC(A)`, `sparse(A)`, `copy!(similar(parent(A)), A)`, ",
"or `$(tri!str)(copy(parent(A)))`."), :full)
return Matrix(A)
end
function full(A::Union{LinAlg.UnitUpperTriangular,LinAlg.UnitLowerTriangular})
tritypestr = isa(A, LinAlg.UnitUpperTriangular) ? "LinAlg.UnitUpperTriangular" :
isa(A, LinAlg.UnitLowerTriangular) ? "LinAlg.UnitLowerTriangular" :
error("should not be reachable!")
depwarn(string(
"`full(A::$(tritypestr))` (and `full` in general) has been deprecated. ",
"To replace `full(A::$(tritypestr))`, as appropriate consider `Matrix(A)`, ",
"`Array(A)`, `SparseMatrixCSC(A)`, `sparse(A)`, or `copy!(similar(parent(A)), A)`."), :full)
return Matrix(A)
end


# issue #20816
@deprecate strwidth textwidth
@deprecate charwidth textwidth
Expand Down
1 change: 0 additions & 1 deletion base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,6 @@ export
×,

# sparse
full,
dropzeros,
dropzeros!,

Expand Down
1 change: 0 additions & 1 deletion base/linalg/bidiag.jl
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ function convert(::Type{Matrix{T}}, A::Bidiagonal) where T
end
convert(::Type{Matrix}, A::Bidiagonal{T}) where {T} = convert(Matrix{T}, A)
convert(::Type{Array}, A::Bidiagonal) = convert(Matrix, A)
full(A::Bidiagonal) = convert(Array, A)
promote_rule(::Type{Matrix{T}}, ::Type{<:Bidiagonal{S}}) where {T,S} = Matrix{promote_type(T,S)}

#Converting from Bidiagonal to Tridiagonal
Expand Down
2 changes: 0 additions & 2 deletions base/linalg/cholesky.jl
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ convert(::Type{AbstractMatrix}, C::Cholesky) = C.uplo == 'U' ? C[:U]'C[:U] : C[:
convert(::Type{AbstractArray}, C::Cholesky) = convert(AbstractMatrix, C)
convert(::Type{Matrix}, C::Cholesky) = convert(Array, convert(AbstractArray, C))
convert(::Type{Array}, C::Cholesky) = convert(Matrix, C)
full(C::Cholesky) = convert(AbstractArray, C)

function convert(::Type{AbstractMatrix}, F::CholeskyPivoted)
ip = invperm(F[:p])
Expand All @@ -372,7 +371,6 @@ end
convert(::Type{AbstractArray}, F::CholeskyPivoted) = convert(AbstractMatrix, F)
convert(::Type{Matrix}, F::CholeskyPivoted) = convert(Array, convert(AbstractArray, F))
convert(::Type{Array}, F::CholeskyPivoted) = convert(Matrix, F)
full(F::CholeskyPivoted) = convert(AbstractArray, F)

copy(C::Cholesky) = Cholesky(copy(C.factors), C.uplo, C.info)
copy(C::CholeskyPivoted) = CholeskyPivoted(copy(C.factors), C.uplo, C.piv, C.rank, C.tol, C.info)
Expand Down
1 change: 0 additions & 1 deletion base/linalg/diagonal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ convert(::Type{Diagonal{T}}, D::Diagonal) where {T} = Diagonal{T}(convert(Abstra
convert(::Type{AbstractMatrix{T}}, D::Diagonal) where {T} = convert(Diagonal{T}, D)
convert(::Type{Matrix}, D::Diagonal) = diagm(0 => D.diag)
convert(::Type{Array}, D::Diagonal) = convert(Matrix, D)
full(D::Diagonal) = convert(Array, D)

# For D<:Diagonal, similar(D[, neweltype]) should yield a Diagonal matrix.
# On the other hand, similar(D, [neweltype,] shape...) should yield a sparse matrix.
Expand Down
1 change: 0 additions & 1 deletion base/linalg/eigen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -435,4 +435,3 @@ convert(::Type{AbstractMatrix}, F::Eigen) = F.vectors * Diagonal(F.values) / F.v
convert(::Type{AbstractArray}, F::Eigen) = convert(AbstractMatrix, F)
convert(::Type{Matrix}, F::Eigen) = convert(Array, convert(AbstractArray, F))
convert(::Type{Array}, F::Eigen) = convert(Matrix, F)
full(F::Eigen) = convert(AbstractArray, F)
2 changes: 0 additions & 2 deletions base/linalg/hessenberg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,10 @@ end
## reconstruct the original matrix
convert(::Type{Matrix}, A::HessenbergQ{<:BlasFloat}) = LAPACK.orghr!(1, size(A.factors, 1), copy(A.factors), A.τ)
convert(::Type{Array}, A::HessenbergQ) = convert(Matrix, A)
full(A::HessenbergQ) = convert(Array, A)
convert(::Type{AbstractMatrix}, F::Hessenberg) = (fq = Array(F[:Q]); (fq * F[:H]) * fq')
convert(::Type{AbstractArray}, F::Hessenberg) = convert(AbstractMatrix, F)
convert(::Type{Matrix}, F::Hessenberg) = convert(Array, convert(AbstractArray, F))
convert(::Type{Array}, F::Hessenberg) = convert(Matrix, F)
full(F::Hessenberg) = convert(AbstractArray, F)

A_mul_B!(Q::HessenbergQ{T}, X::StridedVecOrMat{T}) where {T<:BlasFloat} =
LAPACK.ormhr!('L', 'N', 1, size(Q.factors, 1), Q.factors, Q.τ, X)
Expand Down
1 change: 0 additions & 1 deletion base/linalg/ldlt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,3 @@ convert(::Type{AbstractMatrix}, F::LDLt) = convert(SymTridiagonal, F)
convert(::Type{AbstractArray}, F::LDLt) = convert(AbstractMatrix, F)
convert(::Type{Matrix}, F::LDLt) = convert(Array, convert(AbstractArray, F))
convert(::Type{Array}, F::LDLt) = convert(Matrix, F)
full(F::LDLt) = convert(AbstractArray, F)
2 changes: 1 addition & 1 deletion base/linalg/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Base: A_mul_Bt, At_ldiv_Bt, A_rdiv_Bc, At_ldiv_B, Ac_mul_Bc, A_mul_Bc, Ac
Ac_ldiv_B, Ac_ldiv_Bc, At_mul_Bt, A_rdiv_Bt, At_mul_B
import Base: USE_BLAS64, abs, acos, acosh, acot, acoth, acsc, acsch, adjoint, asec, asech, asin,
asinh, atan, atanh, big, broadcast, ceil, conj, convert, copy, copy!, cos, cosh, cot, coth, csc,
csch, eltype, exp, eye, findmax, findmin, fill!, floor, full, getindex, hcat, imag, indices,
csch, eltype, exp, eye, findmax, findmin, fill!, floor, getindex, hcat, imag, indices,
inv, isapprox, isone, IndexStyle, kron, length, log, map, ndims, oneunit, parent,
power_by_squaring, print_matrix, promote_rule, real, round, sec, sech, setindex!, show, similar,
sin, sincos, sinh, size, sqrt, tan, tanh, transpose, trunc, typed_hcat, vec
Expand Down
4 changes: 0 additions & 4 deletions base/linalg/lq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ convert(::Type{AbstractMatrix}, A::LQ) = A[:L]*A[:Q]
convert(::Type{AbstractArray}, A::LQ) = convert(AbstractMatrix, A)
convert(::Type{Matrix}, A::LQ) = convert(Array, convert(AbstractArray, A))
convert(::Type{Array}, A::LQ) = convert(Matrix, A)
full(A::LQ) = convert(AbstractArray, A)

adjoint(A::LQ{T}) where {T} = QR{T,typeof(A.factors)}(A.factors', A.τ)

Expand Down Expand Up @@ -94,9 +93,6 @@ convert(::Type{AbstractMatrix{T}}, Q::LQPackedQ) where {T} = convert(LQPackedQ{T
convert(::Type{Matrix}, A::LQPackedQ) = LAPACK.orglq!(copy(A.factors),A.τ)
convert(::Type{Array}, A::LQPackedQ) = convert(Matrix, A)

full(Q::LQPackedQ; thin::Bool = true) =
thin ? Array(Q) : A_mul_B!(Q, eye(eltype(Q), size(Q.factors, 2)))

size(A::LQ, dim::Integer) = size(A.factors, dim)
size(A::LQ) = size(A.factors)

Expand Down
2 changes: 0 additions & 2 deletions base/linalg/lu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,6 @@ convert(::Type{AbstractMatrix}, F::LU) = (F[:L] * F[:U])[invperm(F[:p]),:]
convert(::Type{AbstractArray}, F::LU) = convert(AbstractMatrix, F)
convert(::Type{Matrix}, F::LU) = convert(Array, convert(AbstractArray, F))
convert(::Type{Array}, F::LU) = convert(Matrix, F)
full(F::LU) = convert(AbstractArray, F)

function convert(::Type{Tridiagonal}, F::Base.LinAlg.LU{T,Tridiagonal{T,V}}) where {T,V}
n = size(F, 1)
Expand Down Expand Up @@ -594,4 +593,3 @@ convert(::Type{Matrix}, F::LU{T,Tridiagonal{T,V}}) where {T,V} =
convert(Array, convert(AbstractArray, F))
convert(::Type{Array}, F::LU{T,Tridiagonal{T,V}}) where {T,V} =
convert(Matrix, F)
full(F::LU{T,Tridiagonal{T,V}}) where {T,V} = convert(AbstractArray, F)
56 changes: 1 addition & 55 deletions base/linalg/qr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ solution and if the solution is not unique, the one with smallest norm is return
Multiplication with respect to either thin or full `Q` is allowed, i.e. both `F[:Q]*F[:R]`
and `F[:Q]*A` are supported. A `Q` matrix can be converted into a regular matrix with
[`full`](@ref) which has a named argument `thin`.
[`Matrix`](@ref).
# Examples
```jldoctest
Expand Down Expand Up @@ -401,15 +401,13 @@ convert(::Type{AbstractMatrix}, F::Union{QR,QRCompactWY}) = F[:Q] * F[:R]
convert(::Type{AbstractArray}, F::Union{QR,QRCompactWY}) = convert(AbstractMatrix, F)
convert(::Type{Matrix}, F::Union{QR,QRCompactWY}) = convert(Array, convert(AbstractArray, F))
convert(::Type{Array}, F::Union{QR,QRCompactWY}) = convert(Matrix, F)
full(F::Union{QR,QRCompactWY}) = convert(AbstractArray, F)
convert(::Type{QRPivoted{T}}, A::QRPivoted) where {T} = QRPivoted(convert(AbstractMatrix{T}, A.factors), convert(Vector{T}, A.τ), A.jpvt)
convert(::Type{Factorization{T}}, A::QRPivoted{T}) where {T} = A
convert(::Type{Factorization{T}}, A::QRPivoted) where {T} = convert(QRPivoted{T}, A)
convert(::Type{AbstractMatrix}, F::QRPivoted) = (F[:Q] * F[:R])[:,invperm(F[:p])]
convert(::Type{AbstractArray}, F::QRPivoted) = convert(AbstractMatrix, F)
convert(::Type{Matrix}, F::QRPivoted) = convert(Array, convert(AbstractArray, F))
convert(::Type{Array}, F::QRPivoted) = convert(Matrix, F)
full(F::QRPivoted) = convert(AbstractArray, F)

function show(io::IO, F::Union{QR, QRCompactWY, QRPivoted})
println(io, "$(typeof(F)) with factors Q and R:")
Expand Down Expand Up @@ -500,58 +498,6 @@ convert(::Type{AbstractMatrix{S}}, Q::QRCompactWYQ) where {S} = convert(QRCompac
convert(::Type{Matrix}, A::AbstractQ{T}) where {T} = A_mul_B!(A, eye(T, size(A.factors, 1), min(size(A.factors)...)))
convert(::Type{Array}, A::AbstractQ) = convert(Matrix, A)

"""
full(A::AbstractQ; thin::Bool=true) -> Matrix
Converts an orthogonal or unitary matrix stored as a `QRCompactWYQ` object, i.e. in the
compact WY format [^Bischof1987], or in the `QRPackedQ` format, to a dense matrix.
Optionally takes a `thin` Boolean argument, which if `true` omits the columns that span the
rows of `R` in the QR factorization that are zero. The resulting matrix is the `Q` in a thin
QR factorization (sometimes called the reduced QR factorization). If `false`, returns a `Q`
that spans all rows of `R` in its corresponding QR factorization.
# Examples
```jldoctest
julia> a = [1. 2.; 3. 4.; 5. 6.];
julia> qra = qrfact(a, Val(true));
julia> full(qra[:Q], thin=true)
3×2 Array{Float64,2}:
-0.267261 0.872872
-0.534522 0.218218
-0.801784 -0.436436
julia> full(qra[:Q], thin=false)
3×3 Array{Float64,2}:
-0.267261 0.872872 0.408248
-0.534522 0.218218 -0.816497
-0.801784 -0.436436 0.408248
julia> qra = qrfact(a, Val(false));
julia> full(qra[:Q], thin=true)
3×2 Array{Float64,2}:
-0.169031 0.897085
-0.507093 0.276026
-0.845154 -0.345033
julia> full(qra[:Q], thin=false)
3×3 Array{Float64,2}:
-0.169031 0.897085 0.408248
-0.507093 0.276026 -0.816497
-0.845154 -0.345033 0.408248
```
"""
function full(A::AbstractQ{T}; thin::Bool = true) where T
if thin
convert(Array, A)
else
A_mul_B!(A, eye(T, size(A.factors, 1)))
end
end

size(A::Union{QR,QRCompactWY,QRPivoted}, dim::Integer) = size(A.factors, dim)
size(A::Union{QR,QRCompactWY,QRPivoted}) = size(A.factors)
size(A::AbstractQ, dim::Integer) = 0 < dim ? (dim <= 2 ? size(A.factors, 1) : 1) : throw(BoundsError())
Expand Down
1 change: 0 additions & 1 deletion base/linalg/schur.jl
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ convert(::Type{AbstractMatrix}, F::Schur) = (F.Z * F.T) * F.Z'
convert(::Type{AbstractArray}, F::Schur) = convert(AbstractMatrix, F)
convert(::Type{Matrix}, F::Schur) = convert(Array, convert(AbstractArray, F))
convert(::Type{Array}, F::Schur) = convert(Matrix, F)
full(F::Schur) = convert(AbstractArray, F)

copy(F::Schur) = Schur(copy(F.T), copy(F.Z), copy(F.values))
copy(F::GeneralizedSchur) = GeneralizedSchur(copy(F.S), copy(F.T), copy(F.alpha), copy(F.beta), copy(F.Q), copy(F.Z))
1 change: 0 additions & 1 deletion base/linalg/svd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -314,4 +314,3 @@ convert(::Type{AbstractMatrix}, F::SVD) = (F.U * Diagonal(F.S)) * F.Vt
convert(::Type{AbstractArray}, F::SVD) = convert(AbstractMatrix, F)
convert(::Type{Matrix}, F::SVD) = convert(Array, convert(AbstractArray, F))
convert(::Type{Array}, F::SVD) = convert(Matrix, F)
full(F::SVD) = convert(AbstractArray, F)
1 change: 0 additions & 1 deletion base/linalg/symmetric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ similar(A::Union{Symmetric,Hermitian}, ::Type{T}, dims::Dims{N}) where {T,N} = s
convert(::Type{Matrix}, A::Symmetric) = copytri!(convert(Matrix, copy(A.data)), A.uplo)
convert(::Type{Matrix}, A::Hermitian) = copytri!(convert(Matrix, copy(A.data)), A.uplo, true)
convert(::Type{Array}, A::Union{Symmetric,Hermitian}) = convert(Matrix, A)
full(A::Union{Symmetric,Hermitian}) = convert(Array, A)
parent(A::HermOrSym) = A.data
convert(::Type{Symmetric{T,S}},A::Symmetric{T,S}) where {T,S<:AbstractMatrix} = A
convert(::Type{Symmetric{T,S}},A::Symmetric) where {T,S<:AbstractMatrix} = Symmetric{T,S}(convert(S,A.data),A.uplo)
Expand Down
Loading

0 comments on commit b889906

Please sign in to comment.