Data Structures | Macros | Typedefs | Functions | Variables
hutil.h File Reference

Go to the source code of this file.

Data Structures

struct  monh
 
struct  indlist
 

Macros

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

Typedefs

typedef polyrec * poly
 
typedef polypolyset
 
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, ring tailRing)
 
void slicehilb (ideal I)
 
void HilbertSeries_OrbitData (ideal S, int lV, bool ig)
 

Variables

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

Data Structure Documentation

§ monrec

struct monrec

Definition at line 24 of file hutil.h.

Data Fields
int a
scfmon mo

§ sindlist

struct sindlist

Definition at line 32 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 38 of file hutil.h.

Typedef Documentation

§ indset

typedef indlist* indset

Definition at line 31 of file hutil.h.

§ monf

typedef monp* monf

Definition at line 23 of file hutil.h.

§ monp

typedef monh* monp

Definition at line 22 of file hutil.h.

§ poly

typedef polyrec* poly

Definition at line 14 of file hutil.h.

§ polyset

typedef poly* polyset

Definition at line 15 of file hutil.h.

§ scfmon

typedef scmon* scfmon

Definition at line 18 of file hutil.h.

§ scmon

typedef int* scmon

Definition at line 17 of file hutil.h.

§ varset

typedef int* varset

Definition at line 19 of file hutil.h.

Function Documentation

§ hComp()

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

Definition at line 160 of file hutil.cc.

161 {
162  int k = 0;
163  scfmon ex = exist, co = stc;
164  int i;
165 
166  for (i = Nexist; i>0; i--)
167  {
168  if (((**ex) == 0) || ((**ex) == ak))
169  {
170  *co = *ex;
171  co++;
172  k++;
173  }
174  ex++;
175  }
176  *Nstc = k;
177 }
scmon * scfmon
Definition: hutil.h:18
int k
Definition: cfEzgcd.cc:93
int i
Definition: cfEzgcd.cc:123
strat ak
Definition: myNF.cc:321

§ hCreate()

monf hCreate ( int  Nvar)

Definition at line 1002 of file hutil.cc.

1003 {
1004  monf xmem;
1005  int i;
1006  xmem = (monf)omAlloc((Nvar + 1) * sizeof(monp));
1007  for (i = Nvar; i>0; i--)
1008  {
1009  xmem[i] = (monp)omAlloc(LEN_MON);
1010  xmem[i]->mo = NULL;
1011  }
1012  return xmem;
1013 }
monp * monf
Definition: hutil.h:23
#define omAlloc(size)
Definition: omAllocDecl.h:210
#define LEN_MON
Definition: hutil.h:38
monh * monp
Definition: hutil.h:22
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10

§ hDegreeSeries()

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

Definition at line 1334 of file hilb.cc.

1335 {
1336  int m, i, j, k;
1337  *co = *mu = 0;
1338  if ((s1 == NULL) || (s2 == NULL))
1339  return;
1340  i = s1->length();
1341  j = s2->length();
1342  if (j > i)
1343  return;
1344  m = 0;
1345  for(k=j-2; k>=0; k--)
1346  m += (*s2)[k];
1347  *mu = m;
1348  *co = i - j;
1349 }
void mu(int **points, int sizePoints)
int k
Definition: cfEzgcd.cc:93
int j
Definition: myNF.cc:70
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86

§ hDelete()

void hDelete ( scfmon  ev,
int  ev_length 
)

Definition at line 146 of file hutil.cc.

147 {
148  int i;
149 
150  if (ev_length>0)
151  {
152  for (i=ev_length-1;i>=0;i--)
153  omFreeSize(hsecure[i],((currRing->N)+1)*sizeof(int));
154  omFreeSize(hsecure, ev_length*sizeof(scmon));
155  omFreeSize(ev, ev_length*sizeof(scmon));
156  }
157 }
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static scfmon hsecure
Definition: hutil.cc:32
int * scmon
Definition: hutil.h:17
int i
Definition: cfEzgcd.cc:123

§ hDimSolve()

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

Definition at line 29 of file hdegree.cc.

31 {
32  int dn, iv, rad0, b, c, x;
33  scmon pn;
34  scfmon rn;
35  if (Nrad < 2)
36  {
37  dn = Npure + Nrad;
38  if (dn < hCo)
39  hCo = dn;
40  return;
41  }
42  if (Npure+1 >= hCo)
43  return;
44  iv = Nvar;
45  while(pure[var[iv]]) iv--;
46  hStepR(rad, Nrad, var, iv, &rad0);
47  if (rad0!=0)
48  {
49  iv--;
50  if (rad0 < Nrad)
51  {
52  pn = hGetpure(pure);
53  rn = hGetmem(Nrad, rad, radmem[iv]);
54  hDimSolve(pn, Npure + 1, rn, rad0, var, iv);
55  b = rad0;
56  c = Nrad;
57  hElimR(rn, &rad0, b, c, var, iv);
58  hPure(rn, b, &c, var, iv, pn, &x);
59  hLex2R(rn, rad0, b, c, var, iv, hwork);
60  rad0 += (c - b);
61  hDimSolve(pn, Npure + x, rn, rad0, var, iv);
62  }
63  else
64  {
65  hDimSolve(pure, Npure, rad, Nrad, var, iv);
66  }
67  }
68  else
69  hCo = Npure + 1;
70 }
void hDimSolve(scmon pure, int Npure, scfmon rad, int Nrad, varset var, int Nvar)
Definition: hdegree.cc:29
void hElimR(scfmon rad, int *e1, int a2, int e2, varset var, int Nvar)
Definition: hutil.cc:748
scfmon hwork
Definition: hutil.cc:19
scfmon hGetmem(int lm, scfmon old, monp monmem)
Definition: hutil.cc:1029
int hCo
Definition: hdegree.cc:22
scmon hGetpure(scmon p)
Definition: hutil.cc:1058
scmon * scfmon
Definition: hutil.h:18
void hStepR(scfmon rad, int Nrad, varset var, int Nvar, int *a)
Definition: hutil.cc:980
void hPure(scfmon stc, int a, int *Nstc, varset var, int Nvar, scmon pure, int *Npure)
Definition: hutil.cc:627
int * scmon
Definition: hutil.h:17
void hLex2R(scfmon rad, int e1, int a2, int e2, varset var, int Nvar, scfmon w)
Definition: hutil.cc:886
monf radmem
Definition: hutil.cc:24
Variable x
Definition: cfModGcd.cc:4023
const poly b
Definition: syzextra.cc:213

§ hElimR()

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

Definition at line 748 of file hutil.cc.

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

§ hElimS()

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

Definition at line 678 of file hutil.cc.

679 {
680  int nc = *e1, z = 0, i, j, k, k1;
681  scmon n, o;
682  if (!nc || (a2 == e2))
683  return;
684  j = 0;
685  i = a2;
686  o = stc[i];
687  n = stc[0];
688  k = Nvar;
689  loop
690  {
691  k1 = var[k];
692  if (o[k1] > n[k1])
693  {
694  k = Nvar;
695  i++;
696  if (i < e2)
697  o = stc[i];
698  else
699  {
700  j++;
701  if (j < nc)
702  {
703  i = a2;
704  o = stc[i];
705  n = stc[j];
706  }
707  else
708  {
709  if (z!=0)
710  {
711  *e1 -= z;
712  hShrink(stc, 0, nc);
713  }
714  return;
715  }
716  }
717  }
718  else
719  {
720  k--;
721  if (k==0)
722  {
723  stc[j] = NULL;
724  z++;
725  j++;
726  if (j < nc)
727  {
728  i = a2;
729  o = stc[i];
730  n = stc[j];
731  k = Nvar;
732  }
733  else
734  {
735  if (z!=0)
736  {
737  *e1 -= z;
738  hShrink(stc, 0, nc);
739  }
740  return;
741  }
742  }
743  }
744  }
745 }
loop
Definition: myNF.cc:98
static void hShrink(scfmon co, int a, int Nco)
Definition: hutil.cc:303
int k
Definition: cfEzgcd.cc:93
int j
Definition: myNF.cc:70
int * scmon
Definition: hutil.h:17
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10

§ hGetmem()

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

Definition at line 1029 of file hutil.cc.

1030 {
1031  scfmon x = monmem->mo;
1032  int lx = monmem->a;
1033  if ((x==NULL) || (lm > lx))
1034  {
1035  /* according to http://www.singular.uni-kl.de:8002/trac/ticket/463#comment:4
1036  * we need to work around a compiler bug:
1037  * if ((x!=NULL)&&(lx>0)) omFreeSize((ADDRESS)x, lx * sizeof(scmon));
1038  */
1039  if (x!=NULL) if (lx>0) omFreeSize((ADDRESS)x, lx * sizeof(scmon));
1040  monmem->mo = x = (scfmon)omAlloc(lm * sizeof(scmon));
1041  monmem->a = lm;
1042  }
1043  memcpy(x, old, lm * sizeof(scmon));
1044  return x;
1045 }
scmon * scfmon
Definition: hutil.h:18
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void * ADDRESS
Definition: auxiliary.h:115
#define omAlloc(size)
Definition: omAllocDecl.h:210
int * scmon
Definition: hutil.h:17
#define NULL
Definition: omList.c:10
Variable x
Definition: cfModGcd.cc:4023

§ hGetpure()

scmon hGetpure ( scmon  p)

Definition at line 1058 of file hutil.cc.

1059 {
1060  scmon p1 = p;
1061  scmon pn;
1062  p1++;
1063  pn = p1;
1064  pn += (currRing->N);
1065  memcpy(pn, p1, (currRing->N) * sizeof(int));
1066  return pn - 1;
1067 }
return P p
Definition: myNF.cc:203
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int * scmon
Definition: hutil.h:17

§ HilbertSeries_OrbitData()

void HilbertSeries_OrbitData ( ideal  S,
int  lV,
bool  ig 
)

Definition at line 1859 of file hilb.cc.

1860 {
1861  /*
1862  * It is based on iterative right colon operation to the
1863  * monomial ideals of the free associative algebras.
1864  * The algorithm terminates for the monomial right
1865  * ideals whose monomials define regular formal language,
1866  * that is, all the monomials of ideal can be obtained from
1867  * finite subsets by applying the finite number
1868  * of elementary operations.
1869  */
1870 
1871  int trInd;
1872  S = minimalMonomialsGenSet(S);
1873 
1874  int (*POS)(ideal, poly, std::vector<ideal>, std::vector<poly>, int);
1875  if(IG_CASE)
1876  {
1877  trInd = p_Totaldegree(S->m[IDELEMS(S)-1], currRing);
1878  POS = &positionInOrbit_IG_Case;
1879  }
1880  else
1881  {
1882  POS = &positionInOrbit_FG_Case;
1883  }
1884 
1885  std::vector<ideal > idorb;
1886  std::vector< poly > polist;
1887 
1888  ideal orb_init = idInit(1, 1);
1889  idorb.push_back(orb_init);
1890 
1891  polist.push_back( p_One(currRing));
1892 
1893  std::vector< std::vector<int> > mat;
1894  std::vector<int> row;
1895  row.push_back(0);
1896 
1897  std::vector<int> C;
1898 
1899  int ds, is, ps, sz;
1900  int lpcnt = 0;
1901 
1902  poly w, wi;
1903  ideal Jwi;
1904 
1905  while(lpcnt < idorb.size())
1906  {
1907  w = NULL;
1908  w = polist[lpcnt];
1909 
1910  if(lpcnt >= 1)
1911  {
1912  if(p_Totaldegree(idorb[lpcnt]->m[0], currRing) != 0)
1913  {
1914  C.push_back(1);
1915  }
1916  else
1917  C.push_back(0);
1918  }
1919  else
1920  C.push_back(1);
1921 
1922  ds = p_Totaldegree(w, currRing);
1923  lpcnt++;
1924 
1925  for(is = 1; is <= lV; is++)
1926  {
1927  wi = NULL;
1928  //make new copy of word w=polist[lpcnt];
1929  //in wi and update it (next colon word)
1930  //if corresponding to wi get a new ideal(colon of S),
1931  //keep it in the polist else delete it
1932 
1933  wi = pCopy(w);
1934  p_SetExp(wi, (ds*lV)+is, 1, currRing);
1935  p_Setm(wi, currRing);
1936 
1937  Jwi = NULL;
1938  //Jwi stores colon ideal of S w.r.t. wi
1939  //if get a new ideal place it in the idorb
1940  //otherwise delete it
1941  Jwi = idInit(1,1);
1942 
1943  Jwi = colonIdeal(S, wi, lV, Jwi);
1944  ps = (*POS)(Jwi, wi, idorb, polist, trInd);
1945 
1946  if(ps == 0) // found new colon ideal
1947  {
1948 
1949  idorb.push_back(Jwi);
1950  polist.push_back(wi);
1951  row.push_back(1);
1952  }
1953  else // there is a same ideal in the orbit
1954  {
1955  row[ps-1] = row[ps-1] + 1;
1956  idDelete(&Jwi);
1957  pDelete(&wi);
1958  }
1959  }
1960  mat.push_back(row);
1961  sz = row.size();
1962  row.clear();
1963  row.resize(sz, 0);
1964  }
1965 
1966  for(is = idorb.size()-1; is >= 0; is--)
1967  {
1968  idDelete(&idorb[is]);
1969  }
1970  for(is = polist.size()-1; is >= 0; is--)
1971  {
1972  pDelete(&polist[is]);
1973  }
1974 
1975  idorb.resize(0);
1976  polist.resize(0);
1977 
1978  row.resize(0);
1979 
1980  int rowCount, colCount;
1981 #if 0
1982  for(rowCount = 0; rowCount < mat.size(); rowCount++)
1983  {
1984  for(colCount = 0; colCount < mat[rowCount].size(); colCount++)
1985  {
1986  Print("%d,",mat[rowCount][colCount]);
1987  }
1988  PrintLn();
1989  }
1990  printf("rhs column matrix::\n");
1991  for(colCount = 0; colCount < C.size(); colCount++)
1992  printf("%d,",C[colCount]);
1993  //printf("\nlength of the Orbit==%ld\n", C.size());
1994 #endif
1995  ring r = currRing;
1996  char** tt=(char**)omalloc(sizeof(char*));
1997  tt[0] = omStrDup("t");
1998  TransExtInfo p;
1999  p.r = rDefault(0, 1, tt);
2000  coeffs cf = nInitChar(n_transExt,&p);
2001 
2002  char** xx = (char**)omalloc(sizeof(char*));
2003  xx[0] = omStrDup("x");
2004  ring R = rDefault(cf, 1, xx);
2005  rChangeCurrRing(R);
2006  /*
2007  * matrix corresponding to the orbit of the ideal
2008  */
2009  int lO = C.size();//size of the orbit
2010  matrix mR = mpNew(lO, lO);
2011  matrix cMat = mpNew(lO,1);
2012 
2013  for(rowCount = 0; rowCount < lO; rowCount++)
2014  {
2015  for(colCount = 0; colCount < mat[rowCount].size(); colCount++)
2016  {
2017  if(mat[rowCount][colCount] != 0)
2018  {
2019  MATELEM(mR, rowCount + 1, colCount + 1) = p_ISet(mat[rowCount][colCount], R);
2020  p_SetCoeff(MATELEM(mR, rowCount + 1, colCount + 1), n_Mult(pGetCoeff(mR->m[lO*rowCount+colCount]),n_Param(1, R->cf), R->cf), R);
2021  }
2022  }
2023  if(C[rowCount] != 0)
2024  {
2025  cMat->m[rowCount] = p_ISet(C[rowCount], R);
2026  }
2027  mat[rowCount].resize(0);
2028  }
2029  mat.resize(0);
2030  C.resize(0);
2031  matrix u;
2032  unitMatrix(lO,u); //unit matrix
2033  matrix gMat=mp_Sub(u,mR,R);
2034  matrix pMat;
2035  matrix lMat;
2036  matrix uMat;
2037  luDecomp(gMat, pMat, lMat, uMat, R);
2038  matrix H_serVec = mpNew(lO, 1);
2039  matrix Hnot;
2040  luSolveViaLUDecomp(pMat, lMat, uMat, cMat, H_serVec, Hnot);
2041 
2042  mp_Delete(&mR,R);
2043  mp_Delete(&u,R);
2044  mp_Delete(&pMat,R);
2045  mp_Delete(&lMat,R);
2046  mp_Delete(&uMat,R);
2047  mp_Delete(&cMat,R);
2048  mp_Delete(&gMat,R);
2049  mp_Delete(&Hnot,R);
2050  //print the Hilbert series and Orbit length
2051  PrintLn();
2052  pWrite(H_serVec->m[0]);
2053  Print("\nOrbit size = %d\n", lO);
2054 
2055  omFree(tt[0]);
2056  omFree(tt);
2057  omFree(xx[0]);
2058  omFree(xx);
2059  rChangeCurrRing(r);
2060  rDelete(R);
2061 }
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...
static int positionInOrbit_FG_Case(ideal I, poly, std::vector< ideal > idorb, std::vector< poly >, int)
Definition: hilb.cc:1613
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:83
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition: coeffs.h:39
return P p
Definition: myNF.cc:203
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.
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1430
void pWrite(poly p)
Definition: polys.h:290
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:407
static int positionInOrbit_IG_Case(ideal I, poly w, std::vector< ideal > idorb, std::vector< poly > polist, int trInd)
Definition: hilb.cc:1534
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_NumberOfParameters(...)
Definition: coeffs.h:817
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of &#39;a&#39; and &#39;b&#39;, i.e., a*b
Definition: coeffs.h:640
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
poly * m
Definition: matpol.h:19
void luDecomp(const matrix aMat, matrix &pMat, matrix &lMat, matrix &uMat, const ring R)
LU-decomposition of a given (m x n)-matrix.
const ring r
Definition: syzextra.cc:208
poly p_One(const ring r)
Definition: p_polys.cc:1312
#define omFree(addr)
Definition: omAllocDecl.h:261
The main handler for Singular numbers which are suitable for Singular polynomials.
const ring R
Definition: DebugPrint.cc:36
static ideal minimalMonomialsGenSet(ideal I)
Definition: hilb.cc:1665
int m
Definition: cfEzgcd.cc:119
ring rDefault(const coeffs cf, int N, char **n, int ord_size, int *ord, int *block0, int *block1, int **wvhdl)
Definition: ring.cc:113
struct for passing initialization parameters to naInitChar
Definition: transext.h:92
#define IDELEMS(i)
Definition: simpleideals.h:24
void mp_Delete(matrix *a, const ring r)
Definition: matpol.cc:792
void rChangeCurrRing(ring r)
Definition: polys.cc:12
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:47
static ideal colonIdeal(ideal S, poly w, int lV, ideal Jwi)
Definition: hilb.cc:1828
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:483
CanonicalForm cf
Definition: cfModGcd.cc:4024
#define omalloc(size)
Definition: omAllocDecl.h:228
#define NULL
Definition: omList.c:10
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
const CanonicalForm & w
Definition: facAbsFact.cc:55
#define pDelete(p_ptr)
Definition: polys.h:169
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:228
matrix mp_Sub(matrix a, matrix b, const ring R)
Definition: matpol.cc:206
polyrec * poly
Definition: hilb.h:10
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
Definition: p_polys.cc:1296
#define pCopy(p)
return a copy of the poly
Definition: polys.h:168
#define MATELEM(mat, i, j)
Definition: matpol.h:29
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:334
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ hIndAllMult()

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

Definition at line 496 of file hdegree.cc.

498 {
499  int dn, iv, rad0, b, c, x;
500  scmon pn;
501  scfmon rn;
502  if (Nrad < 2)
503  {
504  dn = Npure + Nrad;
505  if (dn > hCo)
506  {
507  if (!Nrad)
508  hCheckIndep(pure);
509  else
510  {
511  pn = *rad;
512  for (iv = Nvar; iv; iv--)
513  {
514  x = var[iv];
515  if (pn[x])
516  {
517  pure[x] = 1;
518  hCheckIndep(pure);
519  pure[x] = 0;
520  }
521  }
522  }
523  }
524  return;
525  }
526  iv = Nvar;
527  while(pure[var[iv]]) iv--;
528  hStepR(rad, Nrad, var, iv, &rad0);
529  iv--;
530  if (rad0 < Nrad)
531  {
532  pn = hGetpure(pure);
533  rn = hGetmem(Nrad, rad, radmem[iv]);
534  pn[var[iv + 1]] = 1;
535  hIndAllMult(pn, Npure + 1, rn, rad0, var, iv);
536  pn[var[iv + 1]] = 0;
537  b = rad0;
538  c = Nrad;
539  hElimR(rn, &rad0, b, c, var, iv);
540  hPure(rn, b, &c, var, iv, pn, &x);
541  hLex2R(rn, rad0, b, c, var, iv, hwork);
542  rad0 += (c - b);
543  hIndAllMult(pn, Npure + x, rn, rad0, var, iv);
544  }
545  else
546  {
547  hIndAllMult(pure, Npure, rad, Nrad, var, iv);
548  }
549 }
void hElimR(scfmon rad, int *e1, int a2, int e2, varset var, int Nvar)
Definition: hutil.cc:748
scfmon hwork
Definition: hutil.cc:19
scfmon hGetmem(int lm, scfmon old, monp monmem)
Definition: hutil.cc:1029
void hIndAllMult(scmon pure, int Npure, scfmon rad, int Nrad, varset var, int Nvar)
Definition: hdegree.cc:496
int hCo
Definition: hdegree.cc:22
scmon hGetpure(scmon p)
Definition: hutil.cc:1058
scmon * scfmon
Definition: hutil.h:18
static void hCheckIndep(scmon pure)
Definition: hdegree.cc:472
void hStepR(scfmon rad, int Nrad, varset var, int Nvar, int *a)
Definition: hutil.cc:980
void hPure(scfmon stc, int a, int *Nstc, varset var, int Nvar, scmon pure, int *Npure)
Definition: hutil.cc:627
int * scmon
Definition: hutil.h:17
void hLex2R(scfmon rad, int e1, int a2, int e2, varset var, int Nvar, scfmon w)
Definition: hutil.cc:886
monf radmem
Definition: hutil.cc:24
Variable x
Definition: cfModGcd.cc:4023
const poly b
Definition: syzextra.cc:213

§ hIndMult()

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

Definition at line 313 of file hdegree.cc.

315 {
316  int dn, iv, rad0, b, c, x;
317  scmon pn;
318  scfmon rn;
319  if (Nrad < 2)
320  {
321  dn = Npure + Nrad;
322  if (dn == hCo)
323  {
324  if (Nrad==0)
325  hIndep(pure);
326  else
327  {
328  pn = *rad;
329  for (iv = Nvar; iv!=0; iv--)
330  {
331  x = var[iv];
332  if (pn[x])
333  {
334  pure[x] = 1;
335  hIndep(pure);
336  pure[x] = 0;
337  }
338  }
339  }
340  }
341  return;
342  }
343  iv = Nvar;
344  dn = Npure+1;
345  if (dn >= hCo)
346  {
347  if (dn > hCo)
348  return;
349  loop
350  {
351  if(!pure[var[iv]])
352  {
353  if(hNotZero(rad, Nrad, var, iv))
354  {
355  pure[var[iv]] = 1;
356  hIndep(pure);
357  pure[var[iv]] = 0;
358  }
359  }
360  iv--;
361  if (!iv)
362  return;
363  }
364  }
365  while(pure[var[iv]]) iv--;
366  hStepR(rad, Nrad, var, iv, &rad0);
367  iv--;
368  if (rad0 < Nrad)
369  {
370  pn = hGetpure(pure);
371  rn = hGetmem(Nrad, rad, radmem[iv]);
372  pn[var[iv + 1]] = 1;
373  hIndMult(pn, Npure + 1, rn, rad0, var, iv);
374  pn[var[iv + 1]] = 0;
375  b = rad0;
376  c = Nrad;
377  hElimR(rn, &rad0, b, c, var, iv);
378  hPure(rn, b, &c, var, iv, pn, &x);
379  hLex2R(rn, rad0, b, c, var, iv, hwork);
380  rad0 += (c - b);
381  hIndMult(pn, Npure + x, rn, rad0, var, iv);
382  }
383  else
384  {
385  hIndMult(pure, Npure, rad, Nrad, var, iv);
386  }
387 }
void hElimR(scfmon rad, int *e1, int a2, int e2, varset var, int Nvar)
Definition: hutil.cc:748
scfmon hwork
Definition: hutil.cc:19
scfmon hGetmem(int lm, scfmon old, monp monmem)
Definition: hutil.cc:1029
int hCo
Definition: hdegree.cc:22
loop
Definition: myNF.cc:98
scmon hGetpure(scmon p)
Definition: hutil.cc:1058
scmon * scfmon
Definition: hutil.h:18
static BOOLEAN hNotZero(scfmon rad, int Nrad, varset var, int Nvar)
Definition: hdegree.cc:281
void hStepR(scfmon rad, int Nrad, varset var, int Nvar, int *a)
Definition: hutil.cc:980
static void hIndep(scmon pure)
Definition: hdegree.cc:296
void hIndMult(scmon pure, int Npure, scfmon rad, int Nrad, varset var, int Nvar)
Definition: hdegree.cc:313
void hPure(scfmon stc, int a, int *Nstc, varset var, int Nvar, scmon pure, int *Npure)
Definition: hutil.cc:627
int * scmon
Definition: hutil.h:17
void hLex2R(scfmon rad, int e1, int a2, int e2, varset var, int Nvar, scfmon w)
Definition: hutil.cc:886
monf radmem
Definition: hutil.cc:24
Variable x
Definition: cfModGcd.cc:4023
const poly b
Definition: syzextra.cc:213

§ hInit()

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

Definition at line 34 of file hutil.cc.

35 {
38 
39 // if (tailRing != currRing)
41 // else
42 // hisModule = id_RankFreeModule(S, currRing);
43 
44  if (hisModule < 0)
45  hisModule = 0;
46 
47  int sl, ql, i, k = 0;
48  polyset si, qi, ss;
49  scfmon ex, ek;
50 
51  if (S!=NULL)
52  {
53  si = S->m;
54  sl = IDELEMS(S);
55  }
56  else
57  {
58  si = NULL;
59  sl = 0;
60  }
61  if (Q!=NULL)
62  {
63  qi = Q->m;
64  ql = IDELEMS(Q);
65  }
66  else
67  {
68  qi = NULL;
69  ql = 0;
70  }
71  if ((sl + ql) == 0)
72  {
73  *Nexist = 0;
74  return NULL;
75  }
76  ss = si;
77  for (i = sl; i>0; i--)
78  {
79  if (*ss!=0)
80  k++;
81  ss++;
82  }
83  ss = qi;
84  for (i = ql; i>0; i--)
85  {
86  if (*ss!=0)
87  k++;
88  ss++;
89  }
90  *Nexist = k;
91  if (k==0)
92  return NULL;
93  ek = ex = (scfmon)omAlloc0(k * sizeof(scmon));
94  hsecure = (scfmon) omAlloc0(k * sizeof(scmon));
95  for (i = sl; i>0; i--)
96  {
97  if (*si!=NULL)
98  {
99  *ek = (scmon) omAlloc(((currRing->N)+1)*sizeof(int));
100  p_GetExpV(*si, *ek, currRing);
101  ek++;
102  }
103  si++;
104  }
105  for (i = ql; i>0; i--)
106  {
107  if (*qi!=NULL)
108  {
109  *ek = (scmon) omAlloc(((currRing->N)+1)*sizeof(int));
110  p_GetExpV(*qi, *ek, currRing);
111  ek++;
112  }
113  qi++;
114  }
115  memcpy(hsecure, ex, k * sizeof(scmon));
116  return ex;
117 }
#define id_TestTail(A, lR, tR)
Definition: simpleideals.h:79
scmon * scfmon
Definition: hutil.h:18
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
Definition: DebugPrint.h:30
static void p_GetExpV(poly p, int *ev, const ring r)
Definition: p_polys.h:1443
int k
Definition: cfEzgcd.cc:93
#define Q
Definition: sirandom.c:25
#define omAlloc(size)
Definition: omAllocDecl.h:210
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static scfmon hsecure
Definition: hutil.cc:32
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
int * scmon
Definition: hutil.h:17
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
#define NULL
Definition: omList.c:10
poly * polyset
Definition: hutil.h:15
int hisModule
Definition: hutil.cc:23
#define omAlloc0(size)
Definition: omAllocDecl.h:211

§ hKill()

void hKill ( monf  xmem,
int  Nvar 
)

Definition at line 1016 of file hutil.cc.

1017 {
1018  int i;
1019  for (i = Nvar; i!=0; i--)
1020  {
1021  if (xmem[i]->mo!=NULL)
1022  omFreeSize((ADDRESS)xmem[i]->mo, xmem[i]->a * sizeof(scmon));
1023  omFreeSize((ADDRESS)xmem[i], LEN_MON);
1024  }
1025  omFreeSize((ADDRESS)xmem, (Nvar + 1) * sizeof(monp));
1026 }
const poly a
Definition: syzextra.cc:212
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void * ADDRESS
Definition: auxiliary.h:115
#define LEN_MON
Definition: hutil.h:38
monh * monp
Definition: hutil.h:22
int * scmon
Definition: hutil.h:17
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10

§ hLex2R()

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

Definition at line 886 of file hutil.cc.

888 {
889  int j0 = 0, j = 0, i = a2, k, k1;
890  scmon n, o;
891  if (!e1)
892  {
893  for (; i < e2; i++)
894  rad[i - a2] = rad[i];
895  return;
896  }
897  else if (i == e2)
898  return;
899  n = rad[j];
900  o = rad[i];
901  loop
902  {
903  k = Nvar;
904  loop
905  {
906  k1 = var[k];
907  if (!o[k1] && n[k1])
908  {
909  w[j0] = o;
910  j0++;
911  i++;
912  if (i < e2)
913  {
914  o = rad[i];
915  break;
916  }
917  else
918  {
919  for (; j < e1; j++)
920  {
921  w[j0] = rad[j];
922  j0++;
923  }
924  memcpy(rad, w, (e1 + e2 - a2) * sizeof(scmon));
925  return;
926  }
927  }
928  else if (o[k1] && !n[k1])
929  {
930  w[j0] = n;
931  j0++;
932  j++;
933  if (j < e1)
934  {
935  n = rad[j];
936  break;
937  }
938  else
939  {
940  for (; i < e2; i++)
941  {
942  w[j0] = rad[i];
943  j0++;
944  }
945  memcpy(rad, w, (e1 + e2 - a2) * sizeof(scmon));
946  return;
947  }
948  }
949  k--;
950  }
951  }
952 }
loop
Definition: myNF.cc:98
int k
Definition: cfEzgcd.cc:93
int j
Definition: myNF.cc:70
int * scmon
Definition: hutil.h:17
int i
Definition: cfEzgcd.cc:123
const CanonicalForm & w
Definition: facAbsFact.cc:55

§ hLex2S()

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

Definition at line 818 of file hutil.cc.

820 {
821  int j0 = 0, j = 0, i = a2, k, k1;
822  scmon n, o;
823  if (!e1)
824  {
825  for (; i < e2; i++)
826  rad[i - a2] = rad[i];
827  return;
828  } else if (i == e2)
829  return;
830  n = rad[j];
831  o = rad[i];
832  loop
833  {
834  k = Nvar;
835  loop
836  {
837  k1 = var[k];
838  if (o[k1] < n[k1])
839  {
840  w[j0] = o;
841  j0++;
842  i++;
843  if (i < e2)
844  {
845  o = rad[i];
846  break;
847  }
848  else
849  {
850  for (; j < e1; j++)
851  {
852  w[j0] = rad[j];
853  j0++;
854  }
855  memcpy(rad, w, (e1 + e2 - a2) * sizeof(scmon));
856  return;
857  }
858  }
859  else if (o[k1] > n[k1])
860  {
861  w[j0] = n;
862  j0++;
863  j++;
864  if (j < e1)
865  {
866  n = rad[j];
867  break;
868  }
869  else
870  {
871  for (; i < e2; i++)
872  {
873  w[j0] = rad[i];
874  j0++;
875  }
876  memcpy(rad, w, (e1 + e2 - a2) * sizeof(scmon));
877  return;
878  }
879  }
880  k--;
881  }
882  }
883 }
loop
Definition: myNF.cc:98
int k
Definition: cfEzgcd.cc:93
int j
Definition: myNF.cc:70
int * scmon
Definition: hutil.h:17
int i
Definition: cfEzgcd.cc:123
const CanonicalForm & w
Definition: facAbsFact.cc:55

§ hLexR()

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

Definition at line 571 of file hutil.cc.

572 {
573  int j = 1, i = 0, k, k1;
574  scmon n, o;
575  if (Nrad < 2)
576  return;
577  n = rad[j];
578  o = rad[0];
579  k = Nvar;
580  loop
581  {
582  k1 = var[k];
583  if (!o[k1] && n[k1])
584  {
585  i++;
586  if (i < j)
587  {
588  o = rad[i];
589  k = Nvar;
590  }
591  else
592  {
593  j++;
594  if (j < Nrad)
595  {
596  i = 0;
597  o = rad[0];
598  n = rad[j];
599  k = Nvar;
600  }
601  else
602  return;
603  }
604  }
605  else if (o[k1] && !n[k1])
606  {
607  for (k = j; k > i; k--)
608  rad[k] = rad[k - 1];
609  rad[i] = n;
610  j++;
611  if (j < Nrad)
612  {
613  i = 0;
614  o = rad[0];
615  n = rad[j];
616  k = Nvar;
617  }
618  else
619  return;
620  }
621  else
622  k--;
623  }
624 }
loop
Definition: myNF.cc:98
int k
Definition: cfEzgcd.cc:93
int j
Definition: myNF.cc:70
int * scmon
Definition: hutil.h:17
int i
Definition: cfEzgcd.cc:123

§ hLexS()

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

Definition at line 512 of file hutil.cc.

513 {
514  if (Nstc < 2)
515  return;
516  int j = 1, i = 0;
517  scmon n = stc[j];
518  scmon o = stc[0];
519  int k = Nvar;
520  loop
521  {
522  int k1 = var[k];
523  if (o[k1] < n[k1])
524  {
525  i++;
526  if (i < j)
527  {
528  o = stc[i];
529  k = Nvar;
530  }
531  else
532  {
533  j++;
534  if (j < Nstc)
535  {
536  i = 0;
537  o = stc[0];
538  n = stc[j];
539  k = Nvar;
540  }
541  else
542  return;
543  }
544  }
545  else if (o[k1] > n[k1])
546  {
547  int tmp_k;
548  for (tmp_k = j; tmp_k > i; tmp_k--)
549  stc[tmp_k] = stc[tmp_k - 1];
550  stc[i] = n;
551  j++;
552  if (j < Nstc)
553  {
554  i = 0;
555  o = stc[0];
556  n = stc[j];
557  k = Nvar;
558  }
559  else
560  return;
561  }
562  else
563  {
564  k--;
565  if (k<=0) return;
566  }
567  }
568 }
loop
Definition: myNF.cc:98
int k
Definition: cfEzgcd.cc:93
int j
Definition: myNF.cc:70
int * scmon
Definition: hutil.h:17
int i
Definition: cfEzgcd.cc:123

§ hOrdSupp()

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

Definition at line 208 of file hutil.cc.

209 {
210  int i, i1, j, jj, k, l;
211  int x;
212  scmon temp, count;
213  float o, h, g, *v1;
214 
215  v1 = (float *)omAlloc(Nvar * sizeof(float));
216  temp = (int *)omAlloc(Nstc * sizeof(int));
217  count = (int *)omAlloc(Nstc * sizeof(int));
218  for (i = 1; i <= Nvar; i++)
219  {
220  i1 = var[i];
221  *temp = stc[0][i1];
222  *count = 1;
223  jj = 1;
224  for (j = 1; j < Nstc; j++)
225  {
226  x = stc[j][i1];
227  k = 0;
228  loop
229  {
230  if (x > temp[k])
231  {
232  k++;
233  if (k == jj)
234  {
235  temp[k] = x;
236  count[k] = 1;
237  jj++;
238  break;
239  }
240  }
241  else if (x < temp[k])
242  {
243  for (l = jj; l > k; l--)
244  {
245  temp[l] = temp[l-1];
246  count[l] = count[l-1];
247  }
248  temp[k] = x;
249  count[k] = 1;
250  jj++;
251  break;
252  }
253  else
254  {
255  count[k]++;
256  break;
257  }
258  }
259  }
260  h = 0.0;
261  o = (float)Nstc/(float)jj;
262  for(j = 0; j < jj; j++)
263  {
264  g = (float)count[j];
265  if (g > o)
266  g -= o;
267  else
268  g = o - g;
269  if (g > h)
270  h = g;
271  }
272  v1[i-1] = h * (float)jj;
273  }
274  omFreeSize((ADDRESS)count, Nstc * sizeof(int));
275  omFreeSize((ADDRESS)temp, Nstc * sizeof(int));
276  for (i = 1; i < Nvar; i++)
277  {
278  i1 = var[i+1];
279  h = v1[i];
280  j = 0;
281  loop
282  {
283  if (h > v1[j])
284  {
285  for (l = i; l > j; l--)
286  {
287  v1[l] = v1[l-1];
288  var[l+1] = var[l];
289  }
290  v1[j] = h;
291  var[j+1] = i1;
292  break;
293  }
294  j++;
295  if (j == i)
296  break;
297  }
298  }
299  omFreeSize((ADDRESS)v1, Nvar * sizeof(float));
300 }
int status int void size_t count
Definition: si_signals.h:59
loop
Definition: myNF.cc:98
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void * ADDRESS
Definition: auxiliary.h:115
g
Definition: cfModGcd.cc:4031
int k
Definition: cfEzgcd.cc:93
#define omAlloc(size)
Definition: omAllocDecl.h:210
int j
Definition: myNF.cc:70
int * scmon
Definition: hutil.h:17
int i
Definition: cfEzgcd.cc:123
Variable x
Definition: cfModGcd.cc:4023
static Poly * h
Definition: janet.cc:978
int l
Definition: cfEzgcd.cc:94

§ hPure()

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

Definition at line 627 of file hutil.cc.

629 {
630  int nc = *Nstc, np = 0, nq = 0, j, i, i1, c, l;
631  scmon x;
632  for (j = a; j < nc; j++)
633  {
634  x = stc[j];
635  i = Nvar;
636  c = 2;
637  l = 0;
638  loop
639  {
640  i1 = var[i];
641  if (x[i1])
642  {
643  c--;
644  if (!c)
645  {
646  l = 0;
647  break;
648  }
649  else if (c == 1)
650  l = i1;
651  }
652  i--;
653  if (!i)
654  break;
655  }
656  if (l)
657  {
658  if (!pure[l])
659  {
660  np++;
661  pure[l] = x[l];
662  }
663  else if (x[l] < pure[l])
664  pure[l] = x[l];
665  stc[j] = NULL;
666  nq++;
667  }
668  }
669  *Npure = np;
670  if (nq!=0)
671  {
672  *Nstc -= nq;
673  hShrink(stc, a, nc);
674  }
675 }
const poly a
Definition: syzextra.cc:212
loop
Definition: myNF.cc:98
static void hShrink(scfmon co, int a, int Nco)
Definition: hutil.cc:303
int j
Definition: myNF.cc:70
int * scmon
Definition: hutil.h:17
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
Variable x
Definition: cfModGcd.cc:4023
int l
Definition: cfEzgcd.cc:94

§ hRadical()

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

Definition at line 417 of file hutil.cc.

418 {
419  int nc = *Nrad, z = 0, i, j, k;
420  scmon n, o;
421  if (nc < 2)
422  return;
423  i = 0;
424  j = 1;
425  n = rad[j];
426  o = rad[0];
427  k = Nvar;
428  loop
429  {
430  if ((o[k]!=0) && (n[k]==0))
431  {
432  loop
433  {
434  k--;
435  if (k==0)
436  {
437  rad[i] = NULL;
438  z++;
439  break;
440  }
441  else
442  {
443  if ((o[k]==0) && (n[k]!=0))
444  break;
445  }
446  }
447  k = Nvar;
448  }
449  else if (!o[k] && n[k])
450  {
451  loop
452  {
453  k--;
454  if (!k)
455  {
456  rad[j] = NULL;
457  z++;
458  break;
459  }
460  else
461  {
462  if (o[k] && !n[k])
463  break;
464  }
465  }
466  k = Nvar;
467  }
468  else
469  {
470  k--;
471  if (!k)
472  {
473  rad[j] = NULL;
474  z++;
475  k = Nvar;
476  }
477  }
478  if (k == Nvar)
479  {
480  if (!rad[j])
481  i = j - 1;
482  loop
483  {
484  i++;
485  if (i == j)
486  {
487  i = -1;
488  j++;
489  if (j < nc)
490  n = rad[j];
491  else
492  {
493  if (z)
494  {
495  *Nrad -= z;
496  hShrink(rad, 0, nc);
497  }
498  return;
499  }
500  }
501  else if (rad[i])
502  {
503  o = rad[i];
504  break;
505  }
506  }
507  }
508  }
509 }
loop
Definition: myNF.cc:98
static void hShrink(scfmon co, int a, int Nco)
Definition: hutil.cc:303
int k
Definition: cfEzgcd.cc:93
int j
Definition: myNF.cc:70
int * scmon
Definition: hutil.h:17
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10

§ hStaircase()

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

Definition at line 319 of file hutil.cc.

320 {
321  int nc = *Nstc;
322  if (nc < 2)
323  return;
324  int z = 0;
325  int i = 0;
326  int j = 1;
327  scmon n = stc[1 /*j*/];
328  scmon o = stc[0];
329  int k = Nvar;
330  loop
331  {
332  int k1 = var[k];
333  if (o[k1] > n[k1])
334  {
335  loop
336  {
337  k--;
338  if (k==0)
339  {
340  stc[i] = NULL;
341  z++;
342  break;
343  }
344  else
345  {
346  k1 = var[k];
347  if (o[k1] < n[k1])
348  break;
349  }
350  }
351  k = Nvar;
352  }
353  else if (o[k1] < n[k1])
354  {
355  loop
356  {
357  k--;
358  if (k==0)
359  {
360  stc[j] = NULL;
361  z++;
362  break;
363  }
364  else
365  {
366  k1 = var[k];
367  if (o[k1] > n[k1])
368  break;
369  }
370  }
371  k = Nvar;
372  }
373  else
374  {
375  k--;
376  if (k==0)
377  {
378  stc[j] = NULL;
379  z++;
380  k = Nvar;
381  }
382  }
383  if (k == Nvar)
384  {
385  if (stc[j]==NULL)
386  i = j - 1;
387  loop
388  {
389  i++;
390  if (i == j)
391  {
392  i = -1;
393  j++;
394  if (j < nc)
395  n = stc[j];
396  else
397  {
398  if (z!=0)
399  {
400  *Nstc -= z;
401  hShrink(stc, 0, nc);
402  }
403  return;
404  }
405  }
406  else if (stc[i]!=NULL)
407  {
408  o = stc[i];
409  break;
410  }
411  }
412  }
413  }
414 }
loop
Definition: myNF.cc:98
static void hShrink(scfmon co, int a, int Nco)
Definition: hutil.cc:303
int k
Definition: cfEzgcd.cc:93
int j
Definition: myNF.cc:70
int * scmon
Definition: hutil.h:17
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10

§ hStepR()

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

Definition at line 980 of file hutil.cc.

981 {
982  int k1, i;
983  k1 = var[Nvar];
984  i = 0;
985  loop
986  {
987  if (rad[i][k1])
988  {
989  *a = i;
990  return;
991  }
992  i++;
993  if (i == Nrad)
994  {
995  *a = i;
996  return;
997  }
998  }
999 }
const poly a
Definition: syzextra.cc:212
loop
Definition: myNF.cc:98
int i
Definition: cfEzgcd.cc:123

§ hStepS()

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

Definition at line 955 of file hutil.cc.

956 {
957  int k1, i;
958  int y;
959  k1 = var[Nvar];
960  y = *x;
961  i = *a;
962  loop
963  {
964  if (y < stc[i][k1])
965  {
966  *a = i;
967  *x = stc[i][k1];
968  return;
969  }
970  i++;
971  if (i == Nstc)
972  {
973  *a = i;
974  return;
975  }
976  }
977 }
const CanonicalForm int const CFList const Variable & y
Definition: facAbsFact.cc:57
const poly a
Definition: syzextra.cc:212
loop
Definition: myNF.cc:98
int i
Definition: cfEzgcd.cc:123
Variable x
Definition: cfModGcd.cc:4023

§ hSupp()

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

Definition at line 180 of file hutil.cc.

181 {
182  int nv, i0, i1, i, j;
183  nv = i0 = *Nvar;
184  i1 = 0;
185  for (i = 1; i <= nv; i++)
186  {
187  j = 0;
188  loop
189  {
190  if (stc[j][i]>0)
191  {
192  i1++;
193  var[i1] = i;
194  break;
195  }
196  j++;
197  if (j == Nstc)
198  {
199  var[i0] = i;
200  i0--;
201  break;
202  }
203  }
204  }
205  *Nvar = i1;
206 }
loop
Definition: myNF.cc:98
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123

§ slicehilb()

void slicehilb ( ideal  I)

Definition at line 1088 of file hilb.cc.

1089 {
1090  //printf("Adi changes are here: \n");
1091  int i, NNN = 0;
1092  int steps = 0, prune = 0, moreprune = 0;
1093  mpz_ptr hilbertcoef;
1094  int *hilbpower;
1095  ideal S = idInit(1,1);
1096  poly q = p_ISet(1,currRing);
1097  ideal X = idInit(1,1);
1098  X->m[0]=p_One(currRing);
1099  for(i=1;i<=currRing->N;i++)
1100  {
1101  p_SetExp(X->m[0],i,1,currRing);
1102  }
1103  p_Setm(X->m[0],currRing);
1104  I = id_Mult(I,X,currRing);
1105  I = SortByDeg(I);
1106  //printf("\n-------------RouneSlice--------------\n");
1107  rouneslice(I,S,q,X->m[0],prune, moreprune, steps, NNN, hilbertcoef, hilbpower);
1108  //printf("\nIn total Prune got rid of %i elements\n",prune);
1109  //printf("\nIn total More Prune got rid of %i elements\n",moreprune);
1110  //printf("\nSteps of rouneslice: %i\n\n", steps);
1111  mpz_t coefhilb;
1112  mpz_t dummy;
1113  mpz_init(coefhilb);
1114  mpz_init(dummy);
1115  printf("\n// %8d t^0",1);
1116  for(i = 0; i<NNN; i++)
1117  {
1118  if(mpz_sgn(&hilbertcoef[i])!=0)
1119  {
1120  gmp_printf("\n// %8Zd t^%d",&hilbertcoef[i],hilbpower[i]);
1121  }
1122  }
1123  omFreeSize(hilbertcoef, (NNN)*sizeof(mpz_t));
1124  omFreeSize(hilbpower, (NNN)*sizeof(int));
1125  //printf("\n-------------------------------------\n");
1126 }
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:934
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void prune(Variable &alpha)
Definition: variable.cc:261
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
poly p_One(const ring r)
Definition: p_polys.cc:1312
int i
Definition: cfEzgcd.cc:123
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...
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:483
static ideal SortByDeg(ideal I)
Definition: hilb.cc:362
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:228
polyrec * poly
Definition: hilb.h:10
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
Definition: p_polys.cc:1296

Variable Documentation

§ hCo

int hCo

Definition at line 22 of file hdegree.cc.

§ hexist

scfmon hexist

Definition at line 19 of file hutil.cc.

§ hisModule

int hisModule

Definition at line 23 of file hutil.cc.

§ hMu

int hMu

Definition at line 22 of file hdegree.cc.

§ hMu2

int hMu2

Definition at line 22 of file hdegree.cc.

§ hNexist

int hNexist

Definition at line 22 of file hutil.cc.

§ hNpure

int hNpure

Definition at line 22 of file hutil.cc.

§ hNrad

int hNrad

Definition at line 22 of file hutil.cc.

§ hNstc

int hNstc

Definition at line 22 of file hutil.cc.

§ hNvar

int hNvar

Definition at line 22 of file hutil.cc.

§ hpur0

scmon hpur0

Definition at line 20 of file hutil.cc.

§ hpure

scmon hpure

Definition at line 20 of file hutil.cc.

§ hrad

scfmon hrad

Definition at line 19 of file hutil.cc.

§ hsel

varset hsel

Definition at line 21 of file hutil.cc.

§ hstc

scfmon hstc

Definition at line 19 of file hutil.cc.

§ hvar

varset hvar

Definition at line 21 of file hutil.cc.

§ hwork

scfmon hwork

Definition at line 19 of file hutil.cc.

§ indlist_bin

omBin indlist_bin

Definition at line 23 of file hdegree.cc.

§ ISet

indset ISet

Definition at line 279 of file hdegree.cc.

§ JSet

indset JSet

Definition at line 279 of file hdegree.cc.

§ radmem

monf radmem

Definition at line 48 of file hutil.h.

§ stcmem

monf stcmem

Definition at line 48 of file hutil.h.