1327{
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345 int trInd;
1348 {
1349 PrintS(
"Hilbert Series:\n 0\n");
1350 return;
1351 }
1352 int (*POS)(ideal, poly, std::vector<ideal>, std::vector<poly>, int, int);
1353 if(trunDegHs != 0)
1354 {
1355 Print(
"\nTruncation degree = %d\n",trunDegHs);
1357 }
1358 else
1359 {
1360 if(IG_CASE)
1361 {
1363 {
1364 WerrorS(
"wrong input: it is not an infinitely gen. case");
1365 return;
1366 }
1369 }
1370 else
1372 }
1373 std::vector<ideal > idorb;
1374 std::vector< poly > polist;
1375
1376 ideal orb_init =
idInit(1, 1);
1377 idorb.push_back(orb_init);
1378
1380
1381 std::vector< std::vector<int> > posMat;
1382 std::vector<int> posRow(lV,0);
1383 std::vector<int> C;
1384
1385 int ds, is, ps;
1386 unsigned long lpcnt = 0;
1387
1389 ideal Jwi;
1390
1391 while(lpcnt < idorb.size())
1392 {
1395 if(lpcnt >= 1 &&
idIs0(idorb[lpcnt]) ==
FALSE)
1396 {
1398 {
1399 C.push_back(1);
1400 }
1401 else
1402 C.push_back(0);
1403 }
1404 else
1405 {
1406 C.push_back(1);
1407 }
1408
1410 lpcnt++;
1411
1412 for(is = 1; is <= lV; is++)
1413 {
1415
1416
1417
1418
1419
1420
1425
1426
1427
1428
1429
1431
1433 ps = (*POS)(Jwi, wi, idorb, polist, trInd, trunDegHs);
1434
1435 if(ps == 0)
1436 {
1437 posRow[is-1] = idorb.size();
1438
1439 idorb.push_back(Jwi);
1440 polist.push_back(wi);
1441 }
1442 else
1443 {
1444 posRow[is-1]=ps-1;
1447 }
1448 }
1449 posMat.push_back(posRow);
1450 posRow.resize(lV,0);
1451 }
1452 int lO = C.size();
1455 Print(
"\nlength of the Orbit = %d", lO);
1457
1458 if(odp)
1459 {
1460 Print(
"words description of the Orbit: \n");
1461 for(is = 0; is < lO; is++)
1462 {
1465 }
1467 PrintS(
"\nmaximal degree, #(sum_j R(w,w_j))");
1469 for(is = 0; is < lO; is++)
1470 {
1471 if(
idIs0(idorb[is]))
1472 {
1474 }
1475 else
1476 {
1478 }
1479 }
1480 }
1481
1482 for(is = idorb.size()-1; is >= 0; is--)
1483 {
1485 }
1486 for(is = polist.size()-1; is >= 0; is--)
1487 {
1489 }
1490
1491 idorb.resize(0);
1492 polist.resize(0);
1493
1494 int adjMatrix[lO][lO];
1495 memset(adjMatrix, 0, lO*lO*sizeof(int));
1496 int rowCount, colCount;
1497 int tm = 0;
1498 if(!mgrad)
1499 {
1500 for(rowCount = 0; rowCount < lO; rowCount++)
1501 {
1502 for(colCount = 0; colCount < lV; colCount++)
1503 {
1504 tm = posMat[rowCount][colCount];
1505 adjMatrix[rowCount][tm] = adjMatrix[rowCount][tm] + 1;
1506 }
1507 }
1508 }
1509
1511 int npar;
1512 char** tt;
1514 if(!mgrad)
1515 {
1516 tt=(
char**)
omAlloc(
sizeof(
char*));
1518 npar = 1;
1519 }
1520 else
1521 {
1522 tt=(
char**)
omalloc(lV*
sizeof(
char*));
1523 for(is = 0; is < lV; is++)
1524 {
1525 tt[is] = (
char*)
omAlloc(7*
sizeof(
char));
1526 sprintf (tt[is], "t%d", is+1);
1527 }
1528 npar = lV;
1529 }
1530
1533 char** xx = (
char**)
omAlloc(
sizeof(
char*));
1537
1538
1539
1542 poly rc;
1543
1544 if(!mgrad)
1545 {
1546 for(rowCount = 0; rowCount < lO; rowCount++)
1547 {
1548 for(colCount = 0; colCount < lO; colCount++)
1549 {
1550 if(adjMatrix[rowCount][colCount] != 0)
1551 {
1552 MATELEM(mR, rowCount + 1, colCount + 1) =
p_ISet(adjMatrix[rowCount][colCount],
R);
1554 }
1555 }
1556 }
1557 }
1558 else
1559 {
1560 for(rowCount = 0; rowCount < lO; rowCount++)
1561 {
1562 for(colCount = 0; colCount < lV; colCount++)
1563 {
1567 MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1)=
p_Add_q(rc,
MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1),
R);
1568 }
1569 }
1570 }
1571
1572 for(rowCount = 0; rowCount < lO; rowCount++)
1573 {
1574 if(C[rowCount] != 0)
1575 {
1577 }
1578 }
1579
1583
1585
1586 if(odp)
1587 {
1588 PrintS(
"\nlinear system:\n");
1589 if(!mgrad)
1590 {
1591 for(rowCount = 0; rowCount < lO; rowCount++)
1592 {
1593 Print(
"H(%d) = ", rowCount+1);
1594 for(colCount = 0; colCount < lV; colCount++)
1595 {
1599 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
1600 }
1601 Print(
" %d\n", C[rowCount] );
1602 }
1603 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
1604 PrintS(
"and i^th summand in the rhs of an eqn. is according\n");
1605 PrintS(
"to the right colon map corresp. to the i^th variable\n");
1606 }
1607 else
1608 {
1609 for(rowCount = 0; rowCount < lO; rowCount++)
1610 {
1611 Print(
"H(%d) = ", rowCount+1);
1612 for(colCount = 0; colCount < lV; colCount++)
1613 {
1617 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
1618 }
1619 Print(
" %d\n", C[rowCount] );
1620 }
1621 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
1622 }
1623 }
1625 posMat.resize(0);
1626 C.resize(0);
1632
1633
1634
1635
1638
1639
1640
1641
1642
1651
1653 Print(
"Hilbert series:");
1656 if(!mgrad)
1657 {
1659 }
1660 else
1661 {
1662 for(is = lV-1; is >= 0; is--)
1663
1665 }
1671}
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