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 = | .3  .86  .69 .13 .78 .42  .68 .67  .21 .12 |
     | .53 .013 .35 .45 .86 .39  .18 .94  .13 .15 |
     | .49 .93  .94 .99 .7  .057 .38 .086 .89 .11 |
     | .26 .63  .44 .59 .86 .65  .23 .68  .43 .13 |
     | .52 .11  .22 .42 .63 .8   .42 .57  .56 .94 |

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

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

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

o4 = | . . .       .       .     157/134 . 675/598 .      .       |
     | . . 471/68  .       .     .       . 173/470 .      .       |
     | . . .       .       .     .       . .       .      .       |
     | . . 349/394 282/497 .     .       . .       992/47 574/893 |
     | . . .       .       70/53 100/57  . 335/381 .      29/372  |

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

o5 = | 922 . .   . 658 76  .   .   .   .   |
     | .   . .   . .   .   62  995 542 847 |
     | .   . .   . .   688 .   .   .   .   |
     | 884 . .   . 709 972 .   43  856 .   |
     | 854 . 609 . 171 .   867 .   840 395 |

o5 : MutableMatrix

See also

Ways to use fillMatrix :