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 = | .44  .71 .33  .023 .21 .5  .14 .2  .97  .19  |
     | .68  .17 .94  .01  .75 .54 .79 .89 .94  .3   |
     | .55  .14 .012 .78  .27 .8  .54 .25 .055 .038 |
     | .047 .47 .97  .26  .84 .83 .71 .77 .68  .67  |
     | .3   .12 .3   .72  .76 .21 .3  .89 .93  .026 |

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

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

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

o4 = | .     .       . . . 170/461 . . .       525/754 |
     | .     .       . . . .       . . .       .       |
     | .     367/468 . . . .       . . .       .       |
     | 51/95 .       . . . .       . . 956/525 .       |
     | .     .       . . . .       . . .       .       |

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

o5 = | .   .   .  .   .   .   . .   .   989 |
     | 592 .   .  184 444 .   . 50  .   .   |
     | 634 .   .  .   .   .   . .   .   486 |
     | .   44  89 366 138 139 . .   783 640 |
     | 888 740 .  .   .   .   . 162 896 39  |

o5 : MutableMatrix

See also

Ways to use fillMatrix :