Changeset 3cc89c in git
- Timestamp:
- Jun 1, 2015, 12:19:52 PM (8 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- dd52bad670674af5262a9ad0f203b628a7a36a0e
- Parents:
- f7f34606f7ff04570296a86535c421167f902351
- Location:
- kernel/GBEngine
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/GBEngine/kstd1.cc
rf7f346 r3cc89c 1643 1643 { 1644 1644 WerrorS("expoent overflow - wrong ordering"); 1645 1645 return(idInit(1,1)); 1646 1646 } 1647 1647 // set ecart -- might have changed because of tail reductions … … 2094 2094 strat->LazyPass=2; 2095 2095 strat->LazyDegree = 1; 2096 strat->enterOnePair=enterOnePairNormal;2097 strat->chainCrit=chainCritNormal;2098 2096 strat->ak = id_RankFreeModule(F,currRing); 2099 2097 strat->kModW=kModW=NULL; -
kernel/GBEngine/kutil.cc
rf7f346 r3cc89c 1172 1172 LObject Lp; 1173 1173 1174 if (strat->interred_flag) return;1175 1174 #ifdef KDEBUG 1176 1175 Lp.ecart=0; Lp.length=0; … … 1492 1491 { 1493 1492 assume(i<=strat->sl); 1494 if (strat->interred_flag) return;1495 1493 1496 1494 int l,j,compare; … … 1777 1775 } 1778 1776 1777 /// p_HasNotCF for the IDLIFT case: ignore component 1778 static BOOLEAN p_HasNotCF_Lift(poly p1, poly p2, const ring r) 1779 { 1780 int i = rVar(r); 1781 loop 1782 { 1783 if ((p_GetExp(p1, i, r) > 0) && (p_GetExp(p2, i, r) > 0)) 1784 return FALSE; 1785 i--; 1786 if (i == 0) 1787 return TRUE; 1788 } 1789 } 1790 1791 /*2 1792 * put the pair (s[i],p) into the set B, ecart=ecart(p) for idLift(I,T) 1793 */ 1794 1795 void enterOnePairLift (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR = -1) 1796 { 1797 assume(ALLOW_PROD_CRIT(strat)); 1798 assume(!rIsPluralRing(currRing)); 1799 assume(strat->syzComp==1); 1800 assume(i<=strat->sl); 1801 1802 int l,j,compare; 1803 LObject Lp; 1804 Lp.i_r = -1; 1805 1806 #ifdef KDEBUG 1807 Lp.ecart=0; Lp.length=0; 1808 #endif 1809 /*- computes the lcm(s[i],p) -*/ 1810 Lp.lcm = pInit(); 1811 1812 pLcm(p,strat->S[i],Lp.lcm); 1813 pSetm(Lp.lcm); 1814 1815 if (strat->sugarCrit) 1816 { 1817 if((!((strat->ecartS[i]>0)&&(ecart>0))) 1818 && p_HasNotCF_Lift(p,strat->S[i],currRing)) 1819 { 1820 /* 1821 *the product criterion has applied for (s,p), 1822 *i.e. lcm(s,p)=product of the leading terms of s and p. 1823 *Suppose (s,r) is in L and the leading term 1824 *of p divides lcm(s,r) 1825 *(==> the leading term of p divides the leading term of r) 1826 *but the leading term of s does not divide the leading term of r 1827 *(notice that tis condition is automatically satisfied if r is still 1828 *in S), then (s,r) can be cancelled. 1829 *This should be done here because the 1830 *case lcm(s,r)=lcm(s,p) is not covered by chainCrit. 1831 * 1832 *Moreover, skipping (s,r) holds also for the noncommutative case. 1833 */ 1834 strat->cp++; 1835 pLmFree(Lp.lcm); 1836 Lp.lcm=NULL; 1837 return; 1838 } 1839 else 1840 Lp.ecart = si_max(ecart,strat->ecartS[i]); 1841 if (strat->fromT && (strat->ecartS[i]>ecart)) 1842 { 1843 pLmFree(Lp.lcm); 1844 Lp.lcm=NULL; 1845 return; 1846 /*the pair is (s[i],t[.]), discard it if the ecart is too big*/ 1847 } 1848 /* 1849 *the set B collects the pairs of type (S[j],p) 1850 *suppose (r,p) is in B and (s,p) is the new pair and lcm(s,p)#lcm(r,p) 1851 *if the leading term of s devides lcm(r,p) then (r,p) will be canceled 1852 *if the leading term of r devides lcm(s,p) then (s,p) will not enter B 1853 */ 1854 { 1855 j = strat->Bl; 1856 loop 1857 { 1858 if (j < 0) break; 1859 compare=pDivComp(strat->B[j].lcm,Lp.lcm); 1860 if ((compare==1) 1861 &&(sugarDivisibleBy(strat->B[j].ecart,Lp.ecart))) 1862 { 1863 strat->c3++; 1864 if ((strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0)) 1865 { 1866 pLmFree(Lp.lcm); 1867 return; 1868 } 1869 break; 1870 } 1871 else 1872 if ((compare ==-1) 1873 && sugarDivisibleBy(Lp.ecart,strat->B[j].ecart)) 1874 { 1875 deleteInL(strat->B,&strat->Bl,j,strat); 1876 strat->c3++; 1877 } 1878 j--; 1879 } 1880 } 1881 } 1882 else /*sugarcrit*/ 1883 { 1884 if(/*(strat->ak==0) && productCrit(p,strat->S[i])*/ 1885 p_HasNotCF_Lift(p,strat->S[i],currRing)) 1886 { 1887 /* 1888 *the product criterion has applied for (s,p), 1889 *i.e. lcm(s,p)=product of the leading terms of s and p. 1890 *Suppose (s,r) is in L and the leading term 1891 *of p devides lcm(s,r) 1892 *(==> the leading term of p devides the leading term of r) 1893 *but the leading term of s does not devide the leading term of r 1894 *(notice that tis condition is automatically satisfied if r is still 1895 *in S), then (s,r) can be canceled. 1896 *This should be done here because the 1897 *case lcm(s,r)=lcm(s,p) is not covered by chainCrit. 1898 */ 1899 strat->cp++; 1900 pLmFree(Lp.lcm); 1901 Lp.lcm=NULL; 1902 return; 1903 } 1904 if (strat->fromT && (strat->ecartS[i]>ecart)) 1905 { 1906 pLmFree(Lp.lcm); 1907 Lp.lcm=NULL; 1908 return; 1909 /*the pair is (s[i],t[.]), discard it if the ecart is too big*/ 1910 } 1911 /* 1912 *the set B collects the pairs of type (S[j],p) 1913 *suppose (r,p) is in B and (s,p) is the new pair and lcm(s,p)#lcm(r,p) 1914 *if the leading term of s devides lcm(r,p) then (r,p) will be canceled 1915 *if the leading term of r devides lcm(s,p) then (s,p) will not enter B 1916 */ 1917 for(j = strat->Bl;j>=0;j--) 1918 { 1919 compare=pDivComp(strat->B[j].lcm,Lp.lcm); 1920 if (compare==1) 1921 { 1922 strat->c3++; 1923 if ((strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0)) 1924 { 1925 pLmFree(Lp.lcm); 1926 return; 1927 } 1928 break; 1929 } 1930 else 1931 if (compare ==-1) 1932 { 1933 deleteInL(strat->B,&strat->Bl,j,strat); 1934 strat->c3++; 1935 } 1936 } 1937 } 1938 /* 1939 *the pair (S[i],p) enters B if the spoly != 0 1940 */ 1941 /*- compute the short s-polynomial -*/ 1942 if (strat->fromT && !TEST_OPT_INTSTRATEGY) 1943 pNorm(p); 1944 1945 if ((strat->S[i]==NULL) || (p==NULL)) 1946 return; 1947 1948 if ((strat->fromQ!=NULL) && (isFromQ!=0) && (strat->fromQ[i]!=0)) 1949 Lp.p=NULL; 1950 else 1951 { 1952 assume(!rIsPluralRing(currRing)); 1953 Lp.p = ksCreateShortSpoly(strat->S[i], p, strat->tailRing); 1954 } 1955 if (Lp.p == NULL) 1956 { 1957 /*- the case that the s-poly is 0 -*/ 1958 if (strat->pairtest==NULL) initPairtest(strat); 1959 strat->pairtest[i] = TRUE;/*- hint for spoly(S^[i],p)=0 -*/ 1960 strat->pairtest[strat->sl+1] = TRUE; 1961 /*hint for spoly(S[i],p) == 0 for some i,0 <= i <= sl*/ 1962 /* 1963 *suppose we have (s,r),(r,p),(s,p) and spoly(s,p) == 0 and (r,p) is 1964 *still in B (i.e. lcm(r,p) == lcm(s,p) or the leading term of s does not 1965 *devide lcm(r,p)). In the last case (s,r) can be canceled if the leading 1966 *term of p devides the lcm(s,r) 1967 *(this canceling should be done here because 1968 *the case lcm(s,p) == lcm(s,r) is not covered in chainCrit) 1969 *the first case is handeled in chainCrit 1970 */ 1971 if (Lp.lcm!=NULL) pLmFree(Lp.lcm); 1972 } 1973 else 1974 { 1975 /*- the pair (S[i],p) enters B -*/ 1976 Lp.p1 = strat->S[i]; 1977 Lp.p2 = p; 1978 1979 pNext(Lp.p) = strat->tail; // !!! 1980 1981 if (atR >= 0) 1982 { 1983 Lp.i_r1 = strat->S_2_R[i]; 1984 Lp.i_r2 = atR; 1985 } 1986 else 1987 { 1988 Lp.i_r1 = -1; 1989 Lp.i_r2 = -1; 1990 } 1991 strat->initEcartPair(&Lp,strat->S[i],p,strat->ecartS[i],ecart); 1992 1993 if (TEST_OPT_INTSTRATEGY) 1994 { 1995 nDelete(&(Lp.p->coef)); 1996 } 1997 1998 l = strat->posInL(strat->B,strat->Bl,&Lp,strat); 1999 enterL(&strat->B,&strat->Bl,&strat->Bmax,Lp,l); 2000 } 2001 } 2002 1779 2003 /*2 1780 2004 * put the pair (s[i],p) into the set B, ecart=ecart(p) … … 1789 2013 { 1790 2014 assume(i<=strat->sl); 1791 if (strat->interred_flag) return;1792 2015 1793 2016 int l; … … 3077 3300 LObject Lp; 3078 3301 3079 if (strat->interred_flag) return;3080 3302 #ifdef KDEBUG 3081 3303 Lp.ecart=0; Lp.length=0; … … 7356 7578 } 7357 7579 #endif 7580 if (TEST_OPT_IDLIFT /* i.e. also strat->syzComp==1 */ 7581 && (!rIsPluralRing(currRing)) 7582 strat->enterOnePair=enterOnePairLift; 7583 7358 7584 7359 7585 strat->sugarCrit = TEST_OPT_SUGARCRIT; … … 9181 9407 9182 9408 assume(i<=strat->sl); // from OnePair 9183 if (strat->interred_flag) return; // ?9184 9409 9185 9410 /* these vars hold for all shifts of s[i] */ … … 9260 9485 9261 9486 poly q; 9262 9263 if (strat->interred_flag) return; // ?9264 9487 9265 9488 /* these vars hold for all shifts of s[i] */ … … 9320 9543 9321 9544 /* need additionally: int up_to_degree, poly V0 with the variables in (0) or just the number lV = the length of the first block */ 9322 9323 if (strat->interred_flag) return;9324 9545 9325 9546 int l,j,compare; -
kernel/GBEngine/kutil.h
rf7f346 r3cc89c 377 377 BOOLEAN posInLOldFlag; 378 378 BOOLEAN use_buckets; 379 BOOLEAN interred_flag;380 379 // if set, pLDeg(p, l) == (pFDeg(pLast(p), pLength) 381 380 BOOLEAN LDegLast; … … 541 540 void kFreeStrat(kStrategy strat); 542 541 void enterOnePairNormal (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR); 542 void enterOnePairLift (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR); 543 543 void enterOnePairSig (int i,poly p,poly pSig,int ecart, int isFromQ,kStrategy strat, int atR); 544 544 void chainCritNormal (poly p,int ecart,kStrategy strat);
Note: See TracChangeset
for help on using the changeset viewer.