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 = | .93  .97 .68 .65  .36 .09 .15  .92 .24 .15 |
     | .029 .72 .14 .28  .91 .61 .47  .79 .76 .53 |
     | .45  .9  .4  .092 .76 .17 .65  .78 .17 .82 |
     | .28  .58 .21 .72  .29 .11 .072 .78 .7  .18 |
     | .82  .89 .58 .9   .97 .41 .15  .78 .17 .13 |

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

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

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

o4 = | . .       732/931 . .     839/447 . 458/353 .       .       |
     | . .       .       . .     .       . .       .       .       |
     | . 948/877 .       . .     .       . .       177/313 109/492 |
     | . 310/309 542/107 . .     .       . .       .       .       |
     | . .       27/8    . 48/49 .       . .       .       811/951 |

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

o5 = | .   .  .   .   .   .   .   . .   .   |
     | .   31 529 .   .   .   .   . 213 .   |
     | 832 .  71  784 .   .   311 . .   .   |
     | 278 .  664 .   685 947 .   . .   763 |
     | 143 .  664 2   708 400 684 . .   .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :