Ticket #2871 (closed defect: fixed)
[with patch, positive review] matrix: M[range(2,-1,-1),:] returns junk
| Reported by: | dfdeshom | Owned by: | dfdeshom |
|---|---|---|---|
| Priority: | minor | Milestone: | sage-3.0 |
| Component: | linear algebra | Keywords: | |
| Cc: | Work issues: | ||
| Report Upstream: | Reviewers: | ||
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description
In the following example, A should be "upside down", but it's not
sage: A = random_matrix(ZZ,3); A [ 1 3 -1] [ 4 -3 -1] [-1 0 -1] sage: A[range(2,-1,-1),:] [ 1 3 -1] [ 4 -3 -1] [-1 0 -1]
The problem is with set(), which doesn't preserve order.
Attachments
Change History
comment:1 Changed 5 years ago by dfdeshom
- Summary changed from matrix: M[range(2,-1,-1),:] returns junk to [with patch,needs review] matrix: M[range(2,-1,-1),:] returns junk
comment:2 Changed 5 years ago by cwitty
- Summary changed from [with patch,needs review] matrix: M[range(2,-1,-1),:] returns junk to [with patch, positive review pending rebase] matrix: M[range(2,-1,-1),:] returns junk
The code and doctests look good, and doctests pass in sage/matrix in Sage 2.11. Unfortunately, applying the patch to Sage 3.0 alpha 2 (the latest I have at the moment) gives a rejected hunk.
comment:3 Changed 5 years ago by cwitty
- Summary changed from [with patch, positive review pending rebase] matrix: M[range(2,-1,-1),:] returns junk to [with patch, positive review] matrix: M[range(2,-1,-1),:] returns junk
With the revised 2871-alpha2.patch, the patch applies and doctests pass in sage/matrix for sage 3.0 alpha2.
Didier, thanks for making the changes I requested on IRC!
Looks good, please apply.
Note: See
TracTickets for help on using
tickets.

