mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-12-24 02:00:30 +01:00
less unicode
This commit is contained in:
parent
54b6fda9e8
commit
936c285155
@ -91,7 +91,7 @@ function distance_to_cone{T<:Rational, S<:Interval}(λ::T, sqrt_matrix::Array{S,
|
||||
info(logger, "ɛ(Δ² - λΔ - ∑ξᵢ*ξᵢ) ∈ $(ɛ_dist)")
|
||||
info(logger, "‖Δ² - λΔ - ∑ξᵢ*ξᵢ‖₁ ∈ $(eoi_SOS_L1_dist)")
|
||||
|
||||
distance_to_cone = λ - 2^(len-1)*eoi_SOS_L₁_dist
|
||||
distance_to_cone = λ - 2^(len-1)*eoi_SOS_L1_dist
|
||||
return distance_to_cone
|
||||
end
|
||||
|
||||
@ -99,14 +99,14 @@ function distance_to_cone{T<:AbstractFloat}(λ::T, sqrt_matrix::Array{T,2}, Δ::
|
||||
SOS = compute_SOS(sqrt_matrix, Δ)
|
||||
|
||||
SOS_diff = EOI(Δ, λ) - SOS
|
||||
eoi_SOS_L₁_dist = norm(SOS_diff,1)
|
||||
eoi_SOS_L1_dist = norm(SOS_diff,1)
|
||||
|
||||
info(logger, "λ = $λ")
|
||||
ɛ_dist = GroupRings.augmentation(SOS_diff)
|
||||
info(logger, "ɛ(Δ² - λΔ - ∑ξᵢ*ξᵢ) ≈ $(@sprintf("%.10f", ɛ_dist))")
|
||||
info(logger, "‖Δ² - λΔ - ∑ξᵢ*ξᵢ‖₁ ≈ $(@sprintf("%.10f", eoi_SOS_L₁_dist))")
|
||||
info(logger, "‖Δ² - λΔ - ∑ξᵢ*ξᵢ‖₁ ≈ $(@sprintf("%.10f", eoi_SOS_L1_dist))")
|
||||
|
||||
distance_to_cone = λ - 2^(len-1)*eoi_SOS_L₁_dist
|
||||
distance_to_cone = λ - 2^(len-1)*eoi_SOS_L1_dist
|
||||
return distance_to_cone
|
||||
end
|
||||
|
||||
@ -140,20 +140,20 @@ function check_distance_to_positive_cone(Δ::GroupRingElem, λ, P;
|
||||
|
||||
info(logger, "Checking in interval arithmetic")
|
||||
Q_ℚω_int = Float64.(Q_ℚω) ± δ
|
||||
t = @timed Interval_dist_to_Σ² = distance_to_cone(λ_ℚ, Q_ℚω_int, Δ_ℚ, len=len)
|
||||
t = @timed Interval_dist_to_ΣSq = distance_to_cone(λ_ℚ, Q_ℚω_int, Δ_ℚ, len=len)
|
||||
info(logger, timed_msg(t))
|
||||
info(logger, "The Augmentation-projected actual distance (to positive cone) ∈ $(Interval_dist_to_Σ²)")
|
||||
info(logger, "The Augmentation-projected actual distance (to positive cone) ∈ $(Interval_dist_to_ΣSq)")
|
||||
info(logger, "------------------------------------------------------------")
|
||||
|
||||
if Interval_dist_to_Σ².lo ≤ 0 || !rational
|
||||
return Interval_dist_to_Σ²
|
||||
if Interval_dist_to_ΣSq.lo ≤ 0 || !rational
|
||||
return Interval_dist_to_ΣSq
|
||||
else
|
||||
info(logger, "Checking Projected SOS decomposition in exact rational arithmetic...")
|
||||
t = @timed ℚ_dist_to_Σ² = distance_to_cone(λ_ℚ, Q_ℚω, Δ_ℚ, len=len)
|
||||
t = @timed ℚ_dist_to_ΣSq = distance_to_cone(λ_ℚ, Q_ℚω, Δ_ℚ, len=len)
|
||||
info(logger, timed_msg(t))
|
||||
@assert isa(ℚ_dist_to_Σ², Rational)
|
||||
info(logger, "Augmentation-projected rational distance (to positive cone) ≥ $(Float64(trunc(ℚ_dist_to_Σ²,8)))")
|
||||
@assert isa(ℚ_dist_to_ΣSq, Rational)
|
||||
info(logger, "Augmentation-projected rational distance (to positive cone) ≥ $(Float64(trunc(ℚ_dist_to_ΣSq,8)))")
|
||||
info(logger, "------------------------------------------------------------")
|
||||
return ℚ_dist_to_Σ²
|
||||
return ℚ_dist_to_ΣSq
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user