Changeset 7ba059 in git
- Timestamp:
- Jul 24, 2007, 2:29:31 PM (17 years ago)
- Branches:
- (u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
- Children:
- 1dc959316eac2288bfe64889d2e83ce1d387c029
- Parents:
- 2f0941897d4f1406c4c4e8071399248a0e0b6e1c
- Location:
- kernel
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/kstd1.cc
r2f0941 r7ba059 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd1.cc,v 1.2 3 2007-07-23 14:41:33 motsakExp $ */4 /* $Id: kstd1.cc,v 1.24 2007-07-24 12:29:30 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 29 29 //#include "../Singular/ipid.h" 30 30 #include "timer.h" 31 32 #ifdef HAVE_PLURAL33 #include "sca.h"34 #endif35 31 36 32 //#include "ipprint.h" … … 2124 2120 #else 2125 2121 // old version 2126 2127 // NOTE: be carefull with Q in non-commutative case2128 // and with F in SCA case!2129 2122 ideal kInterRed (ideal F, ideal Q) 2130 2123 { 2131 #ifndef NDEBUG2132 idTest(F);2133 idTest(Q);2134 #endif2135 2136 2124 int j; 2137 2125 kStrategy strat = new skStrategy; 2138 2126 2139 2140 ideal tempF = F;2141 const ideal tempQ = Q;2142 2143 #ifdef HAVE_PLURAL2144 if(rIsSCA(currRing))2145 {2146 2147 const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);2148 const unsigned int m_iLastAltVar = scaLastAltVar(currRing);2149 tempF = id_KillSquares(F, m_iFirstAltVar, m_iLastAltVar, currRing);2150 2151 // this should be done on the upper level!!! :2152 // tempQ = currRing->nc->SCAQuotient();2153 }2154 #endif2155 2156 // assume(!rIsSCA(currRing));2157 2158 2127 // if (TEST_OPT_PROT) 2159 2128 // { … … 2164 2133 strat->kHEdgeFound = ppNoether != NULL; 2165 2134 strat->kNoether=pCopy(ppNoether); 2166 strat->ak = idRankFreeModule( tempF);2135 strat->ak = idRankFreeModule(F); 2167 2136 initBuchMoraCrit(strat); 2168 2137 strat->NotUsedAxis = (BOOLEAN *)omAlloc((pVariables+1)*sizeof(BOOLEAN)); … … 2178 2147 strat->sevT = initsevT(); 2179 2148 if (pOrdSgn == -1) strat->honey = TRUE; 2180 2181 2182 initS(tempF,tempQ,strat); 2183 2149 initS(F,Q,strat); 2184 2150 if (TEST_OPT_REDSB) 2185 2151 strat->noTailReduction=FALSE; … … 2220 2186 } 2221 2187 delete(strat); 2222 2223 if( F != tempF )2224 {2225 id_Delete( &tempF, currRing);2226 }2227 2228 2188 return shdl; 2229 2189 } -
kernel/kstd2.cc
r2f0941 r7ba059 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1. 49 2007-07-24 11:20:32Singular Exp $ */4 /* $Id: kstd2.cc,v 1.50 2007-07-24 12:29:30 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 101 101 #endif 102 102 (*max_ind)=ende; 103 loop 104 { 105 if (j > ende) return -1; 106 #if defined(PDEBUG) || defined(PDIV_DEBUG) 107 if (p_LmShortDivisibleBy(strat->S[j], strat->sevS[j], 108 p, not_sev, currRing)) 109 return j; 110 #else 111 if ( !(strat->sevS[j] & not_sev) && 112 p_LmDivisibleBy(strat->S[j], p, currRing)) 113 return j; 114 #endif 115 j++; 116 } 117 } 118 119 int kFindNextDivisibleByInS(const kStrategy strat, int start,int max_ind, LObject* L) 120 { 121 unsigned long not_sev = ~L->sev; 122 poly p = L->GetLmCurrRing(); 123 int j = start; 124 125 pAssume(~not_sev == p_GetShortExpVector(p, currRing)); 126 #if 1 127 int ende=max_ind; 128 #else 129 int ende=strat->sl; 130 #endif 103 131 loop 104 132 { … … 995 1023 if (j>=0) 996 1024 { 1025 int sl=pSize(strat->S[j]); 1026 int jj; 1027 loop 1028 { 1029 int sll; 1030 jj=kFindNextDivisibleByInS(strat,j+1,max_ind,&P); 1031 if (jj<0) break; 1032 sll=pSize(strat->S[jj]); 1033 if (sll<sl) 1034 { 1035 j=jj; 1036 sl=sll; 1037 } 1038 } 997 1039 if (!nIsOne(pGetCoeff(strat->S[j]))) 998 1040 { 999 1000 1041 pNorm(strat->S[j]); 1042 //if (TEST_OPT_PROT) { PrintS("n"); mflush(); } 1001 1043 } 1002 1044 nNormalize(pGetCoeff(P.p)); … … 1616 1658 if ((!TEST_OPT_IDLIFT) || (pGetComp(strat->P.p) <= strat->syzComp)) 1617 1659 { 1618 1660 strat->enterS(strat->P, pos, strat, strat->tl); 1619 1661 } 1620 1662 else -
kernel/kutil.h
r2f0941 r7ba059 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: kutil.h,v 1.2 6 2007-07-24 11:20:32Singular Exp $ */6 /* $Id: kutil.h,v 1.27 2007-07-24 12:29:31 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: kernel: utils for kStd … … 451 451 int kFindDivisibleByInS(const kStrategy strat, int *max_ind, LObject* L); 452 452 453 int kFindNextDivisibleByInS(const kStrategy strat, int start,int max_ind, LObject* L); 453 454 TObject* 454 455 kFindDivisibleByInS(kStrategy strat, int pos, LObject* L, TObject *T, -
kernel/longalg.cc
r2f0941 r7ba059 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: longalg.cc,v 1.2 8 2007-07-03 14:45:56Singular Exp $ */4 /* $Id: longalg.cc,v 1.29 2007-07-24 12:29:31 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: algebraic numbers … … 1717 1717 void naNormalize(number &pp) 1718 1718 { 1719 1720 1719 //naTest(pp); // input may not be "normal" 1721 1720 lnumber p = (lnumber)pp; … … 1726 1725 napoly x = p->z; 1727 1726 napoly y = p->n; 1728 if ((y!=NULL) && (naMinimalPoly!=NULL)) 1729 { 1730 y = napInvers(y, naMinimalPoly); 1731 x = napMult(x, y); 1732 if (napGetExp(x,1) >= napGetExp(naMinimalPoly,1)) 1727 if (naMinimalPoly!=NULL) 1728 { 1729 if (y!=NULL) 1730 { 1731 y = napInvers(y, naMinimalPoly); 1732 x = napMult(x, y); 1733 if (napGetExp(x,1) >= napGetExp(naMinimalPoly,1)) 1734 x = napRemainder(x, naMinimalPoly); 1735 p->z = x; 1736 p->n = y = NULL; 1737 } 1738 /* check for degree of x too high: */ 1739 if ((x!=NULL) && (x!=naMinimalPoly) 1740 && (napGetExp(x,1)>napGetExp(naMinimalPoly,1))) 1741 // DO NOT REDUCE naMinimalPoly with itself 1742 { 1733 1743 x = napRemainder(x, naMinimalPoly); 1734 p->z = x; 1735 p->n = y = NULL; 1736 } 1737 /* check for degree of x too high: */ 1738 if ((x!=NULL) && (naMinimalPoly!=NULL) && (x!=naMinimalPoly) 1739 && (napGetExp(x,1)>napGetExp(naMinimalPoly,1))) 1740 // DO NOT REDUCE naMinimalPoly with itself 1741 { 1742 x = napRemainder(x, naMinimalPoly); 1743 p->z = x; 1744 p->z = x; 1745 } 1744 1746 } 1745 1747 /* normalize all coefficients in n and z (if in Q) */ … … 1881 1883 if (nacIsOne(napGetCoeff(y))) 1882 1884 { 1883 if (nap GetExp(y,1)==0)1885 if (napIsConstant(y)) 1884 1886 { 1885 1887 napDelete1(&y); … … 1905 1907 napDelete(&x); 1906 1908 napDelete(&y); 1909 x=xx; 1910 y=yy; 1911 if (napNext(y)==NULL) 1912 { 1913 if(!nacGreaterZero(napGetCoeff(y))) 1914 { 1915 x=napNeg(x); 1916 y=napNeg(y); 1917 } 1918 if (nacIsOne(napGetCoeff(y))) 1919 { 1920 if (napIsConstant(y)) 1921 { 1922 napDelete1(&y); 1923 p->n = NULL; 1924 } 1925 naTest(pp); 1926 return; 1927 } 1928 } 1907 1929 } 1908 1930 } -
kernel/polys.cc
r2f0941 r7ba059 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: polys.cc,v 1.2 5 2007-07-23 14:11:04 motsakExp $ */4 /* $Id: polys.cc,v 1.26 2007-07-24 12:29:31 Singular Exp $ */ 5 5 6 6 /* … … 765 765 { 766 766 c=nDiv(pGetCoeff(h),k); 767 if (!nIsOne(c)) nNormalize(c); 767 // no need to normalize: Z/p, R 768 // normalize already in nDiv: Q_a, Z/p_a 769 // remains: Q 770 if (rField_is_Q() && (!nIsOne(c))) nNormalize(c); 768 771 pSetCoeff(h,c); 769 772 pIter(h); … … 1038 1041 return FALSE; 1039 1042 } 1043 1044 int pSize(poly p) 1045 { 1046 int count = 0; 1047 while ( p != NULL ) 1048 { 1049 count+= nSize( pGetCoeff( p ) ); 1050 pIter( p ); 1051 } 1052 return count; 1053 } 1054 -
kernel/polys.h
r2f0941 r7ba059 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: polys.h,v 1.1 1 2007-06-20 09:39:24 wienandExp $ */6 /* $Id: polys.h,v 1.12 2007-07-24 12:29:31 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT - all basic methods to manipulate polynomials of the … … 373 373 void p_Normalize(poly p, ring r); 374 374 #define pNormalize(p) p_Normalize(p,currRing) 375 int pSize( poly p ); 376 375 377 376 378 // homogenizes p by multiplying certain powers of the varnum-th variable
Note: See TracChangeset
for help on using the changeset viewer.