1573{
1577 int pnt;
1578 int totverts;
1580
1582 {
1583 WerrorS(
"resMatrixSparse::resMatrixSparse: Too many variables!");
1584 return;
1585 }
1586
1589
1592
1594
1597
1598
1599 totverts = 0;
1601
1603
1604
1605#ifdef mprTEST
1606 shift[0]=0.005; shift[1]=0.003; shift[2]=0.008; shift[3]=0.005; shift[4]=0.002;
1607 shift[5]=0.1; shift[6]=0.3; shift[7]=0.2; shift[8]=0.4; shift[9]=0.2;
1608#else
1610#endif
1611#ifdef mprDEBUG_PROT
1612 PrintS(
" shift vector: ");
1615#endif
1616
1617
1619 Qi= chnp.newtonPolytopesP(
gls );
1620
1621#ifdef mprMINKSUM
1623#else
1624
1626 E= mpa.getInnerPoints( Qi, shift );
1627#endif
1628
1629#ifdef mprDEBUG_PROT
1630#ifdef mprMINKSUM
1632#endif
1633 PrintS(
"\n E = (Q_0 + ... + Q_n) \\cap \\N :\n");
1634 for ( pnt= 1; pnt <=
E->num; pnt++ )
1635 {
1636 Print(
"%d: <",pnt);print_exp( (*
E)[pnt],
E->dim );
PrintS(
">\n");
1637 }
1639#endif
1640
1641#ifdef mprTEST
1648
1650#else
1651
1652 for (
i= 0;
i <=
n;
i++ ) Qi[
i]->
lift();
1653#endif
1655
1656
1657 for ( pnt= 1; pnt <=
E->num; pnt++ )
1658 {
1659 RC( Qi,
E, pnt, shift );
1660 }
1661
1662
1664 for ( pnt=
k; pnt > 0; pnt-- )
1665 {
1666 if ( (*
E)[pnt]->rcPnt ==
NULL )
1667 {
1668 E->removePoint(pnt);
1670 }
1671 }
1673
1674#ifdef mprDEBUG_PROT
1675 PrintS(
" points which lie in a cell:\n");
1676 for ( pnt= 1; pnt <=
E->num; pnt++ )
1677 {
1678 Print(
"%d: <",pnt);print_exp( (*
E)[pnt],
E->dim );
PrintS(
">\n");
1679 }
1681#endif
1682
1683
1684 for (
i= 0;
i <=
n;
i++ ) Qi[
i]->unlift();
1687
1688#ifdef mprDEBUG_PROT
1689 Print(
" points with a[ij] (%d):\n",
E->num);
1690 for ( pnt= 1; pnt <=
E->num; pnt++ )
1691 {
1692 Print(
"Punkt p \\in E[%d]: <",pnt);print_exp( (*
E)[pnt],
E->dim );
1693 Print(
">, RC(p) = (i:%d, j:%d), a[i,j] = <",(*
E)[pnt]->rc.set,(*
E)[pnt]->rc.pnt);
1694
1695 print_exp( (*
E)[pnt]->rcPnt,
E->dim );
PrintS(
">\n");
1696 }
1697#endif
1698
1699
1701 {
1702 WerrorS(
"could not handle a degenerate situation: no inner points found");
1703 goto theEnd;
1704 }
1706 {
1707
1709 WerrorS(
"resMatrixSparse::resMatrixSparse: Error in resMatrixSparse::createMatrix!");
1710 goto theEnd;
1711 }
1712
1713 theEnd:
1714
1716 {
1718 }
1720
1722
1724}
int RC(pointSet **pQ, pointSet *E, int vert, mprfloat shift[])
Row Content Function Finds the largest i such that F[i] is a point, F[i]= a[ij] in A[i] for some j.
void randomVector(const int dim, mprfloat shift[])
int createMatrix(pointSet *E)
create coeff matrix uRPos[i][1]: row of matrix uRPos[i][idelem+1]: col of u(0) uRPos[i][2....
pointSet * minkSumAll(pointSet **pQ, int numq, int dim)
Linear Programming / Linear Optimization using Simplex - Algorithm.
REvaluation E(1, terms.length(), IntRandom(25))
void WerrorS(const char *s)
ideal lift(const ideal J, const ring r, const ideal inI, const ring s)
#define mprSTICKYPROT(msg)
#define omFreeSize(addr, size)
static int pLength(poly a)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
void PrintS(const char *s)