mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-12-25 02:15:29 +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, "ɛ(Δ² - λΔ - ∑ξᵢ*ξᵢ) ∈ $(ɛ_dist)")
|
||||||
info(logger, "‖Δ² - λΔ - ∑ξᵢ*ξᵢ‖₁ ∈ $(eoi_SOS_L1_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
|
return distance_to_cone
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -99,14 +99,14 @@ function distance_to_cone{T<:AbstractFloat}(λ::T, sqrt_matrix::Array{T,2}, Δ::
|
|||||||
SOS = compute_SOS(sqrt_matrix, Δ)
|
SOS = compute_SOS(sqrt_matrix, Δ)
|
||||||
|
|
||||||
SOS_diff = EOI(Δ, λ) - SOS
|
SOS_diff = EOI(Δ, λ) - SOS
|
||||||
eoi_SOS_L₁_dist = norm(SOS_diff,1)
|
eoi_SOS_L1_dist = norm(SOS_diff,1)
|
||||||
|
|
||||||
info(logger, "λ = $λ")
|
info(logger, "λ = $λ")
|
||||||
ɛ_dist = GroupRings.augmentation(SOS_diff)
|
ɛ_dist = GroupRings.augmentation(SOS_diff)
|
||||||
info(logger, "ɛ(Δ² - λΔ - ∑ξᵢ*ξᵢ) ≈ $(@sprintf("%.10f", ɛ_dist))")
|
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
|
return distance_to_cone
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -140,20 +140,20 @@ function check_distance_to_positive_cone(Δ::GroupRingElem, λ, P;
|
|||||||
|
|
||||||
info(logger, "Checking in interval arithmetic")
|
info(logger, "Checking in interval arithmetic")
|
||||||
Q_ℚω_int = Float64.(Q_ℚω) ± δ
|
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, 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, "------------------------------------------------------------")
|
info(logger, "------------------------------------------------------------")
|
||||||
|
|
||||||
if Interval_dist_to_Σ².lo ≤ 0 || !rational
|
if Interval_dist_to_ΣSq.lo ≤ 0 || !rational
|
||||||
return Interval_dist_to_Σ²
|
return Interval_dist_to_ΣSq
|
||||||
else
|
else
|
||||||
info(logger, "Checking Projected SOS decomposition in exact rational arithmetic...")
|
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))
|
info(logger, timed_msg(t))
|
||||||
@assert isa(ℚ_dist_to_Σ², Rational)
|
@assert isa(ℚ_dist_to_ΣSq, Rational)
|
||||||
info(logger, "Augmentation-projected rational distance (to positive cone) ≥ $(Float64(trunc(ℚ_dist_to_Σ²,8)))")
|
info(logger, "Augmentation-projected rational distance (to positive cone) ≥ $(Float64(trunc(ℚ_dist_to_ΣSq,8)))")
|
||||||
info(logger, "------------------------------------------------------------")
|
info(logger, "------------------------------------------------------------")
|
||||||
return ℚ_dist_to_Σ²
|
return ℚ_dist_to_ΣSq
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user