1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-10-15 08:05:35 +02:00

put rationalization and projection to augmentation in a separate function

to have gc collect unused matrices of Rationals after this is finished
This commit is contained in:
kalmar 2017-08-04 20:36:25 +02:00
parent 845d7733a4
commit 7d42f28b29

View File

@ -111,6 +111,23 @@ function distance_to_cone(λ, sqrt_matrix::AbstractArray, Δ::GroupRingElem, wle
return distance_to_cone
end
function rationalize_and_project{T}(Q::AbstractArray{T}, δ::T, logger)
info(logger, "")
info(logger, "Rationalizing")
t = @timed Q_ = (Q, δ)
info(logger, timed_msg(t))
info(logger, "Projecting columns of the rationalized Q to the augmentation ideal...")
t = @timed Q_ω = correct_to_augmentation_ideal!(Q_)
info(logger, timed_msg(t))
info(logger, "Intervalizing Q")
t = @timed Q_ω_int = Float64.(Q_ω) ± 10*eps(δ)
info(logger, timed_msg(t))
return Q_ω_int
end
function check_distance_to_positive_cone(Δ::GroupRingElem, λ, Q, wlen;
tol=1e-14, rational=false)
@ -127,16 +144,13 @@ function check_distance_to_positive_cone(Δ::GroupRingElem, λ, Q, wlen;
end
info(logger, "")
info(logger, "Projecting columns of rationalized Q to the augmentation ideal...")
δ = tol
Q_ = (Q, δ)
t = @timed Q_ω = correct_to_augmentation_ideal(Q_)
info(logger, timed_msg(t))
λ_ = (λ, δ)
Δ_ = (Δ, δ)
info(logger, "Projecting columns of the rationalized Q to the augmentation ideal...")
Q_ω_int = rationalize_and_project(Q, tol, logger)
λ_ = (λ, tol)
Δ_ = (Δ, tol)
info(logger, "Checking in interval arithmetic")
Q_ω_int = Float64.(Q_ω) ± δ
t = @timed Interval_dist_to_ΣSq = distance_to_cone(λ_, Q_ω_int, Δ_, wlen)
info(logger, timed_msg(t))
info(logger, "The Augmentation-projected actual distance (to positive cone) ∈ $(Interval_dist_to_ΣSq)")