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 = | .54 .88  .91 .14  .68 .87 .92  .89 .32  .41  |
     | .93 .55  .31 .61  .92 .41 .74  .92 .29  .27  |
     | .15 .8   .65 .078 .83 .54 .15  .91 .7   .052 |
     | .47 .15  .88 .39  .45 .83 .37  .8  .058 .75  |
     | .64 .031 .76 .22  .94 .51 .027 .2  .23  .25  |

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

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

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

o4 = | 590/523 287/97 52/133 .       .     11/9    .       . 425/404 . |
     | .       .      .      583/873 .     603/217 .       . .       . |
     | .       .      .      479/224 .     165/943 449/191 . 35/38   . |
     | .       .      .      .       .     121/103 .       . 837/700 . |
     | .       .      .      .       62/41 .       484/35  . 879/446 . |

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

o5 = | .   .   .   671 .   657 .   .   . .   |
     | 160 .   526 21  .   448 787 .   . 443 |
     | .   339 .   79  988 .   .   .   . .   |
     | 866 746 .   .   430 .   .   194 . 121 |
     | .   200 360 .   .   944 108 .   . .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :