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 = | .77  .5   .33  .074 .25 .19 .2  .29 .89 .16 |
     | .26  .29  .054 .49  .33 .5  .41 .28 .36 .3  |
     | .97  .4   .88  .13  .68 .91 .36 .74 .63 .5  |
     | .78  .019 .94  .82  .89 .26 .4  .21 .33 .75 |
     | .089 .26  .16  .22  .71 .27 .92 .81 .41 .95 |

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

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

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

o4 = | .       .     .       .       . 130/59  .       .       .       .       |
     | .       .     670/431 .       . 991/709 .       517/30  .       931/652 |
     | 125/117 66/83 .       .       . .       495/481 .       343/920 .       |
     | .       .     .       219/205 . .       2/13    317/17  .       .       |
     | 706/163 .     .       .       . .       86/31   902/325 .       .       |

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

o5 = | .   .   .   520 640 .   .  347 970 .   |
     | 563 .   .   249 291 .   .  .   .   160 |
     | .   .   629 .   .   .   .  .   .   .   |
     | .   .   .   .   .   .   .  .   .   671 |
     | 228 663 .   .   157 151 92 475 842 43  |

o5 : MutableMatrix

See also

Ways to use fillMatrix :