next | previous | forward | backward | up | top | index | toc | Macaulay2 web site

fillMatrix -- fill a mutable matrix with random numbers

Synopsis

Description

i1 : printingPrecision = 2

o1 = 2
i2 : fillMatrix(mutableMatrix(RR,5,10))

o2 = | .0098 .2   .24 .47 .26 .081 .79 .64 .93 .1  |
     | .97   .35  .79 .63 .43 .2   .93 .26 .23 .68 |
     | .29   .49  .68 .16 .57 .14  .49 .77 .52 .02 |
     | .56   .088 1   .56 .56 .3   .52 .86 .61 .67 |
     | .95   .66  .33 .39 .41 .7   .9  .32 .4  .21 |

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

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

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

o4 = | . .     . 117/83  .       .       160/929 . . . |
     | . 223/6 . .       .       .       .       . . . |
     | . .     . .       .       727/59  63/74   . . . |
     | . .     . 475/402 653/339 .       .       . . . |
     | . .     . .       .       271/251 .       . . . |

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

o5 = | .   .   138 65 .   .   919 .   .   102 |
     | .   .   496 .  .   327 770 .   472 637 |
     | 214 .   .   .  447 13  .   555 .   653 |
     | 782 657 .   .  .   168 126 .   .   .   |
     | .   .   .   .  .   .   .   .   .   115 |

o5 : MutableMatrix

See also

Ways to use fillMatrix :