1407{
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425 int trInd;
1428 {
1429 PrintS(
"Hilbert Series:\n 0\n");
1430 return;
1431 }
1432 int (*POS)(ideal, poly, std::vector<ideal>, std::vector<poly>, int, int);
1433 if(trunDegHs != 0)
1434 {
1435 Print(
"\nTruncation degree = %d\n",trunDegHs);
1437 }
1438 else
1439 {
1440 if(IG_CASE)
1441 {
1443 {
1444 WerrorS(
"wrong input: it is not an infinitely gen. case");
1445 return;
1446 }
1449 }
1450 else
1452 }
1453 std::vector<ideal > idorb;
1454 std::vector< poly > polist;
1455
1456 ideal orb_init =
idInit(1, 1);
1457 idorb.push_back(orb_init);
1458
1460
1461 std::vector< std::vector<int> > posMat;
1462 std::vector<int> posRow(lV,0);
1463 std::vector<int> C;
1464
1465 int ds, is, ps;
1466 unsigned long lpcnt = 0;
1467
1469 ideal Jwi;
1470
1471 while(lpcnt < idorb.size())
1472 {
1475 if(lpcnt >= 1 &&
idIs0(idorb[lpcnt]) ==
FALSE)
1476 {
1478 {
1479 C.push_back(1);
1480 }
1481 else
1482 C.push_back(0);
1483 }
1484 else
1485 {
1486 C.push_back(1);
1487 }
1488
1490 lpcnt++;
1491
1492 for(is = 1; is <= lV; is++)
1493 {
1495
1496
1497
1498
1499
1500
1505
1506
1507
1508
1509
1511
1513 ps = (*POS)(Jwi, wi, idorb, polist, trInd, trunDegHs);
1514
1515 if(ps == 0)
1516 {
1517 posRow[is-1] = idorb.size();
1518
1519 idorb.push_back(Jwi);
1520 polist.push_back(wi);
1521 }
1522 else
1523 {
1524 posRow[is-1]=ps-1;
1527 }
1528 }
1529 posMat.push_back(posRow);
1530 posRow.resize(lV,0);
1531 }
1532 int lO = C.size();
1535 Print(
"\nlength of the Orbit = %d", lO);
1537
1538 if(odp)
1539 {
1540 Print(
"words description of the Orbit: \n");
1541 for(is = 0; is < lO; is++)
1542 {
1545 }
1547 PrintS(
"\nmaximal degree, #(sum_j R(w,w_j))");
1549 for(is = 0; is < lO; is++)
1550 {
1551 if(
idIs0(idorb[is]))
1552 {
1554 }
1555 else
1556 {
1558 }
1559 }
1560 }
1561
1562 for(is = idorb.size()-1; is >= 0; is--)
1563 {
1565 }
1566 for(is = polist.size()-1; is >= 0; is--)
1567 {
1569 }
1570
1571 idorb.resize(0);
1572 polist.resize(0);
1573
1574 int adjMatrix[lO][lO];
1575 memset(adjMatrix, 0, lO*lO*sizeof(int));
1576 int rowCount, colCount;
1577 int tm = 0;
1578 if(!mgrad)
1579 {
1580 for(rowCount = 0; rowCount < lO; rowCount++)
1581 {
1582 for(colCount = 0; colCount < lV; colCount++)
1583 {
1584 tm = posMat[rowCount][colCount];
1585 adjMatrix[rowCount][tm] = adjMatrix[rowCount][tm] + 1;
1586 }
1587 }
1588 }
1589
1591 int npar;
1592 char** tt;
1594 if(!mgrad)
1595 {
1596 tt=(
char**)
omAlloc(
sizeof(
char*));
1598 npar = 1;
1599 }
1600 else
1601 {
1602 tt=(
char**)
omalloc(lV*
sizeof(
char*));
1603 for(is = 0; is < lV; is++)
1604 {
1605 tt[is] = (
char*)
omAlloc(7*
sizeof(
char));
1606 snprintf (tt[is],7, "t%d", is+1);
1607 }
1608 npar = lV;
1609 }
1610
1613 char** xx = (
char**)
omAlloc(
sizeof(
char*));
1617
1618
1619
1622 poly rc;
1623
1624 if(!mgrad)
1625 {
1626 for(rowCount = 0; rowCount < lO; rowCount++)
1627 {
1628 for(colCount = 0; colCount < lO; colCount++)
1629 {
1630 if(adjMatrix[rowCount][colCount] != 0)
1631 {
1632 MATELEM(mR, rowCount + 1, colCount + 1) =
p_ISet(adjMatrix[rowCount][colCount],
R);
1634 }
1635 }
1636 }
1637 }
1638 else
1639 {
1640 for(rowCount = 0; rowCount < lO; rowCount++)
1641 {
1642 for(colCount = 0; colCount < lV; colCount++)
1643 {
1647 MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1)=
p_Add_q(rc,
MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1),
R);
1648 }
1649 }
1650 }
1651
1652 for(rowCount = 0; rowCount < lO; rowCount++)
1653 {
1654 if(C[rowCount] != 0)
1655 {
1657 }
1658 }
1659
1663
1665
1666 if(odp)
1667 {
1668 PrintS(
"\nlinear system:\n");
1669 if(!mgrad)
1670 {
1671 for(rowCount = 0; rowCount < lO; rowCount++)
1672 {
1673 Print(
"H(%d) = ", rowCount+1);
1674 for(colCount = 0; colCount < lV; colCount++)
1675 {
1679 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
1680 }
1681 Print(
" %d\n", C[rowCount] );
1682 }
1683 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
1684 PrintS(
"and i^th summand in the rhs of an eqn. is according\n");
1685 PrintS(
"to the right colon map corresp. to the i^th variable\n");
1686 }
1687 else
1688 {
1689 for(rowCount = 0; rowCount < lO; rowCount++)
1690 {
1691 Print(
"H(%d) = ", rowCount+1);
1692 for(colCount = 0; colCount < lV; colCount++)
1693 {
1697 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
1698 }
1699 Print(
" %d\n", C[rowCount] );
1700 }
1701 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
1702 }
1703 }
1705 posMat.resize(0);
1706 C.resize(0);
1712
1713
1714
1715
1718
1719
1720
1721
1722
1731
1733 Print(
"Hilbert series:");
1736 if(!mgrad)
1737 {
1739 }
1740 else
1741 {
1742 for(is = lV-1; is >= 0; is--)
1743
1745 }
1751}
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