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 = | .0098 .89 .86 .042 .17 .41 .37 .0036 .38  .51 |
     | .89   .32 .84 .54  1   .94 .93 .61   .4   .69 |
     | .29   .15 .38 .41  .81 .38 .53 .52   .28  .6  |
     | .89   .57 .23 .61  .23 .32 .8  .067  .079 .2  |
     | .93   .63 .45 .028 .9  .19 .11 .99   .82  .5  |

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

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

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

o4 = | . .       . .      11/5    .       .     860/421 593/85 905/186 |
     | . .       . 83/371 .       415/101 .     .       .      .       |
     | . .       . .      119/142 .       155/7 116/351 .      137/273 |
     | . .       . .      .       .       .     39/7    .      .       |
     | . 475/204 . 53/57  .       .       .     .       .      .       |

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

o5 = | 979 .   .   172 .   .  .   .   .   788 |
     | .   583 587 799 213 .  276 .   .   835 |
     | .   884 .   .   261 .  .   271 .   .   |
     | .   170 .   .   860 .  .   142 648 727 |
     | .   .   .   .   .   64 172 .   14  9   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :