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 = | .23 .87 .64  .3  .048 .081 .69  .29 .079 .19 |
     | .33 .83 .29  .6  .056 .59  .076 .75 .87  .89 |
     | .14 .2  .064 .8  .2   .88  .67  .89 .72  .14 |
     | .49 .39 .48  .73 .55  .7   .48  .8  .22  .32 |
     | .33 .96 .74  .92 .84  .39  .31  .73 .97  .29 |

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

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

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

o4 = | .       . .      .      . .       . . .      605/822 |
     | 449/918 . .      .      . 889/978 . . .      .       |
     | 145/72  . 487/51 81/884 . .       . . .      .       |
     | 362/125 . .      .      . .       . . .      .       |
     | .       . .      .      . .       . . 81/200 .       |

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

o5 = | 776 .   .  .   133 549 .   . .  .   |
     | 124 .   .  455 .   .   .   . 31 .   |
     | .   373 .  88  381 .   65  . .  .   |
     | 484 .   16 151 160 .   799 . .  415 |
     | .   .   .  591 589 140 700 . .  .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :