Skip to content

Commit

Permalink
Add Factorization constructors for SVD
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack committed May 27, 2021
1 parent b4b88e6 commit e94e695
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions stdlib/LinearAlgebra/src/svd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ function SVD{T}(U::AbstractArray, S::AbstractVector{Tr}, Vt::AbstractArray) wher
convert(AbstractArray{T}, Vt))
end

SVD{T}(F::SVD) where {T} = SVD(
convert(AbstractMatrix{T}, F.U),
convert(AbstractVector{real(T)}, F.S),
convert(AbstractMatrix{T}, F.Vt))
Factorization{T}(F::SVD) where {T} = SVD{T}(F)

# iteration for destructuring into components
Base.iterate(S::SVD) = (S.U, Val(:S))
Expand Down

0 comments on commit e94e695

Please sign in to comment.