Changeset ad1c3b in git for kernel/kstd2.cc
- Timestamp:
- Mar 13, 2008, 8:25:49 PM (16 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- ba49d9f52b36950f74de618b1a41a677fa14fa07
- Parents:
- 411ea98eecab97fbeac7f8395433a159d6d03584
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/kstd2.cc
r411ea98 rad1c3b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1.6 4 2008-02-26 23:35:30levandov Exp $ */4 /* $Id: kstd2.cc,v 1.65 2008-03-13 19:25:48 levandov Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 1529 1529 } 1530 1530 1531 poly qq; 1532 1533 /* here in the nonhomog case we shrink the new spoly */ 1534 1535 if ( ! strat->homog) 1536 { 1537 strat->P.GetP(strat->lmBin); // because shifts are counted with .p structure 1538 /* assume strat->P.t_p != NULL */ 1539 /* in the nonhomog case we have to shrink the polynomial */ 1540 assume(strat->P.t_p!=NULL); 1541 qq = p_Shrink(strat->P.t_p, lV, strat->tailRing); // direct shrink 1542 if (qq != NULL) 1543 { 1544 /* we're here if Shrink is nonzero */ 1545 // strat->P.p = NULL; 1546 // strat->P.Delete(); /* deletes P.p and P.t_p */ //error 1547 strat->P.p = NULL; // is not set by Delete 1548 strat->P.t_p = qq; 1549 strat->P.GetP(strat->lmBin); 1550 // update sev and length 1551 strat->initEcart(&(strat->P)); 1552 strat->P.sev = pGetShortExpVector(strat->P.p); 1553 // strat->P.FDeg = strat->P.pFDeg(); 1554 // strat->P.length = strat->P.pLDeg(); 1555 // strat->P.pLength =strat->P.GetpLength(); //pLength(strat->P.p); 1556 } 1557 else 1558 { 1559 /* Shrink is zero, like y(1)*y(2) - y(1)*y(3)*/ 1560 #ifdef KDEBUG 1561 if (TEST_OPT_DEBUG){PrintS("nonzero s shrinks to 0");PrintLn();} 1562 #endif 1563 // strat->P.Delete(); // cause error 1564 strat->P.p = NULL; 1565 strat->P.t_p = NULL; 1566 // strat->P.p = NULL; // or delete strat->P.p ? 1567 } 1568 } 1569 /* end shrinking poly in the nonhomog case */ 1570 1531 1571 if (strat->P.p == NULL && strat->P.t_p == NULL) 1532 1572 { … … 1570 1610 strat->P.p = redtailBba(&(strat->P),pos-1,strat, withT); 1571 1611 } 1612 1613 // here we must shrink again! and optionally reduce again 1614 // or build shrink into redtailBba! 1572 1615 1573 1616 #ifdef KDEBUG … … 1596 1639 } 1597 1640 1641 /* here in the nonhomog case we shrink the reduced poly AGAIN */ 1642 1643 if ( ! strat->homog) 1644 { 1645 strat->P.GetP(strat->lmBin); // because shifts are counted with .p structure 1646 /* assume strat->P.t_p != NULL */ 1647 /* in the nonhomog case we have to shrink the polynomial */ 1648 assume(strat->P.t_p!=NULL); // poly qq defined above 1649 qq = p_Shrink(strat->P.t_p, lV, strat->tailRing); // direct shrink 1650 if (qq != NULL) 1651 { 1652 /* we're here if Shrink is nonzero */ 1653 // strat->P.p = NULL; 1654 // strat->P.Delete(); /* deletes P.p and P.t_p */ //error 1655 strat->P.p = NULL; // is not set by Delete 1656 strat->P.t_p = qq; 1657 strat->P.GetP(strat->lmBin); 1658 // update sev and length 1659 strat->initEcart(&(strat->P)); 1660 strat->P.sev = pGetShortExpVector(strat->P.p); 1661 } 1662 else 1663 { 1664 /* Shrink is zero, like y(1)*y(2) - y(1)*y(3)*/ 1665 #ifdef PDEBUG 1666 if (TEST_OPT_DEBUG){PrintS("nonzero s shrinks to 0");PrintLn();} 1667 #endif 1668 // strat->P.Delete(); // cause error 1669 strat->P.p = NULL; 1670 strat->P.t_p = NULL; 1671 // strat->P.p = NULL; // or delete strat->P.p ? 1672 goto red_shrink2zero; 1673 } 1674 } 1675 /* end shrinking poly AGAIN in the nonhomog case */ 1676 1677 1598 1678 // enter into S, L, and T 1599 1679 //if ((!TEST_OPT_IDLIFT) || (pGetComp(strat->P.p) <= strat->syzComp)) … … 1601 1681 //enterTShift(LObject p, kStrategy strat, int atT, int uptodeg, int lV); // syntax 1602 1682 // the default value for atT = -1 as in bba 1603 strat->P.GetP(); // because shifts are counted with .p structure 1683 /* strat->P.GetP(); */ 1684 // because shifts are counted with .p structure // done before, but ? 1604 1685 enterTShift(strat->P,strat,-1,uptodeg, lV); 1605 // poly vw;1606 // if (strat->P.t_p!=NULL)1607 // {1608 // vw = pCopyL2p(strat->P,strat);1609 // }1610 // else1611 // {1612 // vw = pCopy(strat->P.p);1613 // }1614 1686 enterpairsShift(strat->P.p,strat->sl,strat->P.ecart,pos,strat, strat->tl,uptodeg,lV); 1615 1687 // enterpairsShift(vw,strat->sl,strat->P.ecart,pos,strat, strat->tl,uptodeg,lV); 1616 // delete vw ?1617 1688 // posInS only depends on the leading term 1618 1689 if ((!TEST_OPT_IDLIFT) || (pGetComp(strat->P.p) <= strat->syzComp)) … … 1624 1695 // strat->P.Delete(); // syzComp test: it is in T 1625 1696 } 1697 1626 1698 if (hilb!=NULL) khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat); 1627 1699 // Print("[%d]",hilbeledeg); … … 1629 1701 if (strat->sl>srmax) srmax = strat->sl; 1630 1702 } 1631 else if (strat->P.p1 == NULL && strat->minim > 0) 1632 { 1633 p_Delete(&strat->P.p2, currRing, strat->tailRing); 1703 else 1704 { 1705 red_shrink2zero: 1706 if (strat->P.p1 == NULL && strat->minim > 0) 1707 { 1708 p_Delete(&strat->P.p2, currRing, strat->tailRing); 1709 } 1634 1710 } 1635 1711 #ifdef KDEBUG
Note: See TracChangeset
for help on using the changeset viewer.