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 = | .25 .36 .079 .66 .28 .49 .65  .75 .33 .17  |
     | .79 .97 .29  .71 .39 .57 .061 .8  .33 .095 |
     | .5  .61 .41  .21 .48 .82 .21  .85 .74 .028 |
     | .89 .24 .93  .49 .6  .21 .019 .13 .12 .37  |
     | .36 .67 .17  .97 .83 .79 .89  .1  .97 .58  |

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

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

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

o4 = | .       .      . .       .       . .       . . 697/436 |
     | 949/341 .      . .       .       . .       . . .       |
     | .       .      . 573/838 2/107   . .       . . .       |
     | .       .      . .       .       . 781/145 . . .       |
     | .       302/85 . 410/527 688/487 . .       . . .       |

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

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

o5 : MutableMatrix

See also

Ways to use fillMatrix :