Changeset a6889e in git
- Timestamp:
- Jan 16, 2006, 4:27:10 AM (18 years ago)
- Branches:
- (u'spielwiese', '2fa36c576e6a4ddbb1093b43c7f8e9835e17e52a')
- Children:
- 2be0b378a350d61f44d0245309b730d0dc823681
- Parents:
- c6022d8f25317f2f6b7390478a1df53933e9e351
- Location:
- kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/kstd2.cc
rc6022d ra6889e 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1. 5 2006-01-13 18:10:04wienand Exp $ */4 /* $Id: kstd2.cc,v 1.6 2006-01-16 03:27:10 wienand Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 172 172 } 173 173 174 poly kFind DivisibleByZeroPoly(LObject* h) {174 poly kFindZeroPoly(poly input_p, ring leadRing, ring tailRing) { 175 175 // m = currRing->ch 176 177 if (input_p == NULL) return NULL; 176 178 177 179 int k_ind2 = 0; 178 180 int a_ind2 = 0; 179 181 180 poly p = h->GetLmCurrRing();182 poly p = input_p; 181 183 poly zeroPoly = NULL; 182 184 long a = (long) pGetCoeff(p); … … 188 190 } 189 191 190 for (int i = 1; i <= currRing->N; i++) {192 for (int i = 1; i <= leadRing->N; i++) { 191 193 a = factorial(pGetExp(p, i)); 192 194 k = k * a; … … 200 202 number tmp1; 201 203 poly tmp2, tmp3; 202 if ( currRing->ch <= k_ind2 + a_ind2) {203 zeroPoly = p_ISet(a, h->tailRing);204 for (int i = 1; i <= currRing->N; i++) {204 if (leadRing->ch <= k_ind2 + a_ind2) { 205 zeroPoly = p_ISet(a, tailRing); 206 for (int i = 1; i <= leadRing->N; i++) { 205 207 for (long j = 1; j <= pGetExp(p, i); j++) { 206 208 tmp1 = nInit(j); 207 tmp2 = p_ISet(1, h->tailRing);208 p_SetExp(tmp2, i, 1, h->tailRing);209 p_Setm(tmp2, h->tailRing);209 tmp2 = p_ISet(1, tailRing); 210 p_SetExp(tmp2, i, 1, tailRing); 211 p_Setm(tmp2, tailRing); 210 212 if (nIsZero(tmp1)) { 211 zeroPoly = p_Mult_q(zeroPoly, tmp2, h->tailRing);213 zeroPoly = p_Mult_q(zeroPoly, tmp2, tailRing); 212 214 } 213 215 else { 214 tmp3 = p_ISet((long) tmp1, h->tailRing);215 zeroPoly = p_Mult_q(zeroPoly, p_Add_q(tmp2, tmp3, h->tailRing), h->tailRing);216 tmp3 = p_ISet((long) tmp1, tailRing); 217 zeroPoly = p_Mult_q(zeroPoly, p_Add_q(tmp2, tmp3, tailRing), tailRing); 216 218 } 217 219 } 218 220 } 219 zeroPoly = p_LmDeleteAndNext(zeroPoly, h->tailRing);221 zeroPoly = p_LmDeleteAndNext(zeroPoly, tailRing); 220 222 tmp2 = pISet(a); 221 for (int i = 1; i <= currRing->N; i++) {223 for (int i = 1; i <= leadRing->N; i++) { 222 224 pSetExp(tmp2, i, pGetExp(p, i)); 223 225 } … … 226 228 return tmp2; 227 229 } 228 if ( currRing->ch - k_ind2 <= a_ind2) {230 if (leadRing->ch - k_ind2 <= a_ind2) { 229 231 PrintS("Case not implented yet !!!"); PrintLn(); 230 232 PrintS("But it should not mae any difference."); PrintLn(); … … 232 234 } 233 235 return NULL; 236 } 237 238 poly kFindDivisibleByZeroPoly(LObject* h) { 239 return kFindZeroPoly(h->GetLmCurrRing(), currRing, h->tailRing); 234 240 } 235 241 … … 241 247 if (h->p == NULL && h->t_p == NULL) return 0; // spoly is zero (can only occure with zero divisors) 242 248 243 if (strat->tl<0) return 1;249 // if (strat->tl<0) return 1; 244 250 int at,d,i; 245 251 int j = 0; … … 262 268 loop 263 269 { 264 zeroPoly = NULL; //kFindDivisibleByZeroPoly(h);270 zeroPoly = kFindDivisibleByZeroPoly(h); 265 271 if (zeroPoly != NULL) { 266 272 #ifdef KDEBUG 267 273 if (TEST_OPT_DEBUG) 268 274 { 275 PrintS("zero poly created: "); 276 wrp(zeroPoly); 277 PrintLn(); 269 278 PrintS("zero red:"); 270 279 } -
kernel/kutil.h
rc6022d ra6889e 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: kutil.h,v 1. 9 2006-01-13 18:10:05wienand Exp $ */6 /* $Id: kutil.h,v 1.10 2006-01-16 03:27:10 wienand Exp $ */ 7 7 /* 8 8 * ABSTRACT: kernel: utils for kStd … … 504 504 * 505 505 ***************************************************************/ 506 poly kFindZeroPoly(poly input_p, ring leadRing, ring tailRing); 506 507 ideal bba (ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat); 507 508 poly kNF2 (ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce); -
kernel/ringgb.cc
rc6022d ra6889e 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ringgb.cc,v 1. 3 2006-01-13 18:10:05wienand Exp $ */4 /* $Id: ringgb.cc,v 1.4 2006-01-16 03:27:10 wienand Exp $ */ 5 5 /* 6 6 * ABSTRACT: ringgb interface … … 30 30 31 31 poly reduce_poly_fct(poly p, ring r) { 32 return NULL;32 return kFindZeroPoly(p, r, r); 33 33 } 34 34 -
kernel/rmodulo2m.cc
rc6022d ra6889e 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: rmodulo2m.cc,v 1. 2 2006-01-13 18:10:06wienand Exp $ */4 /* $Id: rmodulo2m.cc,v 1.3 2006-01-16 03:27:10 wienand Exp $ */ 5 5 /* 6 6 * ABSTRACT: numbers modulo 2^m … … 244 244 nr2mModul=0; 245 245 } 246 PrintS("Modul: ");247 Print("%d\n", nr2mModul);246 // PrintS("Modul: "); 247 // Print("%d\n", nr2mModul); 248 248 } 249 249
Note: See TracChangeset
for help on using the changeset viewer.