mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-09-13 08:35:40 +02:00
correct columns of Q directly to intervals
hopefully containing 0
This commit is contained in:
parent
9840268250
commit
56d944e8af
@ -50,13 +50,13 @@ function compute_SOS(sqrt_matrix, elt::GroupRingElem)
|
|||||||
return GroupRingElem(result, parent(elt))
|
return GroupRingElem(result, parent(elt))
|
||||||
end
|
end
|
||||||
|
|
||||||
function correct_to_augmentation_ideal!{T<:Rational}(sqrt_matrix::Array{T,2})
|
function correct_to_augmentation_ideal{T<:Rational}(sqrt_matrix::Array{T,2})
|
||||||
l = size(sqrt_matrix, 2)
|
l = size(sqrt_matrix, 2)
|
||||||
sqrt_corrected = sqrt_matrix
|
sqrt_corrected = Array{Interval{Float64}}(l,l)
|
||||||
Threads.@threads for j in 1:l
|
Threads.@threads for j in 1:l
|
||||||
col = sum(view(sqrt_matrix, :,j))//l
|
col = sum(view(sqrt_matrix, :,j))//l
|
||||||
for i in 1:l
|
for i in 1:l
|
||||||
sqrt_corrected[i,j] -= col
|
sqrt_corrected[i,j] = (Float64(sqrt_matrix[i,j]) - Float64(col)) ± eps(0.0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return sqrt_corrected
|
return sqrt_corrected
|
||||||
@ -120,14 +120,13 @@ function rationalize_and_project{T}(Q::AbstractArray{T}, δ::T, logger)
|
|||||||
info(logger, timed_msg(t))
|
info(logger, timed_msg(t))
|
||||||
|
|
||||||
info(logger, "Projecting columns of the rationalized Q to the augmentation ideal...")
|
info(logger, "Projecting columns of the rationalized Q to the augmentation ideal...")
|
||||||
t = @timed Q_ℚω = correct_to_augmentation_ideal!(Q_ℚ)
|
t = @timed Q_int = correct_to_augmentation_ideal(Q_ℚ)
|
||||||
info(logger, timed_msg(t))
|
info(logger, timed_msg(t))
|
||||||
|
|
||||||
info(logger, "Intervalizing Q")
|
check = all([0.0 in sum(view(Q_int, :, i)) for i in 1:size(Q_int, 2)])
|
||||||
t = @timed Q_ℚω_int = Float64.(Q_ℚω) ± 10*eps(δ)
|
@assert check
|
||||||
info(logger, timed_msg(t))
|
|
||||||
|
|
||||||
return Q_ℚω_int
|
return Q_int
|
||||||
end
|
end
|
||||||
|
|
||||||
function check_distance_to_positive_cone(Δ::GroupRingElem, λ, Q, wlen;
|
function check_distance_to_positive_cone(Δ::GroupRingElem, λ, Q, wlen;
|
||||||
|
Loading…
Reference in New Issue
Block a user