D.2.5.6 sparsemat
.................
Procedure from library random.lib (see random_lib).

Usage:
sparsemat(n,m[,p,b]); n,m,p,b integers

Return:
nxm integer matrix, p percent of the entries are 0, the remaining
are random coefficients >=1 and <= b; [defaults: (p,b) = (75,1)]

Example:
LIB "random.lib";
sparsemat(5,5);"";
==> 0,0,0,0,0,
==> 0,1,0,0,1,
==> 0,0,0,1,0,
==> 0,1,0,0,0,
==> 0,1,0,1,1 
==> 
sparsemat(5,5,95);"";
==> 1,0,0,0,0,
==> 0,0,0,0,0,
==> 0,0,0,0,0,
==> 0,0,0,0,0,
==> 0,0,0,1,0 
==> 
sparsemat(5,5,5);"";
==> 1,1,1,1,1,
==> 1,1,1,1,1,
==> 1,1,1,1,1,
==> 1,0,1,1,1,
==> 1,1,1,1,0 
==> 
sparsemat(5,5,50,100);
==> 0,17,24,80,0,
==> 0,13,30,45,0,
==> 19,0,0,0,0,
==> 93,0,23,0,69,
==> 0,88,44,31,0 

<font size="-1">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; User manual for <a href="http://www.singular.uni-kl.de/"><i>Singular</i></a> version 2-0-4, October 2002,
generated by <a href="http://www.gnu.org/software/texinfo/"><i>texi2html</i></a>.
</font>

</body>
</html>
