>
> The above code is a good idea, but there would be efficiency
> issues. It would be better to do this (see the ev function below).
>
> sage: R1.<w> = QQ['w']
> sage: R2.<z> = R1['z']
> sage: f = w*z + (1-w)*z^3 + 3
> sage: def ev(f, a):
> ... return f.parent()([c(a) for c in f.list()])
> sage: ev(f, 3)
> (-2)*z^3 + 3*z + 3
>
> That said, I would love to add a function that basically does the above
> to SAGE, but it's unclear what the notation would even be. One idea
> is this:
> sage: f(w=3)
in my actual situation, i have something like
R1.<w0,w1,w2,w3,w4,w5> = QQ['w']
R2.<z> = R1['z']
and i would like to compute the w's from some other variables, and then
pass this list into the evaluator:
w = <expression that returns list of [w0,...,w5]>
f(z;w) # pseudo-notation
instead of the cumbersome
f(w0=w[0],w1=w[1],...)
which only handles a constant number of variables anyway.
i don't know what the notation should be, but it should somehow handle
multiple variables.
man, i really love using a software package where i can request features
and have a response within hours.
-kyle
--~--~---------~--~----~------------~-------~--~----~
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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---