#15820: Implement sequences of bounded integers
-------------------------------------+-------------------------------------
Reporter: SimonKing | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.4
Component: algebra | Resolution:
Keywords: sequence bounded | Merged in:
integer | Reviewers: Jeroen Demeyer, Simon
Authors: Simon King, | King
Jeroen Demeyer | Work issues:
Report Upstream: N/A | Commit:
Branch: | 4e9e1c51f6524bfa2d2c55d197b82a983dd01184
u/jdemeyer/ticket/15820 | Stopgaps:
Dependencies: #17195, #17196 |
-------------------------------------+-------------------------------------
Comment (by SimonKing):
Should we add tests in the spirit of this:
{{{
sage: from sage.data_structures.bounded_integer_sequences import
BoundedIntegerSequence
sage: B = BoundedIntegerSequence(4,[1,2,3,2,3,2,3])
sage: while 1:
....: C = B+B
....:
^C---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call
last)
<ipython-input-3-dda173c83bbe> in <module>()
----> 1 while Integer(1):
2 C = B+B
3
/home/king/Sage/git/sage/local/lib/python2.7/site-
packages/sage/ext/c_lib.so in sage.ext.c_lib.sage_python_check_interrupt
(build/cythonized/sage/ext/c_lib.c:1683)()
/home/king/Sage/git/sage/local/lib/python2.7/site-
packages/sage/ext/c_lib.so in sage.ext.c_lib.sig_raise_exception
(build/cythonized/sage/ext/c_lib.c:769)()
KeyboardInterrupt:
sage: while 1:
C = B+B
....:
^C---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call
last)
<ipython-input-4-dda173c83bbe> in <module>()
1 while Integer(1):
----> 2 C = B+B
3
/home/king/Sage/git/sage/local/lib/python2.7/site-
packages/sage/data_structures/bounded_integer_sequences.so in
sage.data_structures.bounded_integer_sequences.BoundedIntegerSequence.__add__
(build/cythonized/sage/data_structures/bounded_integer_sequences.c:10964)()
/home/king/Sage/git/sage/local/lib/python2.7/site-
packages/sage/data_structures/bounded_integer_sequences.so in
sage.data_structures.bounded_integer_sequences.biseq_init_concat
(build/cythonized/sage/data_structures/bounded_integer_sequences.c:7632)()
/home/king/Sage/git/sage/local/lib/python2.7/site-
packages/sage/ext/c_lib.so in sage.ext.c_lib.sig_raise_exception
(build/cythonized/sage/ext/c_lib.c:769)()
KeyboardInterrupt:
}}}
As you can see, the interruption occurs in the correct place already in
the second try.
--
Ticket URL: <http://trac.sagemath.org/ticket/15820#comment:379>
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.