1
0
mirror of https://github.com/kalmarek/SmallHyperbolic synced 2024-11-30 09:10:27 +01:00

move safe_eigvals

This commit is contained in:
kalmarek 2020-05-26 00:09:23 +02:00
parent 6cd237bb8e
commit d781aa46a9
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
2 changed files with 11 additions and 10 deletions

View File

@ -68,16 +68,6 @@ function load_principal_repr(i, q = 109; CC = AcbField(PRECISION))
return a, b
end
function safe_eigvals(m::acb_mat)
evs = eigvals(m)
all(isfinite.(evs)) && return evs
CC = base_ring(m)
X = matrix(CC, rand(CC, size(m)))
evs = eigvals(X * m * inv(X))
all(isfinite.(evs)) && return evs
throw(ArgumentError("Could not compute eigenvalues"))
end
if !isinteractive()
for i = 0:27

View File

@ -163,3 +163,14 @@ function _count_multiplicites(evs)
rev = true,
)
end
function safe_eigvals(m::acb_mat)
evs = eigvals(m)
all(isfinite.(evs)) && return evs
CC = base_ring(m)
X = matrix(CC, rand(CC, size(m)))
evs = eigvals(X * m * inv(X))
return evs
all(isfinite.(evs)) && return evs
throw(ArgumentError("Could not compute eigenvalues"))
end