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 = | .013 .5    .92  .61 .62 .35 .81   .15 .83 .015 |
     | .81  .69   .14  .84 .8  .46 .27   .14 .28 .58  |
     | .008 .48   .096 .74 .04 .21 .91   .48 .61 .91  |
     | .55  .0085 .13  .32 .72 .46 .0036 .66 .91 .33  |
     | .11  .96   .54  .83 .69 .24 .48   .5  .72 .039 |

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

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

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

o4 = | . . . .       .       . .       .       .       . |
     | . . . .       .       . .       .       .       . |
     | . . . .       658/683 . .       .       896/339 . |
     | . . . 956/479 .       . .       121/123 .       . |
     | . . . .       337/578 . 394/185 .       659/877 . |

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

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

o5 : MutableMatrix

See also

Ways to use fillMatrix :