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 = | .21 .081 .35 .17 .9  .9  .26  .19  .2   .71 |
     | .76 .52  .89 .82 .34 .58 .012 .82  .21  .36 |
     | .42 .039 .81 .46 .37 .15 .64  .13  .81  .71 |
     | .89 .57  .13 .2  .45 .11 .71  .85  .83  .56 |
     | .28 .11  .76 .31 .6  .75 .15  .017 .036 .38 |

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

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

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

o4 = | 439/806 208/245 128/595 .       .       .       .       967/92  . . |
     | .       4/77    .       324/743 .       .       545/749 .       . . |
     | .       901/271 .       .       .       .       .       .       . . |
     | .       .       .       .       376/685 .       .       .       . . |
     | 9/361   .       .       367/136 .       547/361 138/911 347/443 . . |

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

o5 = | .   573 .   771 . .   .   157 .   401 |
     | 155 511 .   .   . .   .   .   .   .   |
     | 18  281 .   188 . .   .   127 747 732 |
     | 362 .   .   .   . 875 973 .   .   .   |
     | .   434 540 150 . .   .   .   472 611 |

o5 : MutableMatrix

See also

Ways to use fillMatrix :