1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-12-25 02:15:29 +01:00

sparsify only once during the reconstruction

This commit is contained in:
kalmar 2017-07-28 12:44:25 +02:00
parent 706097931a
commit f6674337ed

View File

@ -123,10 +123,11 @@ function reconstruct_sol{T<:GroupElem, S<:AbstractArray}(mreps::Dict{T, S},
for g in keys(mreps)
A, B = mreps[g], mreps[inv(g)]
for π in 1:length(Us)
recP .+= sparsify(dims[π].* (A * Us[π]*Ps[π]*Ust[π] * B))
recP .+= dims[π].* (A * Us[π]*Ps[π]*Ust[π] * B)
end
end
recP .*= 1/length(keys(mreps))
recP[abs.(recP) .< eps(eltype(recP))] = zero(eltype(recP))
return recP
end