Changeset d2b2a7 in git for Singular/LIB/random.lib
- Timestamp:
- May 5, 1998, 1:55:40 PM (26 years ago)
- Branches:
- (u'spielwiese', '873fc1222e995d7cb33f79d8f1792ce418c8c72c')
- Children:
- 97f92aa6d280f6022eaae47195ccc02503ccb984
- Parents:
- 4996f5286c7671191ad22e654499fd8b752fe4f0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/random.lib
r4996f52 rd2b2a7 1 // $Id: random.lib,v 1. 4 1998-04-03 22:47:12krueger Exp $1 // $Id: random.lib,v 1.5 1998-05-05 11:55:36 krueger Exp $ 2 2 //system("random",787422842); 3 3 //(GMG/BM, last modified 22.06.96) 4 4 /////////////////////////////////////////////////////////////////////////////// 5 5 6 version="$Id: random.lib,v 1. 4 1998-04-03 22:47:12krueger Exp $";6 version="$Id: random.lib,v 1.5 1998-05-05 11:55:36 krueger Exp $"; 7 7 info=" 8 8 LIBRARY: random.lib PROCEDURES OF RANDOM MATRIX AND POLY OPERATIONS … … 23 23 24 24 proc genericid (id, list #) 25 USAGE: genericid(id,[,p,b]); id ideal/module, k,p,b integers25 "USAGE: genericid(id,[,p,b]); id ideal/module, k,p,b integers 26 26 RETURN: system of generators of id which are generic, sparse, triagonal linear 27 27 combinations of given generators with coefficients in [1,b] and … … 29 29 NOTE: For performance reasons try small bound b in characteristic 0 30 30 EXAMPLE: example genericid; shows an example 31 " 31 32 { 32 33 //----------------------------- set defaults ---------------------------------- … … 50 51 51 52 proc randomid (id, list #) 52 USAGE: randomid(id,[k,b]); id ideal/module, b,k integers53 "USAGE: randomid(id,[k,b]); id ideal/module, b,k integers 53 54 RETURN: ideal/module having k generators which are random linear combinations 54 55 of generators of id with coefficients in the interval [-b,b] … … 56 57 NOTE: For performance reasons try small bound b in characteristic 0 57 58 EXAMPLE: example randomid; shows an example 59 " 58 60 { 59 61 //----------------------------- set defaults ---------------------------------- … … 76 78 77 79 proc randommat (int n, int m, list #) 78 USAGE: randommat(n,m[,id,b]); n,m,b integers, id ideal80 "USAGE: randommat(n,m[,id,b]); n,m,b integers, id ideal 79 81 RETURN: nxm matrix, entries are random linear combinations of elements 80 82 of id and coefficients in [-b,b] … … 82 84 NOTE: For performance reasons try small bound b in char 0 83 85 EXAMPLE: example randommat; shows an example 86 " 84 87 { 85 88 //----------------------------- set defaults ---------------------------------- … … 109 112 110 113 proc sparseid (int k, int u, list #) 111 USAGE: sparseid(k,u[,o,p,b]); k,u,o,p,b integers114 "USAGE: sparseid(k,u[,o,p,b]); k,u,o,p,b integers 112 115 RETURN: ideal having k generators in each degree d, u<=d<=o, p percent of 113 116 terms in degree d are 0, the remaining have random coefficients 114 117 in the interval [1,b], (default: o=u=d, p=75, b=30000) 115 118 EXAMPLE: example sparseid; shows an example 119 " 116 120 { 117 121 //----------------------------- set defaults ---------------------------------- … … 138 142 139 143 proc sparsemat (int n, int m, list #) 140 USAGE: sparsemat(n,m[,p,b]); n,m,p,b integers144 "USAGE: sparsemat(n,m[,p,b]); n,m,p,b integers 141 145 RETURN: nxm integer matrix, p percent of the entries are 0, the remaining 142 146 are random coefficients >=1 and <= b; [defaults: (p,b) = (75,1)] 143 147 EXAMPLE: example sparsemat; shows an example 148 " 144 149 { 145 150 int r,h,ii; … … 184 189 185 190 proc sparsepoly (int u, list #) 186 USAGE: sparsepoly(u[,o,p,b]); u,o,p,b integers191 "USAGE: sparsepoly(u[,o,p,b]); u,o,p,b integers 187 192 RETURN: poly having only terms in degree d, u<=d<=o, p percent of the terms 188 193 in degree d are 0, the remaining have random coefficients in [1,b), 189 194 (defaults: o=u=d, p=75, b=30000) 190 195 EXAMPLE: example sparsepoly; shows an example 196 " 191 197 { 192 198 //----------------------------- set defaults ---------------------------------- … … 209 215 210 216 proc sparsetriag (int n, int m, list #) 211 USAGE: sparsetriag(n,m[,p,b]); n,m,p,b integers217 "USAGE: sparsetriag(n,m[,p,b]); n,m,p,b integers 212 218 RETURN: nxm lower triagonal integer matrix, diagonal entries equal to 1, about 213 219 p percent of lower diagonal entries are 0, the remaining are random 214 220 integers >=1 and <= b; [defaults: (p,b) = (75,1)] 215 221 EXAMPLE: example sparsetriag; shows an example 222 " 216 223 { 217 224 int ii,min,l,r; intmat M[n][m];
Note: See TracChangeset
for help on using the changeset viewer.