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 = | .72 .42 .011 .85 .68  .89  .37 .46  .67     .61  |
     | .12 .12 .29  .94 .56  .099 .23 .013 .19     .46  |
     | .49 .86 .75  .47 1    .15  .1  .28  .000076 .096 |
     | .82 .89 .4   .66 .16  .84  .53 .96  .4      .22  |
     | .2  .72 .18  .74 .085 .97  .63 .29  .036    .48  |

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

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

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

o4 = | . .     . 603/2   .       424/391 .      605/784 . .       |
     | . 73/99 . 523/603 .       .       .      .       . .       |
     | . .     . .       700/661 .       168/95 .       . .       |
     | . .     . .       .       .       .      .       . 565/377 |
     | . .     . .       .       .       .      .       . .       |

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

o5 = | 61  .   .   449 316 .   .   312 658 807 |
     | 370 338 .   961 .   453 .   .   .   .   |
     | .   .   297 812 .   .   968 .   .   753 |
     | .   72  .   .   .   .   .   704 .   345 |
     | 967 .   137 .   .   .   21  .   .   .   |

o5 : MutableMatrix

See also

Ways to use fillMatrix :