Ticket #13922: trac_13922_faster_QQgcd.patch

File trac_13922_faster_QQgcd.patch, 1.5 KB (added by Simon King, 10 years ago)
  • .hgignore

    # HG changeset patch
    # User Simon King <simon.king@uni-jena.de>
    # Date 1357577854 -3600
    # Node ID a9df8ba646af506811b27db20b9fc4bb383f7980
    # Parent  750e847040aa026e8747e7a7ade27ffbfba2dfbf
    #13922: Avoid the creation of non-unique real interval fields and homsets in QQ.gcd
    Add sage/rings/real_mpfi.h to .hgignore
    
    diff --git a/.hgignore b/.hgignore
    a b  
    5353sage/rings/rational.h
    5454sage/rings/complex_double.h
    5555sage/rings/complex_double_api.h
     56sage/rings/real_mpfi.h
    5657sage/misc/allocator.h
    5758sage/symbolic/pynac.h
    5859sage/modular/arithgroup/farey_symbol.h
  • sage/rings/real_mpfi.pyx

    diff --git a/sage/rings/real_mpfi.pyx b/sage/rings/real_mpfi.pyx
    a b  
    242242# The real field is in Cython, so mpfi elements will have access to
    243243# their parent via direct C calls, which will be faster.
    244244
    245 RealIntervalField_cache = {}
    246 
    247 def RealIntervalField(prec=53, sci_not=False):
     245cdef public dict RealIntervalField_cache = {}
     246
     247cpdef RealIntervalField_class RealIntervalField(prec=53, sci_not=False):
    248248    r"""
    249249    Construct a RealIntervalField_class, with caching.
    250250
     
    28262826        # First, we try using approximate arithmetic of slightly higher
    28272827        # precision.
    28282828        cdef RealIntervalFieldElement highprec
    2829         highprec = RealIntervalField_class(int(self.prec() * 1.2))(self)
     2829        highprec = RealIntervalField(int(self.prec() * 1.2))(self)
    28302830
    28312831        cdef Rational try1 = highprec._simplest_rational_helper()
    28322832