On Wed, Apr 8, 2009 at 1:06 PM, John H Palmieri <jhpalmier...@gmail.com> wrote: > > > > On Apr 8, 1:03 pm, John H Palmieri <jhpalmier...@gmail.com> wrote: >> On Apr 8, 12:56 pm, "Justin C. Walker" <jus...@mac.com> wrote: >> >> >> >> > On Apr 8, 2009, at 12:07 , gerhard wrote: >> >> > > Print methods for matrices with subdivisions >> >> > > let M be a matrix over QQ: >> > > subdivisions are printed fine >> > > over GF(2): >> > > M.get_subdivisions() shows the subdivisions are defined, >> > > but the print method does not know about them. >> >> > Yup. Most matrix classes seem to use a common method for printing, >> > while the 'mod 2' matrix implementation has its own "stringify" method. >> >> > There may be a good explanation for this, but commenting out the mod2 >> > method seems to have the right effect without damaging anything else. >> > At least with minimal testing. >> >> Another workaround: if M is a matrix over GF(2), then do this: >> >> sage: MS = M.sparse_matrix() >> sage: MS.subdivide(2,3) >> >> The subdivisions in MS should appear: the problem is only in dense >> matrices over GF(2). >> >> > > The show methods cannot handle subdivisions altogether. >> >> > I'm not sure I understand. For other than the mod 2 elements, show(X) >> > produces an image of a subdivided matrix. Do you mean just in the mod >> > 2 case? >> >> > > Are there any plans to enhance these printing methods? >> >> > I think it qualifies as a bug, and I've created a Trac report for the >> > problem: >> > <http://trac.sagemath.org/sage_trac/ticket/5714> >> >> Hi Justin, >> >> I also created a ticket, <http://trac.sagemath.org/sage_trac/ticket/ >> 5715>, with a patch, deleting the str method for dense mod 2 >> matrices. > > I'll mark mine as a duplicate. Go ahead with your patch. >
Neither Justin nor I have a patch, and I don't think either of us are working on one. I posted this on your patch, which slows str down by a factor of 12 (in this example): Needs work. There is a *very good* reason that there is a str method for GF(2) -- it's for speed! Check this out: {{{ BEFORE YOUR PATCH: sage: a = random_matrix(GF(2),1000) sage: time b = a.str() CPU times: user 0.41 s, sys: 0.01 s, total: 0.42 s Wall time: 0.42 s }}} {{{ AFTER YOUR PATCH: sage: a = random_matrix(GF(2),1000) sage: time b = a.str() CPU times: user 5.02 s, sys: 0.86 s, total: 5.88 s Wall time: 5.89 s }}} --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---