Ticket #13533: 13533_gcc_not_optional.patch

File 13533_gcc_not_optional.patch, 5.0 KB (added by jdemeyer, 10 years ago)
  • sage/misc/cython.py

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1348600581 -7200
    # Node ID d895d1e2210e0e53d9bbcfb10b7aacf9ebed76b7
    # Parent  011160197a50e08948ab8d48a3f62bb4dee10d51
    No longer mark Cython tests as "optional - gcc"
    
    diff --git a/sage/misc/cython.py b/sage/misc/cython.py
    a b  
    590590    Create a compiled function which evaluates ``expr`` assuming machine values
    591591    for ``vars``.
    592592
    593     .. warning::
    594 
    595         This implementation is not well tested.
    596 
    597593    INPUT:
    598594
    599595    - ``vars`` - list of pairs (variable name, c-data type), where the variable
     
    604600      objects defined in the current module scope ``globals()`` using
    605601      ``sage.object_name``.
    606602
     603    .. warning::
     604
     605        Accessing ``globals()`` doesn't actually work, see :trac:`12446`.
     606
    607607    EXAMPLES:
    608608
    609609    We create a Lambda function in pure Python (using the r to make sure the 3.2
     
    613613
    614614    We make the same Lambda function, but in a compiled form. ::
    615615
    616         sage: g = cython_lambda('double x, double y', 'x*x + y*y + x + y + 17*x + 3.2')  # optional -- gcc
    617         sage: g(2,3)                                                                     # optional -- gcc
    618         55.200000000000003
    619         sage: g(0,0)                                                                     # optional -- gcc
    620         3.2000000000000002
     616        sage: g = cython_lambda('double x, double y', 'x*x + y*y + x + y + 17*x + 3.2')
     617        sage: g(2,3)
     618        55.2
     619        sage: g(0,0)
     620        3.2
    621621
    622     We access a global function and variable. ::
     622    The following should work but doesn't, see :trac:`12446`::
    623623
    624624        sage: a = 25
    625         sage: f = cython_lambda('double x', 'sage.math.sin(x) + sage.a')                 # optional -- gcc
    626         sage: f(10)                                                                      # optional -- gcc
     625        sage: f = cython_lambda('double x', 'sage.math.sin(x) + sage.a')
     626        sage: f(10)  # known bug
    627627        24.455978889110629
    628628        sage: a = 50
    629         sage: f(10)                                                                      # optional -- gcc
     629        sage: f(10)  # known bug
    630630        49.455978889110632
    631631    """
    632632    if isinstance(vars, str):
     
    664664
    665665    INPUT:
    666666
    667     - ``filename`` - string: a Cython (formerly SageX) (.spyx) file
     667    - ``filename`` - string: a Cython (.spyx) file
    668668
    669669    OUTPUT: None
    670670
     
    689689        sage: s = "def hello():\n  print 'hello'\n"
    690690        sage: f.write(s)
    691691        sage: f.close()
    692         sage: cython_create_local_so('hello.spyx')                            # optional -- gcc
     692        sage: cython_create_local_so('hello.spyx')
    693693        Compiling hello.spyx...
    694         sage: sys.path.append('.')                                            # optional -- gcc
    695         sage: import hello                                                    # optional -- gcc
    696         sage: hello.hello()                                                   # optional -- gcc
     694        sage: sys.path.append('.')
     695        sage: import hello
     696        sage: hello.hello()
    697697        hello
    698698        sage: os.chdir(curdir)
    699699
  • sage/misc/session.pyx

    diff --git a/sage/misc/session.pyx b/sage/misc/session.pyx
    a b  
    266266
    267267    Something similar happens for cython-defined functions.::
    268268   
    269         sage: g = cython_lambda('double x', 'x*x + 1.5')  # optional -- gcc
    270         sage: save_session('tmp_f', verbose=True)         # optional -- gcc
    271         ...
     269        sage: g = cython_lambda('double x', 'x*x + 1.5')
     270        sage: save_session('tmp_f', verbose=True)
     271        Saving...
    272272        Not saving g: g is a function, method, class or type
    273273        ...
    274274    """
  • sage/rings/polynomial/polynomial_compiled.pyx

    diff --git a/sage/rings/polynomial/polynomial_compiled.pyx b/sage/rings/polynomial/polynomial_compiled.pyx
    a b  
    3131        [ ] Recursive calling
    3232        [ ] Faster casting of coefficients / argument
    3333        [ ] Multivariate polynomials
    34         [ ] SageX implementation of Pippenger's Algorithm that doesn't
     34        [ ] Cython implementation of Pippenger's Algorithm that doesn't
    3535            depend heavily upon dicts.
    3636        [ ] Computation of parameter sequence suggested by Pippenger
    3737        [ ] Univariate exponentiation can use Brauer's method to improve
  • sage/structure/element.pyx

    diff --git a/sage/structure/element.pyx b/sage/structure/element.pyx
    a b  
    923923        return left._rich_to_bool(op, left._cmp_c_impl(right))
    924924
    925925    cdef int _cmp_c_impl(left, Element right) except -2:
    926         ### For derived SageX code, you *MUST* ALSO COPY the __richcmp__ above
     926        ### For derived Cython code, you *MUST* ALSO COPY the __richcmp__ above
    927927        ### into your class!!!  For Python code just use __cmp__.
    928928        raise NotImplementedError, "BUG: sort algorithm for elements of '%s' not implemented"%right.parent()
    929929