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 = | .24 .45  .075 .85  .12 .86 .02  .023 .24  .98 |
     | .39 .97  .46  .99  .62 .31 .82  .85  .08  .99 |
     | .58 .096 .95  .028 .67 .97 .048 .55  .2   .73 |
     | .81 .76  .46  .5   .45 .82 .023 .51  .075 .13 |
     | .3  .36  .37  .43  .8  .52 .22  .43  .97  .62 |

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

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

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

o4 = | .       . .      . . 115/19  .     .      .       .       |
     | .       . 331/94 . . 61/40   .     .      .       629/954 |
     | 961/418 . .      . . .       .     .      .       .       |
     | .       . .      . . 620/783 271/3 179/86 .       .       |
     | 397/459 . .      . . 663/124 .     .      961/791 39/77   |

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

o5 = | 229 968 40  723 .   .   .   . 722 .   |
     | .   .   .   67  .   .   .   . .   150 |
     | 212 .   754 252 721 502 741 . .   .   |
     | .   .   423 410 .   .   .   . .   368 |
     | .   .   353 .   973 972 .   . .   .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :