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 = | .8  .9  .34  .95 .84 .39 .87 .78 .53   .11 |
     | .19 .73 .08  .3  .7  .11 .34 .5  .16   .99 |
     | .43 .85 .76  .56 .85 .53 .55 .66 .74   .74 |
     | .65 .76 .6   .67 .82 .85 .63 .49 .3    .48 |
     | .93 .52 .061 .4  .92 .41 .51 .69 .0069 .25 |

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

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

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

o4 = | 57/71 113/119 .      239/188 .       8/217 . .    . . |
     | .     .       .      .       .       .     . .    . . |
     | .     515/591 687/56 446/597 .       .     . .    . . |
     | .     55/2    .      .       719/269 .     . .    . . |
     | .     .       .      .       .       .     . 7/34 . . |

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

o5 = | .   595 726 .   237 . .   .   .   .   |
     | 93  727 .   .   .   . 976 .   163 724 |
     | .   377 457 548 .   . .   .   .   .   |
     | 239 983 134 .   .   . 863 874 .   .   |
     | 152 .   .   .   734 . 454 .   .   .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :