Changeset 5eb865 in git
- Timestamp:
- Jun 9, 2009, 8:21:50 PM (14 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- e4be351ada16eebdaa1e48ce01115ffc5287dbd3
- Parents:
- b82abb0dc3349df20acd8231f648b8ff51bc61b6
- Location:
- kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/kInline.cc
rb82abb r5eb865 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: kInline.cc,v 1.1 5 2009-03-18 16:56:02Singular Exp $9 * Version: $Id: kInline.cc,v 1.16 2009-06-09 18:21:50 Singular Exp $ 10 10 *******************************************************************/ 11 11 #ifndef KINLINE_CC … … 1086 1086 } 1087 1087 1088 #ifdef HAVE_RINGS 1089 KINLINE poly redtailBba_Z (poly p,int pos,kStrategy strat) 1090 { 1091 LObject L(p, currRing, strat->tailRing); 1092 return redtailBba_Z(&L, pos, strat); 1093 } 1094 #endif 1095 1088 1096 KINLINE poly redtailBba(TObject *T, int pos,kStrategy strat) 1089 1097 { -
kernel/kstd2.cc
rb82abb r5eb865 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1.8 7 2009-06-04 08:15:45Singular Exp $ */4 /* $Id: kstd2.cc,v 1.88 2009-06-09 18:21:50 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 1221 1221 if ((p!=NULL)&&((lazyReduce & KSTD_NF_LAZY)==0)) 1222 1222 { 1223 BITSET save=test;1224 test &= ~Sy_bit(OPT_INTSTRATEGY);1225 1223 if (TEST_OPT_PROT) { PrintS("t"); mflush(); } 1226 p = redtailBba(p,max_ind,strat,(lazyReduce & KSTD_NF_NONORM)==0); 1227 test=save; 1224 #ifdef HAVE_RINGS 1225 if (rField_is_Ring()) 1226 { 1227 p = redtailBba_Z(p,max_ind,strat); 1228 } 1229 else 1230 #endif 1231 { 1232 BITSET save=test; 1233 test &= ~Sy_bit(OPT_INTSTRATEGY); 1234 p = redtailBba(p,max_ind,strat,(lazyReduce & KSTD_NF_NONORM)==0); 1235 test=save; 1236 } 1228 1237 } 1229 1238 /*- release temp data------------------------------- -*/ … … 1277 1286 /*- compute------------------------------------------------------- -*/ 1278 1287 res=idInit(IDELEMS(q),si_max(q->rank,F->rank)); 1288 BITSET save=test; 1289 test &= ~Sy_bit(OPT_INTSTRATEGY); 1279 1290 for (i=IDELEMS(q)-1; i>=0; i--) 1280 1291 { … … 1285 1296 if ((p!=NULL)&&((lazyReduce & KSTD_NF_LAZY)==0)) 1286 1297 { 1287 BITSET save=test;1288 test &= ~Sy_bit(OPT_INTSTRATEGY);1289 1298 if (TEST_OPT_PROT) { PrintS("t"); mflush(); } 1290 p = redtailBba(p,max_ind,strat,(lazyReduce & KSTD_NF_NONORM)==0); 1291 test=save; 1299 #ifdef HAVE_RINGS 1300 if (rField_is_Ring()) 1301 { 1302 p = redtailBba_Z(p,max_ind,strat); 1303 } 1304 else 1305 #endif 1306 { 1307 p = redtailBba(p,max_ind,strat,(lazyReduce & KSTD_NF_NONORM)==0); 1308 } 1292 1309 } 1293 1310 res->m[i]=p; … … 1297 1314 } 1298 1315 /*- release temp data------------------------------- -*/ 1316 test=save; 1299 1317 omfree(strat->sevS); 1300 1318 omfree(strat->ecartS); -
kernel/kutil.cc
rb82abb r5eb865 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kutil.cc,v 1.14 3 2009-06-04 08:42:06Singular Exp $ */4 /* $Id: kutil.cc,v 1.144 2009-06-09 18:21:50 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: kernel: utils for kStd … … 4596 4596 return L->GetLmCurrRing(); 4597 4597 } 4598 4599 #ifdef HAVE_RINGS 4600 poly redtailBba_Z (LObject* L, int pos, kStrategy strat ) 4601 // normalize=FALSE, withT=FALSE, coeff=Z 4602 { 4603 strat->redTailChange=FALSE; 4604 if (strat->noTailReduction) return L->GetLmCurrRing(); 4605 poly h, p; 4606 p = h = L->GetLmTailRing(); 4607 if ((h==NULL) || (pNext(h)==NULL)) 4608 return L->GetLmCurrRing(); 4609 4610 TObject* With; 4611 // placeholder in case strat->tl < 0 4612 TObject With_s(strat->tailRing); 4613 4614 LObject Ln(pNext(h), strat->tailRing); 4615 Ln.pLength = L->GetpLength() - 1; 4616 4617 pNext(h) = NULL; 4618 if (L->p != NULL) pNext(L->p) = NULL; 4619 L->pLength = 1; 4620 4621 Ln.PrepareRed(strat->use_buckets); 4622 4623 int cnt=REDTAIL_CANONICALIZE; 4624 while(!Ln.IsNull()) 4625 { 4626 loop 4627 { 4628 Ln.SetShortExpVector(); 4629 With = kFindDivisibleByInS(strat, pos, &Ln, &With_s); 4630 if (With == NULL) break; 4631 cnt--; 4632 if (cnt==0) 4633 { 4634 cnt=REDTAIL_CANONICALIZE; 4635 poly tmp=Ln.CanonicalizeP(); 4636 } 4637 // we are in Z, do not Ccall pNorm 4638 strat->redTailChange=TRUE; 4639 // test divisibility of coefs: 4640 poly p_Ln=Ln.GetLmCurrRing(); 4641 poly p_With=With->GetLmCurrRing(); 4642 number z=nIntMod(pGetCoeff(p_Ln),pGetCoeff(p_With)); 4643 if (!nIsZero(z)) 4644 { 4645 // subtract z*Ln, add z.Ln to L 4646 poly m=pHead(p_Ln); 4647 pSetCoeff(m,z); 4648 poly mm=pHead(m); 4649 pNext(h) = m; 4650 pIter(h); 4651 L->pLength++; 4652 mm=pNeg(mm); 4653 if (Ln.bucket!=NULL) 4654 { 4655 int dummy=1; 4656 kBucket_Add_q(Ln.bucket,mm,&dummy); 4657 } 4658 else 4659 { 4660 if (Ln.p!=NULL) Ln.p=pAdd(Ln.p,mm); 4661 else if (Ln.t_p!=NULL) Ln.t_p=p_Add_q(Ln.t_p,mm,strat->tailRing); 4662 } 4663 } 4664 else 4665 nDelete(&z); 4666 4667 if (ksReducePolyTail(L, With, &Ln)) 4668 { 4669 // reducing the tail would violate the exp bound 4670 // set a flag and hope for a retry (in bba) 4671 strat->completeReduce_retry=TRUE; 4672 do 4673 { 4674 pNext(h) = Ln.LmExtractAndIter(); 4675 pIter(h); 4676 L->pLength++; 4677 } while (!Ln.IsNull()); 4678 goto all_done; 4679 } 4680 if (Ln.IsNull()) goto all_done; 4681 With_s.Init(currRing); 4682 } 4683 pNext(h) = Ln.LmExtractAndIter(); 4684 pIter(h); 4685 pNormalize(h); 4686 L->pLength++; 4687 } 4688 4689 all_done: 4690 Ln.Delete(); 4691 if (L->p != NULL) pNext(L->p) = pNext(p); 4692 4693 if (strat->redTailChange) 4694 { 4695 L->last = NULL; 4696 L->length = 0; 4697 } 4698 4699 //if (TEST_OPT_PROT) { PrintS("N"); mflush(); } 4700 //L->Normalize(); // HANNES: should have a test 4701 kTest_L(L); 4702 return L->GetLmCurrRing(); 4703 } 4704 #endif 4598 4705 4599 4706 /*2 -
kernel/kutil.h
rb82abb r5eb865 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: kutil.h,v 1.4 4 2009-05-06 12:53:48Singular Exp $ */6 /* $Id: kutil.h,v 1.45 2009-06-09 18:21:50 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: kernel: utils for kStd … … 401 401 LObject* L,const kStrategy strat); 402 402 KINLINE poly redtailBba (poly p,int pos,kStrategy strat,BOOLEAN normalize=FALSE); 403 #ifdef HAVE_RINGS 404 KINLINE poly redtailBba_Z (poly p,int pos,kStrategy strat); 405 poly redtailBba_Z (LObject* L, int pos, kStrategy strat ); 406 #endif 403 407 poly redtailBba (LObject *L, int pos,kStrategy strat, 404 408 BOOLEAN withT = FALSE,BOOLEAN normalize=FALSE);
Note: See TracChangeset
for help on using the changeset viewer.