1467{
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485 int trInd;
1488 {
1489 PrintS(
"Hilbert Series:\n 0\n");
1490 return;
1491 }
1492 int (*POS)(ideal, poly, std::vector<ideal>, std::vector<poly>, int, int);
1493 if(trunDegHs != 0)
1494 {
1495 Print(
"\nTruncation degree = %d\n",trunDegHs);
1497 }
1498 else
1499 {
1500 if(IG_CASE)
1501 {
1503 {
1504 WerrorS(
"wrong input: it is not an infinitely gen. case");
1505 return;
1506 }
1509 }
1510 else
1512 }
1513 std::vector<ideal > idorb;
1514 std::vector< poly > polist;
1515
1516 ideal orb_init =
idInit(1, 1);
1517 idorb.push_back(orb_init);
1518
1520
1521 std::vector< std::vector<int> > posMat;
1522 std::vector<int> posRow(lV,0);
1523 std::vector<int> C;
1524
1525 int ds, is, ps;
1526 unsigned long lpcnt = 0;
1527
1529 ideal Jwi;
1530
1531 while(lpcnt < idorb.size())
1532 {
1535 if(lpcnt >= 1 &&
idIs0(idorb[lpcnt]) ==
FALSE)
1536 {
1538 {
1539 C.push_back(1);
1540 }
1541 else
1542 C.push_back(0);
1543 }
1544 else
1545 {
1546 C.push_back(1);
1547 }
1548
1550 lpcnt++;
1551
1552 for(is = 1; is <= lV; is++)
1553 {
1555
1556
1557
1558
1559
1560
1565
1566
1567
1568
1569
1571
1573 ps = (*POS)(Jwi, wi, idorb, polist, trInd, trunDegHs);
1574
1575 if(ps == 0)
1576 {
1577 posRow[is-1] = idorb.size();
1578
1579 idorb.push_back(Jwi);
1580 polist.push_back(wi);
1581 }
1582 else
1583 {
1584 posRow[is-1]=ps-1;
1587 }
1588 }
1589 posMat.push_back(posRow);
1590 posRow.resize(lV,0);
1591 }
1592 int lO = C.size();
1595 Print(
"\nlength of the Orbit = %d", lO);
1597
1598 if(odp)
1599 {
1600 Print(
"words description of the Orbit: \n");
1601 for(is = 0; is < lO; is++)
1602 {
1605 }
1607 PrintS(
"\nmaximal degree, #(sum_j R(w,w_j))");
1609 for(is = 0; is < lO; is++)
1610 {
1611 if(
idIs0(idorb[is]))
1612 {
1614 }
1615 else
1616 {
1618 }
1619 }
1620 }
1621
1622 for(is = idorb.size()-1; is >= 0; is--)
1623 {
1625 }
1626 for(is = polist.size()-1; is >= 0; is--)
1627 {
1629 }
1630
1631 idorb.resize(0);
1632 polist.resize(0);
1633
1634 int adjMatrix[lO][lO];
1635 memset(adjMatrix, 0, lO*lO*sizeof(int));
1636 int rowCount, colCount;
1637 int tm = 0;
1638 if(!mgrad)
1639 {
1640 for(rowCount = 0; rowCount < lO; rowCount++)
1641 {
1642 for(colCount = 0; colCount < lV; colCount++)
1643 {
1644 tm = posMat[rowCount][colCount];
1645 adjMatrix[rowCount][tm] = adjMatrix[rowCount][tm] + 1;
1646 }
1647 }
1648 }
1649
1651 int npar;
1652 char** tt;
1654 if(!mgrad)
1655 {
1656 tt=(
char**)
omAlloc(
sizeof(
char*));
1658 npar = 1;
1659 }
1660 else
1661 {
1662 tt=(
char**)
omalloc(lV*
sizeof(
char*));
1663 for(is = 0; is < lV; is++)
1664 {
1665 tt[is] = (
char*)
omAlloc(7*
sizeof(
char));
1666 sprintf (tt[is], "t%d", is+1);
1667 }
1668 npar = lV;
1669 }
1670
1673 char** xx = (
char**)
omAlloc(
sizeof(
char*));
1677
1678
1679
1682 poly rc;
1683
1684 if(!mgrad)
1685 {
1686 for(rowCount = 0; rowCount < lO; rowCount++)
1687 {
1688 for(colCount = 0; colCount < lO; colCount++)
1689 {
1690 if(adjMatrix[rowCount][colCount] != 0)
1691 {
1692 MATELEM(mR, rowCount + 1, colCount + 1) =
p_ISet(adjMatrix[rowCount][colCount],
R);
1694 }
1695 }
1696 }
1697 }
1698 else
1699 {
1700 for(rowCount = 0; rowCount < lO; rowCount++)
1701 {
1702 for(colCount = 0; colCount < lV; colCount++)
1703 {
1707 MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1)=
p_Add_q(rc,
MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1),
R);
1708 }
1709 }
1710 }
1711
1712 for(rowCount = 0; rowCount < lO; rowCount++)
1713 {
1714 if(C[rowCount] != 0)
1715 {
1717 }
1718 }
1719
1723
1725
1726 if(odp)
1727 {
1728 PrintS(
"\nlinear system:\n");
1729 if(!mgrad)
1730 {
1731 for(rowCount = 0; rowCount < lO; rowCount++)
1732 {
1733 Print(
"H(%d) = ", rowCount+1);
1734 for(colCount = 0; colCount < lV; colCount++)
1735 {
1739 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
1740 }
1741 Print(
" %d\n", C[rowCount] );
1742 }
1743 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
1744 PrintS(
"and i^th summand in the rhs of an eqn. is according\n");
1745 PrintS(
"to the right colon map corresp. to the i^th variable\n");
1746 }
1747 else
1748 {
1749 for(rowCount = 0; rowCount < lO; rowCount++)
1750 {
1751 Print(
"H(%d) = ", rowCount+1);
1752 for(colCount = 0; colCount < lV; colCount++)
1753 {
1757 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
1758 }
1759 Print(
" %d\n", C[rowCount] );
1760 }
1761 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
1762 }
1763 }
1765 posMat.resize(0);
1766 C.resize(0);
1772
1773
1774
1775
1778
1779
1780
1781
1782
1791
1793 Print(
"Hilbert series:");
1796 if(!mgrad)
1797 {
1799 }
1800 else
1801 {
1802 for(is = lV-1; is >= 0; is--)
1803
1805 }
1811}
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
static FORCE_INLINE number n_Param(const int iParameter, const coeffs r)
return the (iParameter^th) parameter as a NEW number NOTE: parameter numbering: 1....
@ n_transExt
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
const CanonicalForm int s
void WerrorS(const char *s)
static int positionInOrbitTruncationCase(ideal I, poly w, std::vector< ideal > idorb, std::vector< poly > polist, int, int trunDegHs)
static ideal colonIdeal(ideal S, poly w, int lV, ideal Jwi, int trunDegHs)
static int positionInOrbit_FG_Case(ideal I, poly, std::vector< ideal > idorb, std::vector< poly >, int, int)
static int positionInOrbit_IG_Case(ideal I, poly w, std::vector< ideal > idorb, std::vector< poly > polist, int trInd, int)
static ideal minimalMonomialGenSet(ideal I)
#define idDelete(H)
delete an ideal
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
bool unitMatrix(const int n, matrix &unitMat, const ring R)
Creates a new matrix which is the (nxn) unit matrix, and returns true in case of success.
void luDecomp(const matrix aMat, matrix &pMat, matrix &lMat, matrix &uMat, const ring R)
LU-decomposition of a given (m x n)-matrix.
bool luSolveViaLUDecomp(const matrix pMat, const matrix lMat, const matrix uMat, const matrix bVec, matrix &xVec, matrix &H)
Solves the linear system A * x = b, where A is an (m x n)-matrix which is given by its LU-decompositi...
void mp_Delete(matrix *a, const ring r)
matrix mp_Sub(matrix a, matrix b, const ring R)
matrix mpNew(int r, int c)
create a r x c zero-matrix
#define MATELEM(mat, i, j)
1-based access to matrix
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
The main handler for Singular numbers which are suitable for Singular polynomials.
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
static poly p_Add_q(poly p, poly q, const ring r)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
static void p_Setm(poly p, const ring r)
static number p_SetCoeff(poly p, number n, ring r)
static long p_Totaldegree(poly p, const ring r)
void rChangeCurrRing(ring r)
#define pCopy(p)
return a copy of the poly
void StringSetS(const char *st)
void PrintS(const char *s)
ring rDefault(const coeffs cf, int N, char **n, int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl, unsigned long bitmask)
ideal idInit(int idsize, int rank)
initialise an ideal / module
struct for passing initialization parameters to naInitChar