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 = | .18  .51 .039 .88 .1  .037 .074 .66  .16   .51  |
     | .092 .77 .8   .29 .43 .84  .012 .038 .0095 .31  |
     | .18  .58 .96  .18 .18 .65  .48  .86  .32   .54  |
     | .96  1   .38  .16 .85 .61  .62  .82  .76   .39  |
     | .19  .84 .14  .47 .39 .58  .19  .46  .41   .072 |

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

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

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

o4 = | 333/808 .     400/123 . .       962/237 . .      . . |
     | 4/57    .     .       . .       .       . .      . . |
     | .       33/43 .       . 376/197 .       . .      . . |
     | .       .     .       . .       139/803 . .      . . |
     | .       .     .       . .       .       . 455/83 . . |

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

o5 = | .   235 .   40 .   .   .   .  .   .   |
     | .   939 400 12 963 .   .   .  .   .   |
     | .   302 847 .  .   .   523 .  598 .   |
     | 303 536 .   .  100 .   .   29 310 .   |
     | .   .   600 .  .   961 538 .  .   713 |

o5 : MutableMatrix

See also

Ways to use fillMatrix :