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 = | .38 .18 .14 .93 .96  .39  .4  .73 .47  1    |
     | .41 .59 .62 .37 1    .19  .79 .72 .9   .76  |
     | .55 .25 .24 .65 .12  .66  .88 .86 .051 .75  |
     | .13 .18 .83 .74 .93  .085 .67 .3  .7   .31  |
     | .47 .82 .21 .48 .017 .59  .51 .63 .46  .065 |

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

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

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

o4 = | 193/130 . 20/269  . . . .      . 31/4 59/408  |
     | .       . .       . . . .      . .    .       |
     | .       . 289/219 . . . .      . .    .       |
     | .       . .       . . . 58/365 . .    .       |
     | 633/25  . .       . . . 89/77  . .    493/814 |

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

o5 = | .   .   .   .   305 .   .   .   .   525 |
     | .   972 517 .   .   694 .   471 .   442 |
     | .   .   .   432 .   239 .   863 .   .   |
     | .   783 849 941 851 126 .   .   827 .   |
     | 388 .   .   .   .   .   789 .   544 .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :