Changeset d2b2a7 in git for Singular/LIB/ring.lib
- Timestamp:
- May 5, 1998, 1:55:40 PM (26 years ago)
- Branches:
- (u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
- Children:
- 97f92aa6d280f6022eaae47195ccc02503ccb984
- Parents:
- 4996f5286c7671191ad22e654499fd8b752fe4f0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/ring.lib
r4996f52 rd2b2a7 1 // $Id: ring.lib,v 1. 5 1998-04-03 22:47:13krueger Exp $1 // $Id: ring.lib,v 1.6 1998-05-05 11:55:37 krueger Exp $ 2 2 //(GMG, last modified 03.11.95) 3 3 /////////////////////////////////////////////////////////////////////////////// 4 4 5 version="$Id: ring.lib,v 1. 5 1998-04-03 22:47:13krueger Exp $";5 version="$Id: ring.lib,v 1.6 1998-05-05 11:55:37 krueger Exp $"; 6 6 info=" 7 7 LIBRARY: ring.lib PROCEDURES FOR MANIPULATING RINGS AND MAPS … … 26 26 27 27 proc changechar (string newr, string c, list #) 28 USAGE: changechar(newr,c[,r]); newr,c=strings, r=ring28 "USAGE: changechar(newr,c[,r]); newr,c=strings, r=ring 29 29 CREATE: create a new ring with name `newr` and make it the basering if r is 30 30 an existing ring [default: r=basering]. 31 31 The new ring differs from the old ring only in the characteristic. 32 If, say, (newr,c) = ( "R","0,A") and the ring r exists, the new32 If, say, (newr,c) = (\"R\",\"0,A\") and the ring r exists, the new 33 33 basering will have name R characteristic 0 and one parameter A. 34 34 RETURN: No return value … … 38 38 start with @ (see the file HelpForProc) 39 39 EXAMPLE: example changechar; shows an example 40 " 40 41 { 41 42 if( size(#)==0 ) { def @r=basering; } … … 71 72 72 73 proc changeord (string newr, string o, list #) 73 USAGE: changeord(newr,o[,r]); newr,o=strings, r=ring/qring74 "USAGE: changeord(newr,o[,r]); newr,o=strings, r=ring/qring 74 75 CREATE: create a new ring with name `newr` and make it the basering if r is 75 76 an existing ring/qring [default: r=basering]. 76 77 The new ring differs from the old ring only in the ordering. If, say, 77 (newr,o) = ( "R","wp(2,3),dp") and the ring r exists and has >=378 (newr,o) = (\"R\",\"wp(2,3),dp\") and the ring r exists and has >=3 78 79 variables, the new basering will have name R and ordering wp(2,3),dp. 79 80 RETURN: No return value … … 82 83 start with @ (see the file HelpForProc) 83 84 EXAMPLE: example changeord; shows an example 85 " 84 86 { 85 87 if( size(#)==0 ) { def @r=basering; } … … 117 119 118 120 proc changevar (string newr, string vars, list #) 119 USAGE: changevar(newr,vars[,r]); newr,vars=strings, r=ring/qring121 "USAGE: changevar(newr,vars[,r]); newr,vars=strings, r=ring/qring 120 122 CREATE: creates a new ring with name `newr` and makes it the basering if r 121 123 is an existing ring/qring [default: r=basering]. 122 124 The new ring differs from the old ring only in the variables. If, 123 say, (newr,vars) = ( "R","t()") and the ring r exists and has n125 say, (newr,vars) = (\"R\",\"t()\") and the ring r exists and has n 124 126 variables, the new basering will have name R and variables 125 127 t(1),...,t(n). 126 If vars = "a,b,c,d", the new ring will have the variables a,b,c,d.128 If vars = \"a,b,c,d\", the new ring will have the variables a,b,c,d. 127 129 RETURN: No return value 128 130 NOTE: This procedure is useful in connection with the procedure ringtensor, … … 132 134 start with @ (see the file HelpForProc) 133 135 EXAMPLE: example changevar; shows an example 136 " 134 137 { 135 138 if( size(#)==0 ) { def @r=basering; } … … 174 177 175 178 proc defring (string s1, string s2, int n, string s3, string s4) 176 USAGE: defring(s1,s2,n,s3,s4); s1..s4=strings, n=integer179 "USAGE: defring(s1,s2,n,s3,s4); s1..s4=strings, n=integer 177 180 CREATE: Define a ring with name 's1', characteristic 's2', ordering 's4' and 178 181 n variables with names derived from s3 and make it the basering. 179 If s3 is a single letter, say s3= "a", and if n<=26 then a and the182 If s3 is a single letter, say s3=\"a\", and if n<=26 then a and the 180 183 following n-1 letters from the alphabeth (cyclic order) are taken as 181 184 variables. If n>26 or if s3 is a single letter followed by (, say 182 s3= "T(", the variables are T(1),...,T(n).185 s3=\"T(\", the variables are T(1),...,T(n). 183 186 RETURN: No return value 184 187 NOTE: This proc is useful for defining a ring in a procedure. … … 187 190 start with @ (see the file HelpForProc) 188 191 EXAMPLE: example defring; shows an example 192 " 189 193 { 190 194 string @newring = "ring "+s1+"=("+s2+"),("; … … 207 211 208 212 proc defrings (int n, list #) 209 USAGE: defrings(n,[p]); n,p integers213 "USAGE: defrings(n,[p]); n,p integers 210 214 CREATE: Defines a ring with name Sn, characteristic p, ordering ds and n 211 215 variables x,y,z,a,b,...if n<=26 (resp. x(1..n) if n>26) and makes it … … 213 217 RETURN: No return value 214 218 EXAMPLE: example defrings; shows an example 219 " 215 220 { 216 221 int p; … … 239 244 240 245 proc defringp (int n,list #) 241 USAGE: defringp(n,[p]); n,p=integers246 "USAGE: defringp(n,[p]); n,p=integers 242 247 CREATE: defines a ring with name Pn, characteristic p, ordering dp and n 243 248 variables x,y,z,a,b,...if n<=26 (resp. x(1..n) if n>26) and makes it … … 245 250 RETURN: No return value 246 251 EXAMPLE: example defringp; shows an example 252 " 247 253 { 248 254 int p; … … 272 278 273 279 proc extendring (string na, int n, string va, string o, list #) 274 USAGE: extendring(na,n,va,o[iv,i,r]); na,va,o=strings,280 "USAGE: extendring(na,n,va,o[iv,i,r]); na,va,o=strings, 275 281 n,i=integers, r=ring, iv=intvec of positive integers or iv=0 276 282 CREATE: Define a ring with name `na` which extends the ring r by adding n new … … 279 285 -- The characteristic is the characteristic of r 280 286 -- The new vars are derived from va. If va is a single letter, say 281 va= "T", and if n<=26 then T and the following n-1 letters from287 va=\"T\", and if n<=26 then T and the following n-1 letters from 282 288 T..Z..T (resp. T(1..n) if n>26) are taken as additional variables. 283 If va is a single letter followed by (, say va= "x(", the new289 If va is a single letter followed by (, say va=\"x(\", the new 284 290 variables are x(1),...,x(n) 285 291 -- The ordering is the product ordering between the ordering of r and … … 289 295 not contain a 'c' or a 'C' the same rule applies to ordstr(r). 290 296 - If no intvec iv is given, or if iv=0, o may be any allowed ordstr, 291 like "ds" or "dp(2),wp(1,2,3),Ds(2)" or "ds(a),dp(b),ls" if a and b297 like \"ds\" or \"dp(2),wp(1,2,3),Ds(2)\" or \"ds(a),dp(b),ls\" if a and b 292 298 are globally (!) defined integers and if a+b+1<=n 293 299 If, however, a and b are local to a proc calling extendring, the 294 300 intvec iv must be used to let extendring know the values of a and b 295 301 - If an intvec iv !=0 is given, iv[1],iv[2],... is taken for the 1st, 296 2nd,... block of o, if o contains no substring "w" or "W" i.e. no297 weighted ordering (in the above case o= "ds,dp,ls" and iv=a,b).302 2nd,... block of o, if o contains no substring \"w\" or \"W\" i.e. no 303 weighted ordering (in the above case o=\"ds,dp,ls\" and iv=a,b). 298 304 If o contains a weighted ordering (only one (!) weighted block is 299 305 allowed) iv[1] is taken as size for the weight-vector, the next 300 306 iv[1] values of iv are taken as weights and the remaining values of 301 307 iv as block-size for the remaining non-weighted blocks. 302 e.g. o= "dp,ws,Dp,ds", iv=3,2,3,4,2,5 creates the ordering308 e.g. o=\"dp,ws,Dp,ds\", iv=3,2,3,4,2,5 creates the ordering 303 309 dp(2),ws(2,3,4),Dp(5),ds 304 310 RETURN: No return value … … 308 314 start with @ (see the file HelpForProc) 309 315 EXAMPLE: example extendring; shows an example 316 " 310 317 { 311 318 //--------------- initialization and place c/C of ordering properly ----------- … … 425 432 426 433 proc fetchall (R, list #) 427 USAGE: fetchall(R[,s]); R=ring/qring, s=string434 "USAGE: fetchall(R[,s]); R=ring/qring, s=string 428 435 CREATE: fetch all objects of ring R (of type poly/ideal/vector/module/number/ 429 436 matrix) into the basering. 430 437 If no 3rd argument is present, the names are the same as in R. If, 431 say, f is a poly in R and the 3rd argument is the string "R", then f438 say, f is a poly in R and the 3rd argument is the string \"R\", then f 432 439 is maped to f_R etc. 433 440 RETURN: no return value … … 439 446 //***at the moment it does not work if R contains a map 440 447 EXAMPLE: example fetchall; shows an example 448 " 441 449 { 442 450 list @L@=names(R); … … 469 477 470 478 proc imapall (R, list #) 471 USAGE: imapall(R[,s]); R=ring/qring, s=string479 "USAGE: imapall(R[,s]); R=ring/qring, s=string 472 480 CREATE: map all objects of ring R (of type poly/ideal/vector/module/number/ 473 481 matrix) into the basering, by applying imap to all objects of R. 474 482 If no 3rd argument is present, the names are the same as in R. If, 475 say, f is a poly in R and the 3rd argument is the string "R", then f483 say, f is a poly in R and the 3rd argument is the string \"R\", then f 476 484 is maped to f_R etc. 477 485 RETURN: no return value … … 483 491 //***at the moment it does not work if R contains a map 484 492 EXAMPLE: example imapall; shows an example 493 " 485 494 { 486 495 list @L@=names(R); … … 513 522 514 523 proc mapall (R, ideal i, list #) 515 USAGE: mapall(R,i[,s]); R=ring/qring, i=ideal of basering, s=string524 "USAGE: mapall(R,i[,s]); R=ring/qring, i=ideal of basering, s=string 516 525 CREATE: map all objects of ring R (of type poly/ideal/vector/module/number/ 517 526 matrix, map) into the basering, by mapping the jth variable of R to 518 527 the jth generator of the ideal i. If no 3rd argument is present, the 519 528 names are the same as in R. If, say, f is a poly in R and the 3rd 520 argument is the string "R", then f is maped to f_R etc.529 argument is the string \"R\", then f is maped to f_R etc. 521 530 RETURN: no return value 522 531 NOTE: This procedure has the same effect as defining a map, say psi, by … … 529 538 CAUTION: mapall does not work inside a procedure 530 539 EXAMPLE: example mapall; shows an example 540 " 531 541 { 532 542 list @L@=names(R); map @psi@ = R,i; … … 566 576 567 577 proc ringtensor (string s, list #) 568 USAGE: ringtensor(s,r1,r2,...); s=string, r1,r2,...=rings578 "USAGE: ringtensor(s,r1,r2,...); s=string, r1,r2,...=rings 569 579 CREATE: A new base ring with name `s` if r1,r2,... are existing rings. 570 If, say, s = "R" and the rings r1,r2,... exist, the new ring will580 If, say, s = \"R\" and the rings r1,r2,... exist, the new ring will 571 581 have name R, variables from all rings r1,r2,... and as monomial 572 582 ordering the block (product) ordering of r1,r2,... . Hence, R … … 585 595 start with @ (see the file HelpForProc) 586 596 EXAMPLE: example ringtensor; shows an example 597 " 587 598 { 588 599 int @ii,@q;
Note: See TracChangeset
for help on using the changeset viewer.