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 = | .5   .23 .18 .39  .13 .34 .84 .67 .61  .33 |
     | .95  .32 .53 .26  .15 .22 .97 .61 .079 .83 |
     | .071 .27 .8  .078 .53 .29 .62 .94 .99  .82 |
     | .69  .84 .93 .74  .36 .17 .62 .2  .29  .51 |
     | .42  .24 .31 .69  .19 .66 .67 .52 .4   .75 |

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

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

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

o4 = | .     .       .       . 855/968 .       .      61/343 . . |
     | .     335/423 .       . .       543/436 35/338 .      . . |
     | .     .       848/725 . .       .       .      .      . . |
     | 5/103 .       .       . .       174/65  .      .      . . |
     | .     .       .       . 159/4   .       .      .      . . |

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

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

o5 : MutableMatrix

See also

Ways to use fillMatrix :