On Jul 23, 9:36 pm, Jason Grout <jason-s...@creativetrax.com> wrote: > On 7/23/10 11:35 AM, VictorMiller wrote: > > > There's abugin assigning 1 x 1 submatrices. assigning any > > submatrices with dimensions bigger than 1 seems to work as expected: > > >sage: A =matrix(GF(2),100,100) > >sage: C1 =matrix(GF(2),[[1]]) > >sage: C2 =matrix(GF(2),[[0,1],[1,0]]) > > >sage: A[88:90,88:90] = C2 # this is ok however > > >sage: A[90:91,90:91] = C1 > > Off the top of my head, my guess is that it gets confused and thinks you > are doing: > > A[90,90]=C1 > > (and so it tries to convert C1 to an element of A, or something). > > Definitely looks like abug. > > Thanks, > > Jason
Hi, indeed the problem seems to be that for the matrix method __setitem__ A[90:91,90:91] is treated like the matrix element A[90,90] while for the method __getitem__ A[90:91,90:91] is treated like the 1x1 submatrix with element A[90,90]. I opened a ticket and added a patch which changed the method __setitem__ so that A[90:91,90:91] is now treated like a 1x1 matrix, too. Look here: http://trac.sagemath.org/sage_trac/ticket/9747. Greetings, Phil -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org