Changeset 32f8ae in git for Singular/LIB
- Timestamp:
- Mar 4, 2011, 10:40:18 AM (13 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- e1b97a7206fd50919b213db8b84df958b1aa819a
- Parents:
- 5ec7e30c5061dc69ea8a990af082b8d61c6a618a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/fpadim.lib
r5ec7e3 r32f8ae 142 142 {for (i3 = 1; i3 <= n; i3++) 143 143 {for (i4 = 1; i4 <= (n^(i1-1)); i4++) 144 145 146 144 {M[i2,i1] = i3; 145 i2 = i2 + 1; 146 } 147 147 } 148 148 } … … 191 191 for (j = 1; j<= size(P); j++) 192 192 {if (P[j] <= size(Vt)) 193 194 195 193 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 194 if (isInMat(Vt2,L[j]) > 0) {w = 1; break;} 195 } 196 196 } 197 197 if (w == 0) 198 198 {vector Vtt; 199 200 201 199 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 200 M = M,Vtt; 201 kill Vtt; 202 202 } 203 203 } … … 207 207 for (i = 1; i <= size(M); i++) 208 208 {kill Vt; intvec Vt; 209 210 209 for (j =1; j <= size(M[i]); j++){Vt[j] = int(leadcoef(M[i][j]));} 210 dimen = dimen + 1 + findDimen(Vt,n,L,P); 211 211 } 212 212 return(dimen); … … 220 220 for (j = 1; j<= size(P); j++) 221 221 {if (P[j] <= size(Vt)) 222 223 224 222 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 223 if (isInMat(Vt2,L[j]) > 0) {w = 1; break;} 224 } 225 225 } 226 226 if (w == 0) {vector Vtt; 227 228 229 227 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 228 M = M,Vtt; 229 kill Vtt; 230 230 } 231 231 } … … 235 235 for (i = 1; i <= size(M); i++) 236 236 {kill Vt; intvec Vt; 237 238 237 for (j =1; j <= size(M[i]); j++){Vt[j] = int(leadcoef(M[i][j]));} 238 dimen = dimen + 1 + findDimen(Vt,n,L,P,degbound); 239 239 } 240 240 return(dimen); … … 255 255 for (j = 1; j <= size(P); j++) 256 256 {if (P[j] <= size(Vt)) 257 258 259 260 257 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 258 if (isInMat(Vt2,L[j]) > 0) 259 {w = 1; break;} 260 } 261 261 } 262 262 if (w == 0) {r = findCycle(Vt,L,P,n,ld,M);} … … 272 272 for (it = 1; it <= j; it++) 273 273 { for(it2 = 1; it2 <= nrows(M);it2++) 274 274 {Mt[it,it2] = int(leadcoef(M[it2,it]));} 275 275 } 276 276 Vt = V[(size(V)-ld+1)..size(V)]; … … 279 279 else 280 280 {vector Vtt; 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 281 for (it =1; it <= size(Vt); it++) 282 {Vtt = Vtt + Vt[it]*gen(it);} 283 M = M,Vtt; 284 kill Vtt; 285 for (i = 1; i <= n; i++) 286 {Vt = V,i; w = 0; 287 for (j = 1; j <= size(P); j++) 288 {if (P[j] <= size(Vt)) 289 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 290 //L[j]; type(L[j]);Vt2;type(Vt2); 291 if (isInMat(Vt2,L[j]) > 0) 292 {w = 1; break;} 293 } 294 } 295 if (w == 0) {r = findCycle(Vt,L,P,n,ld,M);} 296 if (r == 1) {break;} 297 } 298 return(r); 299 299 } 300 300 } … … 308 308 for (i = 1; i <= n; i++) 309 309 {Vt = V,i; w = 0; 310 311 312 313 314 315 316 317 318 319 310 for (j = 1; j <= size(P); j++) 311 {if (P[j] <= size(Vt)) 312 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 313 //L[j]; type(L[j]);Vt2;type(Vt2); 314 if (isInMat(Vt2,L[j]) > 0) 315 {w = 1; break;} 316 } 317 } 318 if (w == 0) {r = findCycle(Vt,L,P,n,ld,M);} 319 if (r == 1) {break;} 320 320 } 321 321 return(r); … … 342 342 for (j = 1; j<= size(P); j++) 343 343 {if (P[j] <= size(Vt)) 344 345 346 344 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 345 if (isInMat(Vt2,L[j]) > 0) {w = 1; break;} 346 } 347 347 } 348 348 if (w == 0) 349 349 {vector Vtt; 350 351 352 350 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 351 M = M,Vtt; 352 kill Vtt; 353 353 } 354 354 } … … 358 358 for (i = 1; i <= size(M); i++) 359 359 {kill Vt; intvec Vt; 360 361 360 for (j =1; j <= size(M[i]); j++) {Vt[j] = int(leadcoef(M[i][j]));} 361 h1 = h1 + 1; H1 = findHCoeff(Vt,n,L,P,H1); 362 362 } 363 363 if (size(H1) < (size(V)+2)) {H1[(size(V)+2)] = h1;} … … 374 374 for (j = 1; j<= size(P); j++) 375 375 {if (P[j] <= size(Vt)) 376 377 378 376 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 377 if (isInMat(Vt2,L[j]) > 0) {w = 1; break;} 378 } 379 379 } 380 380 if (w == 0) 381 381 {vector Vtt; 382 383 384 382 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 383 M = M,Vtt; 384 kill Vtt; 385 385 } 386 386 } … … 390 390 for (i = 1; i <= size(M); i++) 391 391 {kill Vt; intvec Vt; 392 393 394 392 for (j =1; j <= size(M[i]); j++) 393 {Vt[j] = int(leadcoef(M[i][j]));} 394 h1 = h1 + 1; H1 = findHCoeff(Vt,n,L,P,H1,degbound); 395 395 } 396 396 if (size(H1) < (size(V)+2)) { H1[(size(V)+2)] = h1;} … … 419 419 for (j = 1; j<= size(P); j++) 420 420 {if (P[j] <= size(Vt)) 421 422 423 421 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 422 if (isInMat(Vt2,L[j]) > 0) {w = 1; break;} 423 } 424 424 } 425 425 if (w == 0) 426 426 {vector Vtt; 427 428 429 427 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 428 M = M,Vtt; 429 kill Vtt; 430 430 } 431 431 } … … 435 435 for (i = 1; i <= size(M); i++) 436 436 {kill Vt; intvec Vt; 437 438 439 440 441 442 437 for (j =1; j <= size(M[i]); j++) 438 {Vt[j] = int(leadcoef(M[i][j]));} 439 if (size(R[1]) < (size(V)+2)) { R[1][(size(V)+2)] = 1;} 440 else 441 {R[1][(size(V)+2)] = R[1][(size(V)+2)] + 1;} 442 R = findHCoeffMis(Vt,n,L,P,R); 443 443 } 444 444 return(R); … … 456 456 for (j = 1; j<= size(P); j++) 457 457 {if (P[j] <= size(Vt)) 458 459 460 458 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 459 if (isInMat(Vt2,L[j]) > 0) {w = 1; break;} 460 } 461 461 } 462 462 if (w == 0) 463 463 {vector Vtt; 464 465 466 464 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 465 M = M,Vtt; 466 kill Vtt; 467 467 } 468 468 } … … 472 472 for (i = 1; i <= ncols(M); i++) 473 473 {kill Vt; intvec Vt; 474 475 476 477 478 479 474 for (j =1; j <= size(M[i]); j++) 475 {Vt[j] = int(leadcoef(M[i][j]));} 476 if (size(R[1]) < (size(V)+2)) { R[1][(size(V)+2)] = 1;} 477 else 478 {R[1][(size(V)+2)] = R[1][(size(V)+2)] + 1;} 479 R = findHCoeffMis(Vt,n,L,P,R,degbound); 480 480 } 481 481 return(R); … … 500 500 for (j = 1; j<= size(P); j++) 501 501 {if (P[j] <= size(Vt)) 502 503 504 502 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 503 if (isInMat(Vt2,L[j]) > 0) {w = 1; break;} 504 } 505 505 } 506 506 if (w == 0) 507 507 {vector Vtt; 508 509 510 508 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 509 M = M,Vtt; 510 kill Vtt; 511 511 } 512 512 } … … 520 520 for (i = 1; i <= size(M); i++) 521 521 {kill Vt; intvec Vt; 522 523 522 for (j =1; j <= size(M[i]); j++){Vt[j] = int(leadcoef(M[i][j]));} 523 R[1] = R[1] + 1; R = findMisDim(Vt,n,L,P,R); 524 524 } 525 525 return(R); … … 537 537 for (j = 1; j<= size(P); j++) 538 538 {if (P[j] <= size(Vt)) 539 540 541 539 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 540 if (isInMat(Vt2,L[j]) > 0) {w = 1; break;} 541 } 542 542 } 543 543 if (w == 0) 544 544 {vector Vtt; 545 546 547 545 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 546 M = M,Vtt; 547 kill Vtt; 548 548 } 549 549 } … … 557 557 for (i = 1; i <= size(M); i++) 558 558 {kill Vt; intvec Vt; 559 560 559 for (j =1; j <= size(M[i]); j++){Vt[j] = int(leadcoef(M[i][j]));} 560 R[1] = R[1] + 1; R = findMisDim(Vt,n,L,P,R,degbound); 561 561 } 562 562 return(R); … … 586 586 for (j = 1; j <= size(P); j++) 587 587 {if (P[j] <= size(Vt)) 588 589 590 591 588 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 589 if (isInMat(Vt2,L[j]) > 0) 590 {w = 1; break;} 591 } 592 592 } 593 593 if (w == 0) 594 594 {vector Vtt; 595 596 597 595 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 596 M = M,Vtt; 597 kill Vtt; 598 598 } 599 599 } … … 603 603 for (i = 1; i <= size(M); i++) 604 604 {kill Vt; intvec Vt; 605 606 605 for (j =1; j <= size(M[i]); j++){Vt[j] = int(leadcoef(M[i][j]));} 606 R = R + findmistletoes(Vt,n,L,P); 607 607 } 608 608 return(R); … … 617 617 for (j = 1; j <= size(P); j++) 618 618 {if (P[j] <= size(Vt)) 619 620 621 619 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 620 if (isInMat(Vt2,L[j]) > 0){w = 1; break;} 621 } 622 622 } 623 623 if (w == 0) 624 624 {vector Vtt; 625 626 627 625 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 626 M = M,Vtt; 627 kill Vtt; 628 628 } 629 629 } … … 633 633 for (i = 1; i <= ncols(M); i++) 634 634 {kill Vt; intvec Vt; 635 636 637 638 635 for (j =1; j <= size(M[i]); j++) 636 {Vt[j] = int(leadcoef(M[i][j]));} 637 //Vt; typeof(Vt); size(Vt); 638 R = R + findmistletoes(Vt,n,L,P,degbound); 639 639 } 640 640 return(R); … … 1651 1651 @* degbound <= attrib(basering,uptodeg) holds. 1652 1652 NOTE: - If L is the list returned, then L[1] is an integer, the K-dimension, 1653 @* L[2] is an intvec, the Hilbert series and L[3] is an ideal, 1653 @* L[2] is an intvec, the Hilbert series and L[3] is an ideal, 1654 1654 @* the mistletoes 1655 1655 @* - If degbound is set, there will be a degree bound added. 0 means no … … 2041 2041 2042 2042 2043 proc tst_fpadim()2044 {2045 example ivDHilbert;2046 example ivDHilbertSickle;2047 example ivDimCheck;2048 example ivHilbert;2049 example ivKDim;2050 example ivMis2Base;2051 example ivMis2Dim;2052 example ivOrdMisLex;2053 example ivSickle;2054 example ivSickleHil;2055 example ivSickleDim;2056 example lpDHilbert;2057 example lpDHilbertSickle;2058 example lpHilbert;2059 example lpDimCheck;2060 example lpKDim;2061 example lpMis2Base;2062 example lpMis2Dim;2063 example lpOrdMisLex;2064 example lpSickle;2065 example lpSickleHil;2066 example lpSickleDim;2067 example sickle;2068 example ivL2lpI;2069 example iv2lp;2070 example iv2lpList;2071 example iv2lpMat;2072 example lp2iv;2073 example lp2ivId;2074 example lpId2ivLi;2075 }2076 2077 2078 2079 2080 2081 2043 /* 2082 2044 Here are some examples one may try. Just copy them into your console.
Note: See TracChangeset
for help on using the changeset viewer.