Mutability of echelon form result

8 views
Skip to first unread message

Rob Beezer

unread,
Dec 28, 2010, 11:38:13 PM12/28/10
to sage-devel
sage: A=matrix(QQ,2,range(4))
sage: B=matrix(ZZ,2,range(4))
sage: C=A.echelon_form()
sage: D=B.echelon_form()
sage: C.is_mutable()
True
sage: D.is_mutable()
False

Should C and D be different with regard to mutability? If not, should
both results be immutable? (I'd rather not have to handle both
possibilities!)

Thanks,
Rob

Robert Bradshaw

unread,
Dec 29, 2010, 2:24:00 AM12/29/10
to sage-...@googlegroups.com

It's almost certain that mutability of C is an oversight.

- Robert

Rob Beezer

unread,
Dec 29, 2010, 1:12:51 PM12/29/10
to sage-devel
Thanks, Robert. I'll dig deeper.

On Dec 28, 11:24 pm, Robert Bradshaw <rober...@math.washington.edu>
wrote:

Rob Beezer

unread,
Jan 1, 2011, 11:09:29 PM1/1/11
to sage-devel

William Stein

unread,
Jan 2, 2011, 1:36:12 AM1/2/11
to sage-...@googlegroups.com
On Sat, Jan 1, 2011 at 8:09 PM, Rob Beezer <goo...@beezer.cotse.net> wrote:
> A fix is available at   http://trac.sagemath.org/sage_trac/ticket/10543

Good, because this is a major bug! See below for how it could wreak havoc:

sage: A = matrix(QQ,2,range(4))
sage: C = A.echelon_form()
sage: C[0,0] = 20
sage: A.echelon_form()
[20 0]
[ 0 1]

But that's not an echelon form!

William

Rob Beezer

unread,
Jan 2, 2011, 2:13:42 AM1/2/11
to sage-devel
On Jan 1, 10:36 pm, William Stein <wst...@gmail.com> wrote:
> See below for how it could wreak havoc:

Yes, since the echelon form gets cached. There could be others (over
other rings), I just haven't checked. But doing a quick survey is on
my list for Bug Days coming up.

Rob
Reply all
Reply to author
Forward
0 new messages