mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-12-27 02:45:30 +01:00
drop zeros when reconstructing the solution
This commit is contained in:
parent
263af398eb
commit
9afbccda15
@ -11,11 +11,17 @@ function get_solution(model)
|
|||||||
return solution
|
return solution
|
||||||
end
|
end
|
||||||
|
|
||||||
function get_solution(model, wd, varP)
|
function get_solution(model, wd, varP, eps = 1e-10)
|
||||||
λ = JuMP.value(model[:λ])
|
λ = JuMP.value(model[:λ])
|
||||||
|
|
||||||
Qs = [real.(sqrt(JuMP.value.(P))) for P in varP]
|
@info "reconstructing the solution"
|
||||||
Q = PropertyT.reconstruct(Qs, wd)
|
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)
|
solution = Dict(:λ => λ, :Q => Q)
|
||||||
|
|
||||||
return solution
|
return solution
|
||||||
|
Loading…
Reference in New Issue
Block a user