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 = | .21   .85  .0078 .24 .16 .23   .74 .012 .97 .89 |
     | .0012 .012 .56   .66 .45 .73   .75 .87  .48 .43 |
     | .3    .6   .46   .28 .95 .0086 .46 .25  .74 .59 |
     | .37   .38  .19   .1  .37 .61   .87 .57  .99 .72 |
     | .058  .38  .51   .6  .53 .84   .5  .78  .97 .6  |

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

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

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

o4 = | .      .      . .       . 106/289 .       . .      . |
     | .      .      . .       . .       .       . .      . |
     | .      136/57 . 986/873 . 415/13  943/478 . 67/184 . |
     | .      .      . .       . .       .       . .      . |
     | 571/82 .      . .       . .       1/155   . .      . |

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

o5 = | 76 877 .   .   .   .   .   .   93  .   |
     | .  545 290 21  .   990 .   .   .   812 |
     | .  780 .   .   .   .   .   363 58  .   |
     | .  456 .   952 394 859 307 31  947 .   |
     | .  490 .   79  608 .   .   .   .   401 |

o5 : MutableMatrix

See also

Ways to use fillMatrix :