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 = | .79 .3  .66  .74 .48  .39 .26 .62  .76  .31 |
     | .27 1   .071 .91 .33  .21 .54 .15  .48  .59 |
     | .19 .48 .65  .37 .51  .74 .91 .069 .73  .72 |
     | .34 .63 .74  .42 .87  .1  .65 .51  .046 .33 |
     | .99 .43 .8   .38 .026 .77 .38 .51  .45  .46 |

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

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

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

o4 = | . .      .       . .       758/631 . . . 731/870 |
     | . 49/128 .       . .       .       . . . .       |
     | . .      523/265 . 495/284 .       . . . .       |
     | . .      .       . .       .       . . . .       |
     | . .      559/407 . 551/331 259/68  . . . 262/161 |

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

o5 = | .  .   350 .   .   .   33  .   . 3   |
     | 61 .   483 .   166 617 .   .   . .   |
     | .  447 115 771 580 .   240 697 . 396 |
     | 74 .   .   .   .   .   .   .   . 828 |
     | .  .   649 .   .   .   643 .   . .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :