Macaulay2 » Documentation
Packages » Macaulay2Doc :: matrix(MutableMatrix)
next | previous | forward | backward | up | index | toc

matrix(MutableMatrix) -- make a matrix from a mutable one

Synopsis

Description

There are many more operations available for matrices than for immutable matrices, but mutable matrices are sometimes easier to construct.
i1 : m = mutableMatrix(ZZ,3,5)

o1 = 0

o1 : MutableMatrix
i2 : m_(1,2) = 3

o2 = 3
i3 : m_(2,4) = 54

o3 = 54
i4 : m_(0,0) = -12

o4 = -12
i5 : m

o5 = | -12 0 0 0 0  |
     | 0   0 3 0 0  |
     | 0   0 0 0 54 |

o5 : MutableMatrix
i6 : matrix m

o6 = | -12 0 0 0 0  |
     | 0   0 3 0 0  |
     | 0   0 0 0 54 |

              3       5
o6 : Matrix ZZ  <-- ZZ

See also

Ways to use this method: