Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Displaying matrices with . instead of 0

In GAP it is possible (at least in some circumstances) to display a matrix with . instead of 0 and without brackets. This makes the structure of the matrix much easier to see. Is there a way to do this in Sage?

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 ] ]
click to hide/show revision 2
retagged

Displaying matrices with . instead of 0

In GAP it is possible (at least in some circumstances) to display a matrix with . instead of 0 and without brackets. This makes the structure of the matrix much easier to see. Is there a way to do this in Sage?

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 ] ]