1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-11-23 08:15:29 +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)) return sum(x[g].*mreps[g] for g in parent(x).basis if x[g] != zero(T))
end end
function orthSVD(M::AbstractMatrix) function orthSVD{T}(M::AbstractMatrix{T})
M = full(M) M = full(M)
fact = svdfact(M) fact = svdfact(M)
singv = fact[:S] M_rank = sum(fact[:S] .> maximum(size(M))*eps(T))
M_rank = sum(singv .> maximum(size(M))*eps(eltype(singv)))
return fact[:U][:,1:M_rank] return fact[:U][:,1:M_rank]
end end