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 = | .06  .064 .3   .29  .21 .71 .3  .23 .39 .66 |
     | .82  .64  .024 .25  .69 .21 .2  .63 .6  .41 |
     | .019 .61  .66  .048 .95 .92 .34 .71 .81 .71 |
     | .083 .64  .95  .027 .19 .89 .83 .36 .75 .5  |
     | .85  .99  .05  .23  .6  .3  .4  .73 .95 .47 |

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

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

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

o4 = | .       .       .       9/89    .       .       .     .       .       . |
     | .       241/189 .       .       .       .       .     .       .       . |
     | .       .       .       37/19   595/228 149/973 .     186/533 805/654 . |
     | 932/109 .       229/264 .       .       .       .     .       .       . |
     | .       .       .       469/925 .       333/860 1/214 .       .       . |

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

o5 = | .   . .   .   909 .  .   552 50  854 |
     | 992 . .   .   506 67 .   .   .   675 |
     | .   . .   .   68  .  618 424 .   .   |
     | .   . 88  .   .   .  977 .   .   98  |
     | 856 . 401 389 .   .  181 339 816 .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :