last minute functional changes

This commit is contained in:
kalmarek 2018-11-24 13:58:49 +01:00
parent 9fc23c43d7
commit 8666cc6b2c

View File

@ -129,6 +129,10 @@ orbit_data = PropertyT.decimate(orbit_data);
elt = adj+3op; elt = adj+3op;
const SOLUTION_FILE = PropertyT.filename(sett, :solution)
if !isfile(SOLUTION_FILE)
SDP_problem, varλ, varP = PropertyT.SOS_problem(elt, Δ, orbit_data; upper_bound=sett.upper_bound) SDP_problem, varλ, varP = PropertyT.SOS_problem(elt, Δ, orbit_data; upper_bound=sett.upper_bound)
begin begin
@ -162,7 +166,11 @@ end
info("Reconstructing P...") info("Reconstructing P...")
@time P = PropertyT.reconstruct(Ps, orbit_data); @time P = PropertyT.reconstruct(Ps, orbit_data);
save(PropertyT.filename(sett, :solution), "λ", λ, "P", P) save(SOLUTION_FILE, "λ", λ, "P", P)
end
P, λ = load(SOLUTION_FILE, "P", "λ")
@show λ;
@time const Q = real(sqrtm(P)); @time const Q = real(sqrtm(P));
@ -172,14 +180,12 @@ function SOS_residual(eoi::GroupRingElem, Q::Matrix)
return eoi - sos return eoi - sos
end end
addprocs(4) info("Floating Point arithmetic:")
@everywhere using PropertyT
@show λ;
EOI = elt - λ*Δ EOI = elt - λ*Δ
b = SOS_residual(EOI, Q) b = SOS_residual(EOI, Q)
@show norm(b, 1); @show norm(b, 1);
info("Interval arithmetic:")
using IntervalArithmetic using IntervalArithmetic
Qint = PropertyT.augIdproj(Q); Qint = PropertyT.augIdproj(Q);
@assert all([zero(eltype(Q)) in sum(view(Qint, :, i)) for i in 1:size(Qint, 2)]) @assert all([zero(eltype(Q)) in sum(view(Qint, :, i)) for i in 1:size(Qint, 2)])
@ -190,4 +196,4 @@ Q_int = PropertyT.augIdproj(Q);
b_int = SOS_residual(EOI_int, Q_int) b_int = SOS_residual(EOI_int, Q_int)
@show norm(b_int, 1); @show norm(b_int, 1);
@interval(λ) - 2^2*norm(b_int,1) info("λ is certified to be > ", (@interval(λ) - 2^2*norm(b_int,1)).lo)