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 = | .079 .055 .16 .72 .31   .86 .078 .92  .86 .58 |
     | .81  .72  .76 .96 .6    .45 .46  .4   .9  .56 |
     | .83  .79  .85 .75 .31   .42 .6   .074 .16 .24 |
     | .99  .18  .98 .28 .0095 .89 .21  .94  .22 .63 |
     | .77  .43  .38 .88 .87   .17 .22  .68  .83 .76 |

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

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

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

o4 = | .      407/718 . 73/583 .     .       .       142/349 .      .       |
     | .      .       . .      67/61 .       .       232/101 103/15 .       |
     | .      .       . .      .     .       202/631 .       .      927/140 |
     | 231/59 .       . .      .     .       .       .       88/321 .       |
     | .      .       . .      .     443/703 .       .       .      59/776  |

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

o5 = | .   .  126 384 .   501 . .   209 .   |
     | 592 .  .   253 .   .   . .   356 227 |
     | 212 .  .   .   .   .   . 914 244 .   |
     | 523 99 .   .   126 .   . 505 709 .   |
     | .   .  .   276 .   892 . 496 359 120 |

o5 : MutableMatrix

See also

Ways to use fillMatrix :