Macaulay2 » Documentation
Packages » Macaulay2Doc » matrices » mutable matrices » mutableMatrix
next | previous | forward | backward | up | index | toc

mutableMatrix -- make a mutable matrix

Description

i1 : f = mutableMatrix {{1,2,3,4}}

o1 = | 1 2 3 4 |

                     1       4
o1 : MutableMatrix ZZ  <-- ZZ
i2 : f_(0,2)

o2 = 3
i3 : f_(0,2) = 33

o3 = 33
i4 : f

o4 = | 1 2 33 4 |

                     1       4
o4 : MutableMatrix ZZ  <-- ZZ
i5 : R = QQ[a..z]

o5 = R

o5 : PolynomialRing
i6 : mutableMatrix genericMatrix(R,3,3)

o6 = | a d g |
     | b e h |
     | c f i |

                    3      3
o6 : MutableMatrix R  <-- R

If the argument is a number or a ring element, then the result is a $1\times 1$ mutable matrix. The ring may be given as well, as the first argument.

i7 : mutableMatrix 5

o7 = | 5 |

                     1       1
o7 : MutableMatrix ZZ  <-- ZZ
i8 : ring oo

o8 = ZZ

o8 : Ring
i9 : mutableMatrix(RR, 5)

o9 = | 5 |

                       1         1
o9 : MutableMatrix RR    <-- RR
                     53        53
i10 : ring oo

o10 = RR
        53

o10 : RealField

Ways to use mutableMatrix:

  • mutableMatrix(List)
  • mutableMatrix(Matrix)
  • mutableMatrix(MutableMatrix)
  • mutableMatrix(Number)
  • mutableMatrix(Ring,List)
  • mutableMatrix(Ring,Number)
  • mutableMatrix(Ring,RingElement)
  • mutableMatrix(RingElement)
  • mutableMatrix(RingFamily,List)
  • mutableMatrix(RingFamily,Number)
  • mutableMatrix(RingFamily,RingElement)
  • mutableMatrix(Ring,ZZ,ZZ) -- make a mutable matrix filled with zeroes
  • mutableMatrix(RingFamily,ZZ,ZZ) -- see mutableMatrix(Ring,ZZ,ZZ) -- make a mutable matrix filled with zeroes

For the programmer

The object mutableMatrix is a method function with options.


The source of this document is in /build/reproducible-path/macaulay2-1.26.11+ds/M2/Macaulay2/packages/Macaulay2Doc/doc_mutablematrices.m2:456:0.