Changeset 2271063 in git
- Timestamp:
- Aug 31, 2018, 3:44:43 PM (5 years ago)
- Branches:
- (u'spielwiese', 'a719bcf0b8dbc648b128303a49777a094b57592c')
- Children:
- 5292886b6f6adce1c6a27dacf4fe27712caac11f5c67260d24e1d3b531a24492a610c49608477ba9
- Parents:
- a83d208fed33c8c5dd5ae7c36fca503e8b225ee7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/freegb.lib
ra83d20 r2271063 23 23 24 24 shiftPoly(p,i); compute the i-th shift of letterplace polynomial p 25 lpPower(f,n); natural power of a letterplace polynomial 25 26 lieBracket(a,b[, N]); compute Lie bracket ab-ba of two letterplace polynomials 26 27 … … 62 63 /* secondary */ 63 64 example shiftPoly; 65 example lpPower; 64 66 example lieBracket; 65 67 example lp2lstr; … … 3205 3207 // lpMult(a,b); 3206 3208 // } 3207 // 3208 // proc lpPower(poly f, int n) 3209 // "USAGE: lpPower(f,n); f letterplace polynomial, int n 3210 // RETURN: poly 3211 // ASSUME: basering has a letterplace ring structure 3212 // PURPOSE: compute the letterplace form of f^n 3213 // EXAMPLE: example lpPower; shows examples 3214 // " 3215 // { 3216 // if (n<0) { ERROR("the power must be a natural number!"); } 3217 // if (n==0) { return(poly(1)); } 3218 // if (n==1) { return(f); } 3219 // int i; 3220 // poly p = 1; 3221 // for(i=1; i<= n; i++) 3222 // { 3223 // p = lpMult(p,f); 3224 // } 3225 // return(p); 3226 // } 3227 // example 3228 // { 3229 // "EXAMPLE:"; echo = 2; 3230 // // define a ring in letterplace form as follows: 3231 // ring r = 0,(x(1),y(1),x(2),y(2),x(3),y(3),x(4),y(4)),dp; 3232 // def R = setLetterplaceAttributes(r,4,2); // supply R with letterplace structure 3233 // setring R; 3234 // poly a = x(1)*y(2) + y(1); poly b = y(1) - 1; 3235 // lpPower(a,2); 3236 // lpPower(b,4); 3237 // } 3209 3210 proc lpPower(poly f, int n) 3211 "USAGE: lpPower(f,n); f letterplace polynomial, int n 3212 RETURN: poly 3213 ASSUME: basering has a letterplace ring structure 3214 PURPOSE: compute the letterplace form of f^n 3215 EXAMPLE: example lpPower; shows examples 3216 " 3217 { 3218 if (n<0) { ERROR("the power must be a natural number!"); } 3219 if (n==0) { return(poly(1)); } 3220 if (n==1) { return(f); } 3221 poly p = 1; 3222 for(int i = 1; i <= n; i++) 3223 { 3224 p = p*f; 3225 } 3226 return(p); 3227 } 3228 example 3229 { 3230 "EXAMPLE:"; echo = 2; 3231 // define a ring in letterplace form as follows: 3232 ring r = 0,(x(1),y(1),x(2),y(2),x(3),y(3),x(4),y(4)),dp; 3233 def R = setLetterplaceAttributes(r,4,2); // supply R with letterplace structure 3234 setring R; 3235 poly a = x(1)*y(2) + y(1); poly b = y(1) - 1; 3236 lpPower(a,2); 3237 lpPower(b,4); 3238 } 3238 3239 3239 3240 // new: lp normal from by using shift-invariant data by Grischa Studzinski
Note: See TracChangeset
for help on using the changeset viewer.