David & William,

"David Joyner" <[EMAIL PROTECTED]> writes:

> I would use the lambda notation:
>
> sage: m = lambda x: matrix([[x[0],x[1]],[x[2],x[3]]])
> sage: m([1,2,3,4])
>
> [1 2]
> [3 4]
> sage: m([1,2,3,a])
>
> [1 2]
> [3 a]
> sage: m([a,b,3,4])
>
> [a b]
> [3 4]
>
>
> There might be better ways though.
>
> ++++++++++++++++++++++++++++++++++++++++

"William Stein" <[EMAIL PROTECTED]> writes:

> You should do m.substitute(a=1) just like you're doing -- unfortunately,
> nobody implemented that yet, and it's doing some dumb generic behavior.
> [...]
> Fortunately, I just implemented this for SAGE-2.7.1, which I'll release very
> very soon.

Thank you both very much.  It seems I need a careful read of the user
manual, I had not picked up on lambda expressions.  I am compiling
2.7.1 so will soon be able to test blah.substitute(a=1).

Roger


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
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/
-~----------~----~----~----~------~----~------~--~---

Reply via email to