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 = | .99 .026  .98 .84 .82 .47  .52 .7    .0082 .66 |
     | .92 .55   .46 .74 .84 .63  .23 .52   .056  .11 |
     | .16 .97   .77 .64 .24 .96  .69 .12   .92   .86 |
     | .62 .0011 .54 .68 .21 .38  .74 .0023 1     .3  |
     | .43 .41   .41 .2  .16 .074 .2  .76   .25   .48 |

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

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

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

o4 = | .       . .       .       . . 167/14 . .     .     |
     | 863/922 . .       .       . . .      . .     34/49 |
     | .       . .       .       . . .      . .     .     |
     | .       . 205/937 910/649 . . .      . .     .     |
     | .       . .       .       . . .      . 41/36 .     |

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

o5 = | 602 .   .   .   .   .   325 .   393 .   |
     | .   822 280 .   .   .   179 .   .   167 |
     | .   478 .   .   .   133 472 201 .   294 |
     | .   .   .   474 .   .   .   841 .   .   |
     | 621 .   .   .   563 .   904 .   .   .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :