*Hello Sage team.
I would like to build callable symbolic expression into some python code
file an load (import) it. Since it's before Sage parse it, expression like
f(x) = x**2 is of course forbidden.
Look at this code :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# -*- coding: utf-8 -*-
from sage.symbolic.expression_conversions import SR
class C:
def __init__(self):
self.__f = SR(1) # An integer, for example. It could be "pi", etc.
def f(self, x):
return self.__f(x)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Now the Sage session :
> from C import C
> c = C()
< c.f(2)
*
*< ... ValueError: the number of arguments must be less than or equal to 0 ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
*What tool can I use to convert this constant an make it a constant
function ?
Thanks.*
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
Visit this group at http://groups.google.com/group/sage-support?hl=en.