Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 7ebd25ac536d248d499a3ce2acda963a > files > 4370

Macaulay2-1.3.1-8.fc15.i686.rpm

<?xml version="1.0" encoding="utf-8" ?>  <!-- for emacs: -*- coding: utf-8 -*- -->
<!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"	 "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head><title>fillMatrix -- fill a mutable matrix with random numbers</title>
<link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/>
</head>
<body>
<table class="buttons">
  <tr>
    <td><div><a href="_finding_spyour_spfiles_spunder_spcygwin.html">next</a> | <a href="___File__Position.html">previous</a> | <a href="_finding_spyour_spfiles_spunder_spcygwin.html">forward</a> | <a href="___File__Position.html">backward</a> | up | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div>

    </td>
  </tr>
</table>
<hr/>
<div><h1>fillMatrix -- fill a mutable matrix with random numbers</h1>
<div class="single"><h2>Synopsis</h2>
<ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>fillMatrix M</tt><br/><tt>fillMatrix(M,n)</tt></div>
</dd></dl>
</div>
</li>
<li><span>Function: <a href="_fill__Matrix.html" title="fill a mutable matrix with random numbers">fillMatrix</a></span></li>
<li><div class="single">Inputs:<ul><li><span><tt>M</tt>, <span>a <a href="___Mutable__Matrix.html">mutable matrix</a></span></span></li>
<li><span><tt>n</tt>, <span>an <a href="___Z__Z.html">integer</a></span>, if specified, the maximum number of entries to replace</span></li>
</ul>
</div>
</li>
<li><div class="single">Consequences:<ul><li>some entries of M are replaced with randomly generated numbers, whose size depends on the value of the option <tt>Height</tt></li>
</ul>
</div>
</li>
<li><div class="single">Outputs:<ul><li><span><tt>M</tt></span></li>
</ul>
</div>
</li>
<li><div class="single"><a href="_using_spfunctions_spwith_spoptional_spinputs.html">Optional inputs</a>:<ul><li><span><tt>Density => </tt><span><span>a <a href="___R__R.html">real number</a></span>, <span>default value 1</span>, the fraction of entries of <tt>M</tt> to be replaced, if <tt>n</tt> is not specified</span></span></li>
<li><span><tt>UpperTriangular => </tt><span><span>a <a href="___Boolean.html">Boolean value</a></span>, <span>default value false</span>, whether to fill entries only above the diagonal</span></span></li>
<li><span><tt>Height => </tt><span><span>an <a href="___Z__Z.html">integer</a></span>, <span>default value 10</span>, a bound on the absolute values of the generated random numbers</span></span></li>
</ul>
</div>
</li>
</ul>
</div>
<div class="single"><h2>Description</h2>
<div><table class="examples"><tr><td><pre>i1 : printingPrecision = 2

o1 = 2</pre>
</td></tr>
<tr><td><pre>i2 : fillMatrix(mutableMatrix(RR,5,10))

o2 = | .69 .41  .67  .87  .28  .36  .36  .2  .42 .8   |
     | .85 .8   .072 .5   .32  .037 .29  .46 1   .26  |
     | .12 .55  .7   .8   .26  .23  .88  .12 .63 .54  |
     | .96 .37  .06  .83  .96  .43  .02  1   .53 .17  |
     | .54 .033 .094 .041 .056 .27  .086 .18 .35 .054 |

o2 : MutableMatrix</pre>
</td></tr>
<tr><td><pre>i3 : fillMatrix(mutableMatrix(ZZ,5,10),UpperTriangular=>true)

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

o3 : MutableMatrix</pre>
</td></tr>
<tr><td><pre>i4 : fillMatrix(mutableMatrix(QQ,5,10),Density=>.2,Height=>1000)

o4 = | . . 109/315 996/91 . . .       .      .       .       |
     | . . 807/377 .      . . .       .      659/340 .       |
     | . . 106/423 .      . . 191/401 .      .       .       |
     | . . .       .      . . 220/49  761/78 797/535 567/439 |
     | . . .       .      . . .       .      188/623 .       |

o4 : MutableMatrix</pre>
</td></tr>
<tr><td><pre>i5 : fillMatrix(mutableMatrix(ZZ,5,10),25,Height=>1000)

o5 = | .   295 .   509 321 127 .   79  .  437 |
     | 477 .   192 .   161 .   554 .   23 .   |
     | .   .   .   324 .   .   604 277 .  .   |
     | 330 .   .   702 .   501 632 69  .  14  |
     | .   .   528 .   .   .   .   .   .  .   |

o5 : MutableMatrix</pre>
</td></tr>
</table>
</div>
</div>
<div class="single"><h2>See also</h2>
<ul><li><span><a href="_set__Random__Seed.html" title="set starting point for random number generator">setRandomSeed</a> -- set starting point for random number generator</span></li>
<li><span><a href="_random.html" title="get a random element">random</a> -- get a random element</span></li>
<li><span><a href="_mutable__Matrix.html" title="make a mutable matrix">mutableMatrix</a> -- make a mutable matrix</span></li>
</ul>
</div>
<div class="waystouse"><h2>Ways to use <tt>fillMatrix</tt> :</h2>
<ul><li>fillMatrix(MutableMatrix)</li>
<li>fillMatrix(MutableMatrix,ZZ)</li>
</ul>
</div>
</div>
</body>
</html>