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 = | 1   .29 .45  .63 .61 .53  .26  .98 .4   .076 |
     | .76 .16 .058 .93 .39 .84  .027 .6  1    .48  |
     | .16 .19 .71  .99 .27 .2   .21  .25 .79  .62  |
     | .34 .9  .95  .95 .24 .83  .9   .94 .16  1    |
     | .54 .56 .84  .45 .29 .085 .2   .8  .067 .59  |

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

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

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

o4 = | . 407/867 .      .      . 109/513 . . .       . |
     | . .       326/37 .      . .       . . .       . |
     | . .       .      .      . 718/951 . . .       . |
     | . 158/117 .      .      . .       . . .       . |
     | . 128/957 .      92/581 . .       . . 899/159 . |

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

o5 = | .   . .   734 .   615 298 692 229 435 |
     | 914 . .   .   .   .   .   618 563 893 |
     | 783 . .   .   .   991 903 .   .   .   |
     | .   . 286 .   712 .   609 .   585 .   |
     | 853 . .   .   869 .   147 333 .   .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :