From edede50603d685c629b5e1c080dedcc93a5fa377 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Tue, 30 May 2017 23:02:50 +0200 Subject: [PATCH] document order of svdvals --- base/linalg/svd.jl | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/base/linalg/svd.jl b/base/linalg/svd.jl index 4ea9291873a89..639d528a1b812 100644 --- a/base/linalg/svd.jl +++ b/base/linalg/svd.jl @@ -15,10 +15,6 @@ SVD(U::AbstractArray{T}, S::Vector{Tr}, Vt::AbstractArray{T}) where {T,Tr} = SVD `svdfact!` is the same as [`svdfact`](@ref), but saves space by overwriting the input `A`, instead of creating a copy. - -If `thin=true` (default), a thin SVD is returned. For a ``M \\times N`` matrix -`A`, `U` is ``M \\times M`` for a full SVD (`thin=false`) and -``M \\times \\min(M, N)`` for a thin SVD. """ function svdfact!(A::StridedMatrix{T}; thin::Bool=true) where T<:BlasFloat m,n = size(A) @@ -38,6 +34,7 @@ Compute the singular value decomposition (SVD) of `A` and return an `SVD` object `U`, `S`, `V` and `Vt` can be obtained from the factorization `F` with `F[:U]`, `F[:S]`, `F[:V]` and `F[:Vt]`, such that `A = U*diagm(S)*Vt`. The algorithm produces `Vt` and hence `Vt` is more efficient to extract than `V`. +The singular values in `S` are sorted in descending order. If `thin=true` (default), a thin SVD is returned. For a ``M \\times N`` matrix `A`, `U` is ``M \\times M`` for a full SVD (`thin=false`) and @@ -74,7 +71,7 @@ svdfact(x::Integer; thin::Bool=true) = svdfact(float(x), thin=thin) svd(A, thin::Bool=true) -> U, S, V Computes the SVD of `A`, returning `U`, vector `S`, and `V` such that -`A == U*diagm(S)*V'`. +`A == U*diagm(S)*V'`. The singular values in `S` are sorted in descending order. If `thin=true` (default), a thin SVD is returned. For a ``M \\times N`` matrix `A`, `U` is ``M \\times M`` for a full SVD (`thin=false`) and @@ -136,7 +133,7 @@ svdvals(A::AbstractMatrix{<:BlasFloat}) = svdvals!(copy(A)) """ svdvals(A) -Returns the singular values of `A`. +Returns the singular values of `A` in descending order. # Example