17 Jan
2005
17 Jan
'05
12:44 a.m.
On Sun, 2005-01-16 at 23:19 +0200, Matti Peltomäki wrote:
This does not cause the same failure in the GiNaC test case since sparse_tree returns an ex. However, in PyGiNaC the return value is unwrapped from ex to whatever type it is, and with a numeric, the problem above occurs.
So, in the end, I'm left with the situation that I don't know how to symbolically present something like cos(1) in PyGiNaC. Is it possible in some way not obvious to me?
I think that the best solution is to not export the form of cos (and friends) that takes a numeric argument. That way, you always create a ginac.function object rather than call a true free function. This change requires you to use evalf() if you really want to evaluate it numerically. -Jonathan