Ticket #12289: trac_12289-more-alg.patch

File trac_12289-more-alg.patch, 5.1 KB (added by kcrisman, 6 years ago)
  • sage/functions/exp_integral.py

    # HG changeset patch
    # User Karl-Dieter Crisman <kcrisman@gmail.com>
    # Date 1371611484 14400
    # Node ID 58f03801e64d798eeea1f0d8edded0e20a877ce6
    # Parent  43e9f42f159040ff5ffe3c952e85d90af1657338
    Trac 12289 - adding algorithm keyword to functions added later
    
    diff --git a/sage/functions/exp_integral.py b/sage/functions/exp_integral.py
    a b  
    216216
    217217        return None # leaves the expression unevaluated
    218218
    219     def _evalf_(self, n, z, parent=None):
     219    def _evalf_(self, n, z, parent=None, algorithm=None):
    220220        """
    221221        EXAMPLES::
    222222
     
    327327
    328328        return None # leaves the expression unevaluated
    329329
    330     def _evalf_(self, z, parent=None):
     330    def _evalf_(self, z, parent=None, algorithm=None):
    331331        """
    332332        EXAMPLES::
    333333
     
    452452                return z
    453453        return None # leaves the expression unevaluated
    454454
    455     def _evalf_(self, z, parent=None):
     455    def _evalf_(self, z, parent=None, algorithm=None):
    456456        """
    457457        EXAMPLES::
    458458
     
    637637        # If we return:(li(z)-li(2)) we get correct symbolic integration.
    638638        # But on definite integration it returns x.xxxx-li(2).
    639639
    640     def _evalf_(self, z, parent=None):
     640    def _evalf_(self, z, parent=None, algorithm=None):
    641641        """
    642642        EXAMPLES::
    643643
     
    812812
    813813        return None # leaves the expression unevaluated
    814814
    815     def _evalf_(self, z, parent=None):
     815    def _evalf_(self, z, parent=None, algorithm=None):
    816816        """
    817817        EXAMPLES:
    818818
     
    972972
    973973        return None # leaves the expression unevaluated
    974974
    975     def _evalf_(self, z, parent=None):
     975    def _evalf_(self, z, parent=None, algorithm=None):
    976976        """
    977977        EXAMPLES::
    978978
     
    11271127
    11281128        return None # leaves the expression unevaluated
    11291129
    1130     def _evalf_(self, z, parent=None):
     1130    def _evalf_(self, z, parent=None, algorithm=None):
    11311131        """
    11321132        EXAMPLES::
    11331133
     
    12611261
    12621262        return None
    12631263
    1264     def _evalf_(self, z, parent=None):
     1264    def _evalf_(self, z, parent=None, algorithm=None):
    12651265        """
    12661266        EXAMPLES::
    12671267
     
    13961396            return self._evalf_(x, parent(x))
    13971397        return None
    13981398
    1399     def _evalf_(self, x, parent=None):
     1399    def _evalf_(self, x, parent=None, algorithm=None):
    14001400        """
    14011401        EXAMPLES::
    14021402
  • sage/functions/log.py

    diff --git a/sage/functions/log.py b/sage/functions/log.py
    a b  
    630630                return sage_structure_coerce_parent(z)(Integer(-1))
    631631        return None
    632632
    633     def _evalf_(self, n, z, parent=None):
     633    def _evalf_(self, n, z, parent=None, algorithm=None):
    634634        """
    635635        EXAMPLES::
    636636
  • sage/functions/other.py

    diff --git a/sage/functions/other.py b/sage/functions/other.py
    a b  
    17861786            # or x involves an expression such as sqrt(2)
    17871787            return None
    17881788
    1789     def _evalf_(self, x, parent_d=None):
     1789    def _evalf_(self, x, parent_d=None, algorithm=None):
    17901790        """
    17911791        EXAMPLES::
    17921792
     
    18121812            3.14159265358979
    18131813            sage: arg(2.0+3*i)
    18141814            0.982793723247329
     1815
     1816        TESTS::
     1817
     1818            sage: C = arg(5+I)
     1819            sage: C.n()
    18151820        """
    18161821        try:
    18171822            return x.arg()
  • sage/symbolic/expression.pyx

    diff --git a/sage/symbolic/expression.pyx b/sage/symbolic/expression.pyx
    a b  
    914914                    R_complex = R.complex_field()
    915915                except (TypeError, AttributeError):
    916916                    raise err
    917             res = self._gobj.evalf(0, {'parent':R})
     917            res = self._gobj.evalf(0, {'parent':R_complex})
    918918        if is_a_numeric(res):
    919919            return R(py_object_from_numeric(res))
    920920        else:
  • sage/symbolic/function.pyx

    diff --git a/sage/symbolic/function.pyx b/sage/symbolic/function.pyx
    a b  
    915915            sage: class my_function(SymbolicFunction):
    916916            ....:     def __init__(self):
    917917            ....:         SymbolicFunction.__init__(self, 'foo', nargs=2)
    918             ....:     def _evalf_(self, x, y, parent=None):
     918            ....:     def _evalf_(self, x, y, parent=None, algorithm=None):
    919919            ....:         return x*y*2r
    920920            ....:     def _conjugate_(self, x, y):
    921921            ....:         return x
  • sage/symbolic/pynac.pyx

    diff --git a/sage/symbolic/pynac.pyx b/sage/symbolic/pynac.pyx
    a b  
    10921092        1.0*I
    10931093        sage: py_float(pi, {'parent':RealField(100)})
    10941094        3.1415926535897932384626433833
    1095         sage: py_float(10, CDF)
     1095        sage: py_float(10, {'parent':CDF})
    10961096        10.0
    10971097        sage: type(py_float(10, {'parent':CDF}))
    10981098        <type 'sage.rings.complex_double.ComplexDoubleElement'>
    1099         sage: py_float(1/2, {'parent':CC}))
     1099        sage: py_float(1/2, {'parent':CC})
    11001100        0.500000000000000
    11011101        sage: type(py_float(1/2, {'parent':CC}))
    11021102        <type 'sage.rings.complex_number.ComplexNumber'>