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

fillMatrix -- fill a mutable matrix with random numbers

Synopsis

Description

i1 : printingPrecision = 2

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

o2 = | .77  .78  .69 .22   .63  .22 .44  .49 .4  .16  |
     | .21  .73  .23 .82   .033 .63 .043 .73 .38 .76  |
     | .37  .24  .86 .6    .46  .11 .26  .74 .59 .37  |
     | .046 .48  .86 .15   .12  .26 .8   .9  .44 .089 |
     | .69  .059 .62 .0055 .36  .14 .44  .48 .92 .98  |

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

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

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

o4 = | . . .       .      . .       . .   .       .       |
     | . . .       .      . 845/654 . .   657/335 .       |
     | . . .       24/175 . .       . .   .       .       |
     | . . .       .      . 793/399 . 1/2 .       291/256 |
     | . . 517/184 .      . .       . .   .       .       |

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

o5 = | 896 .   819 .   696 .   .   .   .  . |
     | .   482 .   397 .   .   758 647 .  . |
     | .   316 .   .   49  503 662 .   .  . |
     | .   .   811 643 .   71  .   .   88 . |
     | .   .   94  .   506 .   .   .   9  . |

o5 : MutableMatrix

See also

Ways to use fillMatrix :