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 = | .94  .69 .41 .08 .72  .33  .17  .32 .82 .54 |
     | .14  .25 .79 .55 .63  .24  .87  .25 .6  .84 |
     | .82  .66 .45 .8  .94  .67  .43  .78 .45 .69 |
     | .32  .8  .48 .94 .12  .12  .69  .68 .8  .34 |
     | .026 .87 .87 .41 .024 .097 .078 .36 .92 .99 |

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

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

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

o4 = | . .     .      .       .      7/2     896/457 . .      . |
     | . 11/14 .      813/442 .      .       .       . 21/113 . |
     | . .     82/281 .       10/59  .       .       . .      . |
     | . .     .      .       83/160 .       .       . .      . |
     | . .     .      .       .      505/754 .       . .      . |

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

o5 = | .   .   .   .   240 .   741 .   .   464 |
     | .   953 693 .   57  .   83  .   .   454 |
     | .   .   .   939 .   .   .   .   578 227 |
     | 715 .   .   .   704 679 .   .   .   573 |
     | .   .   953 283 958 .   .   520 916 .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :