Opened 13 years ago

Closed 13 years ago

#8264 closed defect (fixed)

swap_row does not work on modular matrices

Reported by: Jan Willemson Owned by: William Stein
Priority: major Milestone:
Component: linear algebra Keywords:
Cc: Merged in: sage-4.3.4.alpha1
Authors: Mike Hansen Reviewers: Nicolas Borie
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


For some reason, swap_row does not work if the elements of the matrix are treated as integers modulo something. The code to reproduce the bug is the following:

A = matrix(ZZ, 2,[1,2,3,4])
B = copy(A)
print B,'\n'
B.swap_columns(0,1) # So far so good
print B,'\n'
C = A.apply_map(lambda x:mod(x,8))
C.swap_rows(0,1) # This line does not work
print C,'\n'
C.swap_columns(0,1) # But this one does
print C

The bug reproduces every time on Mac OSX 10.6, SAGE version 4.3.1.

Attachments (1)

trac_8264.patch (1.3 KB) - added by Mike Hansen 13 years ago.

Download all attachments as: .zip

Change History (4)

Changed 13 years ago by Mike Hansen

Attachment: trac_8264.patch added

comment:1 Changed 13 years ago by Mike Hansen

Authors: Mike Hansen
Status: newneeds_review

comment:2 Changed 13 years ago by nborie

Reviewers: Nicolas Borie
Status: needs_reviewpositive_review

The patch fix the ticket and add the good test.

Positive review from me.

comment:3 Changed 13 years ago by Mike Hansen

Merged in: sage-4.3.4.alpha1
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.