#12303: leave beta symbolic for exact complex inputs
------------------------------------+---------------------------------------
Reporter: ktkohl | Owner: burcin
Type: defect | Status: new
Priority: major | Milestone: sage-5.1
Component: symbolics | Resolution:
Keywords: special function | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Burcin Erocal | Merged in:
Dependencies: | Stopgaps:
------------------------------------+---------------------------------------
Changes (by {'newvalue': u'Burcin Erocal', 'oldvalue': ''}):
* milestone: sage-5.0 => sage-5.1
* dependencies: 9130 =>
* author: => Burcin Erocal
Comment:
Pynac 0.2.4 from #12950 contains a fix for this. There is a patch with a
doctest attached to that ticket. We should close this when that is merged.
Replying to [comment:2 benjaminfjones]:
> How is a Ginac function called to do numerical evaluation? I thought
this would work as a custom `_eval_` method for `beta`:
>
> {{{
> #!python
> def _eval_(self, y, z):
> if not isinstance(y, Expression) and not isinstance(z,
Expression) and \
> (is_inexact(y) or is_inexact(z)):
> coercion_model = sage.structure.element.get_coercion_model()
> y, z = coercion_model.canonical_coercion(y, z)
> return GinacFunction.__call__(self, y, z)
> return None
> }}}
>
> But `GinacFunction.__call__` ends up calling the custom `_eval_` and I
get an infinite recursion. I'm having trouble using the debugger to
determine how, for example, `beta(4.0, 5.0)` is calculated. Is this
because Pynac is mostly in Cython?
Pynac is mostly C++. You should use GDB to trace the code.
The short answer to your question is: I haven't thought of this use case,
so there isn't an easy way to call the evaluation method defined in Pynac
from your `_eval_()`. The custom methods can only overwrite the ones
defined in C++, they don't follow any inheritance principles from OOP.
This could be done by calling `beta_eval()` defined in
`ginac/inifcns_gamma.cpp` directly from Cython, but that would be really
messy. :)
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12303#comment:3>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.