Opened 6 years ago

Closed 6 years ago

#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: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
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 (2)

2871.patch (2.1 KB) - added by dfdeshom 6 years ago.
2871-alpha2.patch (2.0 KB) - added by dfdeshom 6 years ago.
patch against alpha2

Download all attachments as: .zip

Change History (6)

comment:1 Changed 6 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

Changed 6 years ago by dfdeshom

comment:2 Changed 6 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.

Changed 6 years ago by dfdeshom

patch against alpha2

comment:3 Changed 6 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.

comment:4 Changed 6 years ago by mabshoff

  • Resolution set to fixed
  • Status changed from new to closed

Merged 2871-alpha2.patch in Sage 3.0.alpha4

Note: See TracTickets for help on using tickets.