next | previous | forward | backward | up | top | index | toc | directory | Macaulay 2 web site

fillMatrix -- fill a mutable matrix with random numbers

Synopsis

Description

i1 : printingPrecision = 2

o1 = 2
i2 : fillMatrix(mutableMatrix(RR,5,10))

o2 = | .35  .23  .21 .87 .51 .9  .39 .57    .13 .84  |
     | .46  .96  .79 .44 .19 .52 .79 .3     .31 .88  |
     | .081 .097 .97 .14 .67 .11 .54 .43    .44 .33  |
     | .4   .56  .99 .64 .18 .56 .8  .00084 .94 .25  |
     | .12  .6   .21 .94 .52 .61 .44 .63    .88 .093 |

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

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

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

o4 = | . .       514/609 69/77 .      124/453 .       . 52/53   185/523 |
     | . .       .       .     .      .       .       . .       .       |
     | . 661/727 609/713 .     173/32 .       332/425 . 103/735 .       |
     | . .       .       .     .      .       .       . .       .       |
     | . .       .       .     .      .       .       . 134/269 561/538 |

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

o5 = | .   .   .   .   805 .   .   . .   .   |
     | 931 160 .   718 379 .   290 . 436 970 |
     | 540 .   444 .   .   498 .   . 817 .   |
     | .   878 .   357 .   200 .   . .   69  |
     | 498 .   .   114 .   628 410 . .   .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :