#15219: numerical integral needs an operand for callable symbolic functions
----------------------------+-------------------------
       Reporter:  kcrisman  |        Owner:
           Type:  defect    |       Status:  new
       Priority:  minor     |    Milestone:  sage-5.12
      Component:  calculus  |   Resolution:
       Keywords:            |    Merged in:
        Authors:            |    Reviewers:
Report Upstream:  N/A       |  Work issues:
         Branch:            |       Commit:
   Dependencies:            |     Stopgaps:
----------------------------+-------------------------

Comment (by kcrisman):

 Here's the relevant code.
 {{{

     def symbol(self, ex):
         r"""
         EXAMPLES::

             sage: f = x._fast_float_('x', 'y')
             sage: f(1,2)
             1.0
             sage: f = x._fast_float_('y', 'x')
             sage: f(1,2)
             2.0
         """
         if self.vars == ():
             return self.ff.fast_float_arg(0)

         vars = list(self.vars)
         name = repr(ex)
         if name in vars:
             return self.ff.fast_float_arg(vars.index(name))
         svars = [repr(x) for x in vars]
         if name in svars:
             return self.ff.fast_float_arg(svars.index(name))

         if ex.is_symbol(): # case of callable function which is the
 variable, like f(x)=x
             name = repr(SR(ex)) # this gets back just the 'output' of the
 function
             if name in svars:
                 return self.ff.fast_float_arg(svars.index(name))

         try:
             return self.ff.fast_float_constant(float(ex))
         except TypeError:
             raise ValueError, "free variable: %s" % repr(ex)
 }}}
 Note that this case is supposedly already taken care of!  But apparently
 in this case `name` is not in `svars`.   I'll investigate...

--
Ticket URL: <http://trac.sagemath.org/ticket/15219#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to