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 = | .68 .0024 .36 .94 .47 .022 .1  .24 .67  .78 |
     | .93 .32   .29 .43 .77 .091 .43 .3  .8   .79 |
     | .25 .42   .5  .14 .38 .93  .88 .54 .059 .22 |
     | .52 .23   .21 .44 .22 .64  .55 .89 .16  .6  |
     | .59 .48   .77 .18 .61 .84  1   .36 .16  .32 |

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

o3 = | . . . . . . . . . . |
     | . . . . . . . . . . |
     | . . . . . . . . . . |
     | . . . . . . . . . . |
     | . . . . . . . . . . |

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

o4 = | .       . . .      . .       303/611 .       .       . |
     | .       . . .      . .       .       389/494 .       . |
     | 782/769 . . 37/420 . .       17/688  .       .       . |
     | 302/129 . . .      . .       .       .       .       . |
     | .       . . .      . 262/123 30/7    .       109/236 . |

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

o5 = | . . . . . . . . . . |
     | . . . . . . . . . . |
     | . . . . . . . . . . |
     | . . . . . . . . . . |
     | . . . . . . . . . . |

o5 : MutableMatrix

See also

Ways to use fillMatrix :