Maxima/Ecl on 32-bit machine cannot evaluate "apply(union, listify({{..}}))"



On Tue, Sep 02, 2008 at 10:18:43PM -0600, Robert Dodier wrote:
> On 9/2/08, Oliver Kullmann <O.Kullmann at swansea.ac.uk> wrote:
> 
> >  Remark: One should deprecate "makelist", since
> >   - create_list is much more powerful
> >   - makelist has a bug when the loop is empty
> 
> I don't know what you mean by this. Please be more specific.
>

(%i7) makelist(i,i,0,-2);
If 4 arguments are given to MAKELIST, the difference of the 3rd and 4th arguments should evaluate to a non-negative integer:
-2
 -- an error.  To debug this try debugmode(true);

> 
> Instead of load(nset) I recommend pretty strongly to just call xreduce
> instead of apply.
> 

With CLisp the argument-size of "union" seems actually unrestricted (at least 10^7 arguments
work).

(%i8) xreduce(union,create_list({i},i,1,10000))$
Evaluation took 876.0147 seconds (898.9797 elapsed) using 4205.856 MB.
(%i9) apply(union,create_list({i},i,1,10000))$
Evaluation took 153.9416 seconds (163.0768 elapsed) using 1534.958 MB.

Where you actually need to use xreduce, for "append" (with clisp here we have the
rather restricted bound of 4095 arguments), the difference is much smaller.

We stopped using xreduce for big unions, since for some our applications it had
a big effect --- 5 hours instead of 1 hour where you need to do a lot of experimentations
is not good.

So I would be careful about recommending xreduce: In cases like "union" it invokes
big unnecessary overheads (and this potentially for many people --- all the users of 
Maxima needing to wait longer, running computers longer).

Oliver