mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-11-24 16:35:28 +01:00
Compare commits
No commits in common. "9afbccda1566d6dd209f1ebfd32d230795643eda" and "56aed884161210688aa2ad6d5570a612a10ba73f" have entirely different histories.
9afbccda15
...
56aed88416
@ -82,17 +82,61 @@ unit = Δ
|
|||||||
show_progress = true,
|
show_progress = true,
|
||||||
)
|
)
|
||||||
|
|
||||||
solve_in_loop(
|
warm = nothing
|
||||||
model,
|
|
||||||
wd,
|
let status = JuMP.OPTIMIZE_NOT_CALLED, warm = warm, eps = 1e-9
|
||||||
varP;
|
certified, λ = false, 0.0
|
||||||
logdir = "./log/G2/r=$HALFRADIUS/Adj-$(UPPER_BOUND)Δ",
|
while status ≠ JuMP.OPTIMAL
|
||||||
optimizer = scs_optimizer(;
|
@time status, warm = PropertyT.solve(
|
||||||
linear_solver = SCS.MKLDirectSolver,
|
model,
|
||||||
eps = 1e-9,
|
scs_optimizer(;
|
||||||
max_iters = 100_000,
|
linear_solver = SCS.MKLDirectSolver,
|
||||||
accel = 50,
|
eps = eps,
|
||||||
alpha = 1.95,
|
max_iters = 100_000,
|
||||||
),
|
accel = 50,
|
||||||
data = (elt = elt, unit = unit, halfradius = HALFRADIUS),
|
alpha = 1.95,
|
||||||
)
|
),
|
||||||
|
warm,
|
||||||
|
)
|
||||||
|
|
||||||
|
@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
|
||||||
|
|
||||||
|
@info "certifying the solution"
|
||||||
|
@time certified, λ = PropertyT.certify_solution(
|
||||||
|
elt,
|
||||||
|
unit,
|
||||||
|
JuMP.objective_value(model),
|
||||||
|
Q;
|
||||||
|
halfradius = HALFRADIUS,
|
||||||
|
augmented = true,
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
if certified && λ > 0
|
||||||
|
Κ(λ, S) = round(sqrt(2λ / length(S)), Base.RoundDown; digits = 5)
|
||||||
|
@info "Certified result: $G has property (T):" N λ Κ(λ, S)
|
||||||
|
else
|
||||||
|
@info "Could NOT certify the result:" certified λ
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# solve_in_loop(
|
||||||
|
# model,
|
||||||
|
# wd,
|
||||||
|
# varP;
|
||||||
|
# logdir = "./log/G2/r=$HALFRADIUS/Adj-InfΔ",
|
||||||
|
# optimizer = scs_optimizer(;
|
||||||
|
# eps = 1e-10,
|
||||||
|
# max_iters = 50_000,
|
||||||
|
# accel = 50,
|
||||||
|
# alpha = 1.95,
|
||||||
|
# ),
|
||||||
|
# data = (elt = elt, unit = unit, halfradius = HALFRADIUS),
|
||||||
|
# )
|
||||||
|
@ -11,17 +11,11 @@ function get_solution(model)
|
|||||||
return solution
|
return solution
|
||||||
end
|
end
|
||||||
|
|
||||||
function get_solution(model, wd, varP, eps = 1e-10)
|
function get_solution(model, wd, varP)
|
||||||
λ = JuMP.value(model[:λ])
|
λ = JuMP.value(model[:λ])
|
||||||
|
|
||||||
@info "reconstructing the solution"
|
Qs = [real.(sqrt(JuMP.value.(P))) for P in varP]
|
||||||
Q = @time let wd = wd, Ps = [JuMP.value.(P) for P in varP], eps = eps
|
Q = PropertyT.reconstruct(Qs, wd)
|
||||||
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