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 = | .53  .73 .65 .24 .18  .81 .81 .88   .34 .94 |
     | .28  .23 .53 .7  .95  .59 .76 .38   .19 .98 |
     | .72  .39 .47 .16 .029 .85 .9  .0034 .47 .9  |
     | .53  .93 .15 .81 .82  .63 .47 .062  .42 .1  |
     | .086 .63 .82 .15 .59  .56 .71 .22   .44 .12 |

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

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

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

o4 = | .       . . .       .      . 499/695 253/535 55/13 . |
     | 753/811 . . .       .      . .       .       .     . |
     | .       . . 825/694 .      . 463/514 .       .     . |
     | 473/92  . . 928/183 169/83 . .       .       .     . |
     | .       . . .       89/176 . .       247/766 .     . |

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

o5 = | .   288 .   .   .   .   370 740 208 .   |
     | 966 316 .   .   .   .   .   832 .   756 |
     | .   .   .   .   568 477 .   .   303 .   |
     | .   629 .   .   .   .   460 70  .   .   |
     | .   80  651 341 256 216 512 .   128 .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :