Changeset 84db93f in git
 Timestamp:
 Nov 25, 1999, 2:12:27 PM (24 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '23b0a9c07070b684aa12355009488dc00d9501e3')
 Children:
 24e55d9c9c4da931e0ed35d289b334426b6ab185
 Parents:
 b9ce2a5eabe5f00663bb9ef2e4e9ca761079d6dd
 Location:
 Singular
 Files:

 4 edited
Legend:
 Unmodified
 Added
 Removed

Singular/ideals.cc
rb9ce2a r84db93f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ideals.cc,v 1.7 8 19991124 14:07:21 obachmanExp $ */4 /* $Id: ideals.cc,v 1.79 19991125 13:12:24 siebert Exp $ */ 5 5 /* 6 6 * ABSTRACT  all basic methods to manipulate ideals … … 1353 1353 int i, j, k, length=0,reg; 1354 1354 BOOLEAN isMonomial=TRUE; 1355 int ii; 1355 1356 1356 1357 #ifdef PDEBUG 1357 int ii;1358 1358 for(ii=0;ii<IDELEMS(h1);ii++) pTest(h1>m[ii]); 1359 1359 #endif 1360 1360 if (idIs0(h1)) 1361 return idFreeModule(IDELEMS(h1)); 1361 { 1362 ideal result=idFreeModule(IDELEMS(h1)); 1363 int curr_syz_limit=rGetCurrSyzLimit(); 1364 if (curr_syz_limit>0) 1365 for (ii=0;ii<IDELEMS(h1);ii++) 1366 { 1367 if (h1>m[ii]!=NULL) 1368 pShift(&h1>m[ii],curr_syz_limit); 1369 } 1370 return result; 1371 } 1362 1372 k=max(1,idRankFreeModule(h1)); 1363 1373 … … 1456 1466 } 1457 1467 idTest(s_h3); 1468 if (currQuotient != NULL) 1469 { 1470 ideal ts_h3=kStd(s_h3,currQuotient,h,w); 1471 idDelete(&s_h3); 1472 s_h3 = ts_h3; 1473 } 1458 1474 return s_h3; 1459 1475 } … … 3243 3259 /*2 3244 3260 * returns the presentation of an isomorphic, minimally 3245 * embedded module 3261 * embedded module (arg represents the quotient!) 3246 3262 */ 3247 3263 ideal idMinEmbedding(ideal arg,BOOLEAN inPlace) 
Singular/syz.cc
rb9ce2a r84db93f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: syz.cc,v 1.3 2 19991124 14:07:23 obachmanExp $ */4 /* $Id: syz.cc,v 1.33 19991125 13:12:26 siebert Exp $ */ 5 5 6 6 /* … … 382 382 syMinStep(res[syzIndex1],res[syzIndex]); 383 383 if (!idIs0(res[0])) 384 idMinEmbedding(res[0], 384 idMinEmbedding(res[0],TRUE); 385 385 } 386 386 
Singular/syz0.cc
rb9ce2a r84db93f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: syz0.cc,v 1.2 6 19991118 18:43:57siebert Exp $ */4 /* $Id: syz0.cc,v 1.27 19991125 13:12:26 siebert Exp $ */ 5 5 /* 6 6 * ABSTRACT: resolutions … … 31 31 static kBucket_pt sy0buck; 32 32 33 static polyset syInitSort(polyset oldF,int rkF,int Fmax, 34 int syComponentOrder,intvec **modcomp) 33 static void syInitSort(ideal arg,intvec **modcomp) 35 34 { 36 35 int i,j,k,kk,kkk,jj; 37 polyset F; 38 int Fl=Fmax; 36 polyset F,oldF=arg>m; 37 int Fl=IDELEMS(arg); 38 int rkF=idRankFreeModule(arg); 39 int syComponentOrder=pModuleOrder(); 39 40 40 41 while ((Fl!=0) && (oldF[Fl1]==NULL)) Fl; 41 42 if (*modcomp!=NULL) delete modcomp; 42 43 *modcomp = NewIntvec1(rkF+2); 43 F=(polyset)Alloc0( Fmax*sizeof(poly));44 F=(polyset)Alloc0(IDELEMS(arg)*sizeof(poly)); 44 45 j=0; 45 46 for(i=0;i<=rkF;i++) … … 70 71 } 71 72 (**modcomp)[rkF+1] = Fl; 72 return F; 73 arg>m = F; 74 Free((ADDRESS)oldF,IDELEMS(arg)*sizeof(poly)); 75 #ifndef __OPTIMIZE__ 76 //Print("Neue Anordnung: "); 77 //idPrint(arg); 78 #endif 73 79 } 74 80 … … 164 170 /*2 165 171 * computes the Schreyer syzygies in the local case 166 * input: F, Fmax, noSort: F is already ordered by: Schreyerorder 167 * (only allocated: Shdl, Smax) 172 * input: arg (only allocated: Shdl, Smax) 168 173 * output: Shdl, Smax 169 174 */ 170 void sySchreyersSyzygiesFM(polyset F,int Fmax,polyset* Shdl,int* Smax, 171 BOOLEAN noSort) 172 { 173 int Fl=Fmax; 174 while ((Fl!=0) && (F[Fl1]==NULL)) Fl; 175 if (Fl==0) return; 176 177 int i,j,l,k,totalToRed,ecartToRed,kk,bestEcart,totalmax,rkF, 178 Sl=0,smax,tmax,tl; 175 static ideal sySchreyersSyzygiesFM(ideal arg,intvec ** modcomp) 176 { 177 int Fl=IDELEMS(arg); 178 while ((Fl!=0) && (arg>m[Fl1]==NULL)) Fl; 179 ideal result=idInit(16,arg>rank+Fl); 180 polyset F=arg>m,*Shdl=&(result>m); 181 if (Fl==0) return result; 182 183 int i,j,l,k,totalToRed,ecartToRed,kk,kkk; 184 int bestEcart,totalmax,rkF,Sl=0,smax,tmax,tl; 179 185 int *ecartS, *ecartT, *totalS, 180 186 *totalT=NULL, *temp=NULL; 181 intvec * modcomp=NULL;182 187 polyset pairs,S,T,ST,oldF; 183 188 poly p,q,toRed; 184 189 BOOLEAN notFound = FALSE; 185 190 intvec * newmodcomp = NewIntvec1(Fl+2); 191 intvec * tempcomp; 192 193 //Print("Naechster Modul\n"); 194 //idPrint(arg); 186 195 /*initializing the sets*/ 187 ideal idF=(ideal)Alloc0SizeOf(ip_sideal);188 196 ST=(polyset)Alloc0(Fl*sizeof(poly)); 189 197 S=(polyset)Alloc0(Fl*sizeof(poly)); … … 197 205 smax = Fl; 198 206 tmax = 2*Fl; 199 idF>m=F;IDELEMS(idF)=Fmax; 200 idF>nrows=1; 201 rkF=idRankFreeModule(idF); 202 /*sorting of F for index handling*/ 203 if (noSort) 204 { 205 oldF = F; 206 F=syInitSort(F,rkF,Fmax,1,&modcomp); 207 } 208 #ifndef __OPTIMIZE__ 209 Print("Neue Anordnung: "); 210 idF>m=F;IDELEMS(idF)=Fmax; 211 idF>nrows=1; 212 idPrint(idF); 213 FreeSizeOf((ADDRESS)idF,ip_sideal); 214 #endif 207 for (j=1;j<IDELEMS(arg);j++) 208 { 209 if (arg>m[j] != NULL) 210 { 211 assume (arg>m[j1] != NULL); 212 assume (pGetComp(arg>m[j1])pGetComp(arg>m[j])<=0); 213 } 214 } 215 rkF=idRankFreeModule(arg); 215 216 /*construction of the new ordering*/ 216 pSetSchreyerOrdM(F,Fl,rkF); 217 //pSetSchreyerOrdM(F,Fl,rkF); 218 if (rkF>0) 219 rSetSyzComp(rkF); 220 else 221 rSetSyzComp(1); 217 222 /*creating S*/ 218 223 for(j=0;j<Fl;j++) … … 231 236 else 232 237 pSetComp(p,rkF+j+1); 238 pSetmComp(p); 233 239 } 234 240 //PrintLn(); … … 267 273 for(j=0;j<smax;j++) 268 274 { 275 (*newmodcomp)[j+1] = Sl; 269 276 i = pGetComp(S[j]); 277 //#define OLD_PAIR_CONSTRUCTION 278 #ifdef OLD_PAIR_CONSTRUCTION 270 279 k=j+1; 271 /*constructing all pairs with S[j]*/272 280 if (TEST_OPT_PROT) 273 281 { … … 278 286 /*computing the syzygies*/ 279 287 for (k=j+1;k<Fl;k++) 288 #else 289 int syComponentOrder=pModuleOrder(); 290 int lini,wend; 291 if (syComponentOrder==1) 292 { 293 lini=k=j+1; 294 wend=Fl; 295 } 296 else 297 { 298 lini=k=0; 299 while ((k<j) && (pGetComp(S[k]) != i)) k++; 300 wend=j; 301 } 302 if (TEST_OPT_PROT) 303 { 304 Print("(%d)",Flj); 305 mflush(); 306 } 307 syCreatePairs(S,lini,wend,k,j,i,pairs); 308 for (k=lini;k<wend;k++) 309 #endif 280 310 { 281 311 if (pairs[k]!=NULL) … … 289 319 } 290 320 tl = smax; 321 tempcomp = ivCopy(*modcomp); 291 322 /*begin to reduce*/ 292 323 toRed = ksOldCreateSpoly(S[j],S[k]); … … 302 333 mflush(); 303 334 } 335 //Print("Reduziere Paar %d,%d (ecart %d): \n",j,k,ecartToRed); 336 //Print("Poly %d: ",j);pWrite(S[j]); 337 //Print("Poly %d: ",k);pWrite(S[k]); 338 //Print("Spoly: ");pWrite(toRed); 304 339 while (pGetComp(toRed)<=rkF) 305 340 { … … 317 352 * } 318 353 */ 354 //Print("toRed now (neuer ecart %d): ",ecartToRed);pWrite(toRed); 319 355 notFound = TRUE; 320 l=0;321 356 bestEcart = 32000; //a very large integer 322 357 p = NULL; 358 int l=0; 359 #define OLD_SEARCH 360 #ifdef OLD_SEARCH 323 361 while ((l<tl) && (pGetComp(T[l])<pGetComp(toRed))) l++; 362 //assume (l==(**modcomp)[pGetComp(toRed)]); 324 363 while ((l<tl) && (notFound)) 364 #else 365 l = (**modcomp)[pGetComp(toRed)]; 366 kkk = (**modcomp)[pGetComp(toRed)+1]; 367 while ((l<kkk) && (notFound)) 368 #endif 325 369 { 326 370 if ((ecartT[l]<bestEcart) && (pDivisibleBy(T[l],toRed))) … … 345 389 Free((ADDRESS)ecartS,Fl*sizeof(int)); 346 390 Free((ADDRESS)totalS,Fl*sizeof(int)); 347 if (noSort) 348 { 349 Free((ADDRESS)F,Fl*sizeof(poly)); 350 F = oldF; 351 } 352 for(k=0;k<*Smax;k++) pDelete(&((*Shdl)[k])); 353 return; 391 for(k=0;k<IDELEMS(result);k++) pDelete(&((*Shdl)[k])); 392 return result; 354 393 } 355 394 else 356 395 { 357 //Print S("reduced with: ");pWrite(p);PrintLn();396 //Print("reduced with (ecart %d): ",bestEcart);wrp(p);PrintLn(); 358 397 if (notFound) 359 398 { … … 370 409 } 371 410 //PrintS("t"); 411 int comptR=pGetComp(toRed); 412 for (l=tempcomp>length()1;l>comptR;l) 413 { 414 if ((*tempcomp)[l]>0) 415 (*tempcomp)[l]++; 416 } 372 417 l=0; 373 while ((l<tl) && ( pGetComp(toRed)>pGetComp(T[l]))) l++;418 while ((l<tl) && (comptR>pGetComp(T[l]))) l++; 374 419 while ((l<tl) && (totalT[l]<=totalToRed)) l++; 375 420 for (kk=tl;kk>l;kk) … … 386 431 tl++; 387 432 } 388 389 433 toRed = ksOldSpolyRed(p,toRed); 390 434 } 391 435 } 436 //Print("toRed finally (neuer ecart %d): ",ecartToRed);pWrite(toRed); 392 437 //PrintS("s"); 393 438 if (pGetComp(toRed)>rkF) 394 439 { 395 if (Sl>= *Smax)396 { 397 pEnlargeSet(Shdl, *Smax,16);398 *Smax+= 16;399 } 400 pShift(&toRed,rkF);440 if (Sl>=IDELEMS(result)) 441 { 442 pEnlargeSet(Shdl,IDELEMS(result),16); 443 IDELEMS(result) += 16; 444 } 445 //pShift(&toRed,rkF); 401 446 pNorm(toRed); 402 447 (*Shdl)[Sl] = toRed; … … 414 459 } 415 460 } 416 } 417 } 418 for(k=j;k<Fl;k++) pDelete(&(pairs[k])); 419 } 461 delete tempcomp; 462 } 463 } 464 for(k=lini;k<wend;k++) pDelete(&(pairs[k])); 465 } 466 (*newmodcomp)[Fl+1] = Sl; 420 467 Free((ADDRESS)pairs,Fl*sizeof(poly)); 421 468 Free((ADDRESS)ST,Fl*sizeof(poly)); … … 426 473 Free((ADDRESS)ecartS,Fl*sizeof(int)); 427 474 Free((ADDRESS)totalS,Fl*sizeof(int)); 428 if (noSort) 429 { 430 if (modcomp!=NULL) delete modcomp; 431 Free((ADDRESS)F,Fl*sizeof(poly)); 432 F = oldF; 433 } 475 delete *modcomp; 476 *modcomp = newmodcomp; 477 return result; 434 478 } 435 479 … … 476 520 /*2 477 521 * computes the Schreyer syzygies in the global case 478 * input: F, Fmax, noSort: F is already ordered by: Schreyerorder 479 * (only allocated: Shdl, Smax) 522 * input: F 480 523 * output: Shdl, Smax 481 * modcomp, length stores the start position of the module comp. in FF524 * modcomp, length stores the start position of the module comp. in arg 482 525 */ 483 void sySchreyersSyzygiesFB(polyset *FF,int Fmax,polyset* Shdl,int* Smax, 484 BOOLEAN noSort,intvec ** modcomp, int * length,ideal mW) 485 { 486 int i,j,l,k,kkk,rkF,Sl=0,Fl=Fmax,syComponentOrder=pModuleOrder(); 487 int fstart,wend,lini,ltR; 526 static ideal sySchreyersSyzygiesFB(ideal arg,intvec ** modcomp,ideal mW,BOOLEAN redTail=TRUE) 527 { 528 int Fl=IDELEMS(arg); 529 while ((Fl!=0) && (arg>m[Fl1]==NULL)) Fl; 530 ideal result=idInit(16,Fl); 531 int i,j,l,k,kkk,rkF,Sl=0,syComponentOrder=pModuleOrder(); 532 int fstart,wend,lini,ltR,gencQ=0; 488 533 intvec *newmodcomp; 489 534 int *Flength; 490 polyset pairs, oldF,F=*FF;535 polyset pairs,F=arg>m,*Shdl=&(result>m); 491 536 poly p,q,toRed,syz,lastmonom,multWith; 492 ideal idF=(ideal)AllocSizeOf(sip_sideal),null;537 ideal null; 493 538 BOOLEAN isNotReduced=TRUE; 494 539 495 while ((Fl!=0) && (F[Fl1]==NULL)) Fl; 540 //#define WRITE_BUCKETS 541 #ifdef WRITE_BUCKETS 542 Print("Input: \n"); 543 ideal twr=idHead(arg); 544 idPrint(arg); 545 idDelete(&twr); 546 if (modcomp!=NULL) (*modcomp)>show(0,0); 547 #endif 496 548 newmodcomp = NewIntvec1(Fl+2); 497 549 //for (j=0;j<Fl;j++) pWrite(F[j]); … … 500 552 pairs=(polyset)Alloc0(Fl*sizeof(poly)); 501 553 else 502 pairs=(polyset)Alloc0((Fl+IDELEMS(currQuotient))*sizeof(poly)); 503 idF>m=F;IDELEMS(idF)=Fmax; 504 rkF=idRankFreeModule(idF); 554 { 555 gencQ = IDELEMS(currQuotient); 556 pairs=(polyset)Alloc0((Fl+gencQ)*sizeof(poly)); 557 } 558 rkF=idRankFreeModule(arg); 505 559 null = idInit(1,rkF); 506 FreeSizeOf((ADDRESS)idF,sip_sideal);507 if (noSort)508 {509 oldF = *FF;510 F=syInitSort(*FF,rkF,Fmax,syComponentOrder,modcomp);511 }512 else513 {514 F = *FF;515 }516 560 Flength = (int*)Alloc0(Fl*sizeof(int)); 517 561 for(j=0;j<Fl;j++) … … 540 584 } 541 585 syCreatePairs(F,lini,wend,k,j,i,pairs,Fl,mW); 542 if (currQuotient!=NULL) wend = Fl+ IDELEMS(currQuotient);586 if (currQuotient!=NULL) wend = Fl+gencQ; 543 587 for (k=lini;k<wend;k++) 544 588 { … … 613 657 kkk = (**modcomp)[pGetComp(toRed)]; 614 658 while ((l>=kkk) && (!pDivisibleBy(F[l],toRed))) l; 615 //#define WRITE_BUCKETS616 659 #ifdef WRITE_BUCKETS 617 660 kBucketClear(sy0buck,&toRed,<R); … … 642 685 pDelete(&syz); 643 686 for(k=j;k<Fl;k++) pDelete(&(pairs[k])); 644 Free((ADDRESS)pairs,(Fl + IDELEMS(currQuotient))*sizeof(poly)); 645 if (noSort) 646 { 647 Free((ADDRESS)F,Fl*sizeof(poly)); 648 F = oldF; 649 } 650 for(k=0;k<*Smax;k++) pDelete(&((*Shdl)[k])); 651 return; 687 Free((ADDRESS)pairs,(Fl + gencQ)*sizeof(poly)); 688 for(k=0;k<IDELEMS(result);k++) pDelete(&((*Shdl)[k])); 689 return result; 652 690 } 653 691 } … … 686 724 if (syz!=NULL) 687 725 { 688 if (Sl>= *Smax)689 { 690 pEnlargeSet(Shdl, *Smax,16);691 *Smax+= 16;726 if (Sl>=IDELEMS(result)) 727 { 728 pEnlargeSet(Shdl,IDELEMS(result),16); 729 IDELEMS(result) += 16; 692 730 } 693 731 pNorm(syz); 694 if (BTEST1(OPT_REDTAIL) )732 if (BTEST1(OPT_REDTAIL) && redTail) 695 733 { 696 734 (*newmodcomp)[j+2] = Sl; … … 711 749 else 712 750 Free((ADDRESS)pairs,(Fl+IDELEMS(currQuotient))*sizeof(poly)); 713 if (noSort)714 {715 Free((ADDRESS)oldF,Fmax*sizeof(poly));716 *FF = F;717 }718 751 Free((ADDRESS)Flength,Fl*sizeof(int)); 719 752 delete *modcomp; 720 *length = Fl+2;721 753 *modcomp = newmodcomp; 754 return result; 722 755 } 723 756 … … 822 855 } 823 856 857 static void idShift(ideal arg,int index) 858 { 859 int i,j=rGetMaxSyzComp(index); 860 for (i=0;i<IDELEMS(arg);i++) 861 { 862 if (arg>m[i]!=NULL) 863 pShift(&arg>m[i],j); 864 } 865 } 866 867 static void syPrintResolution(resolvente res,int start,int length) 868 { 869 while ((start < length) && (res[start])) 870 { 871 Print("Syz(%d): \n",start); 872 idTest(res[start]); 873 //idPrint(res[start]); 874 start++; 875 } 876 } 877 824 878 resolvente sySchreyerResolvente(ideal arg, int maxlength, int * length, 825 879 BOOLEAN isMonomial, BOOLEAN notReplace) 826 880 { 827 881 ideal mW=NULL; 828 int i,syzIndex = 0,j=0 ,lgth,*ord=NULL,*bl0=NULL,*bl1=NULL;882 int i,syzIndex = 0,j=0; 829 883 intvec * modcomp=NULL,*w=NULL; 830 884 int ** wv=NULL; 831 BOOLEAN sort = TRUE;832 885 tHomog hom=(tHomog)idHomModule(arg,NULL,&w); 833 886 ring origR = currRing; 834 sip_sring tmpR;887 ring syRing=NULL; 835 888 836 889 if ((!isMonomial) && syTestOrder(arg)) … … 856 909 res=newres; 857 910 } 858 res[syzIndex+1] = idInit(16,1); 859 if ((currRing>OrdSgn == 1)  (hom==isHomog)) 860 { 861 sySchreyersSyzygiesFB(&(res[syzIndex]>m),i,&(res[syzIndex+1]>m), 862 &(IDELEMS(res[syzIndex+1])),sort,&modcomp,&lgth,mW); 911 if ((origR>OrdSgn == 1)  (hom==isHomog)) 912 { 913 if (syzIndex==0) syInitSort(res[0],&modcomp); 914 if ((syzIndex==0) && !rRing_has_CompLastBlock(currRing)) 915 res[syzIndex+1] = sySchreyersSyzygiesFB(res[syzIndex],&modcomp,mW,FALSE); 916 else 917 res[syzIndex+1] = sySchreyersSyzygiesFB(res[syzIndex],&modcomp,mW); 863 918 mW = res[syzIndex]; 864 919 } 865 920 //idPrint(res[syzIndex+1]); 866 921 867 // #define THOMAS_THOUGHT_ABOUT_IT868 #ifdef THOMAS_THOUGHT_ABOUT_IT869 if ((syzIndex==0) && (currRing>OrdSgn==1))870 #else871 922 if ((syzIndex==0)) 872 #endif 873 { 874 j = 0; 875 // Thomas: I do not understand why you change the ring here 876 // (after the first Syzygies computation) 877 while ((currRing>order[j]!=ringorder_c) 878 && (currRing>order[j]!=ringorder_C)) 879 j++; 880 if ((!notReplace) && (currRing>order[j]!=0)) 881 { 882 while (currRing>order[j]!=0) j++; 883 ord = (int*)Alloc0((j+1)*sizeof(int)); 884 wv = (int**)Alloc0((j+1)*sizeof(int*)); 885 bl0 = (int*)Alloc0((j+1)*sizeof(int)); 886 bl1 = (int*)Alloc0((j+1)*sizeof(int)); 887 j = 0; 888 while ((currRing>order[j]!=ringorder_c) 889 && (currRing>order[j]!=ringorder_C)) 890 { 891 ord[j] = currRing>order[j]; 892 bl0[j] = currRing>block0[j]; 893 bl1[j] = currRing>block1[j]; 894 wv[j] = currRing>wvhdl[j]; 895 j++; 896 } 897 int m_order=j; 898 while (currRing>order[j+1]!=0) 899 { 900 ord[j] = currRing>order[j+1]; 901 bl0[j] = currRing>block0[j+1]; 902 bl1[j] = currRing>block1[j+1]; 903 wv[j] = currRing>wvhdl[j+1]; 904 j++; 905 } 906 ord[j] = currRing>order[m_order]; 907 bl0[j] = currRing>block0[m_order]; 908 bl1[j] = currRing>block1[m_order]; 909 wv[j] = currRing>wvhdl[m_order]; 910 tmpR = *currRing; 911 tmpR.order = ord; 912 tmpR.block0 = bl0; 913 tmpR.block1 = bl1; 914 tmpR.wvhdl = wv; 915 rComplete(&tmpR, 1); 916 rChangeCurrRing(&tmpR, TRUE); 917 if ((currRing>OrdSgn != 1) && (hom!=isHomog)) 923 { 924 if ((origR>OrdSgn == 1)  (hom==isHomog)) 925 { 926 syRing = rCurrRingAssure_CompLastBlock(); 927 if (syRing != origR) 928 { 929 for (i=0; i<IDELEMS(res[1]); i++) 930 { 931 res[1]>m[i] = prMoveR( res[1]>m[i], origR); 932 } 933 } 934 idTest(res[1]); 935 } 936 else 937 { 938 syRing = rCurrRingAssure_SyzComp_CompLastBlock(); 939 if (syRing != origR) 918 940 { 919 941 for (i=0; i<IDELEMS(res[0]); i++) … … 922 944 } 923 945 } 924 else925 {926 for (i=0; i<IDELEMS(res[0]); i++)927 {928 res[0]>m[i] = prMoveR( res[0]>m[i], origR);929 }930 }931 946 idTest(res[0]); 932 947 } 933 948 } 934 if ((currRing>OrdSgn != 1) && (hom!=isHomog)) 935 sySchreyersSyzygiesFM(res[syzIndex]>m,i,&(res[syzIndex+1]>m), 936 &(IDELEMS(res[syzIndex+1])),sort); 937 if (sort) sort=FALSE; 949 if ((origR>OrdSgn != 1) && (hom!=isHomog)) 950 { 951 if (syzIndex==0) syInitSort(res[0],&modcomp); 952 res[syzIndex+1] = sySchreyersSyzygiesFM(res[syzIndex],&modcomp); 953 } 938 954 syzIndex++; 939 955 if (TEST_OPT_PROT) Print("[%d]\n",syzIndex); 940 956 kBucketDestroy(&(sy0buck)); 941 957 } 942 syReOrderResolventFB(res,*length); 943 if (currRing>OrdSgn == 1) 944 pSetSchreyerOrdM(NULL,0,0); 945 syzIndex = 1; 946 if (/*ringOrderChanged:*/ ord!=NULL) 958 //syPrintResolution(res,1,*length); 959 if ((origR>OrdSgn != 1) && (hom!=isHomog)) 960 { 961 syzIndex = 1; 962 while ((syzIndex < *length) && (!idIs0(res[syzIndex]))) 963 { 964 idShift(res[syzIndex],syzIndex); 965 syzIndex++; 966 } 967 } 968 if ((origR>OrdSgn == 1)  (hom==isHomog)) 969 syzIndex = 1; 970 else 971 syzIndex = 0; 972 syReOrderResolventFB(res,*length,syzIndex+1); 973 if (/*ringOrderChanged:*/ origR!=syRing) 947 974 { 948 975 rChangeCurrRing(origR, TRUE); … … 954 981 if (res[syzIndex]>m[i]) 955 982 { 956 res[syzIndex]>m[i] = prMoveR( res[syzIndex]>m[i], &tmpR);983 res[syzIndex]>m[i] = prMoveR( res[syzIndex]>m[i], syRing); 957 984 } 958 985 } … … 961 988 j = 0; 962 989 while (currRing>order[j]!=0) j++; 963 Free((ADDRESS)ord,(j+1)*sizeof(int));964 Free((ADDRESS)bl0,(j+1)*sizeof(int));965 Free((ADDRESS)bl1,(j+1)*sizeof(int));966 Free((ADDRESS)wv,(j+1)*sizeof(int*));967 990 } 968 991 else … … 979 1002 } 980 1003 } 1004 if ((origR>OrdSgn == 1)  (hom==isHomog)) 1005 { 1006 if (res[1]!=NULL) 1007 { 1008 syReOrderResolventFB(res,2,1); 1009 for (i=0;i<IDELEMS(res[1]);i++) 1010 { 1011 if (res[1]>m[i]) 1012 res[1]>m[i] = pOrdPolyMerge(res[1]>m[i]); 1013 } 1014 } 1015 } 1016 //syPrintResolution(res,0,*length); 981 1017 982 1018 //syMergeSortResolventFB(res,*length); 
Singular/syz1.cc
rb9ce2a r84db93f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: syz1.cc,v 1.5 0 19991120 10:17:23siebert Exp $ */4 /* $Id: syz1.cc,v 1.51 19991125 13:12:27 siebert Exp $ */ 5 5 /* 6 6 * ABSTRACT: resolutions … … 1776 1776 jj = jj+2; 1777 1777 result=NewIntvec3(j,jjsh,0); 1778 IMATELEM(*result,1,1) = max(1,idRankFreeModule(syzstr>res[1])); 1778 if ((syzstr>syRing!=NULL) && (syzstr>syRing!=currRing)) 1779 { 1780 ring origR=currRing; 1781 rChangeCurrRing(syzstr>syRing, TRUE); 1782 IMATELEM(*result,1,1) = max(1,idRankFreeModule(syzstr>res[1])); 1783 rChangeCurrRing(origR,TRUE); 1784 } 1785 else 1786 { 1787 IMATELEM(*result,1,1) = max(1,idRankFreeModule(syzstr>res[1])); 1788 } 1779 1789 for (i=sh;i<jj;i++) 1780 1790 {
Note: See TracChangeset
for help on using the changeset viewer.