mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-11-29 09:45:27 +01:00
cosmetic changes (mostly empty lines)
This commit is contained in:
parent
ed910ccde5
commit
70c160411d
@ -91,6 +91,8 @@ function approximate_by_SOS(sett::Naive,
|
||||
elt::GroupRingElem, orderunit::GroupRingElem;
|
||||
solverlog=tempname()*".log")
|
||||
|
||||
isdir(fullpath(sett)) || mkpath(fullpath(sett))
|
||||
|
||||
@info "Creating SDP problem..."
|
||||
SDP_problem = SOS_problem(elt, orderunit, upper_bound=sett.upper_bound)
|
||||
@info Base.repr(SDP_problem)
|
||||
@ -120,6 +122,8 @@ function approximate_by_SOS(sett::Symmetrized,
|
||||
elt::GroupRingElem, orderunit::GroupRingElem;
|
||||
solverlog=tempname()*".log")
|
||||
|
||||
isdir(fullpath(sett)) || mkpath(fullpath(sett))
|
||||
|
||||
if !isfile(filename(sett, :OrbitData))
|
||||
isdefined(parent(orderunit), :basis) || throw("You need to define basis of Group Ring to compute orbit decomposition!")
|
||||
orbit_data = OrbitData(parent(orderunit), sett.autS)
|
||||
@ -172,16 +176,16 @@ function certify_SOS_decomposition(elt::GroupRingElem, orderunit::GroupRingElem,
|
||||
@time residual = eoi - compute_SOS(parent(eoi), augIdproj(Q))
|
||||
|
||||
L1_norm = norm(residual,1)
|
||||
certified_λ = λ - 2.0^(2ceil(log2(R)))*L1_norm
|
||||
floatingpoint_λ = λ - 2.0^(2ceil(log2(R)))*L1_norm
|
||||
|
||||
info_strs = ["Numerical metrics of the obtained SOS:",
|
||||
"ɛ(elt - λu - ∑ξᵢ*ξᵢ) ≈ $(aug(residual))",
|
||||
"‖elt - λu - ∑ξᵢ*ξᵢ‖₁ ≈ $(L1_norm)",
|
||||
"Floating point (NOT certified) λ ≈"]
|
||||
@info join(info_strs, "\n") certified_λ
|
||||
@info join(info_strs, "\n") floatingpoint_λ
|
||||
|
||||
if certified_λ ≤ 0
|
||||
return certified_λ
|
||||
if floatingpoint_λ ≤ 0
|
||||
return floatingpoint_λ
|
||||
end
|
||||
|
||||
λ = @interval(λ)
|
||||
|
@ -218,8 +218,8 @@ import Base.*
|
||||
"""
|
||||
function *(x::AbstractAlgebra.MatElem, P::Generic.perm)
|
||||
z = similar(x)
|
||||
m = rows(x)
|
||||
n = cols(x)
|
||||
m = nrows(x)
|
||||
n = ncols(x)
|
||||
for i = 1:m
|
||||
for j = 1:n
|
||||
z[i, j] = x[i,P[j]]
|
||||
|
@ -172,7 +172,7 @@ end
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
function warmstart_scs!(m::JuMP.Model, warmstart)
|
||||
function setwarmstart_scs!(m::JuMP.Model, warmstart)
|
||||
solver_name(m) == "SCS" || throw("warmstarting defined only for SCS!")
|
||||
primal, dual, slack = warmstart
|
||||
m.moi_backend.optimizer.model.optimizer.sol.primal = primal
|
||||
@ -197,7 +197,7 @@ function solve(m::JuMP.Model, with_optimizer::JuMP.OptimizerFactory, warmstart=n
|
||||
MOIU.attach_optimizer(m)
|
||||
|
||||
if warmstart != nothing
|
||||
warmstart_scs!(m, warmstart)
|
||||
setwarmstart_scs!(m, warmstart)
|
||||
end
|
||||
|
||||
optimize!(m)
|
||||
|
Loading…
Reference in New Issue
Block a user