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 = | .71  .089 .38 .87 .39 .55  .18 .023 .47 .19  |
     | .31  .17  .77 .43 .27 .99  .58 .6   .96 .19  |
     | .9   .73  .48 .77 .26 .43  .29 .57  .14 .44  |
     | .12  .047 .18 .43 .9  .2   .26 .85  .94 .12  |
     | .048 .26  .83 .33 .77 .055 .41 .23  .2  .004 |

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

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

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

o4 = | 228/257 .       .       947/725 . .       . .       . .       |
     | .       .       .       12/317  . 466/829 . .       . 453/503 |
     | .       417/365 108/229 .       . .       . 633/224 . .       |
     | .       .       .       .       . .       . .       . 1/3     |
     | .       .       .       .       . .       . .       . 161/456 |

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

o5 = | 388 825 .   . 660 .   .   .   287 .   |
     | 235 428 169 . 645 799 546 400 .   438 |
     | .   392 .   . .   .   926 .   670 .   |
     | 90  .   .   . 568 755 .   .   .   .   |
     | .   .   .   . .   421 .   .   134 .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :