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 = | .78 .59 .026 .8  .48 .12   .35 .3  .78  .033 |
     | .18 .63 .53  .89 .62 .32   .92 .39 .3   .63  |
     | .43 .43 .19  .96 .43 .0054 .91 .53 .31  .42  |
     | .89 .74 .53  .71 .77 .68   .24 .46 .51  .71  |
     | .45 .51 .46  .98 .68 .1    .37 .94 .041 .81  |

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

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

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

o4 = | .       508/347 313/514 .       .       .       .       .       . .      |
     | .       317/203 257/489 .       818/875 60/319  .       .       . 14/337 |
     | 996/995 .       .       .       .       .       .       .       . .      |
     | .       .       .       .       .       .       205/228 .       . .      |
     | .       356/245 .       981/788 .       649/735 .       558/203 . .      |

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

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

o5 : MutableMatrix

See also

Ways to use fillMatrix :