On 05/19/2009 02:34 PM, leh...@bayou.uni-linz.ac.at wrote: > On Tue, May 19, 2009 at 12:02:18PM +0200, Ralf Hemmecke wrote: >> Anyway, out of curiosity, do you really need such a "generate" function >> below? > yes, recursion is the fastest way to pass from cumulants to moments > and vice versa, and this recursion needs all previous values.
Not that I really understand that, but it seems that it would be sufficient if the order of the list is reversed for the function f to apply, so a_{n+1} = f([a_n, ..., a_1]). If that is OK then the 'concat' in my code http://groups.google.com/group/fricas-devel/msg/a63032babb120405 could become a 'cons' and thus O(1). But accessing *all* the previous elements is linear time anyway. >> BTW, the documentation is rather vague. > yes, documentation which is not written immediately will never be > written at all... > Since I do not understand the stream mechanism, > I adapted generate(S->S,S) from the axiom library. > So it's a write-only function for me :) I must say, I wouldn't bother with writing yet another 'generate' function if the existing generate: () -> S -> Stream(S) can do the job. Ralf --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To post to this group, send email to fricas-devel@googlegroups.com To unsubscribe from this group, send email to fricas-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/fricas-devel?hl=en -~----------~----~----~----~------~----~------~--~---