On Sunday 12 October 2008 01:00:46 pm Stavros Macrakis wrote:
> > 2a) The lisp Table implementation is the same speed when
> > compiled as create_list. It is interesting that makelist is
> > about 10 times slower. makelist should probably be rewritten
>
> It sounds like that would be a good idea.
I only tested them on large lists (10^5--10^6), using
showtime:true . Repeating a test yields times that vary by
100% or more, but a factor of 10 is pretty clear. I don't
yet know how to time them more carefully and didn't bother
making a loop to accumulate times for shorter lists. makelist
appears to be older than create_list. But I suspect create_list
would work as a drop in replacement for the majority of the
cases in share.
> grep -r makelist src share | wc
602 2834 54515
> grep -r create_list src share | wc
17 78 1252
> Could you post a specification of Table?
http://reference.wolfram.com/mathematica/ref/Table.htmlhttp://documents.wolfram.com/mathematica/functions/Table
Below is link to the Maxima implementation.
The files are:
mmacompat_lisp.lisp -- only Table is in here. This code
does not depend on any other files.
rtest_mmacompat.mac -- the first block of tests are for Table,
which consist of documented examples as well as edge
cases. I need to find a way test that it handles incorrect
input more or less gracefully.
mmacompat_mac.mac -- To run the test above, this must be loaded.
(the Table code in here is unused)
They are at:
http://johnlapeyre.com/mmacompat/new/
So
load("mmacompat_lisp.lisp")
load("mmacompat_mac.mac")
batch("rtest_mmacompat.mac",test)