| In GAP it is possible (at least in some circumstances) to display a matrix with e.g. to show 1 3 3 . 9 1 1 1 2 5 1 1 3 2 3 1 3 1 . 3 1 1 1 . 5 1 . . 1 3 1 1 3 . 3 1 3 1 . 3 1 1 1 . 3 1 3 . . . 1 . 1 . 2 instead of [ [ 1, 3, 3, 0, 9 ], [ 1, 1, 1, 2, 5 ], [ 1, 1, 3, 2, 3 ], [ 1, 3, 1, 0, 3 ], [ 1, 1, 1, 0, 5 ], [ 1, 0, 0, 1, 3 ], [ 1, 1, 3, 0, 3 ], [ 1, 3, 1, 0, 3 ], [ 1, 1, 1, 0, 3 ], [ 1, 3, 0, 0, 0 ], [ 1, 0, 1, 0, 2 ] ] |
| Below is what I currently have in my |
| How about Should we add a method to the matrix class which does something like this? What should it be called?
Maybe m.print_with_dots()? zeros_are_dots()? Not sure... Then one followup would be whether we should enable this only for finite field matrices as in GAP (at least as I understand it in GAP). And whether we should enable blank spaces in sparse matrices. Etc.
kcrisman (Jan 12 '11)
Considering that sometimes I convert a matrix to one over a finite field just so that I can display it like this, I would prefer if the method worked for any matrix.
Ivan Andrus (Jan 13 '11)
Sounds like you need to open a ticket :) Open source is driven by developer interest, as you know. But in that case I vote for an option to leave zero spots blank as well, so it doesn't look so much like a Nethack screen.
kcrisman (Jan 13 '11)
We can add some optional arguments to the "str" method, to be used like mat.str(zero="."), for example. What sort of replacements might we want? Replace "0" with something else? Replace "1" with "+" and "-1" with "-"?
John Palmieri (Jan 13 '11)
Ooh, I like this direction. Can you open a ticket? Ivan is on Trac, and you should copy Jason Grout on it too.
kcrisman (Jan 13 '11) |
| Huh, that's a great question. I don't believe so. However, you could $\LaTeX$ it... Though that's not what you want in terms of the dots. Here it is in Sage, straight from some examples in the GAP reference manual: You'll note that this only happens in the finite field case, where of course 0 isn't in the group of units and so it's appropriate to display it differently. So I don't know whether we would want to do this. For sparse Sage matrices, like (from Sage I could imagine something of the kind as an optional way of doing it. But I don't use them, so you'd want to ask on sage-devel about that. |
Asked: Jan 12 '11
Seen: 173 times
Last updated: Feb 03 '12
powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.