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 = | .89  .71 .91  .71 .35 .54 .19  .39 .28 .89  |
     | .67  .89 .31  .13 .56 .87 .4   .56 .61 .17  |
     | .29  .23 .074 .25 .25 .42 .62  .87 .97 .97  |
     | .63  .46 .81  .74 .15 .61 .015 .7  .68 .065 |
     | .026 .78 .36  .11 .83 .85 .22  .68 .91 .88  |

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

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

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

o4 = | . .       243/835 89/26 .     76/169 .       . 473/389 2/9    |
     | . .       .       .     .     .      .       . .       .      |
     | . 250/159 519/809 .     79/74 .      701/437 . 377/614 .      |
     | . .       .       .     .     .      .       . .       .      |
     | . .       .       .     .     .      .       . 31/951  38/707 |

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

o5 = | .   .   .   .   693 .   .   . .   .   |
     | 830 622 .   655 817 .   170 . 851 155 |
     | 948 .   520 .   .   897 .   . 591 .   |
     | .   391 .   274 .   968 .   . .   596 |
     | 12  .   .   366 .   625 181 . .   .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :