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 = | .13 .19  .73 .54 .84  .12 .68 .2   .66 .62 |
     | .45 .84  .47 .22 .85  .93 .73 .48  .89 .68 |
     | .16 .62  .21 .73 .98  .31 .26 .033 .62 .83 |
     | .64 .011 .43 .41 .087 .48 .79 .37  .49 .72 |
     | .87 .13  .97 .72 .68  .38 .94 .83  1   .45 |

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

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

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

o4 = | 83/308 .     . .      .       9/137 . .     .       . |
     | .      .     . 281/75 .       .     . 34/19 704/981 . |
     | .      .     . .      754/673 .     . .     .       . |
     | .      .     . .      .       .     . .     .       . |
     | .      28/23 . .      .       .     . .     831     . |

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

o5 = | . 223 225 358 .   .   .   .   23  436 |
     | . .   .   146 .   .   463 823 966 803 |
     | . .   .   .   790 .   .   .   .   .   |
     | . 775 .   .   337 813 516 200 .   .   |
     | . 375 .   .   .   410 .   .   .   .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :