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 = | .11 .27  .53 .98 .34 .56  .38 .3   .88 .88  |
     | .38 .62  .53 .35 .42 .74  .43 .088 .68 .083 |
     | .71 .8   .74 .73 .66 .72  .52 .21  .21 .73  |
     | .53 .017 .41 .65 .03 .095 .08 .47  .66 .11  |
     | .74 .044 .55 .68 .62 .4   .9  .59  .96 .87  |

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

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

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

o4 = | . .       .     . .      .      .      .      .      .       |
     | . 342/317 .     . 133/15 487/9  85/191 14/23  .      .       |
     | . .       .     . .      477/37 .      .      307/96 .       |
     | . 437/349 23/40 . .      53/19  .      .      .      .       |
     | . .       .     . .      .      .      807/73 .      745/903 |

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

o5 = | .   986 .   .   .   .   9   70  .   .   |
     | .   570 .   455 .   .   426 206 932 753 |
     | 371 .   204 .   664 209 .   755 .   .   |
     | 38  .   .   747 168 .   994 .   .   .   |
     | .   .   .   .   454 .   .   74  .   170 |

o5 : MutableMatrix

See also

Ways to use fillMatrix :