next | previous | forward | backward | up | top | index | toc | Macaulay2 web site

fillMatrix -- fill a mutable matrix with random numbers

Synopsis

Description

i1 : printingPrecision = 2

o1 = 2
i2 : fillMatrix(mutableMatrix(RR,5,10))

o2 = | .99 .78  .4  .36  .26 .67 .47 .59 .48 .77 |
     | .45 .77  .22 .63  .78 .91 .31 .89 .12 .15 |
     | .63 .43  .56 .021 .41 .34 .24 .62 .55 .84 |
     | .71 .43  .96 .45  .67 .39 .08 .25 .84 .44 |
     | .79 .044 .96 .75  .34 .26 .43 .2  .16 .12 |

o2 : MutableMatrix
i3 : fillMatrix(mutableMatrix(ZZ,5,10),UpperTriangular=>true)

o3 = | . . 9 2 9 6 5 7 7 1 |
     | . . 8 2 2 7 3 5 4 2 |
     | . . . 5 3 8 2 2 4 5 |
     | . . . . 7 7 5 . 2 9 |
     | . . . . . 1 9 2 8 1 |

o3 : MutableMatrix
i4 : fillMatrix(mutableMatrix(QQ,5,10),Density=>.2,Height=>1000)

o4 = | 62/123 969/586 .       . 569/285 .       .       . .       . |
     | .      .       673/740 . .       .       .       . .       . |
     | 76/9   .       .       . .       650/551 350/129 . .       . |
     | .      .       .       . .       584/807 904/521 . 626/119 . |
     | .      .       863/386 . .       .       .       . .       . |

o4 : MutableMatrix
i5 : fillMatrix(mutableMatrix(ZZ,5,10),25,Height=>1000)

o5 = | . 934 970 .   .   .   818 .   669 .   |
     | . 848 277 484 .   197 .   140 829 .   |
     | . .   .   .   .   .   .   804 1   904 |
     | . .   781 .   .   .   259 .   241 635 |
     | . .   145 .   718 267 341 .   .   .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :