Changeset 1c473f in git
- Timestamp:
- Feb 24, 2008, 6:41:32 PM (15 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 4d43ff458adf4e30c9059ffaf846500aa5d64c61
- Parents:
- c1d4a79cef5604c9608af4eb2e48128ef65c70fb
- Location:
- kernel
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/kstd1.cc
rc1d4a79 r1c473f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd1.cc,v 1.3 2 2008-02-08 10:11:28 wienandExp $ */4 /* $Id: kstd1.cc,v 1.33 2008-02-24 17:41:31 levandov Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 1715 1715 r=bba(F,Q,NULL,hilb,strat); 1716 1716 } 1717 } 1718 #ifdef KDEBUG 1719 idTest(r); 1720 #endif 1721 if (toReset) 1722 { 1723 kModW = NULL; 1724 pRestoreDegProcs(pFDegOld, pLDegOld); 1725 } 1726 pLexOrder = b; 1727 //Print("%d reductions canceled \n",strat->cel); 1728 HCord=strat->HCord; 1729 delete(strat); 1730 if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w; 1731 return r; 1732 } 1733 1734 ideal kStdShift(ideal F, ideal Q, tHomog h,intvec ** w, intvec *hilb,int syzComp, 1735 int newIdeal, intvec *vw, int uptodeg, int lV) 1736 { 1737 ideal r; 1738 BOOLEAN b=pLexOrder,toReset=FALSE; 1739 BOOLEAN delete_w=(w==NULL); 1740 kStrategy strat=new skStrategy; 1741 1742 if(!TEST_OPT_RETURN_SB) 1743 strat->syzComp = syzComp; 1744 if (TEST_OPT_SB_1) 1745 strat->newIdeal = newIdeal; 1746 if (rField_has_simple_inverse()) 1747 strat->LazyPass=20; 1748 else 1749 strat->LazyPass=2; 1750 strat->LazyDegree = 1; 1751 strat->ak = idRankFreeModule(F); 1752 strat->kModW=kModW=NULL; 1753 strat->kHomW=kHomW=NULL; 1754 if (vw != NULL) 1755 { 1756 pLexOrder=FALSE; 1757 strat->kHomW=kHomW=vw; 1758 pFDegOld = pFDeg; 1759 pLDegOld = pLDeg; 1760 pSetDegProcs(kHomModDeg); 1761 toReset = TRUE; 1762 } 1763 if (h==testHomog) 1764 { 1765 if (strat->ak == 0) 1766 { 1767 h = (tHomog)idHomIdeal(F,Q); 1768 w=NULL; 1769 } 1770 else if (!TEST_OPT_DEGBOUND) 1771 { 1772 h = (tHomog)idHomModule(F,Q,w); 1773 } 1774 } 1775 pLexOrder=b; 1776 if (h==isHomog) 1777 { 1778 if (strat->ak > 0 && (w!=NULL) && (*w!=NULL)) 1779 { 1780 strat->kModW = kModW = *w; 1781 if (vw == NULL) 1782 { 1783 pFDegOld = pFDeg; 1784 pLDegOld = pLDeg; 1785 pSetDegProcs(kModDeg); 1786 toReset = TRUE; 1787 } 1788 } 1789 pLexOrder = TRUE; 1790 if (hilb==NULL) strat->LazyPass*=2; 1791 } 1792 strat->homog=h; 1793 #ifdef KDEBUG 1794 idTest(F); 1795 #endif 1796 if (pOrdSgn==-1) 1797 { 1798 /* error: no local ord yet with shifts */ 1799 Print("No local ordering possible for shifts"); 1800 return(NULL); 1801 } 1802 else 1803 { 1804 /* global ordering */ 1805 if (w!=NULL) 1806 r=bbaShift(F,Q,*w,hilb,strat,uptodeg,lV); 1807 else 1808 r=bbaShift(F,Q,NULL,hilb,strat,uptodeg,lV); 1717 1809 } 1718 1810 #ifdef KDEBUG -
kernel/kstd1.h
rc1d4a79 r1c473f 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: kstd1.h,v 1. 2 2007-07-25 10:53:15 SingularExp $ */6 /* $Id: kstd1.h,v 1.3 2008-02-24 17:41:31 levandov Exp $ */ 7 7 /* 8 8 * ABSTRACT … … 33 33 ideal kStd(ideal F, ideal Q, tHomog h, intvec ** mw,intvec *hilb=NULL, 34 34 int syzComp=0,int newIdeal=0, intvec *vw=NULL); 35 36 ideal kStdShift(ideal F, ideal Q, tHomog h,intvec ** w, intvec *hilb,int syzComp, 37 int newIdeal, intvec *vw, int uptodeg, int lVblock); 35 38 36 39 /* the following global data are defined in kutil.cc */ -
kernel/kstd2.cc
rc1d4a79 r1c473f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1.6 2 2008-02-23 20:12:51 levandov Exp $ */4 /* $Id: kstd2.cc,v 1.63 2008-02-24 17:41:31 levandov Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 1691 1691 } 1692 1692 1693 1693 1694 ideal freegb(ideal I, int uptodeg, int lVblock) 1694 1695 { … … 1698 1699 /* uptodeg and lVblock are correct - test them! */ 1699 1700 1700 kStrategy strat = new skStrategy;1701 // kStrategy strat = new skStrategy; 1701 1702 /* ideal bbaShift(ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat, int uptodeg, int lV) */ 1702 1703 /* at the moment: … … 1704 1705 - no *w, no *hilb 1705 1706 */ 1706 ideal RS = bbaShift(I,NULL, NULL, NULL, strat, uptodeg, lVblock); 1707 /* ideal F, ideal Q, tHomog h,intvec ** w, intvec *hilb,int syzComp, 1708 int newIdeal, intvec *vw) */ 1709 ideal RS = kStdShift(I,NULL, testHomog, NULL,NULL,0,0,NULL, uptodeg, lVblock); 1710 //bbaShift(I,NULL, NULL, NULL, strat, uptodeg, lVblock); 1707 1711 idSkipZeroes(RS); 1708 1712 return(RS); -
kernel/kutil.cc
rc1d4a79 r1c473f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kutil.cc,v 1.8 5 2008-02-23 20:12:52levandov Exp $ */4 /* $Id: kutil.cc,v 1.86 2008-02-24 17:41:31 levandov Exp $ */ 5 5 /* 6 6 * ABSTRACT: kernel: utils for kStd … … 4307 4307 Print("product criterion:%d chain criterion:%d\n",strat->cp,strat->c3); 4308 4308 if (hilbcount!=0) Print("hilbert series criterion:%d\n",hilbcount); 4309 /* in usual case strat->cv is 0, it gets changed only in shift routines */ 4310 if (strat->cv!=0) Print("shift V criterion:%d\n",strat->cv); 4309 4311 /*mflush();*/ 4310 4312 } … … 6170 6172 strat->cp = 0; 6171 6173 strat->c3 = 0; 6174 strat->cv = 0; 6172 6175 strat->tail = pInit(); 6173 6176 /*- set s -*/ … … 6244 6247 /* that is create the pairs (f, s \dot g) */ 6245 6248 6246 poly qq = strat->S[i]; // previously thought and now again: lm in currRing, tail in tailRing 6247 // elt's of S are compl. in currRing 6248 // previously thought: lm in currRing, tail in tailRing 6249 poly qq = strat->S[i]; // lm in currRing, tail in tailRing 6249 6250 6250 6251 // poly q = pCopy(pHead(strat->S[i])); // lm in currRing … … 6255 6256 /* hence, a total number of elt's to add is: */ 6256 6257 /* int toInsert = 1 + (uptodeg-1) - (pLastVblock(p.p, lV) -1); */ 6257 // int toInsert = uptodeg - pLastVblock(q, lV) +1;6258 6258 int toInsert = itoInsert(qq, uptodeg, lV, strat->tailRing); 6259 6259 … … 6286 6286 6287 6287 // for the 0th shift: insert the orig. pair 6288 6289 6288 enterOnePairShift(qq, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, j, i, uptodeg, lV); 6290 6289 6291 for (j=1; j<= toInsert; j++) // toIns - 1?6290 for (j=1; j<= toInsert; j++) 6292 6291 { 6293 6292 // q = pLPshift(strat->S[i],j,uptodeg,lV); … … 6296 6295 // s = p_LPshift(pNext(qq), j, uptodeg, lV, strat->tailRing); // from tailRing 6297 6296 // pNext(q) = s; // in tailRing 6298 // qq = pLPshift(q,j,uptodeg,lV); // need move6299 // ??? no move needed: in currRing6300 // qq = pMoveCurrTail2poly(qq,strat);6301 6297 /* here we need to call enterOnePair with two polys ... */ 6302 6298 … … 6313 6309 enterOnePairShift(q, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, j, i, uptodeg, lV); 6314 6310 } 6315 /* delete qq */6316 // pDelete(&qq);6317 6311 } 6318 6312 6319 6313 /*1 6320 6314 * put the pairs (sh \dot qq,p) into the set B, ecart=ecart(p) 6315 * despite the name, not only self shifts 6321 6316 */ 6322 6317 void enterOnePairSelfShifts (poly qq, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV) … … 6325 6320 /* format: p,qq are in LObject form: lm in CR, tail in TR */ 6326 6321 /* for true self pairs qq ==p */ 6327 /* we test both */6322 /* we test both qq and p */ 6328 6323 assume(p_LmCheckIsFromRing(qq,currRing)); 6329 6324 assume(p_CheckIsFromRing(pNext(qq),strat->tailRing)); … … 6333 6328 int j = 0; 6334 6329 6335 /* for such pairs start with 1, not with 0 */6330 /* for such self pairs start with 1, not with 0 */ 6336 6331 if (qq == p) j=1; 6337 6332 … … 6339 6334 /* that is create the pairs (f, s \dot g) */ 6340 6335 6341 /* determine how many elements we have to insert for a given s[i] */6342 /* x(0)y(1)z(2) : lastVblock-1=2, to add until lastVblock=uptodeg-1 */6343 /* hence, a total number of elt's to add is: */6344 /* int toInsert = 1 + (uptodeg-1) - (pLastVblock(p.p, lV) -1); */6345 6346 // poly q = pHead(qq); // lm in currRing6347 // pNext(q) = prCopyR(pNext(qq), strat->tailRing, currRing);6348 // pTest(q);6349 6350 6336 int toInsert = itoInsert(qq, uptodeg, lV, strat->tailRing); 6351 6337 … … 6357 6343 #endif 6358 6344 6359 // int toInsert = p_mLastVblock(qq, lV,currRing);6360 // if (pNext(qq) != NULL)6361 // {6362 // toInsert = si_max(toInsert, p_LastVblock(pNext(qq), lV,strat->tailRing) );6363 // }6364 // toInsert = uptodeg - toInsert +1;6365 6366 6345 poly q, s; 6367 6346 6368 // assume(i<=strat->sl); // from OnePair6369 6347 if (strat->interred_flag) return; // ? 6370 6348 … … 6373 6351 int qfromQ = 0; // strat->fromQ[i]; 6374 6352 6375 for (; j<= toInsert; j++) // toIns - 1?6353 for (; j<= toInsert; j++) 6376 6354 { 6377 6355 // q = pLPshift(strat->S[i],j,uptodeg,lV); … … 6383 6361 // s = p_LPshift(pNext(qq), j, uptodeg, lV, strat->tailRing); // from tailRing 6384 6362 // pNext(q) = s; // in tailRing 6385 //prMoveR(s,strat->tailRing,currRing); // in currRing6386 6363 /* here we need to call enterOnePair with two polys ... */ 6387 6364 #ifdef KDEBUG … … 6397 6374 enterOnePairShift(q, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, j, -1, uptodeg, lV); 6398 6375 } 6399 /* delete q? */6400 // pDelete(&q);6401 6376 } 6402 6377 … … 6407 6382 { 6408 6383 6409 /* New Format: q and p are like strat->P.p, so lm in CR, tail in TR */ 6410 /* Format: q is a poly compl. in currRing, p is like strat->P.p, so lm in CR, tail in TR */ 6384 /* Format: q and p are like strat->P.p, so lm in CR, tail in TR */ 6411 6385 6412 6386 /* check this Formats: */ 6413 // assume(p_CheckIsFromRing(q,currRing));6414 6387 assume(p_LmCheckIsFromRing(q,currRing)); 6415 6388 assume(p_CheckIsFromRing(pNext(q),strat->tailRing)); … … 6428 6401 #endif 6429 6402 6430 /* indeed we need LM only before real spoly */6431 6403 /* poly q stays for s[i], ecartq = ecart(q), qisFromQ = applies to q */ 6432 6404 … … 6435 6407 /* need additionally: int up_to_degree, poly V0 with the variables in (0) or just the number lV = the length of the first block */ 6436 6408 6437 // atR = -1;6438 // assume(i<=strat->sl); // satisfied automatically6439 6409 if (strat->interred_flag) return; 6440 6410 … … 6453 6423 6454 6424 /* apply the V criterion */ 6455 /* or do it in ManyShifts? */6456 6425 if (!isInV(Lp.lcm, lV)) 6457 6426 { … … 6468 6437 pLmFree(Lp.lcm); 6469 6438 Lp.lcm=NULL; 6439 /* + counter for applying the V criterion */ 6440 strat->cv++; 6470 6441 return; 6471 /* + add the counter for applying the V criterion */6472 /* like strat->cv */6473 6442 } 6474 6443 … … 6672 6641 /*- the pair (S[i],p) enters B -*/ 6673 6642 /* both of them should have their LM in currRing and TAIL in tailring */ 6674 Lp.p1 = q; // already converted with pMove2CurrTail(q,strat);6643 Lp.p1 = q; // already in the needed form 6675 6644 Lp.p2 = p; // already in the needed form 6676 6645 … … 6820 6789 /* int toInsert = 1 + (uptodeg-1) - (pLastVblock(p.p, lV) -1); */ 6821 6790 6822 // int toInsert = uptodeg - pLastVblock(pCopy(p.p), lV) +1;6823 // int toInsert = uptodeg - pLastVblock(p.p, lV) +1;6824 6825 6791 int toInsert = itoInsert(p.p, uptodeg, lV, strat->tailRing); 6826 6792 … … 6833 6799 atT = strat->posInT(strat->T, strat->tl, p); 6834 6800 6835 // LObject q;6836 // poly s;6837 6801 /* can call enterT in a sequence, e.g. */ 6838 6802 6839 /* first we create the 0th shift */6840 // q = p;6841 // if (q.t_p!=NULL)6842 // {6843 // q.p = pHead(s); // in currRing6844 // q.t_p = prMoveR(s, /* sourcering: */currRing, /* destring: */ strat->tailRing);6845 // if (pNext(q.t_p)!=NULL)6846 // {6847 // pNext(q.p)=pNext(q.t_p);6848 // }6849 // }6850 // else6851 // {6852 // q.p=s;6853 // }6854 6803 /* shift0 = it's our model for further shifts */ 6855 6804 enterT(p,strat,atT); … … 6861 6810 qq.t_p = p_LPshift(p.t_p, i, uptodeg, lV, strat->tailRing); // direct shift 6862 6811 qq.GetP(); 6863 /* shift p, that is create another LObject and shift its poly */6864 /* change: p.p, p.t_p, */6865 /* change: i_r (must be -1 because we're not yet in T ? */6866 // s = pLPshift(pCopyL2p(q,strat), i, uptodeg, lV); // deletes 1st arg, hence pCopy6867 // q.p = pLPshift(q.p, 1, uptodeg, lV);6868 // qq.p = pHead(s); // in currRing6869 // qq.t_p = prMoveR(s, /* sourcering: */currRing, /* destring: */ strat->tailRing);6870 // if (pNext(q.t_p)!=NULL)6871 // {6872 // pNext(q.p)=pNext(q.t_p);6873 // }6874 // }6875 // else6876 // {6877 // q.p=s;6878 // }6879 6812 // update q.sev 6880 6813 qq.sev = pGetShortExpVector(qq.p); … … 6884 6817 enterT(qq,strat,atT); 6885 6818 } 6886 6887 6819 /* Q: what to do with this one in the orig enterT ? */ 6888 6820 /* strat->R[strat->tl] = &(strat->T[atT]); */ -
kernel/kutil.h
rc1d4a79 r1c473f 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: kutil.h,v 1.3 3 2008-02-23 20:12:52 levandov Exp $ */6 /* $Id: kutil.h,v 1.34 2008-02-24 17:41:32 levandov Exp $ */ 7 7 /* 8 8 * ABSTRACT: kernel: utils for kStd … … 298 298 #endif 299 299 int cp,c3; 300 int cv; // in shift bases: counting V criterion 300 301 int sl,mu; 301 302 int tl,tmax; … … 649 650 650 651 ideal freegb(ideal I, int uptodeg, int lVblock); 651 #endif 652 653 ideal bbaShift(ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat, int uptodeg, int lV); 654 #endif -
kernel/shiftgb.cc
rc1d4a79 r1c473f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: shiftgb.cc,v 1. 5 2008-02-23 20:12:53levandov Exp $ */4 /* $Id: shiftgb.cc,v 1.6 2008-02-24 17:41:32 levandov Exp $ */ 5 5 /* 6 6 * ABSTRACT: kernel: utils for shift GB and free GB … … 370 370 } 371 371 372 /* there should be two routines: */ 373 /* 1. tests squarefreeness: in homog this suffices */ 374 /* 2. test the presence of a hole -> in the tail??? */ 372 375 373 376 int isInV(poly p, int lV) 374 377 { 378 375 379 if (lV <= 0) return(0); 376 380 /* returns 1 iff p is in V */ … … 431 435 // i = uptodeg - i +1; 432 436 i = uptodeg - i; 433 p_wrp(p,currRing,r); Print("----i:%d",i); PrintLn();437 // p_wrp(p,currRing,r); Print("----i:%d",i); PrintLn(); 434 438 return(i); 435 439 }
Note: See TracChangeset
for help on using the changeset viewer.