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 = | .91 .74 .7  .53 .97 .89 .9   .67  .95   .54 |
     | .05 .28 .97 .11 .7  .86 .83  .62  .0027 .13 |
     | .19 .24 .38 .71 .53 .94 .5   .18  .69   .94 |
     | .5  .92 .18 .41 .9  .24 .56  .067 .11   .84 |
     | .2  .74 .27 .85 .97 .46 .084 .065 .58   .52 |

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

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

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

o4 = | 227/192 .       .       718/829 .       .      . . . 947/17  |
     | .       .       .       .       .       455/18 . . . .       |
     | .       856/671 209/215 326/117 848/899 .      . . . 872/467 |
     | .       .       93/53   20/11   .       .      . . . .       |
     | .       31/65   .       .       .       53     . . . .       |

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

o5 = | . .   .   . 213 .   .   .   .   26  |
     | . .   562 . .   .   805 525 960 295 |
     | . 819 .   . .   97  978 .   219 .   |
     | . .   .   . .   .   559 .   902 773 |
     | . 102 .   . 880 421 983 .   .   .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :