1
0
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:
kalmarek 2019-04-12 23:18:48 +02:00
parent ed910ccde5
commit 70c160411d
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
5 changed files with 54 additions and 50 deletions

View File

@ -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(λ)

View File

@ -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]]

View File

@ -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)