mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-12-26 18:40:29 +01:00
replace distance_to_cone by distances_to_cone without logging
This commit is contained in:
parent
923d892da0
commit
5918e20569
@ -45,32 +45,13 @@ function compute_SOS(Q::AbstractArray, RG::GroupRing, l::Int)
|
|||||||
return GroupRingElem(result, RG)
|
return GroupRingElem(result, RG)
|
||||||
end
|
end
|
||||||
|
|
||||||
function distance_to_cone{T<:Interval}(elt::GroupRingElem, Q::AbstractArray{T,2}, wlen::Int)
|
function distances_to_cone(elt::GroupRingElem, wlen::Int)
|
||||||
SOS = compute_SOS(Q, parent(elt), length(elt.coeffs))
|
ɛ_dist = GroupRings.augmentation(elt)
|
||||||
SOS_diff = elt - SOS
|
|
||||||
|
|
||||||
ɛ_dist = GroupRings.augmentation(SOS_diff)
|
eoi_SOS_L1_dist = norm(elt,1)
|
||||||
info(LOGGER, "ɛ(∑ξᵢ*ξᵢ) ∈ $(ɛ_dist)")
|
|
||||||
|
|
||||||
eoi_SOS_L1_dist = norm(SOS_diff,1)
|
|
||||||
info(LOGGER, "‖Δ² - λΔ - ∑ξᵢ*ξᵢ‖₁ ∈ $(eoi_SOS_L1_dist)")
|
|
||||||
|
|
||||||
dist = 2^(wlen-1)*eoi_SOS_L1_dist
|
dist = 2^(wlen-1)*eoi_SOS_L1_dist
|
||||||
return dist
|
return dist, ɛ_dist, eoi_SOS_L1_dist
|
||||||
end
|
|
||||||
|
|
||||||
function distance_to_cone{T}(elt::GroupRingElem, Q::AbstractArray{T,2}, wlen::Int)
|
|
||||||
SOS = compute_SOS(Q, parent(elt), length(elt.coeffs))
|
|
||||||
SOS_diff = elt - SOS
|
|
||||||
|
|
||||||
ɛ_dist = GroupRings.augmentation(SOS_diff)
|
|
||||||
info(LOGGER, "ɛ(Δ² - λΔ - ∑ξᵢ*ξᵢ) ≈ $(@sprintf("%.10f", ɛ_dist))")
|
|
||||||
|
|
||||||
eoi_SOS_L1_dist = norm(SOS_diff,1)
|
|
||||||
info(LOGGER, "‖Δ² - λΔ - ∑ξᵢ*ξᵢ‖₁ ≈ $(@sprintf("%.10f", eoi_SOS_L1_dist))")
|
|
||||||
|
|
||||||
dist = 2^(wlen-1)*eoi_SOS_L1_dist
|
|
||||||
return dist
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function augIdproj{T, I<:AbstractInterval}(S::Type{I}, Q::AbstractArray{T,2})
|
function augIdproj{T, I<:AbstractInterval}(S::Type{I}, Q::AbstractArray{T,2})
|
||||||
|
Loading…
Reference in New Issue
Block a user