Changeset a725dae in git
- Timestamp:
- Jan 22, 2006, 5:29:37 AM (18 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 76a71142ba90e62cb5e72eedf1029c5f98235e46
- Parents:
- 7f06ccaffa6e5a520078549a3e37d7d51d338274
- Location:
- kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/kstd2.cc
r7f06cca ra725dae 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1. 8 2006-01-20 01:15:07 wienand Exp $ */4 /* $Id: kstd2.cc,v 1.9 2006-01-22 04:29:37 wienand Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 164 164 */ 165 165 166 /* now in kutil.cc 166 167 long twoPow(long arg) { 167 168 long t = arg; … … 173 174 return result; 174 175 } 176 */ 175 177 176 178 long factorial(long arg) … … 242 244 tmp2 = p_ISet((long) pGetCoeff(zeroPoly), leadRing); 243 245 for (int i = 1; i <= leadRing->N; i++) { 244 pSetExp(tmp2, i, p_GetExp(zeroPoly, i, leadRing));246 pSetExp(tmp2, i, p_GetExp(zeroPoly, i, tailRing)); 245 247 } 246 248 p_Setm(tmp2, leadRing); … … 269 271 tmp2 = p_ISet((long) pGetCoeff(zeroPoly), leadRing); 270 272 for (int i = 1; i <= leadRing->N; i++) { 271 pSetExp(tmp2, i, p_GetExp(zeroPoly, i, leadRing));273 pSetExp(tmp2, i, p_GetExp(zeroPoly, i, tailRing)); 272 274 } 273 275 p_Setm(tmp2, leadRing); … … 311 313 //#endif 312 314 313 h->SetShortExpVector(); 315 h->SetShortExpVector(); 314 316 loop 315 317 { 316 zeroPoly = NULL;//kFindDivisibleByZeroPoly(h);318 zeroPoly = kFindDivisibleByZeroPoly(h); 317 319 if (zeroPoly != NULL) 318 320 { 321 if (TEST_OPT_PROT) 322 { 323 PrintS("z"); 324 } 319 325 #ifdef KDEBUG 320 326 if (TEST_OPT_DEBUG) … … 331 337 tmp_h.sev = pGetShortExpVector(tmp_h.p); 332 338 tmp_h.SetpFDeg(); 339 /* if (TEST_OPT_PROT) 340 { 341 tstcount ++; 342 if (tstcount > 49) 343 { 344 PrintLn(); 345 p_wrp(zeroPoly,currRing); 346 PrintLn(); 347 tstcount = 0; 348 } 349 } */ 333 350 334 351 enterT(tmp_h, strat, strat->tl + 1); -
kernel/kutil.cc
r7f06cca ra725dae 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kutil.cc,v 1.1 5 2006-01-20 01:15:07 wienand Exp $ */4 /* $Id: kutil.cc,v 1.16 2006-01-22 04:29:37 wienand Exp $ */ 5 5 /* 6 6 * ABSTRACT: kernel: utils for kStd … … 1005 1005 pLcm(p,strat->S[i],Lp.lcm); 1006 1006 pSetm(Lp.lcm); 1007 #ifdef HAVE_RING2TOM 1007 #ifdef HAVE_RING2TOM_DEACT 1008 1008 if (strat->sugarCrit && currRing->cring == 0) 1009 1009 #else … … 1079 1079 else /*sugarcrit*/ 1080 1080 { 1081 #ifdef HAVE_RING2TOM 1081 #ifdef HAVE_RING2TOM_DEACT 1082 1082 if (currRing->cring == 0) { 1083 1083 #endif … … 1144 1144 } 1145 1145 #endif 1146 #ifdef HAVE_RING2TOM 1146 #ifdef HAVE_RING2TOM_DEACT 1147 1147 } 1148 1148 #endif … … 1595 1595 } 1596 1596 1597 long twoPow(long arg) { 1598 long t = arg; 1599 long result = 1; 1600 while (t > 0) { 1601 result = 2 * result; 1602 t--; 1603 } 1604 return result; 1605 } 1606 1597 1607 /*2 1598 1608 *(s[0],h),...,(s[k],h) will be put to the pairset L(via initenterpairs) … … 1601 1611 void enterpairs (poly h,int k,int ecart,int pos,kStrategy strat, int atR) 1602 1612 { 1613 #ifdef HAVE_RING2TOM 1614 // enter also zero divisor * poly, if this is non zero and of smaller degree 1615 if (currRing->cring == 1) 1616 { 1617 if (((long) ((h)->coef)) % 2 == 0) 1618 { 1619 long a = ((long) ((h)->coef)) / 2; 1620 long b = currRing->ch - 1; 1621 poly p = p_Copy(h->next, strat->tailRing); 1622 while (a % 2 == 0) 1623 { 1624 a = a / 2; 1625 b--; 1626 } 1627 p = p_Mult_nn(p, (number) twoPow(b), strat->tailRing); 1628 1629 if (p != NULL) 1630 { 1631 if (TEST_OPT_PROT) 1632 { 1633 PrintS("Z"); 1634 } 1635 poly tmp = p_ISet((long) ((p)->coef), currRing); 1636 for (int i = 1; i <= currRing->N; i++) { 1637 pSetExp(tmp, i, p_GetExp(p, i, strat->tailRing)); 1638 } 1639 p_Setm(tmp, currRing); 1640 p = p_LmDeleteAndNext(p, strat->tailRing); 1641 pNext(tmp) = p; 1642 1643 LObject h; 1644 h.p = tmp; 1645 h.tailRing = strat->tailRing; 1646 if (TEST_OPT_INTSTRATEGY) 1647 { 1648 //pContent(h.p); 1649 h.pCleardenom(); // also does a pContent 1650 } 1651 else 1652 { 1653 h.pNorm(); 1654 } 1655 strat->initEcart(&h); 1656 int posx; 1657 if (h.p!=NULL) 1658 { 1659 if (strat->Ll==-1) 1660 posx =0; 1661 else 1662 posx = strat->posInL(strat->L,strat->Ll,&h,strat); 1663 h.sev = pGetShortExpVector(h.p); 1664 h.t_p = k_LmInit_currRing_2_tailRing(h.p, strat->tailRing); 1665 enterL(&strat->L,&strat->Ll,&strat->Lmax,h,posx); 1666 } 1667 } 1668 } 1669 } 1670 #endif 1603 1671 int j=pos; 1604 1672 … … 3278 3346 pos =0; 3279 3347 else 3280 3348 pos = strat->posInL(strat->L,strat->Ll,&h,strat); 3281 3349 h.sev = pGetShortExpVector(h.p); 3282 3350 enterL(&strat->L,&strat->Ll,&strat->Lmax,h,pos); -
kernel/kutil.h
r7f06cca ra725dae 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: kutil.h,v 1.1 0 2006-01-16 03:27:10wienand Exp $ */6 /* $Id: kutil.h,v 1.11 2006-01-22 04:29:37 wienand Exp $ */ 7 7 /* 8 8 * ABSTRACT: kernel: utils for kStd … … 391 391 #ifdef HAVE_RING2TOM 392 392 int redRing2toM (LObject* h,kStrategy strat); 393 long twoPow(long arg); 393 394 #endif 394 395 int redLazy (LObject* h,kStrategy strat);
Note: See TracChangeset
for help on using the changeset viewer.