mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-11-26 09:00:28 +01:00
G₂_Adj: bring back solve_in_loop
This commit is contained in:
parent
56aed88416
commit
263af398eb
@ -82,61 +82,17 @@ unit = Δ
|
|||||||
show_progress = true,
|
show_progress = true,
|
||||||
)
|
)
|
||||||
|
|
||||||
warm = nothing
|
solve_in_loop(
|
||||||
|
|
||||||
let status = JuMP.OPTIMIZE_NOT_CALLED, warm = warm, eps = 1e-9
|
|
||||||
certified, λ = false, 0.0
|
|
||||||
while status ≠ JuMP.OPTIMAL
|
|
||||||
@time status, warm = PropertyT.solve(
|
|
||||||
model,
|
model,
|
||||||
scs_optimizer(;
|
wd,
|
||||||
|
varP;
|
||||||
|
logdir = "./log/G2/r=$HALFRADIUS/Adj-$(UPPER_BOUND)Δ",
|
||||||
|
optimizer = scs_optimizer(;
|
||||||
linear_solver = SCS.MKLDirectSolver,
|
linear_solver = SCS.MKLDirectSolver,
|
||||||
eps = eps,
|
eps = 1e-9,
|
||||||
max_iters = 100_000,
|
max_iters = 100_000,
|
||||||
accel = 50,
|
accel = 50,
|
||||||
alpha = 1.95,
|
alpha = 1.95,
|
||||||
),
|
),
|
||||||
warm,
|
data = (elt = elt, unit = unit, halfradius = HALFRADIUS),
|
||||||
)
|
)
|
||||||
|
|
||||||
@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),
|
|
||||||
# )
|
|
||||||
|
Loading…
Reference in New Issue
Block a user