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 = | .0015 .15 .7  .18 .5  .31 .28 .59 .21 .0081 |
     | .98   .53 .99 .69 .58 .41 .16 .82 .57 .93   |
     | .77   .96 .63 .32 .46 .27 .83 .62 .21 .77   |
     | .96   .87 .24 .89 .51 .11 .81 .89 .2  .95   |
     | .19   .61 .21 .18 1   .54 .11 .12 .19 .87   |

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

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

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

o4 = | . . .      . .       .       . .      .       .     |
     | . . .      . .       903/878 . 29/19  437/68  .     |
     | . . 771/67 . .       .       . .      202/499 .     |
     | . . 69/926 . .       .       . .      282/755 .     |
     | . . .      . 719/260 .       . 19/590 .       10/47 |

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

o5 = | .   . . .   933 .   .   .   744 954 |
     | 993 . . .   .   623 924 495 .   .   |
     | 586 . . .   .   .   .   .   .   .   |
     | 548 . . 258 981 588 957 959 .   .   |
     | 625 . . .   325 117 335 .   .   833 |

o5 : MutableMatrix

See also

Ways to use fillMatrix :