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 = | .87 .12 .41 .45  .44 .61 .16 .53  .26  .43 |
     | .17 .56 .92 .047 .2  .87 .25 .4   .64  .74 |
     | .21 .15 .8  .34  .14 .19 .48 .63  .77  .29 |
     | .88 .26 .9  .81  .82 .39 .39 .9   .18  .67 |
     | .72 .21 .76 .34  .79 .68 .26 .021 .019 .69 |

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

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

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

o4 = | 277/239 . .      .       . .       . .       . .       |
     | .       . .      992/159 . .       . 818/619 . 941/567 |
     | .       . 117/88 .       . 282/839 . 148/77  . .       |
     | .       . .      .       . .       . .       . 163/273 |
     | .       . .      224/233 . .       . .       . .       |

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

o5 = | 444 .   .   .   .   592 .   .   . 100 |
     | .   .   61  .   .   411 .   .   . 670 |
     | .   .   .   .   587 .   333 .   . 398 |
     | .   872 332 .   .   557 .   11  . 351 |
     | 106 916 .   461 .   .   .   721 . 487 |

o5 : MutableMatrix

See also

Ways to use fillMatrix :