1420{
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438 int trInd;
1441 {
1442 PrintS(
"Hilbert Series:\n 0\n");
1443 return;
1444 }
1445 int (*POS)(ideal, poly, std::vector<ideal>, std::vector<poly>, int, int);
1446 if(trunDegHs != 0)
1447 {
1448 Print(
"\nTruncation degree = %d\n",trunDegHs);
1450 }
1451 else
1452 {
1453 if(IG_CASE)
1454 {
1456 {
1457 WerrorS(
"wrong input: it is not an infinitely gen. case");
1458 return;
1459 }
1462 }
1463 else
1465 }
1466 std::vector<ideal > idorb;
1467 std::vector< poly > polist;
1468
1469 ideal orb_init =
idInit(1, 1);
1470 idorb.push_back(orb_init);
1471
1473
1474 std::vector< std::vector<int> > posMat;
1475 std::vector<int> posRow(lV,0);
1476 std::vector<int> C;
1477
1478 int ds, is, ps;
1479 unsigned long lpcnt = 0;
1480
1482 ideal Jwi;
1483
1484 while(lpcnt < idorb.size())
1485 {
1488 if(lpcnt >= 1 &&
idIs0(idorb[lpcnt]) ==
FALSE)
1489 {
1491 {
1492 C.push_back(1);
1493 }
1494 else
1495 C.push_back(0);
1496 }
1497 else
1498 {
1499 C.push_back(1);
1500 }
1501
1503 lpcnt++;
1504
1505 for(is = 1; is <= lV; is++)
1506 {
1508
1509
1510
1511
1512
1513
1518
1519
1520
1521
1522
1524
1526 ps = (*POS)(Jwi, wi, idorb, polist, trInd, trunDegHs);
1527
1528 if(ps == 0)
1529 {
1530 posRow[is-1] = idorb.size();
1531
1532 idorb.push_back(Jwi);
1533 polist.push_back(wi);
1534 }
1535 else
1536 {
1537 posRow[is-1]=ps-1;
1540 }
1541 }
1542 posMat.push_back(posRow);
1543 posRow.resize(lV,0);
1544 }
1545 int lO = C.size();
1548 Print(
"\nlength of the Orbit = %d", lO);
1550
1551 if(odp)
1552 {
1553 Print(
"words description of the Orbit: \n");
1554 for(is = 0; is < lO; is++)
1555 {
1558 }
1560 PrintS(
"\nmaximal degree, #(sum_j R(w,w_j))");
1562 for(is = 0; is < lO; is++)
1563 {
1564 if(
idIs0(idorb[is]))
1565 {
1567 }
1568 else
1569 {
1571 }
1572 }
1573 }
1574
1575 for(is = idorb.size()-1; is >= 0; is--)
1576 {
1578 }
1579 for(is = polist.size()-1; is >= 0; is--)
1580 {
1582 }
1583
1584 idorb.resize(0);
1585 polist.resize(0);
1586
1587 int adjMatrix[lO][lO];
1588 memset(adjMatrix, 0, lO*lO*sizeof(int));
1589 int rowCount, colCount;
1590 int tm = 0;
1591 if(!mgrad)
1592 {
1593 for(rowCount = 0; rowCount < lO; rowCount++)
1594 {
1595 for(colCount = 0; colCount < lV; colCount++)
1596 {
1597 tm = posMat[rowCount][colCount];
1598 adjMatrix[rowCount][tm] = adjMatrix[rowCount][tm] + 1;
1599 }
1600 }
1601 }
1602
1604 int npar;
1605 char** tt;
1607 if(!mgrad)
1608 {
1609 tt=(
char**)
omAlloc(
sizeof(
char*));
1611 npar = 1;
1612 }
1613 else
1614 {
1615 tt=(
char**)
omalloc(lV*
sizeof(
char*));
1616 for(is = 0; is < lV; is++)
1617 {
1618 tt[is] = (
char*)
omAlloc(7*
sizeof(
char));
1619 sprintf (tt[is], "t%d", is+1);
1620 }
1621 npar = lV;
1622 }
1623
1626 char** xx = (
char**)
omAlloc(
sizeof(
char*));
1630
1631
1632
1635 poly rc;
1636
1637 if(!mgrad)
1638 {
1639 for(rowCount = 0; rowCount < lO; rowCount++)
1640 {
1641 for(colCount = 0; colCount < lO; colCount++)
1642 {
1643 if(adjMatrix[rowCount][colCount] != 0)
1644 {
1645 MATELEM(mR, rowCount + 1, colCount + 1) =
p_ISet(adjMatrix[rowCount][colCount],
R);
1647 }
1648 }
1649 }
1650 }
1651 else
1652 {
1653 for(rowCount = 0; rowCount < lO; rowCount++)
1654 {
1655 for(colCount = 0; colCount < lV; colCount++)
1656 {
1660 MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1)=
p_Add_q(rc,
MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1),
R);
1661 }
1662 }
1663 }
1664
1665 for(rowCount = 0; rowCount < lO; rowCount++)
1666 {
1667 if(C[rowCount] != 0)
1668 {
1670 }
1671 }
1672
1676
1678
1679 if(odp)
1680 {
1681 PrintS(
"\nlinear system:\n");
1682 if(!mgrad)
1683 {
1684 for(rowCount = 0; rowCount < lO; rowCount++)
1685 {
1686 Print(
"H(%d) = ", rowCount+1);
1687 for(colCount = 0; colCount < lV; colCount++)
1688 {
1692 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
1693 }
1694 Print(
" %d\n", C[rowCount] );
1695 }
1696 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
1697 PrintS(
"and i^th summand in the rhs of an eqn. is according\n");
1698 PrintS(
"to the right colon map corresp. to the i^th variable\n");
1699 }
1700 else
1701 {
1702 for(rowCount = 0; rowCount < lO; rowCount++)
1703 {
1704 Print(
"H(%d) = ", rowCount+1);
1705 for(colCount = 0; colCount < lV; colCount++)
1706 {
1710 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
1711 }
1712 Print(
" %d\n", C[rowCount] );
1713 }
1714 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
1715 }
1716 }
1718 posMat.resize(0);
1719 C.resize(0);
1725
1726
1727
1728
1731
1732
1733
1734
1735
1744
1746 Print(
"Hilbert series:");
1749 if(!mgrad)
1750 {
1752 }
1753 else
1754 {
1755 for(is = lV-1; is >= 0; is--)
1756
1758 }
1764}
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