Jason Grout wrote:
> Does anyone have a clue why constructing subsets might be so slow?
> 
> $ sage
> ----------------------------------------------------------------------
> | SAGE Version 2.8.5.1, Release Date: 2007-09-26                     |
> | Type notebook() for the GUI, and license() for information.        |
> ----------------------------------------------------------------------
> 
> sage: %time x=list(Subsets(25,5))
> CPU times: user 15.01 s, sys: 1.02 s, total: 16.03 s
> Wall time: 39.74
> sage: %time x=list(Subsets(25,5))
> CPU times: user 21.90 s, sys: 0.36 s, total: 22.26 s
> Wall time: 23.85
> 
> In Mathematica:
> $ math
> Mathematica 6.0 for Linux x86 (32-bit)
> Copyright 1988-2007 Wolfram Research, Inc.
> 
> In[1]:= Timing[Subsets[Range[25], {5}];]
> 
> Out[1]= {0.028001, Null}

Of course, I should have checked the output.  The proper timing in
Mathematica is:

$ math
Mathematica 6.0 for Linux x86 (32-bit)
Copyright 1988-2007 Wolfram Research, Inc.

In[1]:= <<Combinatorica`

In[2]:= Timing[Length[Subsets[Range[25],{5}]]]

Out[2]= {0.044003, 53130}

which isn't much worse, so the question still stands.

-Jason


--~--~---------~--~----~------------~-------~--~----~
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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to