#15820: Implement sequences of bounded integers
-------------------------------------+-------------------------------------
Reporter: SimonKing | Owner:
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-6.3
Component: algebra | Resolution:
Keywords: sequence bounded | Merged in:
integer | Reviewers:
Authors: Simon King | Work issues: Use mpn_* for speedup
Report Upstream: N/A | of iteration and item access
Branch: | Commit:
u/SimonKing/ticket/15820 | 64ac7bab9d4c85136e9845878d69d82be7c300f8
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by SimonKing):
* work_issues: Document cdef functions. Pickling => Use mpn_* for speedup
of iteration and item access
Comment:
I have documented the cdef functions, and I have implemented pickling.
Again (at least for long sequence), this is faster than for ordinary
tuples:
{{{
sage: from sage.misc.bounded_integer_sequences import
BoundedIntegerSequence
sage: L = [randint(0,26) for i in range(5000)]
sage: S = BoundedIntegerSequence(32, L)
sage: %timeit loads(dumps(S))
1000 loops, best of 3: 407 µs per loop
sage: T = tuple(S)
sage: %timeit loads(dumps(T))
100 loops, best of 3: 2.02 ms per loop
}}}
I hope there is a nice example for `mpn_*` somewhere.
--
Ticket URL: <http://trac.sagemath.org/ticket/15820#comment:64>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.