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

fillMatrix -- fill a mutable matrix with random numbers

Synopsis

Description

i1 : printingPrecision = 2

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

o2 = | .68 .088 .81 .18 .54  .81 .26 .81 .76 .72 |
     | .21 .28  .57 .81 .088 .1  .97 .33 .36 .74 |
     | .29 .41  .99 .68 .66  .98 .46 .35 .22 .91 |
     | .64 .49  .17 .85 .57  .98 .11 .82 .14 .66 |
     | .3  .64  .1  .82 .036 .53 .96 .64 .66 .44 |

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

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

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

o4 = | .       .       . . 34/15   . .      758/39  .      . |
     | 575/829 .       . . 161/492 . .      .       .      . |
     | .       .       . . 871/177 . 29/134 247/488 .      . |
     | .       553/334 . . 145/341 . .      .       88/681 . |
     | .       .       . . 469/701 . 25/148 .       .      . |

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

o5 = | .   .   .   .   519 32  .   .   .   .   |
     | .   .   598 .   105 333 .   783 544 .   |
     | .   .   978 244 .   .   920 .   .   .   |
     | 986 .   686 .   .   566 .   .   .   .   |
     | 714 183 .   456 156 .   .   886 275 913 |

o5 : MutableMatrix

See also

Ways to use fillMatrix :