26 #define TRANSEXT_PRIVATES 182 p->exp[o->
data.dp.place]=ord;
193 int *
w=o->
data.wp.weights;
195 for(
int i=a;
i<=e;
i++) ord+=((
unsigned long)
p_GetExp(p,
i,r))*((
unsigned long)w[
i-
a]);
199 for(
int i=a;
i<=e;
i++)
209 p->exp[o->
data.wp.place]=ord;
215 const short a=o->
data.am.start;
216 const short e=o->
data.am.end;
217 const int *
w=o->
data.am.weights;
219 for(
short i=a;
i<=e;
i++, w++)
224 for(
short i=a;
i<=e;
i++)
236 const short len_gen= o->
data.am.len_gen;
238 if ((c > 0) && (c <= len_gen))
241 assume( w[0] == len_gen );
245 p->exp[o->
data.am.place] = ord;
252 a=o->
data.wp64.start;
256 for(
int i=a;
i<=e;
i++)
263 if(ei!=0 && ai/ei!=wi)
267 Print(
"ai %lld, wi %lld\n",ai,wi);
269 Print(
"ai %ld, wi %ld\n",ai,wi);
277 Print(
"ai %lld, ord %lld\n",ai,ord);
279 Print(
"ai %ld, ord %ld\n",ai,ord);
284 long a_0=(long)(ord&mask);
285 long a_1=(long)(ord >>31 );
291 p->exp[o->
data.wp64.place]=a_1;
292 p->exp[o->
data.wp64.place+1]=a_0;
305 int pl=o->
data.cp.place;
306 for(
int i=a;
i<=e;
i++) { p->exp[pl]=
p_GetExp(p,
i,r); pl++; }
314 o->
data.syzcomp.Components);
316 o->
data.syzcomp.ShiftedComponents);
317 if (ShiftedComponents !=
NULL)
320 assume(c == 0 || Components[c] != 0);
321 sc = ShiftedComponents[Components[c]];
322 assume(c == 0 || sc != 0);
324 p->exp[o->
data.syzcomp.place]=sc;
330 const short place = o->
data.syz.place;
331 const int limit = o->
data.syz.limit;
333 if (c > (
unsigned long)limit)
334 p->exp[place] = o->
data.syz.curr_index;
337 assume( (1 <= c) && (c <= (
unsigned long)limit) );
338 p->exp[place]= o->
data.syz.syz_index[c];
354 Print(
"p_Setm_General: ro_isTemp ord: pos: %d, p: ", pos);
p_wrp(p, r);
363 const int*
const pVarOffset = o->
data.isTemp.pVarOffset;
368 for(
int i = 1;
i <= r->N;
i++ )
370 const int vo = pVarOffset[
i];
380 for(
int i = 1;
i <= r->N;
i++ )
382 const int vo = pVarOffset[
i];
402 Print(
"p_Setm_General: ro_is ord: pos: %d, p: ", pos);
p_wrp(p, r);
411 const ideal F = o->
data.is.F;
412 const int limit = o->
data.is.limit;
414 const int start = o->
data.is.start;
416 if( F !=
NULL && c > limit )
420 Print(
"p_Setm_General: ro_is : in rSetm: pos: %d, c: %d > limit: %d\n", c, pos, limit);
421 PrintS(
"preComputed Values: ");
449 Print(
"Respective F[c - %d: %d] pp: ", limit, c);
454 const int end = o->
data.is.end;
461 Print(
"p_Setm_General: is(-Temp-) :: c: %d, limit: %d, [st:%d] ===>>> %ld\n", c, limit, start, p->exp[start]);
466 for(
int i = start;
i <= end;
i++)
467 p->exp[
i] += pp->exp[
i];
470 if (r->NegWeightL_Offset !=
NULL)
472 for (
int i=r->NegWeightL_Size-1;
i>=0;
i--)
474 const int _i = r->NegWeightL_Offset[
i];
475 if( start <= _i && _i <= end )
482 const int*
const pVarOffset = o->
data.is.pVarOffset;
486 for(
int i = 1;
i <= r->N;
i++ )
488 const int vo = pVarOffset[
i];
502 const int*
const pVarOffset = o->
data.is.pVarOffset;
507 const int vo = pVarOffset[0];
513 Print(
"ELSE p_Setm_General: ro_is :: c: %d <= limit: %d, vo: %d, exp: %d\n", c, limit, vo, p->exp[vo]);
526 if (pos == r->OrdSize)
return;
567 if (r->typ[0].ord_typ ==
ro_dp &&
568 r->typ[0].data.dp.start == 1 &&
569 r->typ[0].data.dp.end == r->N &&
570 r->typ[0].data.dp.place == r->pOrdIndex)
572 if (r->typ[0].ord_typ ==
ro_wp &&
573 r->typ[0].data.wp.start == 1 &&
574 r->typ[0].data.wp.end == r->N &&
575 r->typ[0].data.wp.place == r->pOrdIndex &&
576 r->typ[0].data.wp.weights == r->firstwv)
601 for (i=1; i<= r->firstBlockEnds; i++)
603 sum +=
p_GetExp(p, i, r)*r->firstwv[i-1];
620 for (i=0;r->order[
i]!=0;i++)
627 for (k=b0 ;k<=b1 ;k++)
629 j+=
p_GetExp(p,k,r)*r->wvhdl[
i][k - b0 ]*r->OrdSgn;
636 for (k=b0 ;k<=b1 ;k++)
638 j+=
p_GetExp(p,k,r)*r->wvhdl[
i][k - b0 ];
649 for (k=b0 ;k<=b1 ;k++)
657 for (k=0;k<=(b1 - b0 );k++)
673 for (k=b0 ;k<=b1 ;k++)
675 j+=
p_GetExp(p,k, r)*r->wvhdl[
i][ k- b0 ];
682 Print(
"missing order %d in p_WTotaldegree\n",r->order[i]);
707 if ((r->firstwv==
NULL) || (i>r->firstBlockEnds))
711 return r->firstwv[i-1];
721 for(i=1;i<=r->firstBlockEnds;i++)
722 j+=
p_GetExp(p, i, r)*r->firstwv[i-1];
724 for (;i<=
rVar(r);i++)
762 return r->pFDeg(p, r);
815 long o = r->pFDeg(p, r);
891 if ((t=r->pFDeg(p, r))>max) max=t;
901 if ((t=r->pFDeg(p, r))>max) max=t;
1106 static inline unsigned long 1108 unsigned long number_of_exp)
1110 const unsigned long bitmask = r->bitmask;
1111 unsigned long ml1 = l1 & bitmask;
1112 unsigned long ml2 = l2 & bitmask;
1113 unsigned long max = (ml1 > ml2 ? ml1 : ml2);
1114 unsigned long j = number_of_exp - 1;
1118 unsigned long mask = bitmask << r->BitsPerExp;
1123 max |= ((ml1 > ml2 ? ml1 : ml2) & mask);
1126 mask = mask << r->BitsPerExp;
1132 static inline unsigned long 1146 unsigned long l_p, l_max;
1147 unsigned long divmask = r->divmask;
1151 offset = r->VarL_Offset[0];
1153 l_max = max->exp[
offset];
1156 (((l_max & divmask) ^ (l_p & divmask)) != ((l_max-l_p) & divmask)))
1159 for (i=1; i<r->VarL_Size; i++)
1161 offset = r->VarL_Offset[
i];
1163 l_max = max->exp[
offset];
1166 (((l_max & divmask) ^ (l_p & divmask)) != ((l_max-l_p) & divmask)))
1177 unsigned long l_p, divmask = r->divmask;
1182 l_p = p->exp[r->VarL_Offset[0]];
1184 (((l_max & divmask) ^ (l_p & divmask)) != ((l_max-l_p) & divmask)))
1186 for (i=1; i<r->VarL_Size; i++)
1188 l_p = p->exp[r->VarL_Offset[
i]];
1191 (((l_max & divmask) ^ (l_p & divmask)) != ((l_max-l_p) & divmask)))
1257 if((k!=-1)&&(k!=i))
return 0;
1274 for(i=r->N; i>0; i--)
1361 while (*s!=
'\0') s++;
1373 const char *s_save=
s;
1375 if (((
unsigned long)i) > r->bitmask/2)
1406 for(
unsigned int k = iFirstAltVar;
k <= iLastAltVar;
k++)
1426 if ((s!=st)&&isdigit(st[0]))
1468 for(i=(
int)r->N; i; i--)
1528 for(i=(
int)r->N; i; i--)
1573 for(
int i = (
int)
rVar(r);
i>0;
i--)
1576 if (exponent < 0)
return FALSE;
1594 #ifdef HAVE_RATGRING 1607 for (
int i = r->real_var_end;
i>=r->real_var_start;
i--)
1676 int *
D = (
int *)
omAlloc0((len+1)*
sizeof(int));
1677 int *L = (
int *)
omAlloc0((len+1)*
sizeof(int));
1683 int HasConstantCoef = 0;
1684 int is = r->real_var_start - 1;
1690 mintdeg =
si_min(mintdeg,D[k]);
1692 minlen =
si_min(minlen,L[k]);
1696 HasConstantCoef = 1;
1706 int mindeglen = len;
1718 if (D[i] == mintdeg)
1720 if (L[i] < mindeglen)
1727 d =
p_Copy(C[pmindeglen], r);
1799 int divisorLE =
p_GetExp(divisor, 1, r);
1807 int e =
p_GetExp(p, 1, r) - divisorLE;
1862 for(i=
rVar(r);i>0;i--)
1934 for (i=
rVar(r); i!=0; i--)
1992 bin = (number *)
omAlloc0(h*
sizeof(number));
2001 y =
n_Mult(x,bin[e-1],r->cf);
2013 int e,
h = (exp >> 1) + 1;
2035 number *bin =
pnBin(exp,r);
2046 al = (exp + 1) *
sizeof(
poly);
2049 for (e=1; e<
exp; e++)
2055 for (e=exp-1; e>eh; e--)
2064 for (e=eh; e!=0; e--)
2131 if ( (i > 0) && ((
unsigned long ) i > (r->bitmask)))
2133 Werror(
"exponent %d is too large, max. is %ld",i,r->bitmask);
2177 int char_p=
rChar(r);
2178 if ((char_p>0) && (i>char_p)
2184 while (rest>=char_p)
2198 return p_Pow(p,i,r);
2199 if ((char_p==0) || (i<=char_p))
2201 return p_Pow(p,i,r);
2214 #define CLEARENUMERATORS 1 2223 #if CLEARENUMERATORS 2277 #if CLEARENUMERATORS 2342 h =
n_Init(1, r->cf->extRing->cf);
2359 if(!
n_IsOne(h,r->cf->extRing->cf))
2424 #if 1 // currently only used by Singular/janet 2428 if (ph==
NULL)
return;
2439 if (
n_Size(d,r->cf)<=smax)
2448 if (smax==1) smax=2;
2507 d=
nlAdd(n1,t,r->cf);
2509 d=
nlSub(n1,t,r->cf);
2518 d=
nlAdd(n2,t,r->cf);
2520 d=
nlSub(n2,t,r->cf);
2527 d=
nlGcd(n1,n2,r->cf);
2550 if (s2==-1)
return n_Copy(d,r->cf);
2723 #if CLEARENUMERATORS 2771 #if 0 && CLEARENUMERATORS 2829 #ifdef HAVE_RATGRING 2853 #if CLEARENUMERATORS 2899 #if CLEARENUMERATORS 2999 number t=
n_Mult(c,h,r->cf);
3087 fraction
f = (fraction) h;
3088 number n=
p_GetCoeff (NUM (f),C->extRing->cf);
3098 if (!
n_IsOne (n, C->extRing->cf))
3102 nMap=
n_SetMap (C->extRing->cf, C);
3103 number ninv= nMap (n,C->extRing->cf, C);
3116 number p_GetAllDenom(
poly ph,
const ring r)
3118 number d=
n_Init(1,r->cf);
3126 number dd=
n_Mult(d,h,r->cf);
3140 if (r->cf->has_simple_Alloc)
3168 if ((varnum < 1) || (varnum >
rVar(r)))
3217 if (d(qp,r) != o)
return FALSE;
3271 if ((*len == 0) || (j<*len))
3371 pNext(qq) = pNext_q;
3447 if (*p==
NULL)
return;
3481 if (*len==0) *len=1;
3488 (*p)[k-1]=
p_Add_q((*p)[k-1],h,r);
3500 r->pFDeg = new_FDeg;
3502 if (new_lDeg ==
NULL)
3503 new_lDeg = r->pLDegOrig;
3505 r->pLDeg = new_lDeg;
3512 r->pFDeg = old_FDeg;
3513 r->pLDeg = old_lDeg;
3528 if ((c>0) && ((r->pModW)->range(c-1))) d+= (*(r->pModW))[c-1];
3538 pOldFDeg = r->pFDeg;
3539 pOldLDeg = r->pLDeg;
3540 pOldLexOrder = r->pLexOrder;
3542 r->pLexOrder =
TRUE;
3562 if (increment==0)
return;
3572 memset(&(h[l]),0,increment*
sizeof(
poly));
3691 while (non_zero !=
NULL)
3699 result =
p_Add_q(result,qq,r);
3715 poly zero, non_zero;
3720 while (non_zero !=
NULL)
3740 result =
p_Add_q(result,qq,r);
3811 for(i=
rVar(r);i>0;i--)
3812 me[i]+=exponent*ee[i];
3835 poly n_PermNumber(
const number z,
const int *par_perm,
const int ,
const ring src,
const ring dst)
3838 PrintS(
"\nSource Ring: \n");
3843 number zz =
n_Copy(z, src->cf);
3848 PrintS(
"\nDestination Ring: \n");
3860 const coeffs srcCf = src->cf;
3868 const ring srcExtRing = srcCf->extRing;
3871 const coeffs dstCf = dst->cf;
3883 zz = NUM((fraction)z);
3887 if( !DENIS1((fraction)z) )
3890 WarnS(
"Not defined: Cannot map a rational fraction and make a polynomial out of it! Ignoring the denumerator.");
3896 WerrorS(
"Number permutation is not implemented for this data yet!");
3908 if ((par_perm ==
NULL) && (
rPar(dst) != 0 &&
rVar (srcExtRing) > 0))
3911 perm=(
int *)
omAlloc0((
rVar(srcExtRing)+1)*
sizeof(int));
3922 && (!DENIS1((fraction)z))
3925 number n=nMap(
pGetCoeff(DEN((fraction)z)),srcExtRing->cf, dstCf);
3946 const int OldpVariables =
rVar(oldRing);
3964 number n = nMap(
p_GetCoeff(p, oldRing), oldRing->cf, dst->cf);
3993 int mapped_to_par = 0;
3994 for(
int i = 1;
i <= OldpVariables;
i++)
4024 n_Power(ee, e, &eee, dst->cf);
4025 ee =
n_Mult(c, eee, dst->cf);
4031 const int par = -perm[
i];
4035 const coeffs C = dst->cf;
4037 const ring
R = C->extRing;
4045 pcn = NUM((fraction)c);
4106 if (result_last==
NULL)
4112 pNext(result_last)=qq;
4287 p=
p_JetW(
p_Mult_q(p,
p_Invers(n-
p_MinDeg(p,w,R),u,w,R),R),n,ww,R);
4323 while ((p1 !=
NULL) && (p2 !=
NULL))
4342 int i = r1->ExpL_Size;
4344 assume( r1->ExpL_Size == r2->ExpL_Size );
4346 unsigned long *ep = p1->exp;
4347 unsigned long *eq = p2->exp;
4352 if (ep[i] != eq[i])
return FALSE;
4362 assume( r1->cf == r2->cf );
4364 while ((p1 !=
NULL) && (p2 !=
NULL))
4405 while ((p1 !=
NULL) )
4467 if (m==
NULL)
return 0;
4470 for (i=
rVar(r); i>0; i--)
4493 if (p ==
NULL)
return -1;
4500 while ((l < (
rVar(r))) && (lex == 0))
4523 if ((
p_GetComp(qp1,r)+i > 0) || ((j == -i) && (j ==
k)))
4541 qp2->next = qp1->next;
4557 const unsigned int s,
const unsigned int n)
4559 #define Sy_bit_L(x) (((unsigned long)1L)<<(x)) 4561 unsigned long ev = 0L;
4566 if (e > (
long) i) ev |=
Sy_bit_L(s+i);
4592 unsigned long ev = 0;
4606 for (;
j<=r->N;
j++)
4646 unsigned long ev = 0;
4650 unsigned long i = 0L;
4661 for (; j<=r->N; j++)
4704 #define p_Delete__T p_ShallowDelete 4706 #define n_Delete__T(n, r) do {} while (0) #define p_LmCheckPolyRing2(p, r)
int status int void size_t count
BOOLEAN p_VectorHasUnitB(poly p, int *k, const ring r)
void p_SetModDeg(intvec *w, ring r)
for idElimination, like a, except pFDeg, pWeigths ignore it
unsigned long p_GetMaxExpL(poly p, const ring r, unsigned long l_max)
return the maximal exponent of p in form of the maximal long var
static FORCE_INLINE number n_GetNumerator(number &n, const coeffs r)
return the numerator of n (if elements of r are by nature not fractional, result is n) ...
static FORCE_INLINE number n_GetUnit(number n, const coeffs r)
in Z: 1 in Z/kZ (where k is not a prime): largest divisor of n (taken in Z) that is co-prime with k i...
LINLINE number nlSub(number la, number li, const coeffs r)
static unsigned long p_AddComp(poly p, unsigned long v, ring r)
static FORCE_INLINE number n_Gcd(number a, number b, const coeffs r)
in Z: return the gcd of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ...
void p_Setm_General(poly p, const ring r)
const CanonicalForm int s
poly p_Diff(poly a, int k, const ring r)
static poly p_MonPower(poly p, int exp, const ring r)
const char * eati(const char *s, int *i)
const CanonicalForm int const CFList const Variable & y
int p_GetVariables(poly p, int *e, const ring r)
set entry e[i] to 1 if var(i) occurs in p, ignore var(j) if e[j]>0 return #(e[i]>0) ...
static BOOLEAN p_LmIsConstantComp(const poly p, const ring r)
static FORCE_INLINE BOOLEAN n_IsUnit(number n, const coeffs r)
TRUE iff n has a multiplicative inverse in the given coeff field/ring r.
static FORCE_INLINE const char * n_Read(const char *s, number *a, const coeffs r)
!!! Recommendation: This method is too cryptic to be part of the user- !!! interface. As defined here, it is merely a helper !!! method for parsing number input strings.
#define POLY_NEGWEIGHT_OFFSET
long pLDeg1(poly p, int *l, const ring r)
static poly p_LmDeleteAndNext(poly p, const ring r)
static BOOLEAN rField_is_Zp_a(const ring r)
long pLDeg1c_Totaldegree(poly p, int *l, const ring r)
BOOLEAN p_ComparePolys(poly p1, poly p2, const ring r)
returns TRUE if p1 is a skalar multiple of p2 assume p1 != NULL and p2 != NULL
p_SetmProc p_GetSetmProc(const ring r)
BOOLEAN nlGreaterZero(number za, const coeffs r)
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
static int si_min(const int a, const int b)
long pLDeg1c(poly p, int *l, const ring r)
static BOOLEAN pOldLexOrder
poly p_Homogen(poly p, int varnum, const ring r)
void p_Split(poly p, poly *h)
void p_VectorHasUnit(poly p, int *k, int *len, const ring r)
short * iv2array(intvec *iv, const ring R)
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
BOOLEAN p_IsHomogeneous(poly p, const ring r)
static int rPar(const ring r)
(r->cf->P)
static poly p_Mult_mm(poly p, poly m, const ring r)
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
static long p_IncrExp(poly p, int v, ring r)
void p_Setm_WFirstTotalDegree(poly p, const ring r)
int p_MinDeg(poly p, intvec *w, const ring R)
number ndCopyMap(number a, const coeffs aRing, const coeffs r)
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
static BOOLEAN rIsSyzIndexRing(const ring r)
static int _componentsExternal
static poly p_DiffOpM(poly a, poly b, BOOLEAN multiply, const ring r)
static int rGetCurrSyzLimit(const ring r)
static BOOLEAN rIsRatGRing(const ring r)
#define TEST_OPT_CONTENTSB
long p_WDegree(poly p, const ring r)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
static long pModDeg(poly p, ring r)
static void p_GetExpV(poly p, int *ev, const ring r)
#define omFreeSize(addr, size)
LINLINE number nlAdd(number la, number li, const coeffs r)
static poly p_Subst1(poly p, int n, const ring r)
void nlInpGcd(number &a, number b, const coeffs r)
static short rVar(const ring r)
#define rVar(r) (r->N)
poly singclap_gcd(poly f, poly g, const ring r)
destroys f and g
long pLDeg0c(poly p, int *l, const ring r)
void sBucketDestroyAdd(sBucket_pt bucket, poly *p, int *length)
poly p_Div_nn(poly p, const number n, const ring r)
void p_Lcm(const poly a, const poly b, poly m, const ring r)
static BOOLEAN rField_is_Q_a(const ring r)
number nlGcd(number a, number b, const coeffs r)
static void p_MonMult(poly p, poly q, const ring r)
static long p_Totaldegree(poly p, const ring r)
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
void sBucket_Add_p(sBucket_pt bucket, poly p, int length)
adds poly p to bucket destroys p!
poly p_Subst(poly p, int n, poly e, const ring r)
void WerrorS(const char *s)
void p_Setm_TotalDegree(poly p, const ring r)
static FORCE_INLINE number n_NormalizeHelper(number a, number b, const coeffs r)
assume that r is a quotient field (otherwise, return 1) for arguments (a1/a2,b1/b2) return (lcm(a1...
poly p_TakeOutComp1(poly *p, int k, const ring r)
static BOOLEAN rField_is_GF(const ring r)
void p_Norm(poly p1, const ring r)
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
void p_SimpleContent(poly ph, int smax, const ring r)
static long p_MultExp(poly p, int v, long ee, ring r)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
long pLDeg1_Deg(poly p, int *l, const ring r)
poly singclap_pdivide(poly f, poly g, const ring r)
static poly p_TwoMonPower(poly p, int exp, const ring r)
static number p_SetCoeff(poly p, number n, ring r)
poly p_Sub(poly p1, poly p2, const ring r)
long(* pLDegProc)(poly p, int *length, ring r)
static void p_LmFree(poly p, ring)
static int pLength(poly a)
static void p_SetExpV(poly p, int *ev, const ring r)
static poly p_Copy(poly p, const ring r)
returns a copy of p
static FORCE_INLINE BOOLEAN nCoeff_is_Q_a(const coeffs r)
static long p_SubExp(poly p, int v, long ee, ring r)
long totaldegreeWecart_IV(poly p, ring r, const short *w)
long pLDeg1c_Deg(poly p, int *l, const ring r)
static BOOLEAN rField_has_simple_inverse(const ring r)
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
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(...)
void p_Cleardenom_n(poly ph, const ring r, number &c)
int p_IsUnivariate(poly p, const ring r)
return i, if poly depends only on var(i)
poly pp_JetW(poly p, int m, short *w, const ring R)
static poly p_SortAdd(poly p, const ring r, BOOLEAN revert=FALSE)
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
BOOLEAN p_CheckPolyRing(poly p, ring r)
int p_Weight(int i, const ring r)
#define omReallocSize(addr, o_size, size)
const char * p_Read(const char *st, poly &rc, const ring r)
void p_ContentRat(poly &ph, const ring r)
static FORCE_INLINE void n_ClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs r)
Computes the content and (inplace) divides it out on a collection of numbers number c is the content ...
static poly p_Head(poly p, const ring r)
long p_DegW(poly p, const short *w, const ring R)
void p_Setm_Syz(poly p, ring r, int *Components, long *ShiftedComponents)
int r_IsRingVar(const char *n, char **names, int N)
long p_Deg(poly a, const ring r)
poly p_LcmRat(const poly a, const poly b, const long lCompM, const ring r)
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar, BOOLEAN use_mult)
int p_Size(poly p, const ring r)
poly p_Invers(int n, poly u, intvec *w, const ring R)
static int p_Comp_k_n(poly a, poly b, int k, ring r)
poly p_Farey(poly p, number N, const ring r)
#define TEST_OPT_INTSTRATEGY
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
static void p_SetCompP(poly p, int i, ring r)
const CanonicalForm CFMap CFMap & N
Concrete implementation of enumerators over polynomials.
for(int i=0;i< R->ExpL_Size;i++) Print("%09lx "
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
static int max(int a, int b)
This is a polynomial enumerator for simple iteration over coefficients of polynomials.
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
number ntInit(long i, const coeffs cf)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
static BOOLEAN p_IsConstant(const poly p, const ring r)
The main handler for Singular numbers which are suitable for Singular polynomials.
void p_LmDeleteAndNextRat(poly *p, int ishift, ring r)
static poly p_MonMultC(poly p, poly q, const ring rr)
long p_WFirstTotalDegree(poly p, const ring r)
static poly p_Subst0(poly p, int n, const ring r)
void p_Vec2Polys(poly v, poly **p, int *len, const ring r)
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
static FORCE_INLINE BOOLEAN n_DivBy(number a, number b, const coeffs r)
test whether 'a' is divisible 'b'; for r encoding a field: TRUE iff 'b' does not represent zero in Z:...
long pLDeg0(poly p, int *l, const ring r)
static FORCE_INLINE number n_ChineseRemainderSym(number *a, number *b, int rl, BOOLEAN sym, CFArray &inv_cache, const coeffs r)
sBucket_pt sBucketCreate(const ring r)
static FORCE_INLINE void n_Write(number &n, const coeffs r, const BOOLEAN bShortOut=TRUE)
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
poly p_Jet(poly p, int m, const ring R)
static BOOLEAN p_DivisibleBy(poly a, poly b, const ring r)
void p_Setm_Dummy(poly p, const ring r)
static int p_LmCmp(poly p, poly q, const ring r)
static FORCE_INLINE number n_Invers(number a, const coeffs r)
return the multiplicative inverse of 'a'; raise an error if 'a' is not invertible ...
BOOLEAN rSamePolyRep(ring r1, ring r2)
returns TRUE, if r1 and r2 represents the monomials in the same way FALSE, otherwise this is an analo...
static FORCE_INLINE number n_InpNeg(number n, const coeffs r)
in-place negation of n MUST BE USED: n = n_InpNeg(n) (no copy is returned)
static int si_max(const int a, const int b)
static FORCE_INLINE BOOLEAN nCoeff_is_transExt(const coeffs r)
TRUE iff r represents a transcendental extension field.
static number * pnBin(int exp, const ring r)
static number p_InitContent(poly ph, const ring r)
poly p_GetCoeffRat(poly p, int ishift, ring r)
Induced (Schreyer) ordering.
void PrintS(const char *s)
static poly p_Mult_nn(poly p, number n, const ring r)
void(* p_SetmProc)(poly p, const ring r)
static BOOLEAN rField_is_Q(const ring r)
int p_LowVar(poly p, const ring r)
the minimal index of used variables - 1
#define p_LmCheckPolyRing1(p, r)
static long p_MinComp(poly p, ring lmRing, ring tailRing)
poly p_Divide(poly a, poly b, const ring r)
static void p_ExpVectorAdd(poly p1, poly p2, const ring r)
BOOLEAN rOrd_SetCompRequiresSetm(const ring r)
return TRUE if p_SetComp requires p_Setm
static poly p_LmFreeAndNext(poly p, ring)
void rWrite(ring r, BOOLEAN details)
void p_Content(poly ph, const ring r)
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
static FORCE_INLINE BOOLEAN nCoeff_is_GF(const coeffs r)
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
static poly p_Pow(poly p, int i, const ring r)
poly p_JetW(poly p, int m, short *w, const ring R)
poly p_PolyDiv(poly &p, const poly divisor, const BOOLEAN needResult, const ring r)
assumes that p and divisor are univariate polynomials in r, mentioning the same variable; assumes div...
static short scaFirstAltVar(ring r)
static poly pReverse(poly p)
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
poly p_Series(int n, poly p, poly u, intvec *w, const ring R)
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
static unsigned long p_SubComp(poly p, unsigned long v, ring r)
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
static long p_GetOrder(poly p, ring r)
static BOOLEAN rField_is_Zp(const ring r)
static FORCE_INLINE number n_Farey(number a, number b, const coeffs r)
BOOLEAN p_HasNotCF(poly p1, poly p2, const ring r)
void p_Shift(poly *p, int i, const ring r)
shifts components of the vector p by i
void p_Normalize(poly p, const ring r)
#define rRing_has_Comp(r)
static void p_Delete(poly *p, const ring r)
void nlNormalize(number &x, const coeffs r)
poly p_mInit(const char *st, BOOLEAN &ok, const ring r)
unsigned long p_GetShortExpVector(const poly p, const ring r)
#define p_LmEqual(p1, p2, r)
const Variable & v
< [in] a sqrfree bivariate poly
static unsigned long GetBitFields(const long e, const unsigned int s, const unsigned int n)
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
poly p_DivideM(poly a, poly b, const ring r)
BOOLEAN p_DivisibleByRingCase(poly f, poly g, const ring r)
divisibility check over ground ring (which may contain zero divisors); TRUE iff LT(f) divides LT(g)...
int p_IsPurePower(const poly p, const ring r)
return i, if head depends only on var(i)
static FORCE_INLINE void n_Power(number a, int b, number *res, const coeffs r)
fill res with the power a^b
static pLDegProc pOldLDeg
long pLDegb(poly p, int *l, const ring r)
static BOOLEAN rField_is_Ring(const ring r)
void pEnlargeSet(poly **p, int l, int increment)
long pLDeg1_Totaldegree(poly p, int *l, const ring r)
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
BOOLEAN p_LmCheckPolyRing(poly p, ring r)
poly n_PermNumber(const number z, const int *par_perm, const int, const ring src, const ring dst)
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic ...
LINLINE void nlDelete(number *a, const coeffs r)
poly p_Last(const poly p, int &l, const ring r)
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
long(* pFDegProc)(poly p, ring r)
static poly p_Pow_charp(poly p, int i, const ring r)
static pFDegProc pOldFDeg
static short scaLastAltVar(ring r)
poly p_ChineseRemainder(poly *xx, number *x, number *q, int rl, CFArray &inv_cache, const ring R)
static FORCE_INLINE number n_GetDenom(number &n, const coeffs r)
return the denominator of n (if elements of r are by nature not fractional, result is 1) ...
static bool rIsSCA(const ring r)
static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
TRUE iff 'a' and 'b' represent the same number; they may have different representations.
static poly p_LmInit(poly p, const ring r)
static FORCE_INLINE number n_ExactDiv(number a, number b, const coeffs r)
assume that there is a canonical subring in cf and we know that division is possible for these a and ...
static void p_Setm(poly p, const ring r)
poly p_DiffOp(poly a, poly b, BOOLEAN multiply, const ring r)
static long p_AddExp(poly p, int v, long ee, ring r)
long pLDeg1_WFirstTotalDegree(poly p, int *l, const ring r)
static poly p_GetExp_k_n(poly p, int l, int k, const ring r)
static FORCE_INLINE number n_SubringGcd(number a, number b, const coeffs r)
long pLDeg1c_WFirstTotalDegree(poly p, int *l, const ring r)
int dReportError(const char *fmt,...)
static FORCE_INLINE BOOLEAN nCoeff_is_Extension(const coeffs r)
static long * _componentsShifted
static unsigned long p_GetMaxExpL2(unsigned long l1, unsigned long l2, const ring r, unsigned long number_of_exp)
static poly p_Neg(poly p, const ring r)
static void p_LmDelete(poly p, const ring r)
int exponent(const CanonicalForm &f, int q)
int exponent ( const CanonicalForm & f, int q )
static poly p_Subst2(poly p, int n, number e, const ring r)
long p_WTotaldegree(poly p, const ring r)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
void p_wrp(poly p, ring lmRing, ring tailRing)
poly pp_Jet(poly p, int m, const ring R)
poly nc_pSubst(poly p, int n, poly e, const ring r)
substitute the n-th variable by e in p destroy p e is not a constant
void p_Write(poly p, ring lmRing, ring tailRing)
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff 'n' is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2), where m is the long representing n in C: TRUE iff (Im(n) != 0 and Im(n) >= 0) or (Im(n) == 0 and Re(n) >= 0) in K(a)/<p(a)>: TRUE iff (n != 0 and (LC(n) > 0 or deg(n) > 0)) in K(t_1, ..., t_n): TRUE iff (LC(numerator(n) is a constant and > 0) or (LC(numerator(n) is not a constant) in Z/2^kZ: TRUE iff 0 < n <= 2^(k-1) in Z/mZ: TRUE iff the internal mpz is greater than zero in Z: TRUE iff n > 0
static void p_ExpVectorSum(poly pr, poly p1, poly p2, const ring r)
static void p_SplitAndReversePoly(poly p, int n, poly *non_zero, poly *zero, const ring r)
static BOOLEAN p_ExpVectorEqual(poly p1, poly p2, const ring r1, const ring r2)
static long p_DecrExp(poly p, int v, ring r)
static poly p_Add_q(poly p, poly q, const ring r)
static BOOLEAN rField_has_Units(const ring r)
poly p_TakeOutComp(poly *p, int k, const ring r)
static poly p_Init(const ring r, omBin bin)
poly p_Cleardenom(poly p, const ring r)
int p_Var(poly m, const ring r)
static FORCE_INLINE int n_Size(number n, const coeffs r)
return a non-negative measure for the complexity of n; return 0 only when n represents zero; (used fo...
void p_ProjectiveUnique(poly ph, const ring r)
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
static poly p_Mult_q(poly p, poly q, const ring r)
poly p_Power(poly p, int i, const ring r)
void Werror(const char *fmt,...)
void p_DeleteComp(poly *p, int k, const ring r)
static FORCE_INLINE void n_ClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &d, const coeffs r)
(inplace) Clears denominators on a collection of numbers number d is the LCM of all the coefficient d...
static long p_MaxComp(poly p, ring lmRing, ring tailRing)
BOOLEAN p_OneComp(poly p, const ring r)
return TRUE if all monoms have the same component
poly p_GetMaxExpP(poly p, const ring r)
return monomial r such that GetExp(r,i) is maximum of all monomials in p; coeff == 0...
static void pnFreeBin(number *bin, int exp, const coeffs r)