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 = | .33 .9  .57  .17  .97 .36 .14 .8   .44  .64 |
     | .22 .17 .8   .011 .99 .8  .45 .067 .034 .86 |
     | .84 .82 .4   .74  .37 .12 .8  .58  .92  .74 |
     | .2  .92 .9   .084 .39 .45 .4  .044 .37  .49 |
     | .72 .94 .017 .22  .48 .77 .76 .47  .22  .83 |

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

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

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

o4 = | .       101/240 .       .       . .       .       .       . 913/776 |
     | 41/77   .       .       .       . .       .       .       . .       |
     | .       369/877 .       .       . 578/691 .       .       . .       |
     | .       .       .       148/887 . .       885/802 453/697 . .       |
     | 544/225 .       448/177 .       . .       .       .       . .       |

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

o5 = | 301 387 .   .   36  868 .   .   .   .   |
     | 191 565 .   899 .   .   .   56  .   .   |
     | .   .   708 .   893 49  740 .   783 .   |
     | .   .   798 620 808 572 300 .   .   .   |
     | .   558 .   .   .   .   .   671 483 857 |

o5 : MutableMatrix

See also

Ways to use fillMatrix :