next | previous | forward | backward | up | top | index | toc | home

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 = mutableZero(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 . . . .  |
     | .   . 3 . .  |
     | .   . . . 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