154 #define pIfThen(cond, check) do {if (cond) {check;}} while (0)
160 #define p_Test(p,r) _p_Test(p, r, PDEBUG)
161 #define p_LmTest(p,r) _p_LmTest(p, r, PDEBUG)
162 #define pp_Test(p, lmRing, tailRing) _pp_Test(p, lmRing, tailRing, PDEBUG)
166 #define pIsMonomOf(p, q) (TRUE)
167 #define pHaveCommonMonoms(p, q) (TRUE)
168 #define p_LmCheckIsFromRing(p,r) do {} while (0)
169 #define p_LmCheckPolyRing(p,r) do {} while (0)
170 #define p_CheckIsFromRing(p,r) do {} while (0)
171 #define p_CheckPolyRing(p,r) do {} while (0)
172 #define p_CheckRing(r) do {} while (0)
173 #define P_CheckIf(cond, check) do {} while (0)
175 #define p_Test(p,r) do {} while (0)
176 #define p_LmTest(p,r) do {} while (0)
177 #define pp_Test(p, lmRing, tailRing) do {} while (0)
233 #define p_SetmComp p_Setm
285 if(p==
NULL)
return 0;
294 if (i>result) result =
i;
306 if(p==
NULL)
return 0;
315 if (i<result) result =
i;
369 static inline long p_FDeg(
const poly p,
const ring
r) {
return r->pFDeg(p,r); }
370 static inline long p_LDeg(
const poly p,
int *
l,
const ring
r) {
return r->pLDeg(p,l,r); }
413 if (r->typ==
NULL)
return ((p)->
exp[r->pOrdIndex]);
417 switch(r->typ[i].ord_typ)
430 return ((p)->
exp[r->pOrdIndex]);
457 #ifndef HAVE_EXPSIZES
465 static inline long p_GetExp(
const poly p,
const unsigned long iBitmask,
const int VarOffset)
467 pAssume2((VarOffset >> (24 + 6)) == 0);
469 int pos=(VarOffset & 0xffffff);
470 int bitpos=(VarOffset >> 24);
471 unsigned long exp=(p->exp[pos] >> bitmask) & iBitmask;
475 ((p->exp[(VarOffset & 0xffffff)] >> (VarOffset >> 24))
484 static inline unsigned long p_SetExp(
poly p,
const unsigned long e,
const unsigned long iBitmask,
const int VarOffset)
488 pAssume2((VarOffset >> (24 + 6)) == 0);
491 register int shift = VarOffset >> 24;
492 unsigned long ee = e << shift ;
494 register int offset = (VarOffset & 0xffffff);
496 p->exp[
offset] &= ~( iBitmask << shift );
503 #else // #ifdef HAVE_EXPSIZES // EXPERIMENTAL!!!
505 static inline unsigned long BitMask(
unsigned long bitmask,
int twobits)
511 static const unsigned long _bitmasks[4] = {-1, 0x7fff, 0x7f, 0x3};
512 return bitmask & _bitmasks[twobits];
517 static inline long p_GetExp(
const poly p,
const unsigned long iBitmask,
const int VarOffset)
519 int pos =(VarOffset & 0xffffff);
520 int hbyte= (VarOffset >> 24);
521 int bitpos = hbyte & 0x3f;
522 long bitmask = BitMask(iBitmask, hbyte >> 6);
524 long exp=(p->exp[pos] >> bitpos) & bitmask;
529 static inline long p_SetExp(
poly p,
const long e,
const unsigned long iBitmask,
const int VarOffset)
532 pAssume2(e <= BitMask(iBitmask, VarOffset >> 30));
535 register int hbyte = VarOffset >> 24;
536 int bitmask = BitMask(iBitmask, hbyte >> 6);
537 register int shift = hbyte & 0x3f;
538 long ee = e << shift;
540 register int offset = (VarOffset & 0xffffff);
542 p->exp[
offset] &= ~( bitmask << shift );
548 #endif // #ifndef HAVE_EXPSIZES
551 static inline long p_GetExp(
const poly p,
const ring
r,
const int VarOffset)
555 return p_GetExp(p, r->bitmask, VarOffset);
558 static inline long p_SetExp(
poly p,
const long e,
const ring
r,
const int VarOffset)
562 return p_SetExp(p, e, r->bitmask, VarOffset);
573 return p_GetExp(p, r->bitmask, r->VarOffset[v]);
583 return p_SetExp(p, e, r->bitmask, r->VarOffset[v]);
657 #if (OM_TRACK > 2) && defined(OM_TRACK_CUSTOM)
673 return p_New(r, r->PolyBin);
743 static inline unsigned long p_GetMaxExp(
const unsigned long l,
const ring r)
745 unsigned long bitmask = r->bitmask;
746 unsigned long max = (l & bitmask);
747 unsigned long j = r->ExpPerLong - 1;
751 unsigned long i = r->BitsPerExp;
755 e = ((l >>
i) & bitmask);
756 if ((
unsigned long) e >
max)
771 static inline unsigned long
774 const unsigned long bitmask = r->bitmask;
775 unsigned long sum = (l & bitmask);
776 unsigned long j = number_of_exps - 1;
780 unsigned long i = r->BitsPerExp;
783 sum += ((l >>
i) & bitmask);
792 static inline unsigned long
807 return r->p_Procs->p_Copy(p, r);
826 memcpy(np->exp, p->exp, r->ExpL_Size*
sizeof(
long));
838 if (tailRing == lmRing)
853 r->p_Procs->p_Delete(p, r);
862 if (tailRing == lmRing)
880 return r->p_Procs->p_ShallowCopyDelete(p, r, bin);
888 return r->p_Procs->p_Add_q(p, q, shorter, r);
896 poly res = r->p_Procs->p_Add_q(p, q, shorter, r);
897 lp = (lp + lq) - shorter;
909 return r->p_Procs->p_Mult_nn(p, n, r);
916 if (lmRing == tailRing)
921 p = lmRing->p_Procs->p_Mult_nn(p, n, lmRing);
922 pNext(p) = tailRing->p_Procs->p_Mult_nn(pnext, n, tailRing);
932 return r->p_Procs->pp_Mult_nn(p, n, r);
940 int i = r->VarL_Size - 1;
944 if (p->exp[r->VarL_Offset[i]] != 0)
968 return r->p_Procs->pp_Mult_mm(p, m, r);
978 return r->p_Procs->p_Mult_mm(p, m, r);
982 const poly spNoether,
const ring r)
985 const poly res = r->p_Procs->p_Minus_mm_Mult_qq(p, m, q, shorter, spNoether, r);
996 return r->p_Procs->p_Minus_mm_Mult_qq(p, m, q, shorter,
NULL, r);
1004 return r->p_Procs->pp_Mult_Coeff_mm_DivSelect(p, m, shorter, r);
1012 poly pp = r->p_Procs->pp_Mult_Coeff_mm_DivSelect(p, m, shorter, r);
1020 return r->p_Procs->p_Neg(p, r);
1031 r->p_Procs->p_Delete(&q, r);
1036 r->p_Procs->p_Delete(&p, r);
1047 q = r->p_Procs->p_Mult_mm(q, p, r);
1049 r->p_Procs->p_Delete(&p, r);
1061 p = r->p_Procs->p_Mult_mm(p, q, r);
1063 r->p_Procs->p_Delete(&q, r);
1085 return r->p_Procs->pp_Mult_mm(q, p, r);
1090 return r->p_Procs->pp_Mult_mm(p, q, r);
1123 number n_neg =
n_Copy(n_old, r->cf);
1126 res = r->p_Procs->p_Minus_mm_Mult_qq(p, m, q, shorter,
NULL, r);
1127 lp = (lp + lq) - shorter;
1143 return r->p_Procs->p_Merge_q(p, q, r);
1170 return p_String(p, p_ring, p_ring);
1186 p_wrp(p, p_ring, p_ring);
1192 #define _p_LmCmpAction(p, q, r, actionE, actionG, actionS) \
1195 int _cmp = p_LmCmp(p,q,r); \
1196 if (_cmp == 0) actionE; \
1197 if (_cmp == 1) actionG; \
1204 #define _p_LmCmpAction(p, q, r, actionE, actionG, actionS) \
1205 p_MemCmp_LengthGeneral_OrdGeneral(p->exp, q->exp, r->CmpL_Size, r->ordsgn, \
1206 actionE, actionG, actionS)
1210 #define pDivAssume(x) do {} while (0)
1222 if (r->NegWeightL_Offset !=
NULL)
1224 for (
int i=r->NegWeightL_Size-1;
i>=0;
i--)
1232 if (r->NegWeightL_Offset !=
NULL)
1234 for (
int i=r->NegWeightL_Size-1;
i>=0;
i--)
1245 memcpy(d_p->exp, s_p->exp, r->ExpL_Size*
sizeof(
long));
1260 return p_Init(r, r->PolyBin);
1269 memcpy(np->exp, p->exp, r->ExpL_Size*
sizeof(
long));
1280 for (
int i=d_r->N;
i>0;
i--)
1294 return p_LmInit(s_p, s_r, d_r, d_r->PolyBin);
1307 memcpy(np->exp, p->exp, r->ExpL_Size*
sizeof(
long));
1326 memcpy(new_p->exp, p->exp, r->ExpL_Size*
sizeof(
long));
1344 for (
int i=1;
i<=r->N;
i++)
1359 for (
int i=1;
i<=r->N;
i++)
1373 for (
int i=1;
i<=r->N;
i++)
1390 for (
int i=1;
i<=r->N;
i++)
1408 for (
int i=1;
i<=r->N;
i++)
1422 int i = r->ExpL_Size;
1423 unsigned long *ep = p1->exp;
1424 unsigned long *eq = p2->exp;
1429 if (ep[i] != eq[i])
return FALSE;
1441 for (
int i=r->VarL_Size-1;
i>0;
i--)
1451 for (
int j = r->N;
j;
j--)
1459 for (
int j = r->N;
j;
j--)
1477 const unsigned long* _s1 = ((
unsigned long*) p->exp);
1478 const unsigned long* _s2 = ((
unsigned long*) q->exp);
1479 register unsigned long _v1;
1480 register unsigned long _v2;
1481 const unsigned long _l = r->CmpL_Size;
1483 register unsigned long _i=0;
1485 LengthGeneral_OrdGeneral_LoopTop:
1491 if (_i == _l)
return 0;
1492 goto LengthGeneral_OrdGeneral_LoopTop;
1494 const long* _ordsgn = (
long*) r->ordsgn;
1497 if (_ordsgn[_i] == 1)
return 1;
1500 if (_ordsgn[_i] == 1)
return -1;
1515 #define p_LmCmpAction(p, q, r, actionE, actionG, actionS) \
1516 _p_LmCmpAction(p, q, r, actionE, actionG, actionS)
1519 #define p_LmEqual(p1, p2, r) p_ExpVectorEqual(p1, p2, r)
1548 int i=r->VarL_Size - 1;
1549 unsigned long divmask = r->divmask;
1550 unsigned long la, lb;
1552 if (r->VarL_LowIndex >= 0)
1554 i += r->VarL_LowIndex;
1560 (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask)))
1567 while (i>=r->VarL_LowIndex);
1573 la = a->exp[r->VarL_Offset[
i]];
1574 lb = b->exp[r->VarL_Offset[
i]];
1576 (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask)))
1615 #ifdef HAVE_RATGRING
1711 poly b,
unsigned long not_sev_b,
const ring r)
1719 if (sev_a & not_sev_b)
1731 poly b,
unsigned long not_sev_b,
const ring r)
1739 if (sev_a & not_sev_b)
1751 poly b,
unsigned long not_sev_b,
const ring r_b)
1759 if (sev_a & not_sev_b)
1826 unsigned long l1, l2, divmask = r->divmask;
1829 for (i=0; i<r->VarL_Size; i++)
1831 l1 = p1->exp[r->VarL_Offset[
i]];
1832 l2 = p2->exp[r->VarL_Offset[
i]];
1834 if ( (l1 > ULONG_MAX - l2) ||
1835 (((l1 & divmask) ^ (l2 & divmask)) != ((l1 + l2) & divmask)))
1843 const char *
p_Read(
const char *
s,
poly &p,
const ring r);
1851 #ifdef HAVE_RATGRING
1913 poly n_PermNumber(
const number z,
const int *par_perm,
const int OldPar,
const ring src,
const ring dst);
1916 nMapFunc nMap,
const int *par_perm=
NULL,
int OldPar=0);
void p_ProjectiveUnique(poly p, const ring r)
#define p_LmCheckPolyRing2(p, r)
poly p_JetW(poly p, int m, short *w, const ring R)
static poly p_SortMerge(poly p, const ring r, BOOLEAN revert=FALSE)
#define __p_GetComp(p, r)
poly p_Cleardenom(poly p, const ring r)
#define p_MemSum_LengthGeneral(r, s1, s2, length)
static unsigned long p_AddComp(poly p, unsigned long v, ring r)
const CanonicalForm int s
poly p_Farey(poly p, number N, const ring r)
CFArray copy(const CFList &list)
write elements of list into an array
long pLDeg1c(poly p, int *l, ring r)
poly _nc_pp_Mult_qq(const poly p, const poly q, const ring r)
general NC-multiplication without destruction
static BOOLEAN p_LmIsConstantComp(const poly p, const ring r)
void p_LmDeleteAndNextRat(poly *p, int ishift, 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.
#define POLY_NEGWEIGHT_OFFSET
static int p_Cmp(poly p1, poly p2, ring r)
static poly p_LmDeleteAndNext(poly p, const ring r)
int p_LowVar(poly p, const ring r)
the minimal index of used variables - 1
BOOLEAN p_LmCheckIsFromRing(poly p, ring r)
const char * p_Read(const char *s, poly &p, const ring r)
BEGIN_NAMESPACE_SINGULARXX const ring lmRing
BOOLEAN pDebugLmShortDivisibleByNoComp(poly p1, unsigned long sev_1, ring r_1, poly p2, unsigned long not_sev_2, ring r_2)
long p_WDegree(poly p, const ring r)
char * p_String(poly p, ring lmRing, ring tailRing)
void p_String0Long(const poly p, ring lmRing, ring tailRing)
print p in a long way
unsigned long p_GetShortExpVector(const poly a, const ring r)
poly n_PermNumber(const number z, const int *par_perm, const int OldPar, const ring src, const ring dst)
poly _p_Mult_q(poly p, poly q, const int copy, const ring r)
Returns: p * q, Destroys: if !copy then p, q Assumes: pLength(p) >= 2 pLength(q) >=2.
poly p_PermPoly(poly p, const int *perm, const ring OldRing, const ring dst, nMapFunc nMap, const int *par_perm=NULL, int OldPar=0)
static BOOLEAN p_LmDivisibleByNoComp(poly a, poly b, const ring r)
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
static poly p_Mult_mm(poly p, poly m, const ring r)
static long p_IncrExp(poly p, int v, ring r)
poly p_LcmRat(const poly a, const poly b, const long lCompM, const ring r)
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
BOOLEAN p_DebugLmDivisibleByNoComp(poly a, poly b, ring r)
static BOOLEAN p_LmExpVectorAddIsOk(const poly p1, const poly p2, const ring r)
static poly pp_Mult_nn(poly p, number n, const ring r)
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
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 void p_GetExpV(poly p, int *ev, const ring r)
#define _pPolyAssume2(cond, p, r)
BOOLEAN p_VectorHasUnitB(poly p, int *k, const ring r)
static BOOLEAN p_IsUnit(const poly p, const ring r)
const CanonicalForm CFMap CFMap int &both_non_zero int n
static BOOLEAN _p_LmDivisibleBy(poly a, poly b, const ring r)
static unsigned long p_GetMaxExp(const unsigned long l, const ring r)
void p_Vec2Polys(poly v, poly **p, int *len, const ring r)
long p_DegW(poly p, const short *w, const ring R)
poly pp_JetW(poly p, int m, short *w, const ring R)
static poly p_LmShallowCopyDelete(poly p, const ring r)
static poly pp_Mult_mm(poly p, poly m, const ring r)
void p_Lcm(const poly a, const poly b, poly m, const ring r)
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
static long p_Totaldegree(poly p, const ring r)
BOOLEAN _pp_Test(poly p, ring lmRing, ring tailRing, int level)
void p_Shift(poly *p, int i, const ring r)
shifts components of the vector p by i
static void p_MemSub_NegWeightAdjust(poly p, const ring r)
void p_ShallowDelete(poly *p, const ring r)
BOOLEAN p_IsHomogeneous(poly p, const ring r)
#define omTypeAllocBin(type, addr, bin)
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 ...
BOOLEAN pHaveCommonMonoms(poly p, poly q)
long pLDeg1c_Deg(poly p, int *l, ring r)
static bool rIsPluralRing(const ring r)
we must always have this test!
static number p_SetCoeff(poly p, number n, ring r)
void p_Split(poly p, poly *r)
long(* pLDegProc)(poly p, int *length, ring r)
static void p_LmFree(poly p, ring)
BOOLEAN pIsMonomOf(poly p, poly m)
poly p_DiffOp(poly a, poly b, BOOLEAN multiply, 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
long p_WTotaldegree(poly p, const ring r)
static int pLength(poly a)
int int kStrategy strat if(h==NULL) return NULL
void pEnlargeSet(poly **p, int length, int increment)
static void p_SetExpV(poly p, int *ev, const ring r)
void p_TakeOutComp(poly *p, long comp, poly *q, int *lq, const ring r)
poly p_Sub(poly a, poly b, const ring r)
static unsigned long p_GetTotalDegree(const unsigned long l, const ring r, const int number_of_exps)
static poly p_Copy(poly p, const ring r)
returns a copy of p
static long p_GetExpSum(poly p1, poly p2, int i, ring r)
static long p_SubExp(poly p, int v, long ee, ring r)
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
static poly p_Copy_noCheck(poly p, const ring r)
returns a copy of p (without any additional testing)
poly p_DivideM(poly a, poly b, const ring r)
static BOOLEAN p_LmIsConstant(const poly p, const ring r)
poly nc_p_Plus_mm_Mult_qq(poly p, const poly m, const poly q, int &lp, const int, const ring r)
#define p_MemAddSub_LengthGeneral(r, s, t, length)
static poly p_SortAdd(poly p, const ring r, BOOLEAN revert=FALSE)
static BOOLEAN _p_LmDivisibleByNoComp(poly a, poly b, const ring r)
return: FALSE, if there exists i, such that a->exp[i] > b->exp[i] TRUE, otherwise (1) Consider long v...
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
BOOLEAN p_CheckPolyRing(poly p, ring r)
BOOLEAN p_HasNotCF(poly p1, poly p2, const ring r)
static long p_GetExpDiff(poly p1, poly p2, int i, ring r)
static poly nc_mm_Mult_p(const poly m, poly p, const ring r)
void p_Normalize(poly p, const ring r)
static poly p_Head(poly p, const ring r)
void p_Norm(poly p1, const ring r)
poly p_Div_nn(poly p, const number n, const ring r)
BOOLEAN _p_Test(poly p, ring r, int level)
Coefficient rings, fields and other domains suitable for Singular polynomials.
BOOLEAN _p_LmTest(poly p, ring r, int level)
static int p_Comp_k_n(poly a, poly b, int k, ring r)
static void p_SetCompP(poly p, int i, ring r)
poly p_Subst(poly p, int n, poly e, const ring r)
const CanonicalForm CFMap CFMap & N
#define p_MemAdd_LengthGeneral(r, s, length)
long pLDeg1_Totaldegree(poly p, int *l, ring r)
#define p_MemDiff_LengthGeneral(r, s1, s2, length)
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)
#define omFreeBinAddr(addr)
#define p_SetRingOfLm(p, r)
static BOOLEAN p_IsConstant(const poly p, const ring r)
poly _nc_p_Mult_q(poly p, poly q, const ring r)
general NC-multiplication with destruction
void p_Content(poly p, const ring r)
long pLDegb(poly p, int *l, ring r)
long pLDeg0c(poly p, int *l, ring r)
static poly pp_Mult_qq(poly p, poly q, const ring r)
long pLDeg1(poly p, int *l, ring r)
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg=NULL)
poly sBucketSortAdd(poly p, ring r)
Sorts p with bucketSort: p may have equal monomials.
static BOOLEAN p_ExpVectorEqual(poly p1, poly p2, const ring r)
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
int p_Size(poly p, const ring r)
poly p_mInit(const char *s, BOOLEAN &ok, const ring r)
static BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
static void p_MemAdd_NegWeightAdjust(poly p, 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 BOOLEAN p_DivisibleBy(poly a, poly b, const ring r)
void p_DeleteComp(poly *p, int k, const ring r)
static long p_FDeg(const poly p, const ring r)
static int p_LmCmp(poly p, poly q, const ring r)
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)
long p_WFirstTotalDegree(poly p, ring r)
long pLDeg0(poly p, int *l, ring r)
static poly p_ShallowCopyDelete(poly p, const ring r, omBin bin)
poly p_TakeOutComp1(poly *p, int k, const ring r)
static void p_ExpVectorCopy(poly d_p, poly s_p, const ring r)
static BOOLEAN p_IsOne(const poly p, const ring R)
either poly(1) or gen(k)?!
int p_Weight(int c, const ring r)
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
static BOOLEAN p_LmDivisibleByPart(poly a, poly b, const ring r, const int start, const int end)
static void p_ExpVectorSub(poly p1, poly p2, const ring r)
static poly p_Mult_nn(poly p, number n, const ring r)
void(* p_SetmProc)(poly p, const ring r)
static BOOLEAN p_LmShortDivisibleByNoComp(poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
#define p_LmCheckPolyRing1(p, r)
long pLDeg1c_WFirstTotalDegree(poly p, int *l, ring r)
static long p_MinComp(poly p, ring lmRing, ring tailRing)
static long p_LDeg(const poly p, int *l, 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
void p_Cleardenom_n(poly p, const ring r, number &c)
static poly p_LmFreeAndNext(poly p, ring)
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
static BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
static poly pReverse(poly p)
poly p_Jet(poly p, int m, const ring R)
poly p_Power(poly p, int i, const ring r)
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
poly p_Last(const poly a, int &l, const ring r)
static unsigned long p_SubComp(poly p, unsigned long v, ring r)
static BOOLEAN _p_LmDivisibleByPart(poly a, const ring r_a, poly b, const ring r_b, const int start, const int end)
static long p_GetOrder(poly p, ring r)
#define rRing_has_Comp(r)
void p_Write0(poly p, ring lmRing, ring tailRing)
static void p_Delete(poly *p, const ring r)
const Variable & v
< [in] a sqrfree bivariate poly
static void p_ExpVectorDiff(poly pr, poly p1, poly p2, 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 : VarOffset encodes the position in p->exp
static BOOLEAN p_IsConstantComp(const poly p, const ring r)
#define pIfThen1(cond, check)
#define omTypeAlloc0Bin(type, addr, bin)
poly p_Invers(int n, poly u, intvec *w, const ring R)
BOOLEAN p_CheckIsFromRing(poly p, ring r)
static BOOLEAN rField_is_Ring(const ring r)
static poly p_Merge_q(poly p, poly q, const ring r)
poly p_Divide(poly a, poly b, const ring r)
static BOOLEAN _p_LmDivisibleByNoCompPart(poly a, const ring r_a, poly b, const ring r_b, const int start, const int end)
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
int p_Var(poly mi, const ring r)
long p_Deg(poly a, const ring r)
void p_ContentRat(poly &ph, const ring r)
BOOLEAN p_LmCheckPolyRing(poly p, 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)...
#define p_MemSub_LengthGeneral(r, s, length)
long(* pFDegProc)(poly p, ring r)
long pLDeg1_WFirstTotalDegree(poly p, int *l, ring r)
int p_IsUnivariate(poly p, const ring r)
return i, if poly depends only on var(i)
void p_SetModDeg(intvec *w, ring r)
poly p_Diff(poly a, int k, const ring r)
poly p_Series(int n, poly p, poly u, intvec *w, const ring R)
#define omSizeWOfBin(bin_ptr)
static BOOLEAN p_IsConstantPoly(const poly p, const ring r)
poly sBucketSortMerge(poly p, ring r)
Sorts p with bucketSort: assumes all monomials of p are different.
void p_VectorHasUnit(poly p, int *k, int *len, const ring r)
static poly p_LmInit(poly p, const ring r)
static void p_Setm(poly p, const ring r)
static long p_AddExp(poly p, int v, long ee, ring r)
unsigned long p_GetMaxExpL(poly p, const ring r, unsigned long l_max=0)
return the maximal exponent of p in form of the maximal long var
static poly p_Minus_mm_Mult_qq(poly p, const poly m, const poly q, int &lp, int lq, const poly spNoether, const ring r)
long pLDeg1c_Totaldegree(poly p, int *l, ring r)
static poly p_GetExp_k_n(poly p, int l, int k, const ring r)
BOOLEAN p_OneComp(poly p, const ring r)
return TRUE if all monoms have the same component
static poly p_Neg(poly p, const ring r)
static void p_LmDelete(poly p, const ring r)
poly p_GetMaxExpP(poly p, ring r)
return monomial r such that GetExp(r,i) is maximum of all monomials in p; coeff == 0...
static poly nc_mm_Mult_pp(const poly m, const poly p, const ring r)
long pLDeg1_Deg(poly p, int *l, ring r)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
void p_wrp(poly p, ring lmRing, ring tailRing)
void p_String0(poly p, ring lmRing, ring tailRing)
print p according to ShortOut in lmRing & tailRing
void p_Write(poly p, ring lmRing, ring tailRing)
static void p_ExpVectorSum(poly pr, poly p1, poly p2, const ring r)
void p_SimpleContent(poly p, int s, const ring r)
int p_MinDeg(poly p, intvec *w, const ring R)
static long p_DecrExp(poly p, int v, ring r)
static void p_ExpVectorAddSub(poly p1, poly p2, poly p3, const ring r)
poly p_GetCoeffRat(poly p, int ishift, ring r)
static poly p_Add_q(poly p, poly q, const ring r)
static poly p_New(const ring, omBin bin)
BOOLEAN p_CheckRing(ring r)
static poly p_Init(const ring r, omBin bin)
BOOLEAN pDebugLmShortDivisibleBy(poly p1, unsigned long sev_1, ring r_1, poly p2, unsigned long not_sev_2, ring r_2)
poly pp_Jet(poly p, int m, const ring R)
static poly p_Mult_q(poly p, poly q, const ring r)
void p_String0Short(const poly p, ring lmRing, ring tailRing)
print p in a short way, if possible
int p_IsPurePower(const poly p, const ring r)
return i, if head depends only on var(i)
poly p_ChineseRemainder(poly *xx, number *x, number *q, int rl, CFArray &inv_cache, const ring R)
static poly pp_Mult_Coeff_mm_DivSelect(poly p, const poly m, const ring r)
static poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, int &lp, int lq, const ring r)
p_SetmProc p_GetSetmProc(ring r)
static long p_MaxComp(poly p, ring lmRing, ring tailRing)
poly p_Homogen(poly p, int varnum, const ring r)