Changeset e342a2 in git
- Timestamp:
- Oct 24, 2006, 11:45:22 AM (17 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 6e08adb429cbbf3773369df68b06629870822290
- Parents:
- 3a8d345bf7b5a2c27d4d61b0d414df5302626e75
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/kstd2.cc
r3a8d345 re342a2 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1.2 4 2006-10-17 16:17:53 SingularExp $ */4 /* $Id: kstd2.cc,v 1.25 2006-10-24 09:45:22 wienand Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 317 317 int j = 0; 318 318 int pass = 0; 319 poly zeroPoly ;319 poly zeroPoly = NULL; 320 320 321 321 // TODO warum SetpFDeg notwendig? … … 333 333 #ifdef HAVE_VANGB 334 334 zeroPoly = kFindDivisibleByZeroPoly(h); 335 #else336 zeroPoly = NULL;337 #endif338 335 if (zeroPoly != NULL) 339 336 { … … 358 355 } 359 356 else 357 #endif 360 358 { 361 359 j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h); … … 378 376 379 377 ksReducePoly(h, &(strat->T[j]), NULL, NULL, strat); 378 #ifdef HAVE_VANGB 380 379 if (zeroPoly != NULL) 381 380 { … … 383 382 strat->tl--; 384 383 } 384 #endif 385 385 386 386 #ifdef KDEBUG -
kernel/kutil.cc
r3a8d345 re342a2 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kutil.cc,v 1.3 3 2006-10-17 16:17:53 SingularExp $ */4 /* $Id: kutil.cc,v 1.34 2006-10-24 09:45:22 wienand Exp $ */ 5 5 /* 6 6 * ABSTRACT: kernel: utils for kStd … … 2090 2090 /* Helper for kCreateZeroPoly 2091 2091 * enumerating the exponents 2092 ring r = 2^2, (a, b, c), lp; ideal G0 = system("createG0"); ideal G = interred(G0); ncols(G0); ncols(G); 2092 2093 */ 2093 2094 2094 int nextZeroSimplexExponent (long exp[], long ind[], long cexp[], long cind[], long* cabsind, long bound, long N)2095 int nextZeroSimplexExponent (long exp[], long ind[], long cexp[], long cind[], long* cabsind, long step[], long bound, long N) 2095 2096 /* gives the next exponent from the set H_1 */ 2096 2097 { 2097 if (*cabsind < bound) 2098 long add = ind2(cexp[1] + 2); 2099 if ((*cabsind < bound) && (*cabsind - step[1] + add < bound)) 2098 2100 { 2099 2101 cexp[1] += 2; 2100 long add = ind2(cexp[1]);2101 2102 cind[1] += add; 2102 2103 *cabsind += add; … … 2111 2112 *cabsind -= cind[i]; 2112 2113 cind[i] = ind[i]; 2114 step[i] = 500000; 2113 2115 *cabsind += cind[i]; 2114 2116 // Print("in: %d\n", *cabsind); 2115 2117 i += 1; 2116 2118 if (i > N) return 0; 2119 do 2120 { 2121 step[1] = 500000; 2122 for (int j = i + 1; j <= N; j++) 2123 { 2124 if (step[1] > step[j]) step[1] = step[j]; 2125 } 2126 add = ind2(cexp[i] + 2); 2127 if (*cabsind - step[1] + add >= bound) 2128 { 2129 cexp[i] = exp[i]; 2130 *cabsind -= cind[i]; 2131 cind[i] = ind[i]; 2132 *cabsind += cind[i]; 2133 step[i] = 500000; 2134 i += 1; 2135 if (i > N) return 0; 2136 } 2137 else step[1] = -1; 2138 } while (step[1] != -1); 2139 step[1] = 500000; 2117 2140 cexp[i] += 2; 2118 long add = ind2(cexp[i]);2119 2141 cind[i] += add; 2120 2142 *cabsind += add; 2143 if (add < step[i]) step[i] = add; 2144 for (i = 2; i <= N; i++) 2145 { 2146 if (step[1] > step[i]) step[1] = step[i]; 2147 } 2121 2148 } 2122 2149 return 1; … … 2205 2232 long cabsind = 0; // The abs. index of cexp, i.e. the sum of cind 2206 2233 long habsind = 0; // The abs. index of the coefficient of h 2234 long step[50]; // The last increases 2207 2235 for (int i = 1; i <= currRing->N; i++) 2208 2236 { … … 2217 2245 cabsind += ind[i]; 2218 2246 cind[i] = ind[i]; 2219 } 2247 step[i] = 500000; 2248 } 2249 step[1] = 500000; 2220 2250 habsind = ind2((long) p_GetCoeff(p, currRing)); 2221 2251 long bound = currRing->ch - habsind; … … 2231 2261 if (cabsind == 0) 2232 2262 { 2233 if (!(nextZeroSimplexExponent(exp, ind, cexp, cind, &cabsind, bound, currRing->N)))2263 if (!(nextZeroSimplexExponent(exp, ind, cexp, cind, &cabsind, step, bound, currRing->N))) 2234 2264 { 2235 2265 return; … … 2251 2281 enterOneZeroPairRing(zeroPoly, t_p, p, ecart, strat, atR); 2252 2282 } 2253 while ( nextZeroSimplexExponent(exp, ind, cexp, cind, &cabsind, bound, currRing->N) );2283 while ( nextZeroSimplexExponent(exp, ind, cexp, cind, &cabsind, step, bound, currRing->N) ); 2254 2284 } 2255 2285 … … 2268 2298 long cabsind = 0; // The abs. index of cexp, i.e. the sum of cind 2269 2299 long habsind = 0; // The abs. index of the coefficient of h 2300 long step[50]; // The last increases 2270 2301 for (int i = 1; i <= currRing->N; i++) 2271 2302 { … … 2273 2304 cexp[i] = exp[i]; 2274 2305 ind[i] = 0; 2306 step[i] = 500000; 2275 2307 cind[i] = ind[i]; 2276 2308 } 2277 2309 long bound = currRing->ch; 2310 step[1] = 500000; 2278 2311 #ifdef OLI_DEBUG 2279 2312 PrintS("-------------\npoly :"); … … 2287 2320 if (cabsind == 0) 2288 2321 { 2289 if (!(nextZeroSimplexExponent(exp, ind, cexp, cind, &cabsind, bound, currRing->N)))2322 if (!(nextZeroSimplexExponent(exp, ind, cexp, cind, &cabsind, step, bound, currRing->N))) 2290 2323 { 2291 2324 return idInit(1, 1); … … 2311 2344 G0->m[IDELEMS(G0) - 1] = zeroPoly; 2312 2345 } 2313 while ( nextZeroSimplexExponent(exp, ind, cexp, cind, &cabsind, bound, currRing->N) );2346 while ( nextZeroSimplexExponent(exp, ind, cexp, cind, &cabsind, step, bound, currRing->N) ); 2314 2347 idSkipZeroes(G0); 2315 2348 return G0;
Note: See TracChangeset
for help on using the changeset viewer.