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 = | .76  .98 .67 .12 .37 .63 .83 .58  .12  .25 |
     | .029 .99 .62 .4  .77 .23 .86 .066 .95  .79 |
     | .7   .4  .97 .5  .11 .82 .19 .56  .36  .17 |
     | .3   .99 .97 .37 .46 .97 .16 .13  .055 .9  |
     | .24  .52 .4  .26 .45 .58 .68 .91  .5   .26 |

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

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

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

o4 = | .       . 773/684 .      . . .       .       .      .       |
     | .       . 316/59  .      . . .       .       .      .       |
     | .       . .       .      . . .       .       142/89 .       |
     | 493/308 . 2       19/407 . . 129/112 .       32/323 .       |
     | 170/71  . 18/29   .      . . 718/587 370/419 .      379/790 |

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

o5 = | 72  .   .   .   554 709 494 345 .   .  |
     | .   .   .   765 421 .   .   .   .   .  |
     | .   .   708 .   .   .   396 .   .   .  |
     | .   981 .   .   .   312 .   964 974 .  |
     | 256 378 661 674 .   .   .   738 .   82 |

o5 : MutableMatrix

See also

Ways to use fillMatrix :