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 = | .53 .54  .84 .27 .24 .94 .29   .42 .17 .26 |
     | .12 .066 .89 .56 .37 .94 .66   .92 .73 .98 |
     | .44 .41  .3  .22 .41 .17 .61   .88 .61 .13 |
     | .25 .031 .17 .91 .3  .7  .26   .73 .96 .91 |
     | .05 .93  .23 .96 .77 .9  .0051 .92 .16 .3  |

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

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

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

o4 = | 504/625 . .       . .       . . .       406/941 .     |
     | .       . .       . .       . . .       121/578 .     |
     | .       . .       . .       . . 939/257 .       59/53 |
     | .       . .       . 425/584 . . .       .       .     |
     | .       . 756/479 . 81/197  . . .       .       .     |

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

o5 = | . .   942 465 375 .   .   .   101 . |
     | . 783 .   707 66  .   780 .   692 . |
     | . .   447 434 .   510 721 531 .   . |
     | . 623 .   867 106 .   .   .   .   . |
     | . .   462 .   284 683 .   .   242 . |

o5 : MutableMatrix

See also

Ways to use fillMatrix :