MCPcopy Create free account
hub / github.com/Singular/Singular / idElimination

Function idElimination

kernel/ideals.cc:1605–1847  ·  view source on GitHub ↗

2 * eliminate delVar (product of vars) in h1 */

Source from the content-addressed store, hash-verified

1603* eliminate delVar (product of vars) in h1
1604*/
1605ideal idElimination (ideal h1,poly delVar,intvec *hilb, GbVariant alg)
1606{
1607 int i,j=0,k,l;
1608 ideal h,hh, h3;
1609 rRingOrder_t *ord;
1610 int *block0,*block1;
1611 int ordersize=2;
1612 int **wv;
1613 tHomog hom;
1614 intvec * w;
1615 ring tmpR;
1616 ring origR = currRing;
1617
1618 if (delVar==NULL)
1619 {
1620 return idCopy(h1);
1621 }
1622 if ((currRing->qideal!=NULL) && rIsPluralRing(origR))
1623 {
1624 WerrorS("cannot eliminate in a qring");
1625 return NULL;
1626 }
1627 if (idIs0(h1)) return idInit(1,h1->rank);
1628#ifdef HAVE_PLURAL
1629 if (rIsPluralRing(origR))
1630 /* in the NC case, we have to check the admissibility of */
1631 /* the subalgebra to be intersected with */
1632 {
1633 if ((ncRingType(origR) != nc_skew) && (ncRingType(origR) != nc_exterior)) /* in (quasi)-commutative algebras every subalgebra is admissible */
1634 {
1635 if (nc_CheckSubalgebra(delVar,origR))
1636 {
1637 WerrorS("no elimination is possible: subalgebra is not admissible");
1638 return NULL;
1639 }
1640 }
1641 }
1642#endif
1643 hom=(tHomog)idHomModule(h1,NULL,&w); //sets w to weight vector or NULL
1644 h3=idInit(16,h1->rank);
1645 ordersize=rBlocks(origR)+1;
1646#if 0
1647 if (rIsPluralRing(origR)) // we have too keep the odering: it may be needed
1648 // for G-algebra
1649 {
1650 for (k=0;k<ordersize-1; k++)
1651 {
1652 block0[k+1] = origR->block0[k];
1653 block1[k+1] = origR->block1[k];
1654 ord[k+1] = origR->order[k];
1655 if (origR->wvhdl[k]!=NULL) wv[k+1] = (int*) omMemDup(origR->wvhdl[k]);
1656 }
1657 }
1658 else
1659 {
1660 block0[1] = 1;
1661 block1[1] = (currRing->N);
1662 if (origR->OrdSgn==1) ord[1] = ringorder_wp;

Callers 5

jjELIMINFunction · 0.85
jjELIMIN_IVFunction · 0.85
jjELIMIN_ALGFunction · 0.85
jjELIMIN_HILBFunction · 0.85
idSectWithElimFunction · 0.85

Calls 15

idCopyFunction · 0.85
rIsPluralRingFunction · 0.85
WerrorSFunction · 0.85
idIs0Function · 0.85
idInitFunction · 0.85
ncRingTypeFunction · 0.85
nc_CheckSubalgebraFunction · 0.85
idHomModuleFunction · 0.85
rBlocksFunction · 0.85
omAlloc0Function · 0.85
wCallFunction · 0.85
rVarFunction · 0.85

Tested by

no test coverage detected