next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc :: fillMatrix

fillMatrix -- fill a mutable matrix with random numbers

Synopsis

Description

i1 : printingPrecision = 2

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

o2 = | .43 .54 .73 .14 .71    .34  .56 .88 .5  .53 |
     | .11 .58 .93 .22 .74    .059 .85 .57 .54 .17 |
     | .46 .22 .89 .27 .87    .86  .81 .64 .11 .76 |
     | .14 .47 .76 .94 .62    .69  .36 .12 .62 .88 |
     | .88 .81 .72 .51 .00067 .21  .79 .01 .17 .6  |

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

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

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

o4 = | .      .       .       .       837/824 .     .       .       .      961/377 |
     | .      .       .       .       .       41/36 .       .       .      .       |
     | .      .       397/389 .       .       .     17/571  .       79/233 .       |
     | 545/74 98/59   .       541/718 .       .     191/384 .       .      .       |
     | .      289/154 .       311/199 .       .     .       305/241 .      .       |

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

o5 = | .   .   .   .   .   .   .   .   808 .   |
     | .   .   .   192 336 918 539 322 484 .   |
     | .   .   .   53  940 .   .   .   .   673 |
     | 498 277 540 .   774 .   .   638 66  112 |
     | .   .   445 935 643 804 .   389 .   .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :