1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-12-26 10:35:29 +01:00

drop zeros when reconstructing the solution

This commit is contained in:
Marek Kaluba 2023-04-11 10:32:24 +02:00
parent 263af398eb
commit 9afbccda15
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15

View File

@ -11,11 +11,17 @@ function get_solution(model)
return solution
end
function get_solution(model, wd, varP)
function get_solution(model, wd, varP, eps = 1e-10)
λ = JuMP.value(model[])
Qs = [real.(sqrt(JuMP.value.(P))) for P in varP]
Q = PropertyT.reconstruct(Qs, wd)
@info "reconstructing the solution"
Q = @time let wd = wd, Ps = [JuMP.value.(P) for P in varP], eps = eps
PropertyT.__droptol!.(Ps, 100eps)
Qs = real.(sqrt.(Ps))
PropertyT.__droptol!.(Qs, eps)
PropertyT.reconstruct(Qs, wd)
end
solution = Dict( => λ, :Q => Q)
return solution