Ticket #10635: trac_10635_field_hooks.patch

File trac_10635_field_hooks.patch, 1.2 KB (added by cjh, 11 years ago)

Patch implementing desired changes

  • sage/rings/polynomial/polynomial_element.pyx

    Detected SAGE64 flag
    Building Sage on OS X in 64-bit mode
    # HG changeset patch
    # User Chris Hall <chall14@uwyo.edu>
    # Date 1305045830 21600
    # Node ID 60499ea563eb6eb589b1f6f4e0170cc5ca1ec9d0
    # Parent  361a4ad7d52c69b64ae2e658ffd0820af0d87e93
    Trac 10635: added hooks in roots() and factor() for field-provided routines
    
    diff -r 361a4ad7d52c -r 60499ea563eb sage/rings/polynomial/polynomial_element.pyx
    a b  
    27422742        from sage.rings.rational_field import is_RationalField
    27432743
    27442744        n = None
     2745        if hasattr(R, '_factor_univariate_polynomial'):
     2746            return R._factor_univariate_polynomial(self)
     2747
    27452748        if is_IntegerModRing(R) or is_IntegerRing(R) or is_RationalField(R):
    27462749
    27472750            try:
     
    47104713
    47114714        K = self.parent().base_ring()
    47124715        L = K if ring is None else ring
     4716
     4717        if hasattr(K, '_roots_univariate_polynomial'):
     4718            return K._roots_univariate_polynomial(self, ring=ring, multiplicities=multiplicities, algorithm=algorithm)
    47134719       
    47144720        late_import()
    47154721