[next][previous][up][top][index]
search for:

displaying matrices

Normally matrices are displayed in compact notation that originated with Macaulay.

i1 : R = ZZ/101[x,y];
i2 : f = random(R^1,R^{2:-2})

o2 = | 42x2-50xy+39y2 9x2-15xy-22y2 |

             1       2
o2 : Matrix R  <--- R

Setting the global flag compactMatrixForm to false will modify that behavior so that matrices are displayed more clearly and less compactly.

i3 : compactMatrixForm = false

o3 = false
i4 : f

     |    2              2    2              2 |
o4 = | 42x  - 50x*y + 39y   9x  - 15x*y - 22y  |

             1       2
o4 : Matrix R  <--- R

We may use toString to produce a string, useful as input into other programs, or into Macaulay 2 at another time.

i5 : toString f

o5 = matrix {{42*x^2-50*x*y+39*y^2, 9*x^2-15*x*y-22*y^2}}

The function toExternalString tries harder: it gives complete information about the source, target, and degree of the map.

i6 : toExternalString f

o6 = map(R^{{0}}, R^{{-2}, {-2}}, {{42*x^2-50*x*y+39*y^2, 9*x^2-15*x*y-22*y^2}})


[next][previous][up][top][index]
search for: