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 = | .85 .72 .081 .41  .74  .31 .43 .3  .092 .86  |
     | .35 .69 .13  .66  .48  .8  .42 .78 .49  .38  |
     | .26 .62 .57  .33  .075 .58 .54 .17 .96  .65  |
     | .39 .38 .099 .073 .15  .76 .64 .49 .93  .086 |
     | .61 .41 .79  .18  .091 .27 .99 .88 .58  .037 |

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

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

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

o4 = | 637/909 . .       101/168 .       .       . 719/184 217/773 . |
     | .       . 739/690 .       .       .       . .       .       . |
     | 288/611 . .       .       149/101 185/853 . .       .       . |
     | .       . .       13/72   .       .       . .       454/859 . |
     | .       . .       277/123 96/5    .       . .       .       . |

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

o5 = | .   925 501 562 .  358 .   .   .   .   |
     | 740 .   .   .   92 884 758 592 804 .   |
     | 251 .   .   .   .  108 .   .   669 727 |
     | .   .   .   373 .  .   912 .   328 .   |
     | 385 583 .   .   .  20  853 .   .   .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :