My Project
Loading...
Searching...
No Matches
hutil.h File Reference
#include "polys/monomials/ring.h"
#include "kernel/polys.h"
#include "misc/intvec.h"

Go to the source code of this file.

Data Structures

struct  monh
 
struct  indlist
 

Macros

#define LEN_MON   (sizeof(scfmon) + sizeof(int))
 

Typedefs

typedef int * scmon
 
typedef scmonscfmon
 
typedef int * varset
 
typedef monh * monp
 
typedef monpmonf
 
typedef indlist * indset
 

Functions

void hDelete (scfmon ev, int ev_length)
 
void hComp (scfmon exist, int Nexist, int ak, scfmon stc, int *Nstc)
 
void hSupp (scfmon stc, int Nstc, varset var, int *Nvar)
 
void hOrdSupp (scfmon stc, int Nstc, varset var, int Nvar)
 
void hStaircase (scfmon stc, int *Nstc, varset var, int Nvar)
 
void hRadical (scfmon rad, int *Nrad, int Nvar)
 
void hLexS (scfmon stc, int Nstc, varset var, int Nvar)
 
void hLexR (scfmon rad, int Nrad, varset var, int Nvar)
 
void hPure (scfmon stc, int a, int *Nstc, varset var, int Nvar, scmon pure, int *Npure)
 
void hElimS (scfmon stc, int *e1, int a2, int e2, varset var, int Nvar)
 
void hElimR (scfmon rad, int *e1, int a2, int e2, varset var, int Nvar)
 
void hLex2S (scfmon stc, int e1, int a2, int e2, varset var, int Nvar, scfmon w)
 
void hLex2R (scfmon rad, int e1, int a2, int e2, varset var, int Nvar, scfmon w)
 
void hStepS (scfmon stc, int Nstc, varset var, int Nvar, int *a, int *x)
 
void hStepR (scfmon rad, int Nrad, varset var, int Nvar, int *a)
 
monf hCreate (int Nvar)
 
void hKill (monf xmem, int Nvar)
 
scfmon hGetmem (int lm, scfmon old, monp monmem)
 
scmon hGetpure (scmon p)
 
void hDimSolve (scmon pure, int Npure, scfmon rad, int Nrad, varset var, int Nvar)
 
void hIndMult (scmon pure, int Npure, scfmon rad, int Nrad, varset var, int Nvar)
 
void hIndAllMult (scmon pure, int Npure, scfmon rad, int Nrad, varset var, int Nvar)
 
void hDegreeSeries (intvec *s1, intvec *s2, int *co, int *mu)
 
scfmon hInit (ideal S, ideal Q, int *Nexist)
 
void slicehilb (ideal I)
 
void HilbertSeries_OrbitData (ideal S, int lV, bool ig, bool mgrad, bool odp, int trunDegHs)
 
ideal RightColonOperation (ideal i, poly w, int lV)
 

Variables

EXTERN_VAR omBin indlist_bin
 
EXTERN_VAR scfmon hexist
 
EXTERN_VAR scfmon hstc
 
EXTERN_VAR scfmon hrad
 
EXTERN_VAR scfmon hwork
 
EXTERN_VAR scmon hpure
 
EXTERN_VAR scmon hpur0
 
EXTERN_VAR varset hvar
 
EXTERN_VAR varset hsel
 
EXTERN_VAR int hNexist
 
EXTERN_VAR int hNstc
 
EXTERN_VAR int hNrad
 
EXTERN_VAR int hNvar
 
EXTERN_VAR int hNpure
 
EXTERN_VAR monf stcmem
 
EXTERN_VAR monf radmem
 
EXTERN_VAR int hisModule
 
EXTERN_VAR indset ISet
 
EXTERN_VAR indset JSet
 
EXTERN_VAR int hCo
 
EXTERN_VAR int hMu2
 
EXTERN_VAR long hMu
 

Data Structure Documentation

◆ monrec

struct monrec

Definition at line 21 of file hutil.h.

Data Fields
int a
scfmon mo

◆ sindlist

struct sindlist

Definition at line 29 of file hutil.h.

Data Fields
indset nx
intvec * set

Macro Definition Documentation

◆ LEN_MON

#define LEN_MON   (sizeof(scfmon) + sizeof(int))

Definition at line 35 of file hutil.h.

Typedef Documentation

◆ indset

typedef indlist* indset

Definition at line 28 of file hutil.h.

◆ monf

typedef monp* monf

Definition at line 20 of file hutil.h.

◆ monp

typedef monh* monp

Definition at line 19 of file hutil.h.

◆ scfmon

typedef scmon* scfmon

Definition at line 15 of file hutil.h.

◆ scmon

typedef int* scmon

Definition at line 14 of file hutil.h.

◆ varset

typedef int* varset

Definition at line 16 of file hutil.h.

Function Documentation

◆ hComp()

void hComp ( scfmon exist,
int Nexist,
int ak,
scfmon stc,
int * Nstc )

Definition at line 154 of file hutil.cc.

155{
156 int k = 0;
157 scfmon ex = exist, co = stc;
158 int i;
159
160 for (i = Nexist; i>0; i--)
161 {
162 if (((**ex) == 0) || ((**ex) == ak))
163 {
164 *co = *ex;
165 co++;
166 k++;
167 }
168 ex++;
169 }
170 *Nstc = k;
171}
int i
Definition cfEzgcd.cc:132
int k
Definition cfEzgcd.cc:99
scmon * scfmon
Definition hutil.h:15

◆ hCreate()

monf hCreate ( int Nvar)

Definition at line 996 of file hutil.cc.

997{
998 monf xmem;
999 int i;
1000 xmem = (monf)omAlloc((Nvar + 1) * sizeof(monp));
1001 for (i = Nvar; i>0; i--)
1002 {
1003 xmem[i] = (monp)omAlloc(LEN_MON);
1004 xmem[i]->mo = NULL;
1005 }
1006 return xmem;
1007}
#define LEN_MON
Definition hutil.h:35
monh * monp
Definition hutil.h:19
monp * monf
Definition hutil.h:20
#define omAlloc(size)
#define NULL
Definition omList.c:12

◆ hDegreeSeries()

void hDegreeSeries ( intvec * s1,
intvec * s2,
int * co,
int * mu )

Definition at line 742 of file hilb.cc.

743{
744 int i, j, k;
745 int m;
746 *co = *mu = 0;
747 if ((s1 == NULL) || (s2 == NULL))
748 return;
749 i = s1->length();
750 j = s2->length();
751 if (j > i)
752 return;
753 m = 0;
754 for(k=j-2; k>=0; k--)
755 m += (*s2)[k];
756 *mu = m;
757 *co = i - j;
758}
int m
Definition cfEzgcd.cc:128
int length() const
Definition intvec.h:95
int j
Definition facHensel.cc:110
static matrix mu(matrix A, const ring R)
Definition matpol.cc:2028

◆ hDelete()

void hDelete ( scfmon ev,
int ev_length )

Definition at line 140 of file hutil.cc.

141{
142 int i;
143
144 if (ev_length>0)
145 {
146 for (i=ev_length-1;i>=0;i--)
147 omFreeSize(hsecure[i],((currRing->N)+1)*sizeof(int));
148 omFreeSize(hsecure, ev_length*sizeof(scmon));
149 omFreeSize(ev, ev_length*sizeof(scmon));
150 }
151}
STATIC_VAR scfmon hsecure
Definition hutil.cc:29
int * scmon
Definition hutil.h:14
#define omFreeSize(addr, size)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13

◆ hDimSolve()

void hDimSolve ( scmon pure,
int Npure,
scfmon rad,
int Nrad,
varset var,
int Nvar )

Definition at line 35 of file hdegree.cc.

37{
38 int dn, iv, rad0, b, c, x;
39 scmon pn;
40 scfmon rn;
41 if (Nrad < 2)
42 {
43 dn = Npure + Nrad;
44 if (dn < hCo)
45 hCo = dn;
46 return;
47 }
48 if (Npure+1 >= hCo)
49 return;
50 iv = Nvar;
51 while(pure[var[iv]]) iv--;
52 hStepR(rad, Nrad, var, iv, &rad0);
53 if (rad0!=0)
54 {
55 iv--;
56 if (rad0 < Nrad)
57 {
58 pn = hGetpure(pure);
59 rn = hGetmem(Nrad, rad, radmem[iv]);
60 hDimSolve(pn, Npure + 1, rn, rad0, var, iv);
61 b = rad0;
62 c = Nrad;
63 hElimR(rn, &rad0, b, c, var, iv);
64 hPure(rn, b, &c, var, iv, pn, &x);
65 hLex2R(rn, rad0, b, c, var, iv, hwork);
66 rad0 += (c - b);
67 hDimSolve(pn, Npure + x, rn, rad0, var, iv);
68 }
69 else
70 {
71 hDimSolve(pure, Npure, rad, Nrad, var, iv);
72 }
73 }
74 else
75 hCo = Npure + 1;
76}
Variable x
Definition cfModGcd.cc:4090
CanonicalForm b
Definition cfModGcd.cc:4111
VAR int hCo
Definition hdegree.cc:27
void hDimSolve(scmon pure, int Npure, scfmon rad, int Nrad, varset var, int Nvar)
Definition hdegree.cc:35
scfmon hGetmem(int lm, scfmon old, monp monmem)
Definition hutil.cc:1023
void hPure(scfmon stc, int a, int *Nstc, varset var, int Nvar, scmon pure, int *Npure)
Definition hutil.cc:621
VAR scfmon hwork
Definition hutil.cc:16
void hStepR(scfmon rad, int Nrad, varset var, int Nvar, int *a)
Definition hutil.cc:974
void hLex2R(scfmon rad, int e1, int a2, int e2, varset var, int Nvar, scfmon w)
Definition hutil.cc:880
void hElimR(scfmon rad, int *e1, int a2, int e2, varset var, int Nvar)
Definition hutil.cc:742
VAR monf radmem
Definition hutil.cc:21
scmon hGetpure(scmon p)
Definition hutil.cc:1052

◆ hElimR()

void hElimR ( scfmon rad,
int * e1,
int a2,
int e2,
varset var,
int Nvar )

Definition at line 742 of file hutil.cc.

743{
744 int nc = *e1, z = 0, i, j, k, k1;
745 scmon n, o;
746 if (!nc || (a2 == e2))
747 return;
748 j = 0;
749 i = a2;
750 o = rad[i];
751 n = rad[0];
752 k = Nvar;
753 loop
754 {
755 k1 = var[k];
756 if (o[k1] && !n[k1])
757 {
758 k = Nvar;
759 i++;
760 if (i < e2)
761 o = rad[i];
762 else
763 {
764 j++;
765 if (j < nc)
766 {
767 i = a2;
768 o = rad[i];
769 n = rad[j];
770 }
771 else
772 {
773 if (z!=0)
774 {
775 *e1 -= z;
776 hShrink(rad, 0, nc);
777 }
778 return;
779 }
780 }
781 }
782 else
783 {
784 k--;
785 if (!k)
786 {
787 rad[j] = NULL;
788 z++;
789 j++;
790 if (j < nc)
791 {
792 i = a2;
793 o = rad[i];
794 n = rad[j];
795 k = Nvar;
796 }
797 else
798 {
799 if (z!=0)
800 {
801 *e1 -= z;
802 hShrink(rad, 0, nc);
803 }
804 return;
805 }
806 }
807 }
808 }
809}
static void hShrink(scfmon co, int a, int Nco)
Definition hutil.cc:297
#define loop
Definition structs.h:71

◆ hElimS()

void hElimS ( scfmon stc,
int * e1,
int a2,
int e2,
varset var,
int Nvar )

Definition at line 672 of file hutil.cc.

673{
674 int nc = *e1, z = 0, i, j, k, k1;
675 scmon n, o;
676 if (!nc || (a2 == e2))
677 return;
678 j = 0;
679 i = a2;
680 o = stc[i];
681 n = stc[0];
682 k = Nvar;
683 loop
684 {
685 k1 = var[k];
686 if (o[k1] > n[k1])
687 {
688 k = Nvar;
689 i++;
690 if (i < e2)
691 o = stc[i];
692 else
693 {
694 j++;
695 if (j < nc)
696 {
697 i = a2;
698 o = stc[i];
699 n = stc[j];
700 }
701 else
702 {
703 if (z!=0)
704 {
705 *e1 -= z;
706 hShrink(stc, 0, nc);
707 }
708 return;
709 }
710 }
711 }
712 else
713 {
714 k--;
715 if (k==0)
716 {
717 stc[j] = NULL;
718 z++;
719 j++;
720 if (j < nc)
721 {
722 i = a2;
723 o = stc[i];
724 n = stc[j];
725 k = Nvar;
726 }
727 else
728 {
729 if (z!=0)
730 {
731 *e1 -= z;
732 hShrink(stc, 0, nc);
733 }
734 return;
735 }
736 }
737 }
738 }
739}

◆ hGetmem()

scfmon hGetmem ( int lm,
scfmon old,
monp monmem )

Definition at line 1023 of file hutil.cc.

1024{
1025 scfmon x = monmem->mo;
1026 int lx = monmem->a;
1027 if ((x==NULL) || (lm > lx))
1028 {
1029 /* according to http://www.singular.uni-kl.de:8002/trac/ticket/463#comment:4
1030 * we need to work around a compiler bug:
1031 * if ((x!=NULL)&&(lx>0)) omFreeSize((ADDRESS)x, lx * sizeof(scmon));
1032 */
1033 if (x!=NULL) if (lx>0) omFreeSize((ADDRESS)x, lx * sizeof(scmon));
1034 monmem->mo = x = (scfmon)omAlloc(lm * sizeof(scmon));
1035 monmem->a = lm;
1036 }
1037 memcpy(x, old, lm * sizeof(scmon));
1038 return x;
1039}
void * ADDRESS
Definition auxiliary.h:120

◆ hGetpure()

scmon hGetpure ( scmon p)

Definition at line 1052 of file hutil.cc.

1053{
1054 scmon p1 = p;
1055 scmon pn;
1056 p1++;
1057 pn = p1;
1058 pn += (currRing->N);
1059 memcpy(pn, p1, (currRing->N) * sizeof(int));
1060 return pn - 1;
1061}
int p
Definition cfModGcd.cc:4086

◆ HilbertSeries_OrbitData()

void HilbertSeries_OrbitData ( ideal S,
int lV,
bool ig,
bool mgrad,
bool odp,
int trunDegHs )

Definition at line 1406 of file hilb.cc.

1407{
1408
1409 /* new story:
1410 no lV is needed, i.e. it is to be determined
1411 the rest is extracted from the interface input list in extra.cc and makes the input of this proc
1412 called from extra.cc
1413 */
1414
1415 /*
1416 * This is based on iterative right colon operations on a
1417 * two-sided monomial ideal of the free associative algebra.
1418 * The algorithm terminates for those monomial ideals
1419 * whose monomials define "regular formal languages",
1420 * that is, all monomials of the input ideal can be obtained
1421 * from finite languages by applying finite number of
1422 * rational operations.
1423 */
1424
1425 int trInd;
1426 S = minimalMonomialGenSet(S);
1427 if( !idIs0(S) && p_Totaldegree(S->m[0], currRing)==0)
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 {
1442 if(idIs0(S))
1443 {
1444 WerrorS("wrong input: it is not an infinitely gen. case");
1445 return;
1446 }
1447 trInd = p_Totaldegree(S->m[IDELEMS(S)-1], currRing);
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
1459 polist.push_back( p_One(currRing));
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
1468 poly w, wi;
1469 ideal Jwi;
1470
1471 while(lpcnt < idorb.size())
1472 {
1473 w = NULL;
1474 w = polist[lpcnt];
1475 if(lpcnt >= 1 && idIs0(idorb[lpcnt]) == FALSE)
1476 {
1477 if(p_Totaldegree(idorb[lpcnt]->m[0], currRing) != 0)
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
1489 ds = p_Totaldegree(w, currRing);
1490 lpcnt++;
1491
1492 for(is = 1; is <= lV; is++)
1493 {
1494 wi = NULL;
1495 //make new copy 'wi' of word w=polist[lpcnt]
1496 //and update it (for the colon operation).
1497 //if corresponding to wi, right colon operation gives
1498 //a new (right colon) ideal of S,
1499 //keep 'wi' in the polist else delete it
1500
1501 wi = pCopy(w);
1502 p_SetExp(wi, (ds*lV)+is, 1, currRing);
1503 p_Setm(wi, currRing);
1504 Jwi = NULL;
1505 //Jwi stores (right) colon ideal of S w.r.t. word
1506 //wi if colon operation gives a new ideal place it
1507 //in the vector of ideals 'idorb'
1508 //otherwise delete it
1509
1510 Jwi = idInit(1,1);
1511
1512 Jwi = colonIdeal(S, wi, lV, Jwi, trunDegHs);
1513 ps = (*POS)(Jwi, wi, idorb, polist, trInd, trunDegHs);
1514
1515 if(ps == 0) // finds a new ideal
1516 {
1517 posRow[is-1] = idorb.size();
1518
1519 idorb.push_back(Jwi);
1520 polist.push_back(wi);
1521 }
1522 else // ideal is already there in the set
1523 {
1524 posRow[is-1]=ps-1;
1525 idDelete(&Jwi);
1526 pDelete(&wi);
1527 }
1528 }
1529 posMat.push_back(posRow);
1530 posRow.resize(lV,0);
1531 }
1532 int lO = C.size();//size of the orbit
1533 PrintLn();
1534 Print("maximal length of words = %ld\n", p_Totaldegree(polist[lO-1], currRing));
1535 Print("\nlength of the Orbit = %d", lO);
1536 PrintLn();
1537
1538 if(odp)
1539 {
1540 Print("words description of the Orbit: \n");
1541 for(is = 0; is < lO; is++)
1542 {
1543 pWrite0(polist[is]);
1544 PrintS(" ");
1545 }
1546 PrintLn();
1547 PrintS("\nmaximal degree, #(sum_j R(w,w_j))");
1548 PrintLn();
1549 for(is = 0; is < lO; is++)
1550 {
1551 if(idIs0(idorb[is]))
1552 {
1553 PrintS("NULL\n");
1554 }
1555 else
1556 {
1557 Print("%ld, %d \n",p_Totaldegree(idorb[is]->m[IDELEMS(idorb[is])-1], currRing),IDELEMS(idorb[is]));
1558 }
1559 }
1560 }
1561
1562 for(is = idorb.size()-1; is >= 0; is--)
1563 {
1564 idDelete(&idorb[is]);
1565 }
1566 for(is = polist.size()-1; is >= 0; is--)
1567 {
1568 pDelete(&polist[is]);
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
1590 ring r = currRing;
1591 int npar;
1592 char** tt;
1594 if(!mgrad)
1595 {
1596 tt=(char**)omAlloc(sizeof(char*));
1597 tt[0] = omStrDup("t");
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)); //if required enlarge it later
1606 snprintf (tt[is],7, "t%d", is+1);
1607 }
1608 npar = lV;
1609 }
1610
1611 p.r = rDefault(0, npar, tt);
1613 char** xx = (char**)omAlloc(sizeof(char*));
1614 xx[0] = omStrDup("x");
1615 ring R = rDefault(cf, 1, xx);
1616 rChangeCurrRing(R);//rWrite(R);
1617 /*
1618 * matrix corresponding to the orbit of the ideal
1619 */
1620 matrix mR = mpNew(lO, lO);
1621 matrix cMat = mpNew(lO,1);
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);
1633 p_SetCoeff(MATELEM(mR, rowCount + 1, colCount + 1), n_Mult(pGetCoeff(mR->m[lO*rowCount+colCount]),n_Param(1, R->cf), R->cf), R);
1634 }
1635 }
1636 }
1637 }
1638 else
1639 {
1640 for(rowCount = 0; rowCount < lO; rowCount++)
1641 {
1642 for(colCount = 0; colCount < lV; colCount++)
1643 {
1644 rc=NULL;
1645 rc=p_One(R);
1646 p_SetCoeff(rc, n_Mult(pGetCoeff(rc), n_Param(colCount+1, R->cf),R->cf), R);
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 {
1656 MATELEM(cMat, rowCount + 1, 1) = p_ISet(C[rowCount], R);
1657 }
1658 }
1659
1660 matrix u;
1661 unitMatrix(lO, u); //unit matrix
1662 matrix gMat = mp_Sub(u, mR, R);
1663
1664 char* s;
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 {
1676 StringSetS(""); nWrite(n_Param(1, R->cf));
1677 s = StringEndS(); PrintS(s);
1678 Print("*"); omFree(s);
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 {
1694 StringSetS(""); nWrite(n_Param(colCount+1, R->cf));
1695 s = StringEndS(); PrintS(s);
1696 Print("*");omFree(s);
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 }
1704 PrintLn();
1705 posMat.resize(0);
1706 C.resize(0);
1707 matrix pMat;
1708 matrix lMat;
1709 matrix uMat;
1710 matrix H_serVec = mpNew(lO, 1);
1711 matrix Hnot;
1712
1713 //std::clock_t start;
1714 //start = std::clock();
1715
1716 luDecomp(gMat, pMat, lMat, uMat, R);
1717 luSolveViaLUDecomp(pMat, lMat, uMat, cMat, H_serVec, Hnot);
1718
1719 //to print system solving time
1720 //if(odp){
1721 //std::cout<<"solving time of the system = "<<(std::clock()-start)/(double)(CLOCKS_PER_SEC / 1000)<<" ms"<<std::endl;}
1722
1723 mp_Delete(&mR, R);
1724 mp_Delete(&u, R);
1725 mp_Delete(&pMat, R);
1726 mp_Delete(&lMat, R);
1727 mp_Delete(&uMat, R);
1728 mp_Delete(&cMat, R);
1729 mp_Delete(&gMat, R);
1730 mp_Delete(&Hnot, R);
1731 //print the Hilbert series and length of the Orbit
1732 PrintLn();
1733 Print("Hilbert series:");
1734 PrintLn();
1735 pWrite(H_serVec->m[0]);
1736 if(!mgrad)
1737 {
1738 omFree(tt[0]);
1739 }
1740 else
1741 {
1742 for(is = lV-1; is >= 0; is--)
1743
1744 omFree( tt[is]);
1745 }
1746 omFree(tt);
1747 omFree(xx[0]);
1748 omFree(xx);
1749 rChangeCurrRing(r);
1750 rKill(R);
1751}
#define FALSE
Definition auxiliary.h:97
CanonicalForm cf
Definition cfModGcd.cc:4091
poly * m
Definition matpol.h:18
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
Definition coeffs.h:637
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....
Definition coeffs.h:776
@ n_transExt
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition coeffs.h:38
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition numbers.cc:406
#define Print
Definition emacs.cc:80
const CanonicalForm int s
Definition facAbsFact.cc:51
const CanonicalForm & w
Definition facAbsFact.cc:51
void WerrorS(const char *s)
Definition feFopen.cc:24
static int positionInOrbitTruncationCase(ideal I, poly w, std::vector< ideal > idorb, std::vector< poly > polist, int, int trunDegHs)
Definition hilb.cc:1117
static ideal colonIdeal(ideal S, poly w, int lV, ideal Jwi, int trunDegHs)
Definition hilb.cc:1371
static int positionInOrbit_FG_Case(ideal I, poly, std::vector< ideal > idorb, std::vector< poly >, int, int)
Definition hilb.cc:1086
static int positionInOrbit_IG_Case(ideal I, poly w, std::vector< ideal > idorb, std::vector< poly > polist, int trInd, int)
Definition hilb.cc:1008
static ideal minimalMonomialGenSet(ideal I)
Definition hilb.cc:1211
#define idDelete(H)
delete an ideal
Definition ideals.h:29
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
void rKill(ring r)
Definition ipshell.cc:6174
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)
Definition matpol.cc:874
matrix mp_Sub(matrix a, matrix b, const ring R)
Definition matpol.cc:189
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition matpol.cc:37
#define MATELEM(mat, i, j)
1-based access to matrix
Definition matpol.h:29
ip_smatrix * matrix
Definition matpol.h:43
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition monomials.h:44
The main handler for Singular numbers which are suitable for Singular polynomials.
#define nWrite(n)
Definition numbers.h:29
#define omStrDup(s)
#define omalloc(size)
#define omFree(addr)
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
Definition p_polys.cc:1298
poly p_One(const ring r)
Definition p_polys.cc:1314
static poly p_Add_q(poly p, poly q, const ring r)
Definition p_polys.h:938
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
Definition p_polys.h:490
static void p_Setm(poly p, const ring r)
Definition p_polys.h:235
static number p_SetCoeff(poly p, number n, ring r)
Definition p_polys.h:414
static long p_Totaldegree(poly p, const ring r)
Definition p_polys.h:1523
void rChangeCurrRing(ring r)
Definition polys.cc:16
#define pDelete(p_ptr)
Definition polys.h:187
void pWrite0(poly p)
Definition polys.h:310
void pWrite(poly p)
Definition polys.h:309
#define pCopy(p)
return a copy of the poly
Definition polys.h:186
void StringSetS(const char *st)
Definition reporter.cc:128
void PrintS(const char *s)
Definition reporter.cc:284
char * StringEndS()
Definition reporter.cc:151
void PrintLn()
Definition reporter.cc:310
ring rDefault(const coeffs cf, int N, char **n, int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl, unsigned long bitmask)
Definition ring.cc:103
ideal idInit(int idsize, int rank)
initialise an ideal / module
#define IDELEMS(i)
#define R
Definition sirandom.c:27
struct for passing initialization parameters to naInitChar
Definition transext.h:88

◆ hIndAllMult()

void hIndAllMult ( scmon pure,
int Npure,
scfmon rad,
int Nrad,
varset var,
int Nvar )

Definition at line 562 of file hdegree.cc.

564{
565 int dn, iv, rad0, b, c, x;
566 scmon pn;
567 scfmon rn;
568 if (Nrad < 2)
569 {
570 dn = Npure + Nrad;
571 if (dn > hCo)
572 {
573 if (!Nrad)
574 hCheckIndep(pure);
575 else
576 {
577 pn = *rad;
578 for (iv = Nvar; iv; iv--)
579 {
580 x = var[iv];
581 if (pn[x])
582 {
583 pure[x] = 1;
584 hCheckIndep(pure);
585 pure[x] = 0;
586 }
587 }
588 }
589 }
590 return;
591 }
592 iv = Nvar;
593 while(pure[var[iv]]) iv--;
594 hStepR(rad, Nrad, var, iv, &rad0);
595 iv--;
596 if (rad0 < Nrad)
597 {
598 pn = hGetpure(pure);
599 rn = hGetmem(Nrad, rad, radmem[iv]);
600 pn[var[iv + 1]] = 1;
601 hIndAllMult(pn, Npure + 1, rn, rad0, var, iv);
602 pn[var[iv + 1]] = 0;
603 b = rad0;
604 c = Nrad;
605 hElimR(rn, &rad0, b, c, var, iv);
606 hPure(rn, b, &c, var, iv, pn, &x);
607 hLex2R(rn, rad0, b, c, var, iv, hwork);
608 rad0 += (c - b);
609 hIndAllMult(pn, Npure + x, rn, rad0, var, iv);
610 }
611 else
612 {
613 hIndAllMult(pure, Npure, rad, Nrad, var, iv);
614 }
615}
static void hCheckIndep(scmon pure)
Definition hdegree.cc:541
void hIndAllMult(scmon pure, int Npure, scfmon rad, int Nrad, varset var, int Nvar)
Definition hdegree.cc:562

◆ hIndMult()

void hIndMult ( scmon pure,
int Npure,
scfmon rad,
int Nrad,
varset var,
int Nvar )

Definition at line 382 of file hdegree.cc.

384{
385 int dn, iv, rad0, b, c, x;
386 scmon pn;
387 scfmon rn;
388 if (Nrad < 2)
389 {
390 dn = Npure + Nrad;
391 if (dn == hCo)
392 {
393 if (Nrad==0)
394 hIndep(pure);
395 else
396 {
397 pn = *rad;
398 for (iv = Nvar; iv!=0; iv--)
399 {
400 x = var[iv];
401 if (pn[x])
402 {
403 pure[x] = 1;
404 hIndep(pure);
405 pure[x] = 0;
406 }
407 }
408 }
409 }
410 return;
411 }
412 iv = Nvar;
413 dn = Npure+1;
414 if (dn >= hCo)
415 {
416 if (dn > hCo)
417 return;
418 loop
419 {
420 if(!pure[var[iv]])
421 {
422 if(hNotZero(rad, Nrad, var, iv))
423 {
424 pure[var[iv]] = 1;
425 hIndep(pure);
426 pure[var[iv]] = 0;
427 }
428 }
429 iv--;
430 if (!iv)
431 return;
432 }
433 }
434 while(pure[var[iv]]) iv--;
435 hStepR(rad, Nrad, var, iv, &rad0);
436 iv--;
437 if (rad0 < Nrad)
438 {
439 pn = hGetpure(pure);
440 rn = hGetmem(Nrad, rad, radmem[iv]);
441 pn[var[iv + 1]] = 1;
442 hIndMult(pn, Npure + 1, rn, rad0, var, iv);
443 pn[var[iv + 1]] = 0;
444 b = rad0;
445 c = Nrad;
446 hElimR(rn, &rad0, b, c, var, iv);
447 hPure(rn, b, &c, var, iv, pn, &x);
448 hLex2R(rn, rad0, b, c, var, iv, hwork);
449 rad0 += (c - b);
450 hIndMult(pn, Npure + x, rn, rad0, var, iv);
451 }
452 else
453 {
454 hIndMult(pure, Npure, rad, Nrad, var, iv);
455 }
456}
void hIndMult(scmon pure, int Npure, scfmon rad, int Nrad, varset var, int Nvar)
Definition hdegree.cc:382
static BOOLEAN hNotZero(scfmon rad, int Nrad, varset var, int Nvar)
Definition hdegree.cc:353
static void hIndep(scmon pure)
Definition hdegree.cc:368

◆ hInit()

scfmon hInit ( ideal S,
ideal Q,
int * Nexist )

Definition at line 31 of file hutil.cc.

32{
34 if (Q!=NULL) id_LmTest(Q, currRing);
35
37
38 if (hisModule < 0)
39 hisModule = 0;
40
41 int sl, ql, i, k = 0;
42 polyset si, qi, ss;
43 scfmon ex, ek;
44
45 if (S!=NULL)
46 {
47 si = S->m;
48 sl = IDELEMS(S);
49 }
50 else
51 {
52 si = NULL;
53 sl = 0;
54 }
55 if (Q!=NULL)
56 {
57 qi = Q->m;
58 ql = IDELEMS(Q);
59 }
60 else
61 {
62 qi = NULL;
63 ql = 0;
64 }
65 if ((sl + ql) == 0)
66 {
67 *Nexist = 0;
68 return NULL;
69 }
70 ss = si;
71 for (i = sl; i>0; i--)
72 {
73 if (*ss!=0)
74 k++;
75 ss++;
76 }
77 ss = qi;
78 for (i = ql; i>0; i--)
79 {
80 if (*ss!=0)
81 k++;
82 ss++;
83 }
84 *Nexist = k;
85 if (k==0)
86 return NULL;
87 ek = ex = (scfmon)omAlloc0(k * sizeof(scmon));
88 hsecure = (scfmon) omAlloc0(k * sizeof(scmon));
89 for (i = sl; i>0; i--)
90 {
91 if (*si!=NULL)
92 {
93 *ek = (scmon) omAlloc(((currRing->N)+1)*sizeof(int));
94 p_GetExpV(*si, *ek, currRing);
95 ek++;
96 }
97 si++;
98 }
99 for (i = ql; i>0; i--)
100 {
101 if (*qi!=NULL)
102 {
103 *ek = (scmon) omAlloc(((currRing->N)+1)*sizeof(int));
104 p_GetExpV(*qi, *ek, currRing);
105 ek++;
106 }
107 qi++;
108 }
109 memcpy(hsecure, ex, k * sizeof(scmon));
110 return ex;
111}
VAR int hisModule
Definition hutil.cc:20
#define omAlloc0(size)
static void p_GetExpV(poly p, int *ev, const ring r)
Definition p_polys.h:1536
poly * polyset
Definition polys.h:260
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
#define id_LmTest(A, lR)
#define Q
Definition sirandom.c:26

◆ hKill()

void hKill ( monf xmem,
int Nvar )

Definition at line 1010 of file hutil.cc.

1011{
1012 int i;
1013 for (i = Nvar; i!=0; i--)
1014 {
1015 if (xmem[i]->mo!=NULL)
1016 omFreeSize((ADDRESS)xmem[i]->mo, xmem[i]->a * sizeof(scmon));
1017 omFreeSize((ADDRESS)xmem[i], LEN_MON);
1018 }
1019 omFreeSize((ADDRESS)xmem, (Nvar + 1) * sizeof(monp));
1020}

◆ hLex2R()

void hLex2R ( scfmon rad,
int e1,
int a2,
int e2,
varset var,
int Nvar,
scfmon w )

Definition at line 880 of file hutil.cc.

882{
883 int j0 = 0, j = 0, i = a2, k, k1;
884 scmon n, o;
885 if (!e1)
886 {
887 for (; i < e2; i++)
888 rad[i - a2] = rad[i];
889 return;
890 }
891 else if (i == e2)
892 return;
893 n = rad[j];
894 o = rad[i];
895 loop
896 {
897 k = Nvar;
898 loop
899 {
900 k1 = var[k];
901 if (!o[k1] && n[k1])
902 {
903 w[j0] = o;
904 j0++;
905 i++;
906 if (i < e2)
907 {
908 o = rad[i];
909 break;
910 }
911 else
912 {
913 for (; j < e1; j++)
914 {
915 w[j0] = rad[j];
916 j0++;
917 }
918 memcpy(rad, w, (e1 + e2 - a2) * sizeof(scmon));
919 return;
920 }
921 }
922 else if (o[k1] && !n[k1])
923 {
924 w[j0] = n;
925 j0++;
926 j++;
927 if (j < e1)
928 {
929 n = rad[j];
930 break;
931 }
932 else
933 {
934 for (; i < e2; i++)
935 {
936 w[j0] = rad[i];
937 j0++;
938 }
939 memcpy(rad, w, (e1 + e2 - a2) * sizeof(scmon));
940 return;
941 }
942 }
943 k--;
944 }
945 }
946}

◆ hLex2S()

void hLex2S ( scfmon stc,
int e1,
int a2,
int e2,
varset var,
int Nvar,
scfmon w )

Definition at line 812 of file hutil.cc.

814{
815 int j0 = 0, j = 0, i = a2, k, k1;
816 scmon n, o;
817 if (!e1)
818 {
819 for (; i < e2; i++)
820 rad[i - a2] = rad[i];
821 return;
822 } else if (i == e2)
823 return;
824 n = rad[j];
825 o = rad[i];
826 loop
827 {
828 k = Nvar;
829 loop
830 {
831 k1 = var[k];
832 if (o[k1] < n[k1])
833 {
834 w[j0] = o;
835 j0++;
836 i++;
837 if (i < e2)
838 {
839 o = rad[i];
840 break;
841 }
842 else
843 {
844 for (; j < e1; j++)
845 {
846 w[j0] = rad[j];
847 j0++;
848 }
849 memcpy(rad, w, (e1 + e2 - a2) * sizeof(scmon));
850 return;
851 }
852 }
853 else if (o[k1] > n[k1])
854 {
855 w[j0] = n;
856 j0++;
857 j++;
858 if (j < e1)
859 {
860 n = rad[j];
861 break;
862 }
863 else
864 {
865 for (; i < e2; i++)
866 {
867 w[j0] = rad[i];
868 j0++;
869 }
870 memcpy(rad, w, (e1 + e2 - a2) * sizeof(scmon));
871 return;
872 }
873 }
874 k--;
875 }
876 }
877}

◆ hLexR()

void hLexR ( scfmon rad,
int Nrad,
varset var,
int Nvar )

Definition at line 565 of file hutil.cc.

566{
567 int j = 1, i = 0, k, k1;
568 scmon n, o;
569 if (Nrad < 2)
570 return;
571 n = rad[j];
572 o = rad[0];
573 k = Nvar;
574 loop
575 {
576 k1 = var[k];
577 if (!o[k1] && n[k1])
578 {
579 i++;
580 if (i < j)
581 {
582 o = rad[i];
583 k = Nvar;
584 }
585 else
586 {
587 j++;
588 if (j < Nrad)
589 {
590 i = 0;
591 o = rad[0];
592 n = rad[j];
593 k = Nvar;
594 }
595 else
596 return;
597 }
598 }
599 else if (o[k1] && !n[k1])
600 {
601 for (k = j; k > i; k--)
602 rad[k] = rad[k - 1];
603 rad[i] = n;
604 j++;
605 if (j < Nrad)
606 {
607 i = 0;
608 o = rad[0];
609 n = rad[j];
610 k = Nvar;
611 }
612 else
613 return;
614 }
615 else
616 k--;
617 }
618}

◆ hLexS()

void hLexS ( scfmon stc,
int Nstc,
varset var,
int Nvar )

Definition at line 506 of file hutil.cc.

507{
508 if (Nstc < 2)
509 return;
510 int j = 1, i = 0;
511 scmon n = stc[j];
512 scmon o = stc[0];
513 int k = Nvar;
514 loop
515 {
516 int k1 = var[k];
517 if (o[k1] < n[k1])
518 {
519 i++;
520 if (i < j)
521 {
522 o = stc[i];
523 k = Nvar;
524 }
525 else
526 {
527 j++;
528 if (j < Nstc)
529 {
530 i = 0;
531 o = stc[0];
532 n = stc[j];
533 k = Nvar;
534 }
535 else
536 return;
537 }
538 }
539 else if (o[k1] > n[k1])
540 {
541 int tmp_k;
542 for (tmp_k = j; tmp_k > i; tmp_k--)
543 stc[tmp_k] = stc[tmp_k - 1];
544 stc[i] = n;
545 j++;
546 if (j < Nstc)
547 {
548 i = 0;
549 o = stc[0];
550 n = stc[j];
551 k = Nvar;
552 }
553 else
554 return;
555 }
556 else
557 {
558 k--;
559 if (k<=0) return;
560 }
561 }
562}

◆ hOrdSupp()

void hOrdSupp ( scfmon stc,
int Nstc,
varset var,
int Nvar )

Definition at line 202 of file hutil.cc.

203{
204 int i, i1, j, jj, k, l;
205 int x;
206 scmon temp, count;
207 float o, h, g, *v1;
208
209 v1 = (float *)omAlloc(Nvar * sizeof(float));
210 temp = (int *)omAlloc(Nstc * sizeof(int));
211 count = (int *)omAlloc(Nstc * sizeof(int));
212 for (i = 1; i <= Nvar; i++)
213 {
214 i1 = var[i];
215 *temp = stc[0][i1];
216 *count = 1;
217 jj = 1;
218 for (j = 1; j < Nstc; j++)
219 {
220 x = stc[j][i1];
221 k = 0;
222 loop
223 {
224 if (x > temp[k])
225 {
226 k++;
227 if (k == jj)
228 {
229 temp[k] = x;
230 count[k] = 1;
231 jj++;
232 break;
233 }
234 }
235 else if (x < temp[k])
236 {
237 for (l = jj; l > k; l--)
238 {
239 temp[l] = temp[l-1];
240 count[l] = count[l-1];
241 }
242 temp[k] = x;
243 count[k] = 1;
244 jj++;
245 break;
246 }
247 else
248 {
249 count[k]++;
250 break;
251 }
252 }
253 }
254 h = 0.0;
255 o = (float)Nstc/(float)jj;
256 for(j = 0; j < jj; j++)
257 {
258 g = (float)count[j];
259 if (g > o)
260 g -= o;
261 else
262 g = o - g;
263 if (g > h)
264 h = g;
265 }
266 v1[i-1] = h * (float)jj;
267 }
268 omFreeSize((ADDRESS)count, Nstc * sizeof(int));
269 omFreeSize((ADDRESS)temp, Nstc * sizeof(int));
270 for (i = 1; i < Nvar; i++)
271 {
272 i1 = var[i+1];
273 h = v1[i];
274 j = 0;
275 loop
276 {
277 if (h > v1[j])
278 {
279 for (l = i; l > j; l--)
280 {
281 v1[l] = v1[l-1];
282 var[l+1] = var[l];
283 }
284 v1[j] = h;
285 var[j+1] = i1;
286 break;
287 }
288 j++;
289 if (j == i)
290 break;
291 }
292 }
293 omFreeSize((ADDRESS)v1, Nvar * sizeof(float));
294}
int l
Definition cfEzgcd.cc:100
g
Definition cfModGcd.cc:4098
STATIC_VAR Poly * h
Definition janet.cc:971
int status int void size_t count
Definition si_signals.h:69

◆ hPure()

void hPure ( scfmon stc,
int a,
int * Nstc,
varset var,
int Nvar,
scmon pure,
int * Npure )

Definition at line 621 of file hutil.cc.

623{
624 int nc = *Nstc, np = 0, nq = 0, j, i, i1, c, l;
625 scmon x;
626 for (j = a; j < nc; j++)
627 {
628 x = stc[j];
629 i = Nvar;
630 c = 2;
631 l = 0;
632 loop
633 {
634 i1 = var[i];
635 if (x[i1])
636 {
637 c--;
638 if (!c)
639 {
640 l = 0;
641 break;
642 }
643 else if (c == 1)
644 l = i1;
645 }
646 i--;
647 if (!i)
648 break;
649 }
650 if (l)
651 {
652 if (!pure[l])
653 {
654 np++;
655 pure[l] = x[l];
656 }
657 else if (x[l] < pure[l])
658 pure[l] = x[l];
659 stc[j] = NULL;
660 nq++;
661 }
662 }
663 *Npure = np;
664 if (nq!=0)
665 {
666 *Nstc -= nq;
667 hShrink(stc, a, nc);
668 }
669}

◆ hRadical()

void hRadical ( scfmon rad,
int * Nrad,
int Nvar )

Definition at line 411 of file hutil.cc.

412{
413 int nc = *Nrad, z = 0, i, j, k;
414 scmon n, o;
415 if (nc < 2)
416 return;
417 i = 0;
418 j = 1;
419 n = rad[j];
420 o = rad[0];
421 k = Nvar;
422 loop
423 {
424 if ((o[k]!=0) && (n[k]==0))
425 {
426 loop
427 {
428 k--;
429 if (k==0)
430 {
431 rad[i] = NULL;
432 z++;
433 break;
434 }
435 else
436 {
437 if ((o[k]==0) && (n[k]!=0))
438 break;
439 }
440 }
441 k = Nvar;
442 }
443 else if (!o[k] && n[k])
444 {
445 loop
446 {
447 k--;
448 if (!k)
449 {
450 rad[j] = NULL;
451 z++;
452 break;
453 }
454 else
455 {
456 if (o[k] && !n[k])
457 break;
458 }
459 }
460 k = Nvar;
461 }
462 else
463 {
464 k--;
465 if (!k)
466 {
467 rad[j] = NULL;
468 z++;
469 k = Nvar;
470 }
471 }
472 if (k == Nvar)
473 {
474 if (!rad[j])
475 i = j - 1;
476 loop
477 {
478 i++;
479 if (i == j)
480 {
481 i = -1;
482 j++;
483 if (j < nc)
484 n = rad[j];
485 else
486 {
487 if (z)
488 {
489 *Nrad -= z;
490 hShrink(rad, 0, nc);
491 }
492 return;
493 }
494 }
495 else if (rad[i])
496 {
497 o = rad[i];
498 break;
499 }
500 }
501 }
502 }
503}

◆ hStaircase()

void hStaircase ( scfmon stc,
int * Nstc,
varset var,
int Nvar )

Definition at line 313 of file hutil.cc.

314{
315 int nc = *Nstc;
316 if (nc < 2)
317 return;
318 int z = 0;
319 int i = 0;
320 int j = 1;
321 scmon n = stc[1 /*j*/];
322 scmon o = stc[0];
323 int k = Nvar;
324 loop
325 {
326 int k1 = var[k];
327 if (o[k1] > n[k1])
328 {
329 loop
330 {
331 k--;
332 if (k==0)
333 {
334 stc[i] = NULL;
335 z++;
336 break;
337 }
338 else
339 {
340 k1 = var[k];
341 if (o[k1] < n[k1])
342 break;
343 }
344 }
345 k = Nvar;
346 }
347 else if (o[k1] < n[k1])
348 {
349 loop
350 {
351 k--;
352 if (k==0)
353 {
354 stc[j] = NULL;
355 z++;
356 break;
357 }
358 else
359 {
360 k1 = var[k];
361 if (o[k1] > n[k1])
362 break;
363 }
364 }
365 k = Nvar;
366 }
367 else
368 {
369 k--;
370 if (k==0)
371 {
372 stc[j] = NULL;
373 z++;
374 k = Nvar;
375 }
376 }
377 if (k == Nvar)
378 {
379 if (stc[j]==NULL)
380 i = j - 1;
381 loop
382 {
383 i++;
384 if (i == j)
385 {
386 i = -1;
387 j++;
388 if (j < nc)
389 n = stc[j];
390 else
391 {
392 if (z!=0)
393 {
394 *Nstc -= z;
395 hShrink(stc, 0, nc);
396 }
397 return;
398 }
399 }
400 else if (stc[i]!=NULL)
401 {
402 o = stc[i];
403 break;
404 }
405 }
406 }
407 }
408}

◆ hStepR()

void hStepR ( scfmon rad,
int Nrad,
varset var,
int Nvar,
int * a )

Definition at line 974 of file hutil.cc.

975{
976 int k1, i;
977 k1 = var[Nvar];
978 i = 0;
979 loop
980 {
981 if (rad[i][k1])
982 {
983 *a = i;
984 return;
985 }
986 i++;
987 if (i == Nrad)
988 {
989 *a = i;
990 return;
991 }
992 }
993}

◆ hStepS()

void hStepS ( scfmon stc,
int Nstc,
varset var,
int Nvar,
int * a,
int * x )

Definition at line 949 of file hutil.cc.

950{
951 int k1, i;
952 int y;
953 k1 = var[Nvar];
954 y = *x;
955 i = *a;
956 loop
957 {
958 if (y < stc[i][k1])
959 {
960 *a = i;
961 *x = stc[i][k1];
962 return;
963 }
964 i++;
965 if (i == Nstc)
966 {
967 *a = i;
968 return;
969 }
970 }
971}
const CanonicalForm int const CFList const Variable & y
Definition facAbsFact.cc:53

◆ hSupp()

void hSupp ( scfmon stc,
int Nstc,
varset var,
int * Nvar )

Definition at line 174 of file hutil.cc.

175{
176 int nv, i0, i1, i, j;
177 nv = i0 = *Nvar;
178 i1 = 0;
179 for (i = 1; i <= nv; i++)
180 {
181 j = 0;
182 loop
183 {
184 if (stc[j][i]>0)
185 {
186 i1++;
187 var[i1] = i;
188 break;
189 }
190 j++;
191 if (j == Nstc)
192 {
193 var[i0] = i;
194 i0--;
195 break;
196 }
197 }
198 }
199 *Nvar = i1;
200}

◆ RightColonOperation()

ideal RightColonOperation ( ideal i,
poly w,
int lV )

Definition at line 1753 of file hilb.cc.

1754{
1755 /*
1756 * This returns right colon ideal of a monomial two-sided ideal of
1757 * the free associative algebra with respect to a monomial 'w'
1758 * (S:_R w).
1759 */
1760 S = minimalMonomialGenSet(S);
1761 ideal Iw = idInit(1,1);
1762 Iw = colonIdeal(S, w, lV, Iw, 0);
1763 return (Iw);
1764}

◆ slicehilb()

void slicehilb ( ideal I)

Definition at line 666 of file hilb.cc.

667{
668 //printf("Adi changes are here: \n");
669 int i, NNN = 0;
670 int steps = 0, prune = 0, moreprune = 0;
671 mpz_ptr hilbertcoef;
672 int *hilbpower;
673 ideal S = idInit(1,1);
674 poly q = p_One(currRing);
675 ideal X = idInit(1,1);
676 X->m[0]=p_One(currRing);
677 for(i=1;i<=currRing->N;i++)
678 {
679 p_SetExp(X->m[0],i,1,currRing);
680 }
681 p_Setm(X->m[0],currRing);
682 I = id_Mult(I,X,currRing);
683 ideal Itmp = SortByDeg(I);
685 I = Itmp;
686 //printf("\n-------------RouneSlice--------------\n");
687 rouneslice(I,S,q,X->m[0],prune, moreprune, steps, NNN, hilbertcoef, hilbpower);
689 p_Delete(&q,currRing);
690 //printf("\nIn total Prune got rid of %i elements\n",prune);
691 //printf("\nIn total More Prune got rid of %i elements\n",moreprune);
692 //printf("\nSteps of rouneslice: %i\n\n", steps);
693 printf("\n// %8d t^0",1);
694 for(i = 0; i<NNN; i++)
695 {
696 if(mpz_sgn(&hilbertcoef[i])!=0)
697 {
698 gmp_printf("\n// %8Zd t^%d",&hilbertcoef[i],hilbpower[i]);
699 }
700 }
701 PrintLn();
702 omFreeSize(hilbertcoef, (NNN)*sizeof(mpz_t));
703 omFreeSize(hilbpower, (NNN)*sizeof(int));
704 //printf("\n-------------------------------------\n");
705}
void FACTORY_PUBLIC prune(Variable &alpha)
Definition variable.cc:261
static void rouneslice(ideal I, ideal S, poly q, poly x, int &prune, int &moreprune, int &steps, int &NNN, mpz_ptr &hilbertcoef, int *&hilbpower)
Definition hilb.cc:510
static ideal SortByDeg(ideal I)
Definition hilb.cc:177
static void p_Delete(poly *p, const ring r)
Definition p_polys.h:903
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
ideal id_Mult(ideal h1, ideal h2, const ring R)
h1 * h2 one h_i must be an ideal (with at least one column) the other h_i may be a module (with no co...

Variable Documentation

◆ hCo

EXTERN_VAR int hCo

Definition at line 47 of file hutil.h.

◆ hexist

Definition at line 39 of file hutil.h.

◆ hisModule

EXTERN_VAR int hisModule

Definition at line 44 of file hutil.h.

◆ hMu

EXTERN_VAR long hMu

Definition at line 48 of file hutil.h.

◆ hMu2

EXTERN_VAR int hMu2

Definition at line 47 of file hutil.h.

◆ hNexist

EXTERN_VAR int hNexist

Definition at line 42 of file hutil.h.

◆ hNpure

EXTERN_VAR int hNpure

Definition at line 42 of file hutil.h.

◆ hNrad

EXTERN_VAR int hNrad

Definition at line 42 of file hutil.h.

◆ hNstc

EXTERN_VAR int hNstc

Definition at line 42 of file hutil.h.

◆ hNvar

EXTERN_VAR int hNvar

Definition at line 42 of file hutil.h.

◆ hpur0

Definition at line 40 of file hutil.h.

◆ hpure

Definition at line 40 of file hutil.h.

◆ hrad

Definition at line 39 of file hutil.h.

◆ hsel

Definition at line 41 of file hutil.h.

◆ hstc

Definition at line 39 of file hutil.h.

◆ hvar

Definition at line 41 of file hutil.h.

◆ hwork

Definition at line 39 of file hutil.h.

◆ indlist_bin

EXTERN_VAR omBin indlist_bin

Definition at line 37 of file hutil.h.

◆ ISet

Definition at line 46 of file hutil.h.

◆ JSet

Definition at line 46 of file hutil.h.

◆ radmem

EXTERN_VAR monf radmem

Definition at line 43 of file hutil.h.

◆ stcmem

EXTERN_VAR monf stcmem

Definition at line 43 of file hutil.h.