Re: [sage-devel] Of powersets and subsets

2011-04-10 Thread Tom Boothby
On Sun, Apr 10, 2011 at 1:10 PM, Stefan van Zwam wrote: > 3) ??? Option 3: rejoice, the work has been done for you! http://www.sagemath.org/doc/reference/sage/misc/bitset.html -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email t

[sage-devel] Re: Of powersets and subsets

2011-04-10 Thread Rob Beezer
A more accurate follow-up to my hurried post of a few hours ago. Timings on the same machine for a more truthful speed comparison, now in reality "just" a 150x speed-up due to Cython. Triple-braces delimit compute cells in the notebook. Notice that the "%cython" block automatically produces the C

[sage-devel] Re: Of powersets and subsets

2011-04-10 Thread Rob Beezer
On Apr 10, 1:10 pm, Stefan van Zwam wrote: > %time > t = 0 > for s1 in range(0,2**9): >     for s2 in range(0,2**9): >         if s1 & s2: >             t += 1 > t If you Cython-ize this code, which basically means adding the declaration cdef Py_ssize_t t, s1, s2 at the top, its runtime becomes

Re: [sage-devel] numpy with icc

2011-04-10 Thread David Kirkby
On 10 April 2011 13:10, Mag Gam wrote: > Oncer I build sage I plan to recompile numpy with Intel ICC because of > the big performance boost using MKL. Has anyone tried this before? > what sort of problems do you expect? Lots of the code in Sage calls "gcc" directly, so even if you define the envi

[sage-devel] Re: Of powersets and subsets

2011-04-10 Thread Nathann Cohen
Hello !!! > I am working with several people on software for doing matroid theory. > All hail Caesar !! Hail !! Hail !! > Now how do I solve this problem? There seem to be several options: > > 1) Sacrifice compatibility with Sage's Set category, meaning less > user-friendliness > Is the "Matro

[sage-devel] Cython, cached_method, categories

2011-04-10 Thread Simon King
Hi! This post has two purposes: (1) I'd like to draw your attention to #5 (needing review), presenting a cythonized version of cached_method. (2) I have a strategical question about applying #5 in the category framework for rings - this may be better asked in sage- algebra, which is theref

[sage-devel] Of powersets and subsets

2011-04-10 Thread Stefan van Zwam
Dear all, I am working with several people on software for doing matroid theory. Our goal is to produce a Sage package. In our implementation, it makes sense (both mathematically and computationally) to have a set object that is aware of the universe it lives in (which we call the "ground set")

[sage-devel] numpy with icc

2011-04-10 Thread Mag Gam
Oncer I build sage I plan to recompile numpy with Intel ICC because of the big performance boost using MKL. Has anyone tried this before? what sort of problems do you expect? -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to s

Re: [sage-devel] Re: Cannot evaluate symbolic expression numerically

2011-04-10 Thread Adrian Seyboldt
On 10.04.2011 05:37, John Cremona wrote: > The easiest way to get the number of digits of a positive integer n is > len(str(n)) or even n.ndigits() ! > > So > > sage: N=10^6 > sage: sum([n.ndigits() for n in srange(1,N+1)]) > 596 > > solves your problem for all integers up to a million. Thi