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

mutableIdentity -- make a mutable identity matrix

Description

i1 : m = mutableIdentity(QQ,10)

o1 = | 1 0 0 0 0 0 0 0 0 0 |
     | 0 1 0 0 0 0 0 0 0 0 |
     | 0 0 1 0 0 0 0 0 0 0 |
     | 0 0 0 1 0 0 0 0 0 0 |
     | 0 0 0 0 1 0 0 0 0 0 |
     | 0 0 0 0 0 1 0 0 0 0 |
     | 0 0 0 0 0 0 1 0 0 0 |
     | 0 0 0 0 0 0 0 1 0 0 |
     | 0 0 0 0 0 0 0 0 1 0 |
     | 0 0 0 0 0 0 0 0 0 1 |

                     10       10
o1 : MutableMatrix QQ   <-- QQ
i2 : m_(5,5) = 11/13

     11
o2 = --
     13

o2 : QQ
i3 : m

o3 = | 1 0 0 0 0 0     0 0 0 0 |
     | 0 1 0 0 0 0     0 0 0 0 |
     | 0 0 1 0 0 0     0 0 0 0 |
     | 0 0 0 1 0 0     0 0 0 0 |
     | 0 0 0 0 1 0     0 0 0 0 |
     | 0 0 0 0 0 11/13 0 0 0 0 |
     | 0 0 0 0 0 0     1 0 0 0 |
     | 0 0 0 0 0 0     0 1 0 0 |
     | 0 0 0 0 0 0     0 0 1 0 |
     | 0 0 0 0 0 0     0 0 0 1 |

                     10       10
o3 : MutableMatrix QQ   <-- QQ

See also

Ways to use mutableIdentity:

  • mutableIdentity(Ring,ZZ)
  • mutableIdentity(RingFamily,ZZ)

For the programmer

The object mutableIdentity 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:514:0.