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 = | .15  .78 .76 .56 .14 .18 .036 .78 .77 .78 |
     | .3   .99 .71 .28 .63 .62 .39  .4  .73 .59 |
     | .56  1   .33 .98 .72 .88 .5   .96 .11 .8  |
     | .014 .96 .27 1   .47 .11 .47  .16 .21 .62 |
     | .14  .22 .72 .74 .61 .86 .044 .73 .79 .87 |

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

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

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

o4 = | 71/575  .       .       .       .       .       . . .     82/73 |
     | 338/553 .       105/253 .       .       .       . . .     .     |
     | 433/78  174/679 .       .       .       .       . . .     .     |
     | .       .       .       .       .       794/861 . . .     631/9 |
     | 531/608 .       737/386 991/450 105/467 .       . . 10/83 .     |

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

o5 = | .   .   582 . .   540 416 .   91  643 |
     | 361 956 .   . .   .   .   .   .   .   |
     | 568 551 .   . 235 778 581 .   .   .   |
     | 818 .   .   . .   .   .   .   .   .   |
     | 168 .   320 . 774 445 .   948 435 .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :