Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 4c85e83

Browse files
committed
Refine default degree bound
1 parent 60972c5 commit 4c85e83

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/sage/rings/polynomial/polynomial_ring.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -2227,10 +2227,9 @@ def _roots_univariate_polynomial(self, p, ring=None, multiplicities=False, algor
22272227
Q = p.list()
22282228

22292229
if degree_bound is None:
2230-
degree_bound = p.degree() # TODO; replace this by next lines once fixed
2231-
#l = len(Q) - 1
2232-
#dl = Q[l].degree()
2233-
#degree_bound = min((Q[i].degree() - dl)//(l - i) for i in range(l) if Q[i])
2230+
l = len(Q) - 1
2231+
dl = Q[l].degree()
2232+
degree_bound = max((Q[i].degree() - dl)//(l - i) for i in range(l) if Q[i])
22342233

22352234
if algorithm is None:
22362235
algorithm = "Roth-Ruckenstein"

0 commit comments

Comments
 (0)