next | previous | forward | backward | up | top | index | toc | Macaulay2 web site

fillMatrix -- fill a mutable matrix with random numbers

Synopsis

Description

i1 : printingPrecision = 2

o1 = 2
i2 : fillMatrix(mutableMatrix(RR,5,10))

o2 = | .36 .33 .89 .55 .57 .22 .79  .87 .78 .74 |
     | .17 .46 .76 .12 .26 .7  .36  .12 .95 .52 |
     | .39 .85 .92 .22 .52 .96 .067 .28 .83 .91 |
     | .17 .4  .49 .59 .9  .62 .69  .43 .67 .92 |
     | .58 .6  .21 .64 .83 .84 .065 .91 .51 .27 |

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

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

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

o4 = | .       .       .      .       . . .       . .       . |
     | .       181/335 .      275/669 . . 140/219 . 459/193 . |
     | .       .       .      11/381  . . 340/113 . .       . |
     | 433/56  .       31/229 .       . . .       . .       . |
     | 817/658 .       .      .       . . .       . 533/357 . |

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

o5 = | 706 .   .   .   .   . . .   727 .   |
     | 792 .   637 903 285 . . .   .   524 |
     | 700 547 847 13  55  . . .   .   780 |
     | .   .   261 .   628 . . .   872 .   |
     | .   404 .   121 .   . . 448 .   .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :