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 = | .52  .011 .25 .92 .44 .83 .16 .88  .67  .52  |
     | .67  .34  .9  .26 .71 .38 .49 .72  .49  .089 |
     | .049 .41  .87 .85 .6  .48 .46 .49  .049 .65  |
     | .46  .35  .43 .57 .29 .36 .29 .041 .54  .69  |
     | .61  .84  .71 .22 .18 .46 .52 .16  .041 .68  |

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

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

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

o4 = | 245/137 .      .       . 3/214   . . .       .       377/636 |
     | .       .      .       . .       . . .       .       .       |
     | .       .      .       . .       . . .       420/731 .       |
     | 48/71   .      .       . .       . . 661/513 .       684/215 |
     | .       202/89 451/840 . 811/190 . . .       24/41   .       |

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

o5 = | .   .   .   .  .   . 952 .   .   .   |
     | .   .   825 .  .   . .   735 .   48  |
     | .   .   759 56 76  . .   527 295 .   |
     | 496 .   .   .  543 . .   .   .   708 |
     | 769 192 615 .  .   . 912 .   506 912 |

o5 : MutableMatrix

See also

Ways to use fillMatrix :