File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
src/sage/rings/polynomial Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -2564,7 +2564,7 @@ cdef class Polynomial(CommutativePolynomial):
2564
2564
if ring is not None :
2565
2565
# If the new ring is not a finite field, attempt to coerce the polynomial
2566
2566
# and call the function to use naive factoring
2567
- if not ring in FiniteFields():
2567
+ if ring not in FiniteFields():
2568
2568
try :
2569
2569
f = self .change_ring(ring)
2570
2570
except ValueError :
@@ -2605,18 +2605,17 @@ cdef class Polynomial(CommutativePolynomial):
2605
2605
# should be fine. As a result, we simply coerce straight to the user supplied
2606
2606
# ring and find a root here.
2607
2607
# TODO: Additionally, if the above was solved, it would be faster to extend the base
2608
- # ring with the irreducible factor however, if the base ring is an extension
2608
+ # ring with the irreducible factor however, if the base ring is an extension
2609
2609
# then the type of self.base_ring().extension(f) is a Univariate Quotient Polynomial Ring
2610
2610
# and not a finite field. So we do the slower option here to ensure the type is
2611
2611
# maintained.
2612
2612
if not d.is_one():
2613
2613
f = f.change_ring(ring)
2614
-
2614
+
2615
2615
# Now we find the root of this irreducible polynomial over this extension
2616
2616
root = f.any_root()
2617
2617
return ring(root)
2618
2618
2619
-
2620
2619
# If the loop ends and we returned nothing, then no root exists
2621
2620
raise ValueError (f" no root of polynomial {self} can be computed over the ring {ring}" )
2622
2621
You can’t perform that action at this time.
0 commit comments