30 #if __FLINT_RELEASE >= 20503
31 #include <flint/fmpq_mpoly.h>
37#define OVERFLOW_MAX LONG_MAX
38#define OVERFLOW_MIN LONG_MIN
40#define OVERFLOW_MAX (((int64)LONG_MAX)<<30)
41#define OVERFLOW_MIN (-OVERFLOW_MAX)
383 mpz_set_ui(dummy, 1);
385 mpz_set_si(dummy, -1);
386 mpz_add(ec, ec, dummy);
399 int i,howmanyvarinp = 0;
419 poly notsqrfree =
NULL;
436 if(notsqrfree !=
NULL)
509static void rouneslice(ideal I, ideal S, poly q, poly
x,
int &
prune,
int &moreprune,
int &steps,
int &NNN, mpz_ptr &hilbertcoef,
int* &hilbpower)
611 hilbertcoef = (mpz_ptr)
omAlloc((NNN+1)*
sizeof(mpz_t));
612 hilbpower = (
int*)
omAlloc((NNN+1)*
sizeof(int));
613 mpz_init_set( &hilbertcoef[NNN], ec);
625 mpz_add(&hilbertcoef[
i],&hilbertcoef[
i],ec_ptr);
630 hilbertcoef = (mpz_ptr)
omRealloc(hilbertcoef, (NNN+1)*
sizeof(mpz_t));
631 hilbpower = (
int*)
omRealloc(hilbpower, (NNN+1)*
sizeof(int));
632 mpz_init(&hilbertcoef[NNN]);
633 for(
j = NNN;
j>
i;
j--)
635 mpz_set(&hilbertcoef[
j],&hilbertcoef[
j-1]);
636 hilbpower[
j] = hilbpower[
j-1];
638 mpz_set( &hilbertcoef[
i], ec);
656 rouneslice(Ip, Sp, pq,
x,
prune, moreprune, steps, NNN, hilbertcoef,hilbpower);
669 int steps = 0,
prune = 0, moreprune = 0;
686 rouneslice(I,S,q,X->m[0],
prune, moreprune, steps, NNN, hilbertcoef, hilbpower);
692 printf(
"\n// %8d t^0",1);
693 for(
i = 0;
i<NNN;
i++)
695 if(mpz_sgn(&hilbertcoef[
i])!=0)
697 gmp_printf(
"\n// %8Zd t^%d",&hilbertcoef[
i],hilbpower[
i]);
711 if (hseries1 ==
NULL)
713 work =
new intvec(hseries1);
716 for (
i =
k-1;
i >= 0;
i--)
720 if ((
s != 0) || (
k == 1))
725 for (
i =
k-1;
i >= 0;
i--)
734 for (
i =
k-1;
i >= 0;
i--)
735 (*hseries2)[
i] = (*work)[
i];
736 (*hseries2)[
k] = (*work)[
l];
753 for(
k=
j-2;
k>=0;
k--)
761 if ((modul_weight!=
NULL)&&(modul_weight->
compare(0)!=0))
764 Print(
"module weights:%s\n",
s);
772 poly di1=
p_Copy(hseries,Qt);
774#if defined(HAVE_FLINT) && (__FLINT_RELEASE >= 20503)
776 fmpq_mpoly_ctx_t ctx;
777 convSingRFlintR(ctx,Qt);
781 di2=Flint_Divide_MP(di1,0,o_t,0,ctx,Qt);
782 if (di2==
NULL)
break;
798 if (dummy!=Di1)
break;
815 if (hseries==
NULL) di=0;
819 Print(
"// dimension (proj.) = %d\n// degree (proj.) = %d\n", di-1,
mu);
821 Print(
"// dimension (affine) = 0\n// degree (affine) = %d\n",
mu);
824 Print(
"// dimension (local) = %d\n// multiplicity = %d\n", di,
mu);
836 Qt->block0 = (
int *)
omAlloc0(3 *
sizeof(
int *));
837 Qt->block1 = (
int *)
omAlloc0(3 *
sizeof(
int *));
853 if ((src->VarOffset[0]== -1)
854 || (src->pCompIndex<0))
885 if ((modulweight!=
NULL)&&(modulweight->
compare(0)!=0))
888 Print(
"module weights:%s\n",
s);
915 while ((
j >= 0) && (I->m[
j] ==
NULL))
944 if(JCount != ObCount)
949 for(
i = 0;
i < JCount;
i++)
1000 if(JCount != ObCount)
1010 for(
i = 0;
i< JCount;
i++)
1034 int orbCount = idorb.size();
1060 for(
i = 1;
i < orbCount;
i++)
1081 dtrp = trInd - degp;
1110 int OrbCount = idorb.size();
1117 for(
i = 1;
i < OrbCount;
i++)
1142 int OrbCount = idorb.size();
1143 int dtr=0;
int IwCount, ObCount;
1148 for(
i = 1;
i < OrbCount;
i++)
1171 for(
i = 1;
i < OrbCount;
i++)
1184 for(
i = 1;
i < OrbCount;
i++)
1239 for(
k = ICount - 1;
k >=1;
k--)
1241 for(
i = 0;
i <
k;
i++)
1263 poly smon =
p_One(r);
1267 int *e=(
int *)
omAlloc((r->N+1)*
sizeof(int));
1268 int *
s=(
int *)
omAlloc0((r->N+1)*
sizeof(int));
1271 for(
j = 1;
j <= cnt;
j++)
1298 int *e = (
int *)
omAlloc((r->N+1)*
sizeof(int));
1299 int *
s=(
int *)
omAlloc0((r->N+1)*
sizeof(int));
1308 for(
j = (cnt+1);
j < (r->N+1);
j++)
1323static void TwordMap(poly
p, poly
w,
int lV,
int d, ideal Jwi,
bool &flag)
1339 for(
i = 0;
i <= d - 1;
i++)
1384static ideal
colonIdeal(ideal S, poly
w,
int lV, ideal Jwi,
int trunDegHs)
1399 if(trunDegHs !=0 && d >= trunDegHs)
1406 for(
i = 0;
i < SCount;
i++)
1442 PrintS(
"Hilbert Series:\n 0\n");
1445 int (*POS)(ideal, poly, std::vector<ideal>, std::vector<poly>, int, int);
1448 Print(
"\nTruncation degree = %d\n",trunDegHs);
1457 WerrorS(
"wrong input: it is not an infinitely gen. case");
1466 std::vector<ideal > idorb;
1467 std::vector< poly > polist;
1469 ideal orb_init =
idInit(1, 1);
1470 idorb.push_back(orb_init);
1474 std::vector< std::vector<int> > posMat;
1475 std::vector<int> posRow(lV,0);
1479 unsigned long lpcnt = 0;
1484 while(lpcnt < idorb.size())
1488 if(lpcnt >= 1 &&
idIs0(idorb[lpcnt]) ==
FALSE)
1505 for(is = 1; is <= lV; is++)
1526 ps = (*POS)(Jwi, wi, idorb, polist, trInd, trunDegHs);
1530 posRow[is-1] = idorb.size();
1532 idorb.push_back(Jwi);
1533 polist.push_back(wi);
1542 posMat.push_back(posRow);
1543 posRow.resize(lV,0);
1548 Print(
"\nlength of the Orbit = %d", lO);
1553 Print(
"words description of the Orbit: \n");
1554 for(is = 0; is < lO; is++)
1560 PrintS(
"\nmaximal degree, #(sum_j R(w,w_j))");
1562 for(is = 0; is < lO; is++)
1564 if(
idIs0(idorb[is]))
1575 for(is = idorb.size()-1; is >= 0; is--)
1579 for(is = polist.size()-1; is >= 0; is--)
1587 int adjMatrix[lO][lO];
1588 memset(adjMatrix, 0, lO*lO*
sizeof(
int));
1589 int rowCount, colCount;
1593 for(rowCount = 0; rowCount < lO; rowCount++)
1595 for(colCount = 0; colCount < lV; colCount++)
1597 tm = posMat[rowCount][colCount];
1598 adjMatrix[rowCount][tm] = adjMatrix[rowCount][tm] + 1;
1609 tt=(
char**)
omAlloc(
sizeof(
char*));
1615 tt=(
char**)
omalloc(lV*
sizeof(
char*));
1616 for(is = 0; is < lV; is++)
1618 tt[is] = (
char*)
omAlloc(7*
sizeof(
char));
1619 sprintf (tt[is],
"t%d", is+1);
1626 char** xx = (
char**)
omAlloc(
sizeof(
char*));
1639 for(rowCount = 0; rowCount < lO; rowCount++)
1641 for(colCount = 0; colCount < lO; colCount++)
1643 if(adjMatrix[rowCount][colCount] != 0)
1645 MATELEM(mR, rowCount + 1, colCount + 1) =
p_ISet(adjMatrix[rowCount][colCount],
R);
1653 for(rowCount = 0; rowCount < lO; rowCount++)
1655 for(colCount = 0; colCount < lV; colCount++)
1660 MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1)=
p_Add_q(rc,
MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1),
R);
1665 for(rowCount = 0; rowCount < lO; rowCount++)
1667 if(C[rowCount] != 0)
1681 PrintS(
"\nlinear system:\n");
1684 for(rowCount = 0; rowCount < lO; rowCount++)
1686 Print(
"H(%d) = ", rowCount+1);
1687 for(colCount = 0; colCount < lV; colCount++)
1692 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
1694 Print(
" %d\n", C[rowCount] );
1696 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
1697 PrintS(
"and i^th summand in the rhs of an eqn. is according\n");
1698 PrintS(
"to the right colon map corresp. to the i^th variable\n");
1702 for(rowCount = 0; rowCount < lO; rowCount++)
1704 Print(
"H(%d) = ", rowCount+1);
1705 for(colCount = 0; colCount < lV; colCount++)
1710 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
1712 Print(
" %d\n", C[rowCount] );
1714 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
1746 Print(
"Hilbert series:");
1755 for(is = lV-1; is >= 0; is--)
1804 for(
int i=src->N;
i>0;
i--)
1821#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__CYGWIN__)
1822static int compare_rp(
void *arg,
const void *pp1,
const void *pp2)
1824static int compare_rp(
const void *pp1,
const void *pp2,
void* arg)
1827 poly p1=*(poly*)pp1;
1828 poly p2=*(poly*)pp2;
1830 for(
int i=src->N;
i>0;
i--)
1834 if(e1<e2)
return -1;
1842 poly p1=*(poly*)pp1;
1843 poly p2=*(poly*)pp2;
1848 if(e1<e2)
return -1;
1857 while(id->m[
k]==
NULL)
k--;
1859 long *sev=(
long*)
omAlloc0(kk*
sizeof(
long));
1860 BOOLEAN only_lm=r->cf->has_simple_Alloc;
1863 for (
int i=
k;
i>=0;
i--)
1871 for (
int i=
k;
i>=0;
i--)
1878 for (
int i=
k;
i>=0;
i--)
1885 for (
int i=0;
i<
k;
i++)
1891 for (
int j=
i+1;
j<=
k;
j++)
1911 for (
int i=0;
i<
k;
i++)
1917 for (
int j=
i+1;
j<=
k;
j++)
1950 int*
exp=(
int*)
omAlloc((src->N+1)*
sizeof(int));
1956 for(
int j=src->N;
j>0;
j--)
1958 int w=(*wdegree)[
j-1];
1961 WerrorS(
"weights must be positive");
1978 int *exp_q=(
int*)
omAlloc((src->N+1)*
sizeof(int));
1980 for (
int i=1;
i<r;
i++)
1983 for(
int ii=src->N;ii>0;ii--)
1986 for(
int ii=0;ii<
i;ii++)
1994 for (
int ii=
IDELEMS(J)-1;ii>=0;ii--)
2058 #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__CYGWIN__)
2059 qsort_r(AA->m,
IDELEMS(AA),
sizeof(poly),src,compare_rp);
2061 qsort_r(AA->m,
IDELEMS(AA),
sizeof(poly),compare_rp,src);
2080 for(
int i=1;
i<=rk;
i++)
2084 for(
int ii=0;ii<
IDELEMS(AA);ii++)
2086 if (AA->m[ii]!=
NULL)
2133 if((
l==0)||(
l<=-INT_MAX)||(
l>INT_MAX))
2137 else (*ss)[
i]=(int)
l;
2164 while(
prod<(1<<15) && (a>1))
2170 if (a==1)
b=(1<<15);
2208 int w_max=0,w_min=0;
2211 w_max=module_w->
max_in();
2212 w_min=module_w->
min_in();
2214 for(
int c=1;c<=
A->rank;c++)
2222 if ((module_w==
NULL) || ((*module_w)[c-1]==0)) tmp=
ivAdd(
res,res_c);
2231 (*res)[
res->length()-1]=w_min;
2238 if(modulweight==
NULL)
return 0;
2239 return modulweight->
min_in();
2249 x = (*wdegree)[
i-1];
2265 memcpy(pon, pol,
l *
sizeof(
int64));
2268 for (
i =
x;
i <
l;
i++)
2270 #ifndef __SIZEOF_INT128__
2278 __int128 t2=pol[
i -
x];
2280 if ((t>=LONG_MIN)&&(t<=LONG_MAX)) pon[
i]=t;
2284 for (
i =
l;
i < ln;
i++)
2286 #ifndef __SIZEOF_INT128__
2291 __int128 t= -pol[
i -
x];
2292 if ((t>=LONG_MIN)&&(t<=LONG_MAX)) pon[
i]=t;
2299 for (
i =
l;
i <
x;
i++)
2301 for (
i =
x;
i < ln;
i++)
2302 pon[
i] = -pol[
i -
x];
2309 int l = lp,
x,
i,
j;
2313 for (
i = Nv;
i>0;
i--)
2315 x = pure[var[
i + 1]];
2321 for (
i = 0;
i <
l;
i++)
2323 #ifndef __SIZEOF_INT128__
2333 if ((t>=LONG_MIN)&&(t<=LONG_MAX)) pl[
i+
j]=t;
2341 for (
i = 0;
i <
l;
i++)
2343 #ifndef __SIZEOF_INT128__
2353 if ((t>=LONG_MIN)&&(t<=LONG_MAX)) pl[
i+
j]=t;
2368 for (
i = Nvar;
i>0;
i--)
2371 for (
j = 0;
j < Nstc;
j++)
2383 WerrorS(
"internal arrays too big");
2395 for (
x =
Ql[
j];
x < z;
x++)
2405 int Nvar,
int64 *pol,
int Lpol)
2407 int iv = Nvar -1, ln, a, a0, a1,
b,
i;
2420 hStepS(sn, Nstc, var, Nvar, &a, &
x);
2426 x = pure[var[Nvar]];
2444 hStepS(sn, Nstc, var, Nvar, &a, &
x);
2445 hElimS(sn, &
b, a0, a, var, iv);
2447 hPure(sn, a0, &a1, var, iv, pn, &
i);
2458 x = pure[var[Nvar]];
2475 int i,
j,
k,
l, ii, mw;
2514 if (modulweight !=
NULL)
2515 j = (*modulweight)[mc-1]-mw;
2550 while ((
i > 0) && ((*Qpol)[
i - 1] == 0))
2558 for (ii=0; ii<
k; ii++)
2559 (*work)[ii] = (*hseries1)[ii];
2560 if (hseries1 !=
NULL)
2567 (*hseries1)[
i +
j - 1] += (*Qpol)[
i - 1];
2586 while ((*hseries1)[
l-2]==0)
l--;
2590 for (ii=
l-2; ii>=0; ii--)
2591 (*work)[ii] = (*hseries1)[ii];
2595 (*hseries1)[
l-1] = mw;
const CanonicalForm CFMap CFMap & N
void mu(int **points, int sizePoints)
CanonicalForm convSingPFactoryP(poly p, const ring r)
poly convFactoryPSingP(const CanonicalForm &f, const ring r)
int compare(const intvec *o) const
char * ivString(int not_mat=1, int spaces=0, int dim=2) const
Coefficient rings, fields and other domains suitable for Singular polynomials.
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....
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ....
@ n_Q
rational (GMP) numbers
@ 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
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
const CanonicalForm int s
const CanonicalForm int const CFList const Variable & y
void FACTORY_PUBLIC prune(Variable &alpha)
static int max(int a, int b)
VAR void(* WerrorS_callback)(const char *s)
void WerrorS(const char *s)
This file is work in progress and currently not part of the official Singular.
static void idInsertMonomial(ideal I, poly p)
static int comapreMonoIdBases_IG_Case(ideal J, int JCount, ideal Ob, int ObCount)
static void rouneslice(ideal I, ideal S, poly q, poly x, int &prune, int &moreprune, int &steps, int &NNN, mpz_ptr &hilbertcoef, int *&hilbpower)
poly hFirstSeries0m(ideal A, ideal Q, intvec *wdegree, intvec *shifts, const ring src, const ring Qt)
static poly hilbert_series(ideal A, const ring src, const intvec *wdegree, const ring Qt)
poly hFirstSeries0p(ideal A, ideal Q, intvec *wdegree, const ring src, const ring Qt)
static poly SqFree(ideal I)
static void idAddMon(ideal I, ideal p)
static int comapreMonoIdBases(ideal J, ideal Ob)
static void TwordMap(poly p, poly w, int lV, int d, ideal Jwi, bool &flag)
static poly ChooseP(ideal I)
static poly deleteInMon(poly w, int i, int lV, const ring r)
intvec * hSecondSeries(intvec *hseries1)
static void hLastHilb(scmon pure, int Nv, varset var, int64 *pol, int lp)
static BOOLEAN isModule(ideal A, const ring src)
static int CountOnIdUptoTruncationIndex(ideal I, int tr)
static poly ChoosePJL(ideal I)
static int monCompare(const void *m, const void *n)
static void hHilbEst(scfmon stc, int Nstc, varset var, int Nvar)
static int positionInOrbitTruncationCase(ideal I, poly w, std::vector< ideal > idorb, std::vector< poly > polist, int, int trunDegHs)
static intvec * hSeries(ideal S, intvec *modulweight, intvec *wdegree, ideal Q)
static poly LCMmon(ideal I)
void HilbertSeries_OrbitData(ideal S, int lV, bool IG_CASE, bool mgrad, bool odp, int trunDegHs)
static ideal colonIdeal(ideal S, poly w, int lV, ideal Jwi, int trunDegHs)
intvec * hFirstSeries(ideal A, intvec *module_w, ideal Q, intvec *wdegree)
static int hMinModulweight(intvec *modulweight)
static poly shiftInMon(poly p, int i, int lV, const ring r)
static ideal getModuleComp(ideal A, int c, const ring src)
intvec * hFirstSeries0(ideal A, ideal Q, intvec *wdegree, const ring src, const ring Qt)
static void hPrintHilb(poly hseries, const ring Qt, intvec *modul_weight)
static poly ChoosePVar(ideal I)
static int positionInOrbit_FG_Case(ideal I, poly, std::vector< ideal > idorb, std::vector< poly >, int, int)
static void sortMonoIdeal_pCompare(ideal I)
static ideal SortByDeg(ideal I)
static bool IsIn(poly p, ideal I)
static void eulerchar(ideal I, int variables, mpz_ptr ec)
ideal RightColonOperation(ideal S, poly w, int lV)
static void hHilbStep(scmon pure, scfmon stc, int Nstc, varset var, int Nvar, int64 *pol, int Lpol)
static void hWDegree(intvec *wdegree)
static BOOLEAN p_Div_hi(poly p, const int *exp_q, const ring src)
static int positionInOrbit_IG_Case(ideal I, poly w, std::vector< ideal > idorb, std::vector< poly > polist, int trInd, int)
void hDegreeSeries(intvec *s1, intvec *s2, int *co, int *mu)
static poly SearchP(ideal I)
searches for a monomial of degree d>=2 and divides it by a variable (result monomial of deg d-1)
static int64 * hAddHilb(int Nv, int x, int64 *pol, int *lp)
static ideal minimalMonomialGenSet(ideal I)
intvec * hFirstSeries1(ideal S, intvec *modulweight, ideal Q, intvec *wdegree)
ideal idQuotMon(ideal Iorig, ideal p)
static void SortByDeg_p(ideal I, poly p)
static bool JustVar(ideal I)
void hLookSeries(ideal S, intvec *modulweight, ideal Q, intvec *wdegree)
static void id_DelDiv_hi(ideal id, BOOLEAN *bad, const ring r)
static int compare_rp_currRing(const void *pp1, const void *pp2)
void hComp(scfmon exist, int Nexist, int ak, scfmon stc, int *Nstc)
void hLex2S(scfmon rad, int e1, int a2, int e2, varset var, int Nvar, scfmon w)
void hKill(monf xmem, int Nvar)
void hElimS(scfmon stc, int *e1, int a2, int e2, varset var, int Nvar)
void hLexS(scfmon stc, int Nstc, varset var, int Nvar)
void hDelete(scfmon ev, int ev_length)
scfmon hGetmem(int lm, scfmon old, monp monmem)
void hPure(scfmon stc, int a, int *Nstc, varset var, int Nvar, scmon pure, int *Npure)
void hSupp(scfmon stc, int Nstc, varset var, int *Nvar)
void hStepS(scfmon stc, int Nstc, varset var, int Nvar, int *a, int *x)
void hStaircase(scfmon stc, int *Nstc, varset var, int Nvar)
void hOrdSupp(scfmon stc, int Nstc, varset var, int Nvar)
scfmon hInit(ideal S, ideal Q, int *Nexist)
#define idDelete(H)
delete an ideal
BOOLEAN idInsertPoly(ideal h1, poly h2)
insert h2 into h1 (if h2 is not the zero polynomial) return TRUE iff h2 was indeed inserted
ideal id_Copy(ideal h1, const ring r)
copy an ideal
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
intvec * ivAddShift(intvec *a, intvec *b, int s)
intvec * ivAdd(intvec *a, intvec *b)
static void WerrorS_dummy(const char *)
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
gmp_float exp(const gmp_float &a)
The main handler for Singular numbers which are suitable for Singular polynomials.
#define omFreeSize(addr, size)
#define omRealloc(addr, size)
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
poly p_Power(poly p, int i, const ring r)
unsigned long p_GetShortExpVector0(const poly p, const ring r)
poly p_MDivide(poly a, poly b, const ring r)
int p_Compare(const poly a, const poly b, const ring R)
unsigned long p_GetShortExpVector(const poly p, const ring r)
void pEnlargeSet(poly **p, int l, int increment)
unsigned long p_GetShortExpVector1(const poly p, const ring r)
static poly p_Neg(poly p, const ring r)
static poly p_Add_q(poly p, poly q, const ring r)
static void p_LmDelete(poly p, const ring r)
static poly p_Mult_q(poly p, poly q, const ring r)
#define p_LmEqual(p1, p2, r)
void p_Write(poly p, ring lmRing, ring tailRing)
static void p_SetExpV(poly p, int *ev, const ring r)
static poly pp_Mult_mm(poly p, poly m, 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 unsigned long p_SetComp(poly p, unsigned long c, ring r)
static void p_Setm(poly p, const ring r)
static number p_SetCoeff(poly p, number n, ring r)
static poly p_Head(const poly p, const ring r)
copy the (leading) term of p
static BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
static BOOLEAN p_IsOne(const poly p, const ring R)
either poly(1) or gen(k)?!
static BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
static BOOLEAN p_DivisibleBy(poly a, poly b, const ring r)
static void p_Delete(poly *p, const ring r)
static void p_GetExpV(poly p, int *ev, const ring r)
static void p_LmFree(poly p, ring)
static poly p_Init(const ring r, omBin bin)
static poly p_Copy(poly p, const ring r)
returns a copy of p
static long p_Totaldegree(poly p, const ring r)
void rChangeCurrRing(ring r)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
#define pLmDivisibleBy(a, b)
like pDivisibleBy, except that it is assumed that a!=NULL, b!=NULL
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced
#define pCopy(p)
return a copy of the poly
void StringSetS(const char *st)
void PrintS(const char *s)
void Werror(const char *fmt,...)
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
ring rDefault(const coeffs cf, int N, char **n, int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl, unsigned long bitmask)
static short rVar(const ring r)
#define rVar(r) (r->N)
int status int void size_t count
ideal idInit(int idsize, int rank)
initialise an ideal / module
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
int idSkipZeroes0(ideal ide)
void id_Delete0(ideal *h, ring r)
ideal id_Head(ideal h, const ring r)
returns the ideals of initial terms
void id_DelDiv(ideal id, const ring r)
delete id[j], if LT(j) == coeff*mon*LT(i) and vice versa, i.e., delete id[i], if LT(i) == coeff*mon*L...
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 id_CopyFirstK(const ideal ide, const int k, const ring r)
copies the first k (>= 1) entries of the given ideal/module and returns these as a new ideal/module (...
ideal id_SimpleAdd(ideal h1, ideal h2, const ring R)
concat the lists h1 and h2 without zeros
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
struct for passing initialization parameters to naInitChar