Changeset 79f80f in git
- Timestamp:
- Jan 13, 2000, 3:18:58 PM (23 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 3cc3f69eaf583a0a6e659462d814023a400c19ce
- Parents:
- c284cea94669c008bc37b4e349182a16b68b8e6e
- Location:
- Singular
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ideals.cc
rc284ce r79f80f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ideals.cc,v 1.8 1 2000-01-04 15:17:15siebert Exp $ */4 /* $Id: ideals.cc,v 1.82 2000-01-13 14:18:58 siebert Exp $ */ 5 5 /* 6 6 * ABSTRACT - all basic methods to manipulate ideals … … 1609 1609 * of mod 1610 1610 */ 1611 ideal idLiftNonStB(ideal mod, ideal submod,BOOLEAN goodShape) 1612 { 1613 return idLift(mod, submod, goodShape, FALSE); 1614 } 1615 1616 1617 ideal idLift(ideal mod,ideal submod,BOOLEAN goodShape, BOOLEAN isSB) 1611 ideal idLiftNonStB (ideal mod, ideal submod,ideal * rest, 1612 BOOLEAN goodShape,BOOLEAN divide) 1613 { 1614 return idLift(mod, submod, rest, goodShape, FALSE); 1615 } 1616 1617 1618 ideal idLift (ideal mod, ideal submod,ideal * rest, 1619 BOOLEAN goodShape, BOOLEAN isSB,BOOLEAN divide) 1618 1620 { 1619 1621 int lsmod =idRankFreeModule(submod), i, j, k; 1622 int ordSgn=currRing->OrdSgn; 1623 int comps_to_add=0; 1624 poly p; 1620 1625 1621 1626 if (idIs0(mod)) 1622 1627 return idInit(1,mod->rank); 1623 1628 //#define NEW_LIFT 1629 //#define TEST_LIFT 1630 #ifdef TEST_LIFT 1631 //divide=TRUE; 1632 Print("The module is:\n"); 1633 idPrint(mod); 1634 Print("The submodule is:\n"); 1635 idPrint(submod); 1636 #endif 1637 #ifdef NEW_LIFT 1638 if (ordSgn==-1) 1639 { 1640 comps_to_add = IDELEMS(submod); 1641 while ((comps_to_add>0) && (submod->m[comps_to_add-1]==NULL)) 1642 comps_to_add--; 1643 } 1644 #endif 1624 1645 k=idRankFreeModule(mod); 1625 1646 if ((k!=0) && (lsmod==0)) lsmod=1; … … 1645 1666 { 1646 1667 s_h3 = idCopy(s_mod); 1647 idPrepareStd(s_h3, k );1668 idPrepareStd(s_h3, k+comps_to_add); 1648 1669 } 1649 1670 else 1650 1671 { 1651 s_h3 = idPrepare(s_mod,(tHomog)FALSE,k ,NULL);1672 s_h3 = idPrepare(s_mod,(tHomog)FALSE,k+comps_to_add,NULL); 1652 1673 } 1653 1674 if (!goodShape) … … 1668 1689 } 1669 1690 } 1691 #ifdef NEW_LIFT 1692 if (ordSgn==-1) 1693 { 1694 for(j = 0;j<comps_to_add;j++) 1695 { 1696 p = s_temp->m[j]; 1697 if (p!=NULL) 1698 { 1699 while (pNext(p)!=NULL) pIter(p); 1700 pNext(p) = pOne(); 1701 pIter(p); 1702 pSetComp(p,1+j+k); 1703 pSetmComp(p); 1704 } 1705 } 1706 } 1707 #endif 1670 1708 ideal s_result = kNF(s_h3,currQuotient,s_temp,k); 1671 1709 s_result->rank = s_h3->rank; 1710 ideal s_rest = idInit(IDELEMS(s_result),k); 1672 1711 idDelete(&s_h3); 1673 1712 idDelete(&s_temp); … … 1679 1718 if (pGetComp(s_result->m[j])<=k) 1680 1719 { 1681 if ( isSB)1720 if (!divide) 1682 1721 { 1683 WarnS("first module not a standardbasis\n" 1684 "// ** or second not a proper submodule"); 1722 if (isSB) 1723 { 1724 WarnS("first module not a standardbasis\n" 1725 "// ** or second not a proper submodule"); 1726 } 1727 else 1728 WerrorS("2nd module lies not in the first"); 1729 idDelete(&s_result); 1730 idDelete(&s_rest); 1731 s_result=idInit(IDELEMS(submod),submod->rank); 1732 break; 1685 1733 } 1686 1734 else 1687 WerrorS("2nd module lies not in the first"); 1688 idDelete(&s_result); 1689 s_result=idInit(IDELEMS(submod),submod->rank); 1690 break; 1691 } 1692 else 1693 { 1694 pShift(&(s_result->m[j]),-k); 1695 pNeg(s_result->m[j]); 1696 } 1697 } 1698 } 1699 1735 { 1736 p = s_rest->m[j] = s_result->m[j]; 1737 while ((pNext(p)!=NULL) && (pGetComp(pNext(p))<=k)) pIter(p); 1738 s_result->m[j] = pNext(p); 1739 pNext(p) = NULL; 1740 } 1741 } 1742 pShift(&(s_result->m[j]),-k); 1743 pNeg(s_result->m[j]); 1744 } 1745 } 1746 if ((lsmod==0) && (!idIs0(s_rest))) 1747 { 1748 for (j=IDELEMS(s_rest);j>0;j--) 1749 { 1750 if (s_rest->m[j-1]!=NULL) 1751 { 1752 pShift(&(s_rest->m[j-1]),-1); 1753 s_rest->m[j-1] = pNeg(s_rest->m[j-1]); 1754 } 1755 } 1756 } 1757 #ifdef TEST_LIFT 1758 Print("The lift is:\n"); 1759 idPrint(s_result); 1760 Print("The rest is:\n"); 1761 if (s_rest!=NULL) idPrint(s_rest); 1762 #endif 1700 1763 if(syz_ring!=orig_ring) 1701 1764 { … … 1703 1766 rChangeCurrRing(orig_ring,TRUE); 1704 1767 s_result = idrMoveR_NoSort(s_result, syz_ring); 1768 s_rest = idrMoveR_NoSort(s_rest, syz_ring); 1705 1769 rKill(syz_ring); 1706 1770 } 1771 if (rest!=NULL) 1772 *rest = s_rest; 1773 else 1774 idDelete(&s_rest); 1707 1775 return s_result; 1708 1776 } -
Singular/ideals.h
rc284ce r79f80f 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: ideals.h,v 1.1 7 2000-01-04 15:17:16siebert Exp $ */6 /* $Id: ideals.h,v 1.18 2000-01-13 14:18:57 siebert Exp $ */ 7 7 /* 8 8 * ABSTRACT - all basic methods to manipulate ideals … … 21 21 /*- deletes an ideal -*/ 22 22 #endif 23 void idShow(ideal id); 23 24 void idPrint(ideal id); 24 25 /*- initialise an ideal -*/ … … 87 88 ideal idLiftStd (ideal h1, matrix *m, tHomog h=testHomog); 88 89 89 ideal idLift (ideal mod, ideal sumod,BOOLEAN goodShape=FALSE, 90 BOOLEAN isSB=TRUE); 91 ideal idLiftNonStB (ideal mod, ideal submod,BOOLEAN goodShape=FALSE); 90 ideal idLift (ideal mod, ideal sumod,ideal * rest=NULL, 91 BOOLEAN goodShape=FALSE, BOOLEAN isSB=TRUE,BOOLEAN divide=FALSE); 92 ideal idLiftNonStB (ideal mod, ideal submod,ideal * rest=NULL, 93 BOOLEAN goodShape=FALSE,BOOLEAN divide=FALSE); 92 94 93 95 intvec * idMWLift(ideal mod,intvec * weights); -
Singular/iparith.cc
rc284ce r79f80f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: iparith.cc,v 1. 199 2000-01-13 10:33:19 SingularExp $ */4 /* $Id: iparith.cc,v 1.200 2000-01-13 14:18:58 siebert Exp $ */ 5 5 6 6 /* … … 1725 1725 int ul= IDELEMS((ideal)u->Data()); 1726 1726 int vl= IDELEMS((ideal)v->Data()); 1727 //if (currRing->OrdSgn==-1) ul += vl; //to add if NEW_LIFT defined 1727 1728 if (hasFlag(u,FLAG_STD)) 1728 1729 {
Note: See TracChangeset
for help on using the changeset viewer.