Am 2014-08-24 um 16:28 schrieb Volker Braun:
> On Sunday, August 24, 2014 1:38:51 PM UTC+1, Daniel Krenn wrote:
>
> MyElementAdd(MyElementAtom, MyElementMul(MyElementAtom,
> MyElementAtom)
> should be a valid element for my parent.
>
> Are these classes? You mean there is an open-ended number of classes?
No, sorry, the above is very ambiguous. I meant, that each element is of
a certain type and has a number of operands, i.e., the above is
instance of MyElementAdd with operands
- instance of MyElementAtom (no operands)
- instance of MyElementMul with operands
- instance of MyElementAtom (no operands)
- instance of MyElementAtom (no operands)
> (I thought a while about making the recursive structure a "data
> structure" inside the element, but this seems to make an additional
> layer, which is not needed.
>
> IMHO that would be much easier. If you care about performance its more
> important to store your expression tree (I guess thats what you have) in
> a linear data structure than avoid that one layer of indirection. See
> e.g. the fast_callable machinery in sage/ext/fast_callable.pyx
Yes I have a tree. I will look into fast_callable.
Thanks,
Daniel
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.