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 = | .23 .69  .28 .83 .17  .75  .37  .86  .1   .35  |
     | .69 .33  .35 .68 .62  .039 .66  .022 .19  .61  |
     | .23 .41  .17 .54 .52  .76  .032 .9   .7   .96  |
     | .38 .24  .19 .96 .089 .5   .26  .45  .34  .089 |
     | .81 .013 .65 .89 .87  .011 .97  .98  .053 .29  |

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

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

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

o4 = | . 790/137 .       21/32 .       .       216/193 .      .       . |
     | . 825/416 .       .     .       .       .       121/89 .       . |
     | . 163/63  .       .     358/125 .       .       .      .       . |
     | . .       .       .     .       .       201/527 .      .       . |
     | . .       274/331 .     .       473/546 .       .      655/346 . |

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

o5 = | 44 .   .   .   .   956 .   166 .   249 |
     | .  .   500 .   .   887 828 424 59  736 |
     | .  134 .   471 521 .   .   443 107 738 |
     | .  .   469 .   .   167 978 .   .   .   |
     | .  910 .   .   .   .   686 .   .   .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :