<?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>random(Module,Module) -- make a random module map</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_random_lp__R__R_rp.html">next</a> | <a href="_random_lp__List_rp.html">previous</a> | <a href="_random_lp__R__R_rp.html">forward</a> | <a href="_random_lp__List_rp.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>random(Module,Module) -- make a random module map</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>f = random(F,G)</tt></div> </dd></dl> </div> </li> <li><span>Function: <a href="_random.html" title="get a random element">random</a></span></li> <li><div class="single">Inputs:<ul><li><span><tt>F</tt>, <span>a <a href="___Module.html">module</a></span>, a free module</span></li> <li><span><tt>G</tt>, <span>a <a href="___Module.html">module</a></span>, a free module</span></li> </ul> </div> </li> <li><div class="single">Outputs:<ul><li><span><tt>f</tt>, <span>a <a href="___Matrix.html">matrix</a></span>, a random, graded, degree <tt>0</tt> map, from <tt>G</tt> to <tt>F</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>MaximalRank => </tt><span><span>default value false</span>, whether to ensure that the resulting map has maximal rank: designed mostly for use with matrices of numbers: for polynomial rings, returns inhomogeneous results</span></span></li> <li><span><tt>Density => </tt><span><span>a <a href="___R__R.html">real number</a></span>, <span>default value 1</span>, the proportion of entries to set</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 set just entries strictly above the diagonal</span></span></li> <li><span><a href="_random_lp__Type_rp.html">Height => ...</a>, -- random element of a type</span></li> </ul> </div> </li> </ul> </div> <div class="single"><h2>Description</h2> <div><table class="examples"><tr><td><pre>i1 : R = ZZ/101[x,y];</pre> </td></tr> <tr><td><pre>i2 : random(R^{1,2,3},R^{1,2,3}) o2 = {-1} | 41 0 0 | {-2} | -9x-18y 35 0 | {-3} | 17x2-37xy+39y2 -49x-36y 8 | 3 3 o2 : Matrix R <--- R</pre> </td></tr> <tr><td><pre>i3 : random(ZZ^3,ZZ^6,MaximalRank=>true) o3 = | 10234796479 28887529183 9374509155 439476 480620491 9469997744 | | 3633391864 10255183258 3327986576 156016 170622111 3361885390 | | 9028006437 25481385970 8269156027 387658 423950285 8353385508 | 3 6 o3 : Matrix ZZ <--- ZZ</pre> </td></tr> <tr><td><pre>i4 : random(ZZ^3,ZZ^10,Density=>.3) o4 = | 4 0 0 3 8 0 0 0 0 0 | | 0 3 8 8 7 0 8 4 5 0 | | 0 0 0 0 0 0 0 0 0 0 | 3 10 o4 : Matrix ZZ <--- ZZ</pre> </td></tr> <tr><td><pre>i5 : random(ZZ^6,ZZ^6,UpperTriangular=>true) o5 = | 0 6 1 1 3 4 | | 0 0 1 8 9 0 | | 0 0 0 0 8 5 | | 0 0 0 0 3 8 | | 0 0 0 0 0 0 | | 0 0 0 0 0 0 | 6 6 o5 : Matrix ZZ <--- ZZ</pre> </td></tr> </table> </div> </div> <div class="single"><h2>Caveat</h2> <div>Over a polynomial ring, specifying <tt>MaximalRank=>true</tt> will yield a non-homogeneous matrix.</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> </ul> </div> </div> </body> </html>