#10470: Listing an infinite vector space just hangs
------------------------------+---------------------------------------------
Reporter: rbeezer | Owner: jason, was
Type: defect | Status: needs_review
Priority: minor | Milestone: sage-4.7
Component: linear algebra | Keywords:
Author: Rob Beezer | Upstream: N/A
Reviewer: John Palmieri | Merged:
Work_issues: |
------------------------------+---------------------------------------------
Changes (by jhpalmieri):
* reviewer: => John Palmieri
Old description:
> Asking for a list of elements in an infinite vector space does not raise
> an error, but requires a Ctrl-C to get back the command-line.
>
> {{{
> sage: V=QQ^2
> sage: V
> Vector space of dimension 2 over Rational Field
> sage: V.list()
> <hang>
> }}}
>
> Of course, finite examples work properly:
>
> {{{
> sage: V=GF(3)^2
> sage: V.list()
> [(0, 0), (1, 0), (2, 0), (0, 1), (1, 1), (2, 1), (0, 2), (1, 2), (2, 2)]
> }}}
>
> Maybe this should be addressed in the module code, I have not looked into
> the cause much. Perhaps a fix could be as simple as having a non-zero
> dimension with an infinite base ring throwing an error?
New description:
Asking for a list of elements in an infinite vector space does not raise
an error, but requires a Ctrl-C to get back the command-line.
{{{
sage: V=QQ^2
sage: V
Vector space of dimension 2 over Rational Field
sage: V.list()
<hang>
}}}
Of course, finite examples work properly:
{{{
sage: V=GF(3)^2
sage: V.list()
[(0, 0), (1, 0), (2, 0), (0, 1), (1, 1), (2, 1), (0, 2), (1, 2), (2, 2)]
}}}
Maybe this should be addressed in the module code, I have not looked into
the cause much. Perhaps a fix could be as simple as having a non-zero
dimension with an infinite base ring throwing an error?
-----
Apply both patches, [attachment:trac_10470-listing-infinite-sets.patch]
and [attachment:trac_10470-referee-doc.patch].
--
Comment:
I'm happy with the main patch: it gets a positive review. I've added a
little documentation about using {{{X.list()}}} vs. {{{list(X)}}}. If
it's not appropriate, let me know and we can just go with the main patch.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10470#comment:5>
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 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-trac?hl=en.