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 = | .52 .84 .59   .99 .8  .92 .58 .82 .36 .018 |
     | .34 .94 .0074 .96 .61 .26 .47 .45 .93 .61  |
     | .77 .84 .078  .72 .3  .1  .59 .54 .82 .4   |
     | .32 .4  .18   .78 .43 .46 .73 .95 .49 .25  |
     | .17 .98 .83   .59 .74 .72 .45 .66 .51 .58  |

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

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

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

o4 = | .       .      48/139  . . . .       . 247/246 .       |
     | 571/141 .      367/331 . . . .       . .       .       |
     | 1/5     70/313 35/866  . . . .       . .       549/248 |
     | .       .      154/381 . . . .       . 164/121 .       |
     | 93/490  .      435/278 . . . 553/423 . 86/247  499/15  |

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

o5 = | .   478 .   406 . 313 235 .  .   86  |
     | .   .   .   .   . .   .   .  .   540 |
     | .   .   723 480 . .   .   .  683 945 |
     | 503 .   .   705 . 751 .   .  .   .   |
     | 719 .   934 .   . .   921 29 .   .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :