On Apr 2, 1:45 pm, Franco Saliola <[email protected]> wrote:
> sage: a = SymbolicVariables('a')
> ...
> Here is a very simple implementation of SymbolicVariables.
>
> class SymbolicVariables(SageObject):
> def __init__(self, prefix='x'):
> self._prefix = prefix
> def __getitem__(self, i):
> return var("%s%s"%(self._prefix, i))
>
> Thoughts?
It would be conveniet if that would work with more than 1 index, too.
In this particular example, a[1,2] produces something strange if
typeset is turned on in the notebook.
Also, in Maple matrices and vectors with symbolic entries can be
defined as
Matrix(2, symbol=a);
[a[1, 1] a[1, 2]]
[ ]
[a[2, 1] a[2, 2]]
Vector(3, symbol=b);
[b[1]]
[ ]
[b[2]]
[ ]
[b[3]]
Alec
--
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
URL: http://www.sagemath.org
To unsubscribe, reply using "remove me" as the subject.