Changeset 7f3ad4 in git for Singular/LIB/bfct.lib
- Timestamp:
- Jan 14, 2009, 5:07:05 PM (15 years ago)
- Branches:
- (u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
- Children:
- 0721816437af5ddabc83aa203a12d9b58b42a33c
- Parents:
- 95edd5641377e851d4a1d4e986853687991d0895
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/bfct.lib
r95edd5 r7f3ad4 1 1 ////////////////////////////////////////////////////////////////////////////// 2 version="$Id: bfct.lib,v 1.1 0 2009-01-12 19:31:23 Singular Exp $";2 version="$Id: bfct.lib,v 1.11 2009-01-14 16:07:03 Singular Exp $"; 3 3 category="Noncommutative"; 4 4 info=" … … 35 35 AUXILIARY PROCEDURES: 36 36 37 allPositive(v); checks whether all entries of an intvec are positive 37 allPositive(v); checks whether all entries of an intvec are positive 38 38 scalarProd(v,w); computes the standard scalar product of two intvecs 39 39 vec2poly(v[,i]); constructs an univariate poly with given coefficients … … 79 79 EXAMPLE: example gradedWeyl; shows examples 80 80 NOTE: u[i] is the weight of x(i), v[i] the weight of D(i). 81 @* u+v has to be a non-negative intvec. 81 @* u+v has to be a non-negative intvec. 82 82 " 83 83 { … … 88 88 { 89 89 ERROR("weight vectors have wrong dimension"); 90 } 90 } 91 91 intvec uv,gr; 92 92 uv = u+v; … … 97 97 if (uv[i]==0) 98 98 { 99 99 gr[i] = 0; 100 100 } 101 101 else 102 102 { 103 103 gr[i] = 1; 104 104 } 105 105 } … … 114 114 for (i=1; i<=n; i++) 115 115 { 116 if (gr[i] == 1) 116 if (gr[i] == 1) 117 117 { 118 118 l2[n+i] = "xi("+string(i)+")"; … … 231 231 RETURN: ideal/list, linear reductum (over field) of f by elements from I 232 232 PURPOSE: reduce a poly only by linear reductions (no monomial multiplications) 233 NOTE: If s<>0, a list consisting of the reduced ideal and the coefficient 233 NOTE: If s<>0, a list consisting of the reduced ideal and the coefficient 234 234 @* vectors of the used reductions given as module is returned. 235 235 @* Otherwise (and by default), only the reduced ideal is returned. … … 255 255 if (typeof(#[2])=="int" || typeof(#[2])=="number") 256 256 { 257 257 redtail = #[2]; 258 258 } 259 259 } … … 273 273 for (i=1; i<=sI; i++) 274 274 { 275 276 277 278 279 280 281 282 283 284 285 275 if (I[i] == 0) 276 { 277 j++; 278 J[j] = 0; 279 ordJ[j] = -1; 280 M[j] = gen(i); 281 } 282 else 283 { 284 M[i+sZeros-j] = gen(lJ[2][i-j]+j); 285 } 286 286 } 287 287 } … … 290 290 for (i=1; i<=sZeros; i++) 291 291 { 292 293 292 J[i] = 0; 293 ordJ[i] = -1; 294 294 } 295 295 } … … 327 327 for (j=sZeros+1; j<i; j++) 328 328 { 329 330 331 332 { 333 334 335 336 337 338 339 340 341 342 343 344 345 346 329 if (lm == 0) { break; } 330 if (ordlm > maxordJ) { break; } 331 if (ordlm == ordJ[j]) 332 { 333 if (lm > maxlmJ) { break; } 334 if (lm == lmJ[j]) 335 { 336 dbprint(ppl,"reducing " + string(redpoly)); 337 dbprint(ppl," with " + string(J[j])); 338 c = leadcoef(redpoly)/leadcoef(J[j]); 339 redpoly = redpoly - c*J[j]; 340 dbprint(ppl," to " + string(redpoly)); 341 lm = leadmonom(redpoly); 342 ordlm = ord(lm); 343 if (remembercoeffs <> 0) { M[i] = M[i] - c * M[j]; } 344 reduction = 1; 345 } 346 } 347 347 } 348 348 } … … 354 354 lmJ = insertGenerator(lmJ,lm,j); 355 355 ordJ = insertGenerator(ordJ,poly(ordlm),j); 356 if (remembercoeffs <> 0) 356 if (remembercoeffs <> 0) 357 357 { 358 358 v = M[i]; … … 373 373 for (j=i+1; j<=sI; j++) 374 374 { 375 376 377 378 { 379 380 381 382 383 384 385 386 387 388 389 375 for (k=2; k<=size(J[j]); k++) // run over all terms in J[j] 376 { 377 if (ordJ[i] == ord(J[j][k])) 378 { 379 if (lm == normalize(J[j][k])) 380 { 381 c = leadcoef(J[j][k])/leadcoef(J[i]); 382 dbprint(ppl,"reducing " + string(J[j])); 383 dbprint(ppl," with " + string(J[i])); 384 J[j] = J[j] - c*J[i]; 385 dbprint(ppl," to " + string(J[j])); 386 if (remembercoeffs <> 0) { M[j] = M[j] - c * M[i]; } 387 } 388 } 389 } 390 390 } 391 391 } … … 410 410 RETURN: poly/list, linear reductum (over field) of f by elements from I 411 411 PURPOSE: reduce a poly only by linear reductions (no monomial multiplications) 412 NOTE: If s<>0, a list consisting of the reduced poly and the coefficient 412 NOTE: If s<>0, a list consisting of the reduced poly and the coefficient 413 413 @* vector of the used reductions is returned, otherwise (and by default) 414 414 @* only reduced poly is returned. … … 433 433 if (typeof(#[2])=="int" || typeof(#[2])=="number") 434 434 { 435 435 redtail = #[2]; 436 436 } 437 437 if (size(#)>2) 438 438 { 439 439 if (typeof(#[3])=="int" || typeof(#[3])=="number") 440 440 { 441 442 441 prepareideal = #[3]; 442 } 443 443 } 444 444 } … … 469 469 for (i=1; i<=sI; i++) 470 470 { 471 471 M[i] = gen(i); 472 472 } 473 473 } … … 495 495 if (ordf == ordI[i]) 496 496 { 497 498 499 500 501 502 503 504 505 506 507 497 if (lm == lmI[i]) 498 { 499 c = leadcoef(f)/lcI[i]; 500 f = f - c*I[i]; 501 lm = leadmonom(f); 502 ordf = ord(lm); 503 if (remembercoeffs <> 0) 504 { 505 v = v - c * M[i]; 506 } 507 } 508 508 } 509 509 } … … 518 518 for (j=1; j<=size(f); j++) 519 519 { 520 521 522 523 524 525 526 527 528 529 530 531 532 520 if (ord(f[j]) == ordI[i]) 521 { 522 if (normalize(f[j]) == lmI[i]) 523 { 524 c = leadcoef(f[j])/lcI[i]; 525 f = f - c*I[i]; 526 dbprint(ppl,"reducing poly to ",f); 527 if (remembercoeffs <> 0) 528 { 529 v = v - c * M[i]; 530 } 531 } 532 } 533 533 } 534 534 } … … 556 556 f = x3 + y2 + x2 + y + x; 557 557 I = x3 - y3, y3 - x2, x3 - y2, x2 - y, y2-x; 558 list l = linReduce(f, I, 1); 558 list l = linReduce(f, I, 1); 559 559 l; 560 560 module M = I; … … 601 601 if (p <> 0) 602 602 { 603 603 whichengine = 1; 604 604 } 605 605 } … … 668 668 proc pIntersect (poly s, ideal I) 669 669 "USAGE: pIntersect(f, I); f a poly, I an ideal 670 RETURN: vector, coefficient vector of the monic polynomial 670 RETURN: vector, coefficient vector of the monic polynomial 671 671 PURPOSE: compute the intersection of ideal I with the subalgebra K[f] 672 672 ASSUME: I is given as Groebner basis. … … 712 712 if (degs[j] == 0) 713 713 { 714 715 716 717 714 if (degI[i][j] <> 0) 715 { 716 break; 717 } 718 718 } 719 719 if (j == n) 720 720 { 721 722 721 k++; 722 possdegbounds[k] = Max(degI[i]); 723 723 } 724 724 } … … 749 749 if (tobracket==0) // todo bug in bracket? 750 750 { 751 751 toNF = 0; 752 752 } 753 753 else 754 754 { 755 755 toNF = bracket(tobracket,secNF); 756 756 } 757 757 newNF = NF(toNF+oldNF*secNF,I); // = NF(s^i,I) … … 802 802 v = v + m[j,1]*gen(j); 803 803 } 804 setring save; 804 setring save; 805 805 v = imap(@R,v); 806 806 kill @R; … … 864 864 if (size(#)>2) 865 865 { 866 867 868 869 866 if (typeof(#[3])=="int" || typeof(#[3])=="number") 867 { 868 modengine = int(#[3]); 869 } 870 870 } 871 871 } … … 909 909 if (tobracket!=0) 910 910 { 911 911 toNF = bracket(tobracket,NI[2]) + NI[i]*NI[2]; 912 912 } 913 913 else 914 914 { 915 915 toNF = NI[i]*NI[2]; 916 916 } 917 917 newNF = NF(toNF,I); … … 927 927 if (v!=0) // there is a modular solution 928 928 { 929 930 931 932 933 934 935 929 dbprint(ppl,"got solution in char ",solveincharp," of degree " ,i); 930 setring save; 931 v = linSyzSolve(NI,whichengine); 932 if (v==0) 933 { 934 break; 935 } 936 936 } 937 937 else // no modular solution 938 938 { 939 940 939 setring save; 940 v = 0; 941 941 } 942 942 } … … 965 965 { 966 966 dbprint(ppl,"linSyzSolve: got solution!"); 967 967 // "got solution!"; 968 968 break; 969 969 } … … 1015 1015 if (typeof(#[2])=="int" || typeof(#[2])=="number") 1016 1016 { 1017 1017 ringvar = int(#[2]); 1018 1018 } 1019 1019 } … … 1121 1121 while (b == 0) 1122 1122 { 1123 1124 1125 1123 dbprint(ppl,"number of run in the loop: "+string(i)); 1124 int q = prime(random(lb,ub)); 1125 if (findFirst(usedprimes,q)==0) // if q was not already used 1126 1126 { 1127 1128 1129 1130 1131 1132 } 1133 } 1134 else // pIntersectSyz::non-modular 1127 usedprimes = usedprimes,q; 1128 dbprint(ppl,"used prime is: "+string(q)); 1129 b = pIntersectSyz(s,J,q,whichengine,modengine); 1130 } 1131 i++; 1132 } 1133 } 1134 else // pIntersectSyz::non-modular 1135 1135 { 1136 1136 b = pIntersectSyz(s,J,0,whichengine); … … 1158 1158 RETURN: list of ideal and intvec 1159 1159 PURPOSE: computes the roots of the Bernstein-Sato polynomial b(s) 1160 @* for the hypersurface defined by f. 1160 @* for the hypersurface defined by f. 1161 1161 ASSUME: The basering is a commutative polynomial ring in char 0. 1162 BACKGROUND: In this proc, the initial Malgrange ideal is computed according to the algorithm 1162 BACKGROUND: In this proc, the initial Malgrange ideal is computed according to the algorithm 1163 1163 @* by Masayuki Noro and then a system of linear equations is solved by linear reductions. 1164 NOTE: In the output list, the ideal contains all the roots 1164 NOTE: In the output list, the ideal contains all the roots 1165 1165 @* and the intvec their multiplicities. 1166 1166 @* If s<>0, @code{std} is used for GB computations, 1167 @* otherwise, and by default, @code{slimgb} is used. 1167 @* otherwise, and by default, @code{slimgb} is used. 1168 1168 @* If t<>0, a matrix ordering is used for Groebner basis computations, 1169 1169 @* otherwise, and by default, a block ordering is used. 1170 @* If v is a positive weight vector, v is used for homogenization computations, 1170 @* If v is a positive weight vector, v is used for homogenization computations, 1171 1171 @* otherwise and by default, no weights are used. 1172 1172 DISPLAY: If printlevel=1, progress debug messages will be printed, … … 1199 1199 if (size(#)>2) 1200 1200 { 1201 1201 if (typeof(#[3])=="intvec" && size(#[3])==n && allPositive(#[3])==1) 1202 1202 { 1203 1204 1203 u0 = #[3]; 1204 } 1205 1205 } 1206 1206 } … … 1222 1222 "USAGE: bfctSyz(f [,r,s,t,u,v]); f a poly, r,s,t,u optional ints, v an optional intvec 1223 1223 RETURN: list of ideal and intvec 1224 PURPOSE: computes the roots of the Bernstein-Sato polynomial b(s) 1224 PURPOSE: computes the roots of the Bernstein-Sato polynomial b(s) 1225 1225 @* for the hypersurface defined by f 1226 1226 ASSUME: The basering is a commutative polynomial ring in char 0. 1227 BACKGROUND: In this proc, the initial Malgrange ideal is computed according to the algorithm 1227 BACKGROUND: In this proc, the initial Malgrange ideal is computed according to the algorithm 1228 1228 @* by Masayuki Noro and then a system of linear equations is solved by computing syzygies. 1229 NOTE: In the output list, the ideal contains all the roots 1229 NOTE: In the output list, the ideal contains all the roots 1230 1230 @* and the intvec their multiplicities. 1231 @* If r<>0, @code{std} is used for GB computations in characteristic 0, 1232 @* otherwise, and by default, @code{slimgb} is used. 1233 @* If s<>0, a matrix ordering is used for GB computations, otherwise, 1231 @* If r<>0, @code{std} is used for GB computations in characteristic 0, 1232 @* otherwise, and by default, @code{slimgb} is used. 1233 @* If s<>0, a matrix ordering is used for GB computations, otherwise, 1234 1234 @* and by default, a block ordering is used. 1235 @* If t<>0, the computation of the intersection is solely performed over 1235 @* If t<>0, the computation of the intersection is solely performed over 1236 1236 @* charasteristic 0, otherwise and by default, a modular method is used. 1237 @* If u<>0 and by default, @code{std} is used for GB computations in 1238 @* characteristic >0, otherwise, @code{slimgb} is used. 1239 @* If v is a positive weight vector, v is used for homogenization 1237 @* If u<>0 and by default, @code{std} is used for GB computations in 1238 @* characteristic >0, otherwise, @code{slimgb} is used. 1239 @* If v is a positive weight vector, v is used for homogenization 1240 1240 @* computations, otherwise and by default, no weights are used. 1241 1241 DISPLAY: If printlevel=1, progress debug messages will be printed, … … 1275 1275 if (typeof(#[3])=="int" || typeof(#[3])=="number") 1276 1276 { 1277 1278 1279 1277 pIntersectchar = int(#[3]); 1278 } 1279 if (size(#)>3) 1280 1280 { 1281 1281 if (typeof(#[4])=="int" || typeof(#[4])=="number") 1282 1282 { 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1283 modengine = int(#[4]); 1284 } 1285 if (size(#)>4) 1286 { 1287 if (typeof(#[5])=="intvec" && size(#[5])==n && allPositive(#[5])==1) 1288 { 1289 u0 = #[5]; 1290 } 1291 } 1292 } 1293 1293 } 1294 1294 } … … 1315 1315 BACKGROUND: In this proc, the initial ideal of I is computed according to the algorithm by 1316 1316 @* Masayuki Noro and then a system of linear equations is solved by linear reductions. 1317 NOTE: In the output list, the ideal contains all the roots 1317 NOTE: In the output list, the ideal contains all the roots 1318 1318 @* and the intvec their multiplicities. 1319 1319 @* If s<>0, @code{std} is used for GB computations in characteristic 0, 1320 @* otherwise, and by default, @code{slimgb} is used. 1320 @* otherwise, and by default, @code{slimgb} is used. 1321 1321 @* If t<>0, a matrix ordering is used for GB computations, otherwise, 1322 1322 @* and by default, a block ordering is used. … … 1374 1374 "USAGE: bfctOneGB(f [,s,t]); f a poly, s,t optional ints 1375 1375 RETURN: list of ideal and intvec 1376 PURPOSE: computes the roots of the Bernstein-Sato polynomial b(s) for the 1376 PURPOSE: computes the roots of the Bernstein-Sato polynomial b(s) for the 1377 1377 @* hypersurface defined by f, using only one GB computation 1378 1378 ASSUME: The basering is a commutative polynomial ring in char 0. 1379 BACKGROUND: In this proc, the initial Malgrange ideal is computed based on the 1379 BACKGROUND: In this proc, the initial Malgrange ideal is computed based on the 1380 1380 @* algorithm by Masayuki Noro and combined with an elimination ordering. 1381 NOTE: In the output list, the ideal contains all the roots 1381 NOTE: In the output list, the ideal contains all the roots 1382 1382 @* and the intvec their multiplicities. 1383 1383 @* If s<>0, @code{std} is used for the GB computation, otherwise, 1384 @* and by default, @code{slimgb} is used. 1384 @* and by default, @code{slimgb} is used. 1385 1385 @* If t<>0, a matrix ordering is used for GB computations, 1386 1386 @* otherwise, and by default, a block ordering is used. … … 1492 1492 "USAGE: bfctAnn(f [,r]); f a poly, r an optional int 1493 1493 RETURN: list of ideal and intvec 1494 PURPOSE: computes the roots of the Bernstein-Sato polynomial b(s) 1494 PURPOSE: computes the roots of the Bernstein-Sato polynomial b(s) 1495 1495 @* for the hypersurface defined by f 1496 1496 ASSUME: The basering is a commutative polynomial ring in char 0. 1497 1497 BACKGROUND: In this proc, ann(f^s) is computed and then a system of linear 1498 1498 @* equations is solved by linear reductions. 1499 NOTE: In the output list, the ideal contains all the roots 1499 NOTE: In the output list, the ideal contains all the roots 1500 1500 @* and the intvec their multiplicities. 1501 1501 @* If r<>0, @code{std} is used for GB computations, 1502 @* otherwise, and by default, @code{slimgb} is used. 1502 @* otherwise, and by default, @code{slimgb} is used. 1503 1503 DISPLAY: If printlevel=1, progress debug messages will be printed, 1504 1504 @* if printlevel>=2, all the debug messages will be printed.
Note: See TracChangeset
for help on using the changeset viewer.