Changeset d5856f in git
- Timestamp:
- Dec 6, 2013, 4:05:10 PM (9 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'c987db42cd2ec943b97ac5746c99892ceddf909c')
- Children:
- 1eba3916d70fdfa610391e2779d72b202c1b7915
- Parents:
- cda0b04282903cc2bac5f3b79cb72d0319602785
- git-author:
- Christian Eder <ederc@mathematik.uni-kl.de>2013-12-06 16:05:10+01:00
- git-committer:
- Christian Eder <ederc@mathematik.uni-kl.de>2013-12-12 13:51:29+01:00
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/kstd2.cc
rcda0b0 rd5856f 55 55 #define SBA_TAIL_RED 1 56 56 #define SBA_PRODUCT_CRITERION 0 57 #define SBA_PRINT_ZERO_REDUCTIONS 158 #define SBA_PRINT_REDUCTION_STEPS 159 #define SBA_PRINT_OPERATIONS 160 #define SBA_PRINT_SIZE_G 161 #define SBA_PRINT_SIZE_SYZ 157 #define SBA_PRINT_ZERO_REDUCTIONS 0 58 #define SBA_PRINT_REDUCTION_STEPS 0 59 #define SBA_PRINT_OPERATIONS 0 60 #define SBA_PRINT_SIZE_G 0 61 #define SBA_PRINT_SIZE_SYZ 0 62 62 #define SBA_PRINT_PRODUCT_CRITERION 0 63 63 … … 1715 1715 for (int i=0; i<sort->length();++i) 1716 1716 F->m[i] = F1->m[(*sort)[i]-1]; 1717 #if 11717 #if F5DEBUG 1718 1718 printf("SBA COMPUTATIONS DONE IN THE FOLLOWING RING:\n"); 1719 1719 rWrite (currRing); … … 2056 2056 if(strat->sbaOrder != 1) 2057 2057 { 2058 BOOLEAN overwrite = TRUE;2058 BOOLEAN overwrite = FALSE; 2059 2059 for (int tk=0; tk<strat->sl+1; tk++) 2060 2060 { … … 2077 2077 strat->P.sevSig = pGetShortExpVector (strat->P.sig); 2078 2078 int i; 2079 LObject Q; 2079 2080 for(int ps=0;ps<strat->sl+1;ps++) 2080 2081 { … … 2090 2091 strat->syzmax += setmaxTinc; 2091 2092 } 2092 LObject Q;2093 2093 Q.sig = pCopy(strat->P.sig); 2094 2094 // add LM(F->m[i]) to the signature to get a Schreyer order … … 2117 2117 // deg - idx - lp/rp 2118 2118 // => we need to add syzygies with indices > pGetComp(strat->P.sig) 2119 /*2120 2119 if(strat->sbaOrder == 3) 2121 2120 { 2122 BOOLEAN overwrite = TRUE; 2123 for (int tk=0; tk<strat->sl+1; tk++) 2124 { 2125 if (pGetComp(strat->sig[tk]) == pGetComp(strat->P.sig)) 2126 { 2127 //printf("TK %d / %d\n",tk,strat->sl); 2128 overwrite = FALSE; 2129 break; 2130 } 2131 } 2132 //printf("OVERWRITE %d\n",overwrite); 2133 if (overwrite) 2134 { 2135 int cmp = pGetComp(strat->P.sig); 2136 int* vv = (int*)omAlloc((currRing->N+1)*sizeof(int)); 2137 pGetExpV (strat->P.p,vv); 2138 pSetExpV (strat->P.sig, vv); 2139 pSetComp (strat->P.sig,cmp); 2140 2141 strat->P.sevSig = pGetShortExpVector (strat->P.sig); 2142 for(int ps=0;ps<strat->sl+1;ps++) 2143 { 2144 int i = strat->syzl; 2145 2146 strat->newt = TRUE; 2147 if (strat->syzl == strat->syzmax) 2148 { 2149 pEnlargeSet(&strat->syz,strat->syzmax,setmaxTinc); 2150 strat->sevSyz = (unsigned long*) omRealloc0Size(strat->sevSyz, 2151 (strat->syzmax)*sizeof(unsigned long), 2152 ((strat->syzmax)+setmaxTinc) 2153 *sizeof(unsigned long)); 2154 strat->syzmax += setmaxTinc; 2155 } 2156 strat->syz[i] = pCopy(strat->P.sig); 2157 // add LM(F->m[i]) to the signature to get a Schreyer order 2158 // without changing the underlying polynomial ring at all 2159 if (strat->sbaOrder == 0) 2160 p_ExpVectorAdd (strat->syz[i],strat->S[ps],currRing); 2161 // since p_Add_q() destroys all input 2162 // data we need to recreate help 2163 // each time 2164 // ---------------------------------------------------------- 2165 // in the Schreyer order we always know that the multiplied 2166 // module monomial strat->P.sig gives the leading monomial of 2167 // the corresponding principal syzygy 2168 // => we do not need to compute the "real" syzygy completely 2169 poly help = pCopy(strat->sig[ps]); 2170 p_ExpVectorAdd (help,strat->P.p,currRing); 2171 strat->syz[i] = p_Add_q(strat->syz[i],help,currRing); 2172 //printf("%d. SYZ ",i+1); 2173 //pWrite(strat->syz[i]); 2174 strat->sevSyz[i] = p_GetShortExpVector(strat->syz[i],currRing); 2175 strat->syzl++; 2176 } 2177 } 2178 } 2179 */ 2121 int cmp = pGetComp(strat->P.sig); 2122 int max_cmp = IDELEMS(F); 2123 int* vv = (int*)omAlloc((currRing->N+1)*sizeof(int)); 2124 pGetExpV (strat->P.p,vv); 2125 LObject Q; 2126 int pos; 2127 for (int i=cmp+1; i<=max_cmp; ++i) { 2128 Q.sig = p_One(currRing); 2129 p_SetExpV(Q.sig, vv, currRing); 2130 p_SetComp(Q.sig, i, currRing); 2131 pos = posInSyz(strat, Q.sig); 2132 enterSyz(Q, strat, pos); 2133 } 2134 } 2180 2135 //#if 1 2181 2136 #if DEBUGF50 -
kernel/kutil.cc
rcda0b0 rd5856f 4639 4639 if (pLmCmp(strat->syz[strat->syzl-1],sig) != currRing->OrdSgn) 4640 4640 return strat->syzl; 4641 4642 4641 int i; 4643 4642 int an = 0; … … 5091 5090 for (int k=0; k<strat->syzl; k++) 5092 5091 { 5092 //printf("-%d",k); 5093 5093 //#if 1 5094 5094 #ifdef DEBUGF5 5095 Print("checking with: %d -- \n",k);5095 Print("checking with: %d / %d -- \n",k,strat->syzl); 5096 5096 pWrite(pHead(strat->syz[k])); 5097 5097 #endif … … 5102 5102 printf("DELETE!\n"); 5103 5103 #endif 5104 //printf("- T -\n\n"); 5104 5105 return TRUE; 5105 5106 } 5106 //k++;5107 }5107 } 5108 //printf("- F -\n\n"); 5108 5109 return FALSE; 5109 5110 } … … 5116 5117 //#if 1 5117 5118 #ifdef DEBUGF5 5118 Print(" syzygy criterion checks: ");5119 Print("--- syzygy criterion checks: "); 5119 5120 pWrite(sig); 5120 5121 #endif … … 5139 5140 for (int k=min; k<max; k++) 5140 5141 { 5141 #ifdef DEBUGF55142 #ifdef F5DEBUG 5142 5143 printf("COMP %d/%d - MIN %d - MAX %d - SYZL %ld\n",comp,strat->currIdx,min,max,strat->syzl); 5143 5144 Print("checking with: %d -- ",k); … … 5146 5147 if (p_LmShortDivisibleBy(strat->syz[k], strat->sevSyz[k], sig, not_sevSig, currRing)) 5147 5148 return TRUE; 5148 //k++;5149 5149 } 5150 5150 return FALSE; … … 6114 6114 strat->sevSyz = initsevS(ps); 6115 6115 strat->syz = (poly *)omAlloc(ps*sizeof(poly)); 6116 strat->syzl = strat->syzmax = ps; 6116 strat->syzmax = ps; 6117 strat->syzl = 0; 6117 6118 strat->syzidxmax = comp; 6118 6119 #if defined(DEBUGF5) || defined(DEBUGF51) … … 6152 6153 strat->syzIdx[j] = ctr; 6153 6154 j++; 6155 LObject Q; 6156 int pos; 6154 6157 for (k = 0; k<i; k++) 6155 6158 { 6156 poly p = pOne(); 6157 p_ExpVectorCopy(p,strat->S[k],currRing); 6158 strat->syz[ctr] = p; 6159 p_SetCompP (strat->syz[ctr], comp, currRing); 6160 poly q = p_Copy(p, currRing); 6159 Q.sig = pOne(); 6160 p_ExpVectorCopy(Q.sig,strat->S[k],currRing); 6161 p_SetCompP (Q.sig, comp, currRing); 6162 poly q = p_One(currRing); 6161 6163 p_ExpVectorCopy(q,strat->S[i],currRing); 6162 6164 q = p_Neg (q, currRing); 6163 6165 p_SetCompP (q, p_GetComp(strat->sig[k], currRing), currRing); 6164 strat->syz[ctr] = p_Add_q (strat->syz[ctr], q, currRing); 6165 #if defined(DEBUGF5) || defined(DEBUGF51) 6166 //#if 1 6167 printf(". . \n"); 6168 pWrite(strat->syz[ctr]); 6169 #endif 6170 strat->sevSyz[ctr] = p_GetShortExpVector(strat->syz[ctr],currRing); 6166 Q.sig = p_Add_q (Q.sig, q, currRing); 6167 Q.sevSig = p_GetShortExpVector(Q.sig,currRing); 6168 pos = posInSyz(strat, Q.sig); 6169 enterSyz(Q, strat, pos); 6171 6170 ctr++; 6172 6171 } … … 6194 6193 } 6195 6194 strat->syzIdx[j] = ctr; 6195 LObject Q; 6196 int pos; 6196 6197 for (k = 0; k<strat->sl+1; k++) 6197 6198 { 6198 poly p = pOne(); 6199 p_ExpVectorCopy(p,strat->S[k],currRing); 6200 strat->syz[ctr] = p; 6201 p_SetCompP (strat->syz[ctr], comp, currRing); 6202 poly q = p_Copy(p, currRing); 6199 Q.sig = pOne(); 6200 p_ExpVectorCopy(Q.sig,strat->S[k],currRing); 6201 p_SetCompP (Q.sig, comp, currRing); 6202 poly q = p_One(currRing); 6203 6203 p_ExpVectorCopy(q,strat->L[strat->Ll].p,currRing); 6204 6204 q = p_Neg (q, currRing); 6205 6205 p_SetCompP (q, p_GetComp(strat->sig[k], currRing), currRing); 6206 strat->syz[ctr] = p_Add_q (strat->syz[ctr], q, currRing); 6207 //#if 1 6208 #if DEBUGF5 || DEBUGF51 6209 printf(".."); 6210 pWrite(strat->syz[ctr]); 6211 #endif 6212 strat->sevSyz[ctr] = p_GetShortExpVector(strat->syz[ctr],currRing); 6206 Q.sig = p_Add_q (Q.sig, q, currRing); 6207 Q.sevSig = p_GetShortExpVector(Q.sig,currRing); 6208 pos = posInSyz(strat, Q.sig); 6209 enterSyz(Q, strat, pos); 6213 6210 ctr++; 6214 6211 } … … 6220 6217 printf("ps %d\n",ps); 6221 6218 Print("--------------------------------\n"); 6222 for(i=0;i<=ps-1;i++) 6223 { 6219 for(i=0;i<=strat->syzl-1;i++) 6220 { 6221 printf("%d - ",i); 6224 6222 pWrite(strat->syz[i]); 6223 } 6224 for(i=0;i<strat->currIdx;i++) 6225 { 6226 printf("%d - %d\n",i,strat->syzIdx[i]); 6225 6227 } 6226 6228 Print("--------------------------------\n"); … … 7233 7235 int i; 7234 7236 strat->newt = TRUE; 7235 if (strat->syzl == strat->syzmax )7237 if (strat->syzl == strat->syzmax-1) 7236 7238 { 7237 7239 pEnlargeSet(&strat->syz,strat->syzmax,setmaxTinc); … … 7242 7244 strat->syzmax += setmaxTinc; 7243 7245 } 7244 if (atT < strat->syzl -1)7246 if (atT < strat->syzl) 7245 7247 { 7246 7248 #ifdef ENTER_USE_MEMMOVE … … 7258 7260 } 7259 7261 } 7260 i = strat->syzl;7261 //i = atT;7262 strat->syz[ i] = p.sig;7263 strat->sevSyz[ i] = p.sevSig;7262 //i = strat->syzl; 7263 i = atT; 7264 strat->syz[atT] = p.sig; 7265 strat->sevSyz[atT] = p.sevSig; 7264 7266 strat->syzl++; 7265 #if def DEBUGF57266 Print(" last element in strat->syz: %d--%d ",i+1,strat->syzmax);7267 pWrite(strat->syz[ i]);7267 #if F5DEBUG 7268 Print("element in strat->syz: %d--%d ",atT+1,strat->syzmax); 7269 pWrite(strat->syz[atT]); 7268 7270 #endif 7269 7271 // recheck pairs in strat->L with new rule and delete correspondingly … … 7278 7280 cc--; 7279 7281 } 7282 //#if 1 7283 #ifdef DEBUGF5 7284 Print("--- Syzygies ---\n"); 7285 printf("syzl %d\n",strat->syzl); 7286 printf("syzmax %d\n",strat->syzmax); 7287 Print("--------------------------------\n"); 7288 for(i=0;i<=strat->syzl-1;i++) 7289 { 7290 printf("%d - ",i); 7291 pWrite(strat->syz[i]); 7292 } 7293 Print("--------------------------------\n"); 7294 #endif 7280 7295 } 7281 7296
Note: See TracChangeset
for help on using the changeset viewer.