1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-12-26 02:30:29 +01:00

log timings via @timed

This commit is contained in:
kalmar 2017-03-15 20:13:53 +01:00
parent b5608d473f
commit a16e14efe8

View File

@ -122,7 +122,8 @@ function check_distance_to_positive_cone(Δ::GroupAlgebraElement, κ, A;
info(logger, "------------------------------------------------------------") info(logger, "------------------------------------------------------------")
info(logger, "") info(logger, "")
info(logger, "Checking in floating-point arithmetic...") info(logger, "Checking in floating-point arithmetic...")
@time fp_distance = distance_to_cone(κ, A_sqrt, Δ) t = @timed fp_distance = distance_to_cone(κ, A_sqrt, Δ)
info(logger, timed_msg(t))
info(logger, "Floating point distance (to positive cone) ≈ $(Float64(trunc(fp_distance,10)))") info(logger, "Floating point distance (to positive cone) ≈ $(Float64(trunc(fp_distance,10)))")
info(logger, "------------------------------------------------------------") info(logger, "------------------------------------------------------------")
@ -135,7 +136,8 @@ function check_distance_to_positive_cone(Δ::GroupAlgebraElement, κ, A;
info(logger, "Checking in interval arithmetic") info(logger, "Checking in interval arithmetic")
A_sqrt__augᴵ = A_sqrt__aug ± δ A_sqrt__augᴵ = A_sqrt__aug ± δ
@time Interval_dist_to_Σ² = distance_to_cone(κ_, A_sqrt__augᴵ, Δ_) t = @timed Interval_dist_to_Σ² = distance_to_cone(κ_, A_sqrt__augᴵ, Δ_)
info(logger, timed_msg(t))
info(logger, "The Augmentation-projected actual distance (to positive cone) belongs to $Interval_dist_to_Σ²") info(logger, "The Augmentation-projected actual distance (to positive cone) belongs to $Interval_dist_to_Σ²")
info(logger, "------------------------------------------------------------") info(logger, "------------------------------------------------------------")
@ -143,7 +145,8 @@ function check_distance_to_positive_cone(Δ::GroupAlgebraElement, κ, A;
return Interval_dist_to_Σ².lo return Interval_dist_to_Σ².lo
else else
info(logger, "Checking Projected SOS decomposition in exact rational arithmetic...") info(logger, "Checking Projected SOS decomposition in exact rational arithmetic...")
@time _dist_to_Σ² = distance_to_cone(κ_, A_sqrt__aug, Δ_) t = @timed _dist_to_Σ² = distance_to_cone(κ_, A_sqrt__aug, Δ_)
info(logger, timed_msg(t))
@assert isa(_dist_to_Σ², Rational) @assert isa(_dist_to_Σ², 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_Σ²,8)))")
info(logger, "------------------------------------------------------------") info(logger, "------------------------------------------------------------")