move sqrtm out och check_distance_to_positive_cone

This commit is contained in:
kalmar 2017-06-22 12:04:24 +02:00
parent 9c3a1d56c7
commit ee08c52305

View File

@ -228,7 +228,13 @@ function orbit_check_propertyT(logger, sett::Settings)
info(logger, "minimum(P) = $(minimum(P))")
if λ > 0
sgap = PropertyT.check_distance_to_positive_cone(Δ, λ, P, 2*sett.radius, tol=sett.tol, rational=false)
isapprox(eigvals(P), abs(eigvals(P)), atol=sett.tol) ||
warn("The solution matrix doesn't seem to be positive definite!")
# @assert P == Symmetric(P)
Q = real(sqrtm(Symmetric(P)))
sgap = PropertyT.check_distance_to_positive_cone(Δ, λ, Q, 2*sett.radius, tol=sett.tol, rational=false)
if isa(sgap, Interval)
sgap = sgap.lo
end