| 1647 | } |
| 1648 | |
| 1649 | BOOLEAN id_HomModule(ideal m, ideal Q, intvec **w, const ring R) |
| 1650 | { |
| 1651 | if (w!=NULL) *w=NULL; |
| 1652 | if ((Q!=NULL) && (!id_HomIdeal(Q,NULL,R))) return FALSE; |
| 1653 | if (idIs0(m)) |
| 1654 | { |
| 1655 | if (w!=NULL) (*w)=new intvec(m->rank); |
| 1656 | return TRUE; |
| 1657 | } |
| 1658 | |
| 1659 | long cmax=1,order=0,ord,* diff,diffmin=32000; |
| 1660 | int *iscom; |
| 1661 | int i; |
| 1662 | poly p=NULL; |
| 1663 | pFDegProc d; |
| 1664 | if (R->pLexOrder && (R->order[0]==ringorder_lp)) |
| 1665 | d=p_Totaldegree; |
| 1666 | else |
| 1667 | d=R->pFDeg; |
| 1668 | int length=IDELEMS(m); |
| 1669 | poly* P=m->m; |
| 1670 | poly* F=(poly*)omAlloc(length*sizeof(poly)); |
| 1671 | for (i=length-1;i>=0;i--) |
| 1672 | { |
| 1673 | p=F[i]=P[i]; |
| 1674 | cmax=si_max(cmax,p_MaxComp(p,R)); |
| 1675 | } |
| 1676 | cmax++; |
| 1677 | diff = (long *)omAlloc0(cmax*sizeof(long)); |
| 1678 | if (w!=NULL) *w=new intvec(cmax-1); |
| 1679 | iscom = (int *)omAlloc0(cmax*sizeof(int)); |
| 1680 | i=0; |
| 1681 | while (i<=length) |
| 1682 | { |
| 1683 | if (i<length) |
| 1684 | { |
| 1685 | p=F[i]; |
| 1686 | while ((p!=NULL) && (iscom[__p_GetComp(p,R)]==0)) pIter(p); |
| 1687 | } |
| 1688 | if ((p==NULL) && (i<length)) |
| 1689 | { |
| 1690 | i++; |
| 1691 | } |
| 1692 | else |
| 1693 | { |
| 1694 | if (p==NULL) /* && (i==length) */ |
| 1695 | { |
| 1696 | i=0; |
| 1697 | while ((i<length) && (F[i]==NULL)) i++; |
| 1698 | if (i>=length) break; |
| 1699 | p = F[i]; |
| 1700 | } |
| 1701 | //if (pLexOrder && (currRing->order[0]==ringorder_lp)) |
| 1702 | // order=pTotaldegree(p); |
| 1703 | //else |
| 1704 | // order = p->order; |
| 1705 | // order = pFDeg(p,currRing); |
| 1706 | order = d(p,R) +diff[__p_GetComp(p,R)]; |
no test coverage detected