1424{
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442 int trInd;
1445 {
1446 PrintS(
"Hilbert Series:\n 0\n");
1447 return;
1448 }
1449 int (*POS)(ideal, poly, std::vector<ideal>, std::vector<poly>, int, int);
1450 if(trunDegHs != 0)
1451 {
1452 Print(
"\nTruncation degree = %d\n",trunDegHs);
1454 }
1455 else
1456 {
1457 if(IG_CASE)
1458 {
1460 {
1461 WerrorS(
"wrong input: it is not an infinitely gen. case");
1462 return;
1463 }
1466 }
1467 else
1469 }
1470 std::vector<ideal > idorb;
1471 std::vector< poly > polist;
1472
1473 ideal orb_init =
idInit(1, 1);
1474 idorb.push_back(orb_init);
1475
1477
1478 std::vector< std::vector<int> > posMat;
1479 std::vector<int> posRow(lV,0);
1480 std::vector<int> C;
1481
1482 int ds, is, ps;
1483 unsigned long lpcnt = 0;
1484
1486 ideal Jwi;
1487
1488 while(lpcnt < idorb.size())
1489 {
1492 if(lpcnt >= 1 &&
idIs0(idorb[lpcnt]) ==
FALSE)
1493 {
1495 {
1496 C.push_back(1);
1497 }
1498 else
1499 C.push_back(0);
1500 }
1501 else
1502 {
1503 C.push_back(1);
1504 }
1505
1507 lpcnt++;
1508
1509 for(is = 1; is <= lV; is++)
1510 {
1512
1513
1514
1515
1516
1517
1522
1523
1524
1525
1526
1528
1530 ps = (*POS)(Jwi, wi, idorb, polist, trInd, trunDegHs);
1531
1532 if(ps == 0)
1533 {
1534 posRow[is-1] = idorb.size();
1535
1536 idorb.push_back(Jwi);
1537 polist.push_back(wi);
1538 }
1539 else
1540 {
1541 posRow[is-1]=ps-1;
1544 }
1545 }
1546 posMat.push_back(posRow);
1547 posRow.resize(lV,0);
1548 }
1549 int lO = C.size();
1552 Print(
"\nlength of the Orbit = %d", lO);
1554
1555 if(odp)
1556 {
1557 Print(
"words description of the Orbit: \n");
1558 for(is = 0; is < lO; is++)
1559 {
1562 }
1564 PrintS(
"\nmaximal degree, #(sum_j R(w,w_j))");
1566 for(is = 0; is < lO; is++)
1567 {
1568 if(
idIs0(idorb[is]))
1569 {
1571 }
1572 else
1573 {
1575 }
1576 }
1577 }
1578
1579 for(is = idorb.size()-1; is >= 0; is--)
1580 {
1582 }
1583 for(is = polist.size()-1; is >= 0; is--)
1584 {
1586 }
1587
1588 idorb.resize(0);
1589 polist.resize(0);
1590
1591 int adjMatrix[lO][lO];
1592 memset(adjMatrix, 0, lO*lO*sizeof(int));
1593 int rowCount, colCount;
1594 int tm = 0;
1595 if(!mgrad)
1596 {
1597 for(rowCount = 0; rowCount < lO; rowCount++)
1598 {
1599 for(colCount = 0; colCount < lV; colCount++)
1600 {
1601 tm = posMat[rowCount][colCount];
1602 adjMatrix[rowCount][tm] = adjMatrix[rowCount][tm] + 1;
1603 }
1604 }
1605 }
1606
1608 int npar;
1609 char** tt;
1611 if(!mgrad)
1612 {
1613 tt=(
char**)
omAlloc(
sizeof(
char*));
1615 npar = 1;
1616 }
1617 else
1618 {
1619 tt=(
char**)
omalloc(lV*
sizeof(
char*));
1620 for(is = 0; is < lV; is++)
1621 {
1622 tt[is] = (
char*)
omAlloc(7*
sizeof(
char));
1623 sprintf (tt[is], "t%d", is+1);
1624 }
1625 npar = lV;
1626 }
1627
1630 char** xx = (
char**)
omAlloc(
sizeof(
char*));
1634
1635
1636
1639 poly rc;
1640
1641 if(!mgrad)
1642 {
1643 for(rowCount = 0; rowCount < lO; rowCount++)
1644 {
1645 for(colCount = 0; colCount < lO; colCount++)
1646 {
1647 if(adjMatrix[rowCount][colCount] != 0)
1648 {
1649 MATELEM(mR, rowCount + 1, colCount + 1) =
p_ISet(adjMatrix[rowCount][colCount],
R);
1651 }
1652 }
1653 }
1654 }
1655 else
1656 {
1657 for(rowCount = 0; rowCount < lO; rowCount++)
1658 {
1659 for(colCount = 0; colCount < lV; colCount++)
1660 {
1664 MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1)=
p_Add_q(rc,
MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1),
R);
1665 }
1666 }
1667 }
1668
1669 for(rowCount = 0; rowCount < lO; rowCount++)
1670 {
1671 if(C[rowCount] != 0)
1672 {
1674 }
1675 }
1676
1680
1682
1683 if(odp)
1684 {
1685 PrintS(
"\nlinear system:\n");
1686 if(!mgrad)
1687 {
1688 for(rowCount = 0; rowCount < lO; rowCount++)
1689 {
1690 Print(
"H(%d) = ", rowCount+1);
1691 for(colCount = 0; colCount < lV; colCount++)
1692 {
1696 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
1697 }
1698 Print(
" %d\n", C[rowCount] );
1699 }
1700 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
1701 PrintS(
"and i^th summand in the rhs of an eqn. is according\n");
1702 PrintS(
"to the right colon map corresp. to the i^th variable\n");
1703 }
1704 else
1705 {
1706 for(rowCount = 0; rowCount < lO; rowCount++)
1707 {
1708 Print(
"H(%d) = ", rowCount+1);
1709 for(colCount = 0; colCount < lV; colCount++)
1710 {
1714 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
1715 }
1716 Print(
" %d\n", C[rowCount] );
1717 }
1718 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
1719 }
1720 }
1722 posMat.resize(0);
1723 C.resize(0);
1729
1730
1731
1732
1735
1736
1737
1738
1739
1748
1750 Print(
"Hilbert series:");
1753 if(!mgrad)
1754 {
1756 }
1757 else
1758 {
1759 for(is = lV-1; is >= 0; is--)
1760
1762 }
1768}
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
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)
#define idDelete(H)
delete an 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
The main handler for Singular numbers which are suitable for Singular polynomials.
static number p_SetCoeff(poly p, number n, 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)
struct for passing initialization parameters to naInitChar