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 = | .078 .092 .045 .27  .34  .62 .93 .2   .14 .098 |
     | .79  .92  .75  .46  .089 .34 .25 .044 .43 .12  |
     | .45  .82  .51  .59  .38  .39 .3  .29  .74 .9   |
     | .57  .056 .16  .088 1    .38 .7  .44  .13 .59  |
     | .59  .028 .47  .66  .11  .28 .2  .18  .14 .95  |

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

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

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

o4 = | . . . .       . 67/107 .     . . .       |
     | . . . 951/680 . .      .     . . 748/565 |
     | . . . .       . .      .     . . .       |
     | . . . .       . .      280/9 . . .       |
     | . . . .       . .      .     . . .       |

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

o5 = | .   317 .   . .   882 .   .   . .   |
     | 729 393 537 . .   .   .   13  . 732 |
     | 108 .   .   . 783 606 .   834 . .   |
     | .   148 .   . 998 .   358 .   . 952 |
     | 906 .   810 . 263 .   .   .   . 644 |

o5 : MutableMatrix

See also

Ways to use fillMatrix :