Changeset 8fdfee7 in git
- Timestamp:
- Jun 15, 2018, 6:46:25 PM (6 years ago)
- Branches:
- (u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
- Children:
- abfdab3ebcf881e1326c72d6772ac062164d904e
- Parents:
- b00f8a34fb50dbff4746ce45d0680d242f28260c
- Location:
- kernel/GBEngine
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/GBEngine/kstd2.cc
rb00f8a r8fdfee7 3867 3867 int olddeg,reduc; 3868 3868 int hilbeledeg=1,hilbcount=0,minimcnt=0; 3869 BOOLEAN withT = TRUE; // very important for shifts 3869 BOOLEAN withT = TRUE; // currently only T contains the shifts 3870 BITSET save; 3871 SI_SAVE_OPT1(save); 3870 3872 3871 3873 initBuchMoraCrit(strat); /*set Gebauer, honey, sugarCrit, NO CHANGES */ … … 3879 3881 /*Shdl=*/initBuchMoraShift(F, Q,strat); /* updateS with no toT, i.e. no init for T */ 3880 3882 updateSShift(strat); /* initializes T */ 3881 3882 3883 if (strat->minim>0) strat->M=idInit(IDELEMS(F),F->rank); 3883 3884 reduc = olddeg = 0; … … 3887 3888 strat->use_buckets = 1; 3888 3889 #endif 3889 3890 3890 // redtailBBa against T for inhomogenous input 3891 3891 // if (!TEST_OPT_OLDSTD) … … 3900 3900 #endif 3901 3901 3902 3903 #ifdef KDEBUG 3904 //kDebugPrint(strat); 3905 #endif 3902 3906 /* compute------------------------------------------------------- */ 3903 3907 while (strat->Ll >= 0) … … 3974 3978 if (red_result == 1) 3975 3979 { 3980 // get the polynomial (canonicalize bucket, make sure P.p is set) 3981 strat->P.GetP(strat->lmBin); 3982 // in the homogeneous case FDeg >= pFDeg (sugar/honey) 3983 // but now, for entering S, T, we reset it 3984 // in the inhomogeneous case: FDeg == pFDeg 3985 if (strat->homog) strat->initEcart(&(strat->P)); 3986 3976 3987 /* statistic */ 3977 3988 if (TEST_OPT_PROT) PrintS("s"); 3978 3989 3979 // get the polynomial (canonicalize bucket, make sure P.p is set)3980 strat->P.GetP(strat->lmBin);3981 3982 3990 int pos=posInS(strat,strat->sl,strat->P.p,strat->P.ecart); 3983 3991 3984 3992 // reduce the tail and normalize poly 3993 // in the ring case we cannot expect LC(f) = 1, 3994 // therefore we call pCleardenom instead of pNorm 3985 3995 strat->redTailChange=FALSE; 3986 3996 if (TEST_OPT_INTSTRATEGY) … … 3993 4003 if (strat->redTailChange) { 3994 4004 strat->P.t_p=NULL; 3995 // for some reason length and pLength are set to 0 in redtailBba3996 strat->initEcart(&(strat->P));3997 4005 } 3998 4006 } … … 4005 4013 if (strat->redTailChange) { 4006 4014 strat->P.t_p=NULL; 4007 // for some reason length and pLength are set to 0 in redtailBba4008 strat->initEcart(&(strat->P));4009 4015 } 4010 4016 } … … 4038 4044 4039 4045 // enter into S, L, and T 4040 //if ((!TEST_OPT_IDLIFT) || (pGetComp(strat->P.p) <= strat->syzComp)) 4041 // enterT(strat->P, strat); // this was here before Shift stuff 4042 //enterTShift(LObject p, kStrategy strat, int atT, int uptodeg, int lV); // syntax 4043 // the default value for atT = -1 as in bba 4044 /* strat->P.GetP(); */ 4045 // because shifts are counted with .p structure // done before, but ? 4046 int atR=strat->tl+1; // enterTShift introduces T[tl+1], T[tl+2]... 4047 // with T[tl+1]=P.p 4048 enterTShift(strat->P,strat,-1); 4049 enterpairsShift(strat->P.p,strat->sl,strat->P.ecart,pos,strat, atR); 4050 // enterpairsShift(vw,strat->sl,strat->P.ecart,pos,strat, strat->tl,uptodeg,lV); 4051 // posInS only depends on the leading term 4052 strat->enterS(strat->P, pos, strat, atR); 4046 if ((!TEST_OPT_IDLIFT) || (pGetComp(strat->P.p) <= strat->syzComp)) 4047 { 4048 int atR=strat->tl+1; // enterTShift introduces P.p=T[tl+1], T[tl+2]... 4049 enterTShift(strat->P,strat,-1); 4050 enterpairsShift(strat->P.p,strat->sl,strat->P.ecart,pos,strat, atR); 4051 // posInS only depends on the leading term 4052 strat->enterS(strat->P, pos, strat, atR); 4053 } 4053 4054 4054 4055 if (hilb!=NULL) khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat); 4055 4056 // Print("[%d]",hilbeledeg); 4056 if (strat->P.lcm!=NULL) pLmFree(strat->P.lcm); 4057 if (strat->P.lcm!=NULL) { 4058 pLmFree(strat->P.lcm); 4059 strat->P.lcm=NULL; 4060 } 4061 if (strat->s_poly!=NULL) 4062 { 4063 // the only valid entries are: strat->P.p, 4064 // strat->tailRing (read-only, keep it) 4065 // (and P->p1, P->p2 (read-only, must set to NULL if P.p is changed) 4066 if (strat->s_poly(strat)) 4067 { 4068 // we are called AFTER enterS, i.e. if we change P 4069 // we have to add it also to S/T 4070 // and add pairs 4071 int pos=posInS(strat,strat->sl,strat->P.p,strat->P.ecart); 4072 int atR=strat->tl+1; // enterTShift introduces P.p=T[tl+1], T[tl+2]... 4073 enterTShift(strat->P,strat,-1); 4074 enterpairsShift(strat->P.p,strat->sl,strat->P.ecart,pos,strat, atR); 4075 strat->enterS(strat->P, pos, strat, atR); 4076 } 4077 } 4057 4078 } 4058 4079 else if (strat->P.p1 == NULL && strat->minim > 0) … … 4068 4089 if (TEST_OPT_DEBUG) messageSets(strat); 4069 4090 #endif 4091 /* shift case: look for elt's in S such that they are divisible by elt in T */ 4092 if ((TEST_OPT_SB_1 || TEST_OPT_REDSB) && !strat->noClearS) // when is OPT_SB_1 set? 4093 { 4094 for (int k = 0; k <= strat->sl; ++k) 4095 { 4096 for (int j = 0; j<=strat->tl; ++j) 4097 { 4098 // this is like clearS in bba, but we reduce with elements from T, because it contains the shifts too 4099 assume(strat->sevT[j] == pGetShortExpVector(strat->T[j].p)); 4100 assume(strat->sevS[k] == pGetShortExpVector(strat->S[k])); 4101 if (pLmShortDivisibleBy(strat->T[j].p, strat->sevT[j], strat->S[k], ~strat->sevS[k])) 4102 { 4103 if (pLmCmp(strat->T[j].p, strat->S[k]) != 0) { // check whether LM is different 4104 deleteInS(k, strat); 4105 --k; 4106 break; 4107 } 4108 } 4109 } 4110 } 4111 } 4070 4112 /* complete reduction of the standard basis--------- */ 4071 /* shift case: look for elt's in S such that they are divisible by elt in T */4072 // if (TEST_OPT_SB_1)4073 4113 if (TEST_OPT_REDSB) 4074 4114 { 4075 int k=0; 4076 int j=-1; 4077 while(k<=strat->sl) 4078 { 4079 // loop 4080 // { 4081 // if (j>=k) break; 4082 // clearS(strat->S[j],strat->sevS[j],&k,&j,strat); 4083 // j++; 4084 // } 4085 LObject Ln (strat->S[k],currRing, strat->tailRing); 4086 Ln.SetShortExpVector(); 4087 j = kFindDivisibleByInT(strat, &Ln, j+1); 4088 if (j<0) { k++; j=-1;} 4089 else 4090 { 4091 if ( pLmCmp(strat->S[k],strat->T[j].p) == 0) 4092 { 4093 j = kFindDivisibleByInT(strat, &Ln, j+1); 4094 if (j<0) { k++; j=-1;} 4095 else 4096 { 4097 deleteInS(k,strat); 4098 } 4099 } 4100 else 4101 { 4102 deleteInS(k,strat); 4103 } 4104 } 4105 } 4106 } 4107 4108 if (TEST_OPT_REDSB) 4109 { completeReduce(strat, TRUE); //shift: withT = TRUE 4115 completeReduce(strat, TRUE); //shift: withT = TRUE 4110 4116 if (strat->completeReduce_retry) 4111 4117 { … … 4120 4126 int i; 4121 4127 for(i=strat->sl;i>=0;i--) strat->S_2_R[i]=-1; 4128 WarnS("reduction with S is not yet supported by Letterplace"); // if this ever happens, we'll know 4122 4129 completeReduce(strat); 4123 4130 } … … 4140 4147 // } 4141 4148 // } 4142 if (TEST_OPT_PROT) messageStat(hilbcount,strat); 4149 if ((TEST_OPT_PROT) || (TEST_OPT_DEBUG)) messageStat(hilbcount,strat); 4150 SI_RESTORE_OPT1(save); 4151 /* postprocessing for GB over Q-rings ------------------*/ 4143 4152 if (Q!=NULL) updateResult(strat->Shdl,Q,strat); 4153 4154 idTest(strat->Shdl); 4155 4144 4156 return (strat->Shdl); 4145 4157 } -
kernel/GBEngine/kutil.cc
rb00f8a r8fdfee7 12513 12513 int toInsert = itoInsert(p.p, strat->tailRing); 12514 12514 12515 #ifdef PDEBUG12516 // Print("enterTShift uses toInsert: %d", toInsert); PrintLn();12517 #endif12518 int i;12519 12520 if (atT < 0)12521 atT = strat->posInT(strat->T, strat->tl, p);12522 12523 12515 /* can call enterT in a sequence, e.g. */ 12524 12516 … … 12526 12518 enterT(p,strat,atT); 12527 12519 LObject qq; 12528 for (i =1; i<=toInsert; i++) // toIns - 1?12520 for (int i=1; i<=toInsert; i++) 12529 12521 { 12530 12522 qq = p; //qq.Copy(); … … 12540 12532 #endif 12541 12533 /* enter it into T, first el't is with the shift 0 */ 12542 // compute the position for qq12543 atT = strat->posInT(strat->T, strat->tl, qq);12544 12534 enterT(qq,strat,atT); 12545 12535 } 12546 /* Q: what to do with this one in the orig enterT ? */12547 /* strat->R[strat->tl] = &(strat->T[atT]); */12548 /* Solution: it is done by enterT each time separately */12549 12536 } 12550 12537 #endif
Note: See TracChangeset
for help on using the changeset viewer.