#8342: Efficient Arbitrary Sequence Generator
---------------------------+------------------------------------------------
Reporter: colah | Owner: colah
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.3.4
Component: numerical | Keywords: sequence, generator
Author: colah | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
---------------------------+------------------------------------------------
Changes (by novoselt):
* status: needs_review => needs_work
Comment:
Why does this function use a dictionary instead of a list? Is it done for
functions that can get values for "large" n without computing all of the
previous?
Since it does use a dictionary, why does it assume ``base`` to be like
[a_0, a_1, a_2]? It seems to me that it would be more reasonable then to
take a dictionary as ``base`` in case I want to give [a_1, a_2, a_3] or
[a_{-2}, a_0] or even [entry_{"a"}, entry_{"b"}]. That would allow even
for multidimensional sequences indexed by tuples!
The documentation is not quite clear to me. I don't understand what
exactly does the description of ``f`` mean and I think that while lambda-
form is probably the way to use this function (so the included examples
must stay), it would be nice if examples were also written in an
"expanded" way with each internal function having a meaningful name and
some explanation what exactly should it take as an argument and what
should it return. I didn't understand how to use this function until I
looked at the source code.
Finally, the examples test only that the function does not crush. There
should be comparison with expected output. E.g. show that it is possible
to compute Fibonacci numbers that were not given as input and that
actually even required computing some intermediate ones!
As a possible improvement to consider (but I don't know if it should be
done): what about admissible indices? What is the (-10)-th Fibonacci
number? Infinite recursion? Maybe there should an optional parameter for a
function that will check that there exists the corresponding element. And
maybe there can be some way to see which values are already computed to
determine if they will be enough to evaluate the new one or in case when
it is possible to use several ways.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8342#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
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-trac?hl=en.