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 = | .55 .4   .62 .21 .3  .53 .73    .38  .29 .54  |
     | .9  .062 .94 .73 .9  .25 .55    .94  .39 .078 |
     | .87 .4   .33 .49 .38 .81 .00041 .053 .88 .9   |
     | .22 .79  .13 .34 .4  .81 .17    .14  .96 .6   |
     | .22 .41  .86 .32 .79 .4  .65    .79  .17 .55  |

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

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

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

o4 = | 829/290 .       725/497 .       .      .      . . .       . |
     | 122/235 .       .       950/997 84/821 82/413 . . .       . |
     | 419/80  .       .       .       .      .      . . 647/735 . |
     | .       .       .       .       .      .      . . .       . |
     | .       641/511 .       .       .      .      . . 40/503  . |

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

o5 = | 69  530 756 .   .   .   227 .   .   .   |
     | .   .   873 437 .   252 .   .   .   .   |
     | 453 .   .   .   299 352 .   .   .   16  |
     | .   .   .   .   446 .   .   116 .   .   |
     | .   905 817 .   196 .   .   111 544 107 |

o5 : MutableMatrix

See also

Ways to use fillMatrix :