1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-11-19 07:20:28 +01:00

improve slightly orthSVD

This commit is contained in:
kalmarek 2017-11-08 09:50:58 +01:00
parent 3c51a463dc
commit 4ba2f54bb4

View File

@ -164,11 +164,10 @@ function Cstar_repr{T}(x::GroupRingElem{T}, mreps::Dict)
return sum(x[g].*mreps[g] for g in parent(x).basis if x[g] != zero(T))
end
function orthSVD(M::AbstractMatrix)
function orthSVD{T}(M::AbstractMatrix{T})
M = full(M)
fact = svdfact(M)
singv = fact[:S]
M_rank = sum(singv .> maximum(size(M))*eps(eltype(singv)))
M_rank = sum(fact[:S] .> maximum(size(M))*eps(T))
return fact[:U][:,1:M_rank]
end