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 = | .71 .79 .37  .37  .024 .63  .3  .38  .56 .87 |
     | .55 .26 .17  .17  .65  .15  .55 .15  .38 .29 |
     | .3  .63 .018 .85  .062 .11  .68 .52  .19 .16 |
     | .95 .32 .8   .53  .61  .084 .5  .41  .42 .69 |
     | .36 .2  .96  .083 .13  .52  .96 .028 .79 .46 |

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

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

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

o4 = | . . 330/29 242/167 61/127 .       . .      . . |
     | . . .      .       .      .       . .      . . |
     | . . .      .       .      229/483 . .      . . |
     | . . .      .       79/270 .       . .      . . |
     | . . .      831/445 .      971/63  . 52/103 . . |

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

o5 = | .   .   267 .   .   .   556 .   .   .   |
     | 353 340 .   957 991 252 .   .   .   880 |
     | 519 .   .   .   .   462 .   559 .   .   |
     | .   .   .   919 .   .   170 967 796 .   |
     | .   .   414 .   .   .   .   602 .   .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :