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 = | .83 .96 .93 .28 .53 .92   .36  .77 .2  .92  |
     | .76 .57 .55 .22 .47 .16   .49  .84 .99 .033 |
     | .36 .97 .56 .12 .55 .87   .92  .5  .73 .49  |
     | .46 .74 .19 .27 .53 .0092 .5   .19 .51 .64  |
     | .66 .36 .79 .98 .9  .16   .053 .81 .87 .94  |

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

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

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

o4 = | . . .       . .       .     .      .       23/172 .       |
     | . . 483/163 . .       .     .      .       .      .       |
     | . . .       . .       63/38 .      .       .      .       |
     | . . .       . 101/213 .     .      682/721 .      9/4     |
     | . . 577/434 . .       .     13/148 630/461 .      101/167 |

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

o5 = | .   .   .   431 .   .   .   173 .   . |
     | .   .   .   183 .   389 744 843 672 . |
     | .   405 175 291 944 .   .   823 168 . |
     | 733 280 .   609 822 .   .   251 .   . |
     | 528 .   .   .   804 232 .   483 .   . |

o5 : MutableMatrix

See also

Ways to use fillMatrix :