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 = | .63 .51 .92 .75 .66 .05  .96  .26   .44 .95 |
     | .41 .98 .41 .56 .21 .76  .74  .8    .8  .68 |
     | .76 .98 .43 .57 .33 .046 .86  .0051 .28 .98 |
     | .94 .11 .46 .77 .27 .87  .56  .27   .6  .23 |
     | .75 .41 .18 .43 .8  .98  .025 .59   .98 .39 |

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

o3 = | . . . . . . . . . . |
     | . . . . . . . . . . |
     | . . . . . . . . . . |
     | . . . . . . . . . . |
     | . . . . . . . . . . |

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

o4 = | . 127/162 .       . .       .       .       .     .       .       |
     | . .       .       . .       .       470/13  38/5  .       .       |
     | . 215/483 .       . .       .       476/419 .     296/227 .       |
     | . 929/815 .       . 417/212 807/553 .       2/853 .       142/295 |
     | . 328/81  323/546 . 83/194  .       77/4    .     .       .       |

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

o5 = | . . . . . . . . . . |
     | . . . . . . . . . . |
     | . . . . . . . . . . |
     | . . . . . . . . . . |
     | . . . . . . . . . . |

o5 : MutableMatrix

See also

Ways to use fillMatrix :