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 = | .84 .089 .36 .84  .88 .16  .37 .78   .95 .4  |
     | .4  .12  .91 .65  .47 .047 .24 .0029 .69 .09 |
     | .39 .78  .27 .23  .56 .23  .92 .18   .66 .83 |
     | .59 .88  .14 .88  .28 .89  .78 .78   .93 .99 |
     | .15 .043 .9  .012 .1  .12  .54 .83   .3  .52 |

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

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

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

o4 = | . . 353/366 .       295/671 .      .       .       . . |
     | . . .       .       .       47/621 .       .       . . |
     | . . 755/798 .       .       .      .       481/605 . . |
     | . . .       .       36/71   .      .       .       . . |
     | . . .       329/237 .       .      119/120 .       . . |

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

o5 = | 299 .   908 .   .   .   .   779 419 .   |
     | .   926 205 571 .   33  425 .   .   .   |
     | .   .   .   .   627 756 .   .   .   553 |
     | .   .   .   .   .   487 .   753 251 .   |
     | 899 .   .   651 .   .   .   .   164 .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :