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 = | .6   .72 .16 .31 .23 .68   .69   .13  .24  .0056 |
     | .2   .81 .8  .44 .51 .45   .84   .039 .68  .9    |
     | .031 .89 .98 .83 .62 .0082 .0055 .87  .4   .43   |
     | .69  .95 .77 .74 .6  .19   .77   .83  .078 .64   |
     | .26  .35 .27 .82 .53 .8    .39   .36  .94  .62   |

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

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

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

o4 = | . .       . . 66/361  196/825 721/307 .     .       .       |
     | . 89/198  . . 479/153 .       .       15/23 847/930 335/381 |
     | . .       . . .       10/73   543/914 .     .       .       |
     | . .       . . .       496/103 470/297 .     .       761/629 |
     | . 377/149 . . .       33/130  .       .     299/93  .       |

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

o5 = | 901 151 831 .   .   .   .   .   827 742 |
     | 868 .   733 .   .   95  .   .   929 778 |
     | .   .   .   602 .   881 192 99  .   578 |
     | 133 .   .   .   .   .   .   591 973 649 |
     | .   .   .   .   970 .   .   .   .   345 |

o5 : MutableMatrix

See also

Ways to use fillMatrix :