36poly
p_Farey(poly
p, number
N,
const ring r);
71poly
p_One(
const ring r);
75long p_DegW(poly
p,
const int *
w,
const ring
R);
91poly
p_ISet(
long i,
const ring r);
94poly
p_NSet(number n,
const ring r);
124poly
p_Sub(poly a, poly
b,
const ring r);
126poly
p_Power(poly
p,
int i,
const ring r);
156#define pIfThen(cond, check) do {if (cond) {check;}} while (0)
162#define p_Test(p,r) _p_Test(p, r, PDEBUG)
163#define p_LmTest(p,r) _p_LmTest(p, r, PDEBUG)
164#define pp_Test(p, lmRing, tailRing) _pp_Test(p, lmRing, tailRing, PDEBUG)
168#define pIsMonomOf(p, q) (TRUE)
169#define pHaveCommonMonoms(p, q) (TRUE)
170#define p_LmCheckIsFromRing(p,r) (TRUE)
171#define p_LmCheckPolyRing(p,r) (TRUE)
172#define p_CheckIsFromRing(p,r) (TRUE)
173#define p_CheckPolyRing(p,r) (TRUE)
174#define p_CheckRing(r) (TRUE)
175#define P_CheckIf(cond, check) (TRUE)
177#define p_Test(p,r) (TRUE)
178#define p_LmTest(p,r) (TRUE)
179#define pp_Test(p, lmRing, tailRing) (TRUE)
204poly
p_Last(
const poly a,
int &
l,
const ring r);
208void p_Norm(poly p1,
const ring r);
225int p_Size( poly
p,
const ring r );
228poly
p_Homogen (poly
p,
int varnum,
const ring r);
233static inline void p_Setm(poly
p,
const ring r)
241poly
p_Subst(poly
p,
int n, poly e,
const ring r);
244#define p_SetmComp p_Setm
247static inline unsigned long p_SetComp(poly
p,
unsigned long c, ring r)
281static inline void p_SetCompP(poly
p,
int i, ring lmRing, ring tailRing)
292static inline long p_MaxComp(poly
p, ring lmRing, ring tailRing)
296 if(
p==
NULL)
return 0;
313static inline long p_MinComp(poly
p, ring lmRing, ring tailRing)
317 if(
p==
NULL)
return 0;
361void p_String0(poly
p, ring lmRing, ring tailRing);
362char*
p_String(poly
p, ring lmRing, ring tailRing);
363void p_Write(poly
p, ring lmRing, ring tailRing);
364void p_Write0(poly
p, ring lmRing, ring tailRing);
365void p_wrp(poly
p, ring lmRing, ring tailRing);
380static inline long p_FDeg(
const poly
p,
const ring r) {
return r->pFDeg(
p,r); }
381static inline long p_LDeg(
const poly
p,
int *
l,
const ring r) {
return r->pLDeg(
p,
l,r); }
403long p_Deg(poly a,
const ring r);
424 if (r->typ==
NULL)
return ((
p)->
exp[r->pOrdIndex]);
428 switch(r->typ[
i].ord_typ)
441 return ((
p)->
exp[r->pOrdIndex]);
447static inline unsigned long p_AddComp(poly
p,
unsigned long v, ring r)
453static inline unsigned long p_SubComp(poly
p,
unsigned long v, ring r)
469static inline long p_GetExp(
const poly
p,
const unsigned long iBitmask,
const int VarOffset)
471 pAssume2((VarOffset >> (24 + 6)) == 0);
473 int pos=(VarOffset & 0xffffff);
474 int bitpos=(VarOffset >> 24);
475 unsigned long exp=(
p->exp[pos] >> bitmask) & iBitmask;
479 ((
p->exp[(VarOffset & 0xffffff)] >> (VarOffset >> 24))
488static inline unsigned long p_SetExp(poly
p,
const unsigned long e,
const unsigned long iBitmask,
const int VarOffset)
492 pAssume2((VarOffset >> (24 + 6)) == 0);
495 REGISTER int shift = VarOffset >> 24;
496 unsigned long ee = e << shift ;
500 p->exp[
offset] &= ~( iBitmask << shift );
509static inline unsigned long BitMask(
unsigned long bitmask,
int twobits)
515 static const unsigned long _bitmasks[4] = {-1, 0x7fff, 0x7f, 0x3};
516 return bitmask & _bitmasks[twobits];
521static inline long p_GetExp(
const poly
p,
const unsigned long iBitmask,
const int VarOffset)
523 int pos =(VarOffset & 0xffffff);
524 int hbyte= (VarOffset >> 24);
525 int bitpos = hbyte & 0x3f;
526 long bitmask = BitMask(iBitmask, hbyte >> 6);
528 long exp=(
p->exp[pos] >> bitpos) & bitmask;
533static inline long p_SetExp(poly
p,
const long e,
const unsigned long iBitmask,
const int VarOffset)
536 pAssume2(e <= BitMask(iBitmask, VarOffset >> 30));
539 REGISTER int hbyte = VarOffset >> 24;
540 int bitmask = BitMask(iBitmask, hbyte >> 6);
542 long ee = e << shift;
546 p->exp[
offset] &= ~( bitmask << shift );
555static inline long p_GetExp(
const poly
p,
const ring r,
const int VarOffset)
559 return p_GetExp(
p, r->bitmask, VarOffset);
562static inline long p_SetExp(poly
p,
const long e,
const ring r,
const int VarOffset)
566 return p_SetExp(
p, e, r->bitmask, VarOffset);
572static inline long p_GetExp(
const poly
p,
const int v,
const ring r)
577 return p_GetExp(
p, r->bitmask, r->VarOffset[
v]);
582static inline long p_SetExp(poly
p,
const int v,
const long e,
const ring r)
587 return p_SetExp(
p, e, r->bitmask, r->VarOffset[
v]);
661#if (OM_TRACK > 2) && defined(OM_TRACK_CUSTOM)
662static inline poly
p_New(
const ring r,
omBin bin)
677 return p_New(r, r->PolyBin);
680#if (PDEBUG > 2) || defined(XALLOC_BIN)
681static inline void p_LmFree(poly
p, ring r)
693#if (PDEBUG > 2) || defined(XALLOC_BIN)
694static inline void p_LmFree(poly *
p, ring r)
708#if (PDEBUG > 2) || defined(XALLOC_BIN)
775unsigned long p_GetMaxExpL(poly
p,
const ring r,
unsigned long l_max = 0);
781static inline unsigned long p_GetMaxExp(
const unsigned long l,
const ring r)
783 unsigned long bitmask = r->bitmask;
784 unsigned long max = (
l & bitmask);
785 unsigned long j = r->ExpPerLong - 1;
789 unsigned long i = r->BitsPerExp;
793 e = ((
l >>
i) & bitmask);
794 if ((
unsigned long) e >
max)
809static inline unsigned long
812 const unsigned long bitmask = r->bitmask;
813 unsigned long sum = (
l & bitmask);
814 unsigned long j = number_of_exps - 1;
818 unsigned long i = r->BitsPerExp;
821 sum += ((
l >>
i) & bitmask);
842 return r->p_Procs->p_Copy(
p, r);
846static inline poly
p_Copy(poly
p,
const ring r)
860static inline poly
p_Head(
const poly
p,
const ring r)
867 memcpy(np->exp,
p->exp, r->ExpL_Size*
sizeof(
long));
874poly
p_Head0(
const poly
p,
const ring r);
883static inline poly
p_Copy(poly
p,
const ring lmRing,
const ring tailRing)
888 if (tailRing == lmRing)
905 if ((*
p)!=
NULL) r->p_Procs->p_Delete(
p, r);
908static inline void p_Delete(poly *
p,
const ring lmRing,
const ring tailRing)
914 if (tailRing == lmRing)
932 return r->p_Procs->p_ShallowCopyDelete(
p, r, bin);
936static inline poly
p_Add_q(poly
p, poly q,
const ring r)
939 if (q==
NULL)
return p;
940 if (
p==
NULL)
return q;
942 return r->p_Procs->p_Add_q(
p, q, shorter, r);
946static inline poly
p_Add_q(poly
p, poly q,
int &lp,
int lq,
const ring r)
949 if (q==
NULL)
return p;
950 if (
p==
NULL) { lp=
lq;
return q; }
952 poly
res = r->p_Procs->p_Add_q(
p, q, shorter, r);
969 return r->p_Procs->p_Mult_nn(
p, n, r);
971#define __p_Mult_nn(p,n,r) r->p_Procs->p_Mult_nn(p, n, r)
973static inline poly
p_Mult_nn(poly
p, number n,
const ring lmRing,
978 if (lmRing == tailRing)
983 p = lmRing->p_Procs->p_Mult_nn(
p, n, lmRing);
986 pNext(
p) = tailRing->p_Procs->p_Mult_nn(pnext, n, tailRing);
1000 return r->p_Procs->pp_Mult_nn(
p, n, r);
1002#define __pp_Mult_nn(p,n,r) r->p_Procs->pp_Mult_nn(p, n, r)
1009 int i = r->VarL_Size - 1;
1013 if (
p->exp[r->VarL_Offset[
i]] != 0)
1037 return r->p_Procs->pp_Mult_mm(
p,
m, r);
1047 return r->p_Procs->pp_mm_Mult(
p,
m, r);
1057 return r->p_Procs->p_Mult_mm(
p,
m, r);
1067 return r->p_Procs->p_mm_Mult(
p,
m, r);
1071 const poly spNoether,
const ring r)
1074 const poly
res = r->p_Procs->p_Minus_mm_Mult_qq(
p,
m, q, shorter, spNoether, r);
1085 return r->p_Procs->p_Minus_mm_Mult_qq(
p,
m, q, shorter,
NULL, r);
1093 return r->p_Procs->pp_Mult_Coeff_mm_DivSelect(
p,
m, shorter, r);
1101 poly
pp = r->p_Procs->pp_Mult_Coeff_mm_DivSelect(
p,
m, shorter, r);
1107static inline poly
p_Neg(poly
p,
const ring r)
1109 return r->p_Procs->p_Neg(
p, r);
1112extern poly
_p_Mult_q(poly
p, poly q,
const int copy,
const ring r);
1131 q = r->p_Procs->p_mm_Mult(q,
p, r);
1138 p = r->p_Procs->p_Mult_mm(
p, q, r);
1142#if defined(HAVE_PLURAL) || defined(HAVE_SHIFTBBA)
1157 return r->p_Procs->pp_mm_Mult(q,
p, r);
1162 return r->p_Procs->pp_Mult_mm(
p, q, r);
1170#if defined(HAVE_PLURAL) || defined(HAVE_SHIFTBBA)
1195 number n_neg =
n_Copy(n_old, r->cf);
1198 res = r->p_Procs->p_Minus_mm_Mult_qq(
p,
m, q, shorter,
NULL, r);
1199 lp = (lp +
lq) - shorter;
1215 return r->p_Procs->p_Merge_q(
p, q, r);
1258 p_wrp(
p, p_ring, p_ring);
1264#define _p_LmCmpAction(p, q, r, actionE, actionG, actionS) \
1267 int _cmp = p_LmCmp(p,q,r); \
1268 if (_cmp == 0) actionE; \
1269 if (_cmp == 1) actionG; \
1276#define _p_LmCmpAction(p, q, r, actionE, actionG, actionS) \
1277 p_MemCmp_LengthGeneral_OrdGeneral(p->exp, q->exp, r->CmpL_Size, r->ordsgn, \
1278 actionE, actionG, actionS)
1282#define pDivAssume(x) do {} while (0)
1294 if (r->NegWeightL_Offset !=
NULL)
1296 for (
int i=r->NegWeightL_Size-1;
i>=0;
i--)
1304 if (r->NegWeightL_Offset !=
NULL)
1306 for (
int i=r->NegWeightL_Size-1;
i>=0;
i--)
1317 memcpy(d_p->exp, s_p->exp, r->ExpL_Size*
sizeof(
long));
1332 return p_Init(r, r->PolyBin);
1341 memcpy(np->exp,
p->exp, r->ExpL_Size*
sizeof(
long));
1346static inline poly
p_LmInit(poly s_p,
const ring s_r,
const ring d_r,
omBin d_bin)
1351 poly d_p =
p_Init(d_r, d_bin);
1352 for (
unsigned i=d_r->N;
i!=0;
i--)
1363static inline poly
p_LmInit(poly s_p,
const ring s_r,
const ring d_r)
1366 return p_LmInit(s_p, s_r, d_r, d_r->PolyBin);
1379 memcpy(np->exp,
p->exp, r->ExpL_Size*
sizeof(
long));
1397 poly new_p =
p_New(r);
1398 memcpy(new_p->exp,
p->exp, r->ExpL_Size*
sizeof(
long));
1416 for (
int i=1;
i<=r->N;
i++)
1431 for (
int i=1;
i<=r->N;
i++)
1445 for (
int i=1;
i<=r->N;
i++)
1462 for (
int i=1;
i<=r->N;
i++)
1480 for (
int i=1;
i<=r->N;
i++)
1494 unsigned i = r->ExpL_Size;
1495 unsigned long *ep = p1->exp;
1496 unsigned long *eq = p2->exp;
1501 if (ep[
i] != eq[
i])
return FALSE;
1513 for (
unsigned i=r->VarL_Size-1;
i!=0;
i--)
1523 for (
unsigned j = r->N;
j!=0;
j--)
1532 for (
unsigned j = r->N;
j!=0;
j--)
1539 for (
unsigned j = r->N;
j!=0;
j--)
1547 for (
unsigned j = r->N;
j!=0;
j--)
1556 for (
unsigned j = r->N;
j!=0;
j--)
1567 for (
unsigned j = r->N;
j!=0;
j--)
1585 const unsigned long* _s1 = ((
unsigned long*)
p->exp);
1586 const unsigned long* _s2 = ((
unsigned long*) q->exp);
1589 const unsigned long _l = r->CmpL_Size;
1593 LengthGeneral_OrdGeneral_LoopTop:
1599 if (_i == _l)
return 0;
1600 goto LengthGeneral_OrdGeneral_LoopTop;
1602 const long* _ordsgn = (
long*) r->ordsgn;
1608 return -(_ordsgn[_i]);
1612 if (_ordsgn[_i] == 1)
return 1;
1615 if (_ordsgn[_i] == 1)
return -1;
1704 return(
p_LtCmp(
p,q,r) == -r->OrdSgn);
1713 return(
p_LtCmp(
p,q,r) == r->OrdSgn);
1727#define p_LmCmpAction(p, q, r, actionE, actionG, actionS) \
1728 _p_LmCmpAction(p, q, r, actionE, actionG, actionS)
1731#define p_LmEqual(p1, p2, r) p_ExpVectorEqual(p1, p2, r)
1735static inline int p_Cmp(poly p1, poly p2, ring r)
1739 if (p1==
NULL)
return 0;
1751 if (p1==
NULL)
return 0;
1775 int i=r->VarL_Size - 1;
1776 unsigned long divmask = r->divmask;
1777 unsigned long la, lb;
1779 if (r->VarL_LowIndex >= 0)
1781 i += r->VarL_LowIndex;
1787 (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask)))
1794 while (
i>=r->VarL_LowIndex);
1800 la = a->exp[r->VarL_Offset[
i]];
1801 lb =
b->exp[r->VarL_Offset[
i]];
1803 (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask)))
1938 poly
b,
unsigned long not_sev_b,
const ring r)
1946 if (sev_a & not_sev_b)
1958 poly
b,
unsigned long not_sev_b,
const ring r)
1966 if (sev_a & not_sev_b)
1978 poly
b,
unsigned long not_sev_b,
const ring r_b)
1986 if (sev_a & not_sev_b)
2051 unsigned long l1, l2, divmask = r->divmask;
2054 for (
i=0;
i<r->VarL_Size;
i++)
2056 l1 = p1->exp[r->VarL_Offset[
i]];
2057 l2 = p2->exp[r->VarL_Offset[
i]];
2059 if ( (l1 > ULONG_MAX - l2) ||
2060 (((l1 & divmask) ^ (l2 & divmask)) != ((l1 + l2) & divmask)))
2069const char *
p_Read(
const char *
s, poly &
p,
const ring r);
2073poly
p_Div_nn(poly
p,
const number n,
const ring r);
2076void p_Lcm(
const poly a,
const poly
b, poly
m,
const ring r);
2078poly
p_Lcm(
const poly a,
const poly
b,
const ring r);
2081poly
p_LcmRat(
const poly a,
const poly
b,
const long lCompM,
const ring r);
2088poly
p_Diff(poly a,
int k,
const ring r);
2105poly
p_PolyDiv(poly &
p,
const poly divisor,
const BOOLEAN needResult,
const ring r);
2137poly
pp_Jet(poly
p,
int m,
const ring
R);
2138poly
p_Jet(poly
p,
int m,
const ring
R);
2140poly
p_JetW(poly
p,
int m,
int *
w,
const ring
R);
2142poly
n_PermNumber(
const number z,
const int *par_perm,
const int OldPar,
const ring src,
const ring dst);
2144poly
p_PermPoly (poly
p,
const int * perm,
const ring OldRing,
const ring dst,
2152int p_Var(poly mi,
const ring r);
2158void p_Shift (poly *
p,
int i,
const ring r);
2161int p_Compare(
const poly a,
const poly
b,
const ring
R);
2167poly
p_Div_mm(poly
p,
const poly
m,
const ring r);
const CanonicalForm CFMap CFMap & N
Coefficient rings, fields and other domains suitable for Singular polynomials.
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
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 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),...
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 FORCE_INLINE BOOLEAN n_Greater(number a, number b, const coeffs r)
ordered fields: TRUE iff 'a' is larger than 'b'; in Z/pZ: TRUE iff la > lb, where la and lb are the l...
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/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.
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
const CanonicalForm int s
const Variable & v
< [in] a sqrfree bivariate poly
CFArray copy(const CFList &list)
write elements of list into an array
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
static int max(int a, int b)
static BOOLEAN length(leftv result, leftv arg)
poly nc_p_Plus_mm_Mult_qq(poly p, const poly m, const poly q, int &lp, const int, const ring r)
poly _nc_pp_Mult_qq(const poly p, const poly q, const ring r)
general NC-multiplication without destruction
poly _nc_p_Mult_q(poly p, poly q, const ring r)
general NC-multiplication with destruction
#define pIfThen1(cond, check)
#define p_LmCheckPolyRing1(p, r)
#define p_LmCheckPolyRing2(p, r)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
#define _pPolyAssume2(cond, p, r)
#define POLY_NEGWEIGHT_OFFSET
#define __p_GetComp(p, r)
#define p_SetRingOfLm(p, r)
#define rRing_has_Comp(r)
gmp_float exp(const gmp_float &a)
#define omTypeAlloc0Bin(type, addr, bin)
#define omTypeAllocBin(type, addr, bin)
#define omFreeBin(addr, bin)
#define omFreeBinAddr(addr)
#define omSizeWOfBin(bin_ptr)
BOOLEAN pDebugLmShortDivisibleByNoComp(poly p1, unsigned long sev_1, ring r_1, poly p2, unsigned long not_sev_2, ring r_2)
BOOLEAN pDebugLmShortDivisibleBy(poly p1, unsigned long sev_1, ring r_1, poly p2, unsigned long not_sev_2, ring r_2)
BOOLEAN p_DebugLmDivisibleByNoComp(poly a, poly b, ring r)
#define p_MemDiff_LengthGeneral(r, s1, s2, length)
#define p_MemSub_LengthGeneral(r, s, length)
#define p_MemAdd_LengthGeneral(r, s, length)
#define p_MemAddSub_LengthGeneral(r, s, t, length)
#define p_MemSum_LengthGeneral(r, s1, s2, length)
static poly p_Neg(poly p, const ring r)
void p_Content_n(poly p, number &c, const ring r)
poly p_Diff(poly a, int k, const ring r)
long pLDeg1c_WFirstTotalDegree(poly p, int *l, ring r)
static int p_CmpPolys(poly p1, poly p2, ring r)
long pLDeg0(poly p, int *l, ring r)
poly p_DivideM(poly a, poly b, const ring r)
int p_IsPurePower(const poly p, const ring r)
return i, if head depends only on var(i)
static long p_GetExpDiff(poly p1, poly p2, int i, ring r)
static void p_ExpVectorSum(poly pr, poly p1, poly p2, const ring r)
poly pp_Jet(poly p, int m, 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)
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg=NULL)
BOOLEAN pIsMonomOf(poly p, poly m)
BOOLEAN p_LmCheckPolyRing(poly p, ring r)
static void p_MemAdd_NegWeightAdjust(poly p, const ring r)
poly p_Farey(poly p, number N, const ring r)
BOOLEAN _p_Test(poly p, ring r, int level)
static void p_ExpVectorAdd(poly p1, poly p2, const ring r)
static unsigned long p_SubComp(poly p, unsigned long v, ring r)
long pLDeg1_Deg(poly p, int *l, ring r)
BOOLEAN p_CheckIsFromRing(poly p, ring r)
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
long pLDeg1_WFirstTotalDegree(poly p, int *l, ring r)
static long p_SubExp(poly p, int v, long ee, ring r)
static BOOLEAN _p_LmDivisibleByPart(poly a, const ring r_a, poly b, const ring r_b, const int start, const int end)
poly p_Sub(poly a, poly b, 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_IsConstantComp(const poly p, const ring r)
like the respective p_LmIs* routines, except that p might be empty
int p_Size(poly p, const ring r)
static long p_AddExp(poly p, int v, long ee, ring r)
static poly p_LmInit(poly p, const ring r)
poly p_GcdMon(poly f, poly g, const ring r)
polynomial gcd for f=mon
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
static long p_FDeg(const poly p, const ring r)
static unsigned long p_GetMaxExp(const unsigned long l, const ring r)
int p_LowVar(poly p, const ring r)
the minimal index of used variables - 1
poly p_CopyPowerProduct0(const poly p, const number n, const ring r)
like p_Head, but with coefficient n
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),...
poly p_Homogen(poly p, int varnum, const ring r)
static void p_ExpVectorCopy(poly d_p, poly s_p, const ring r)
poly p_Subst(poly p, int n, poly e, const ring r)
static void p_LmDelete0(poly p, const ring r)
long pLDeg1c_Deg(poly p, int *l, ring r)
static int p_Cmp(poly p1, poly p2, ring r)
BOOLEAN _p_LmTest(poly p, ring r, int level)
#define __pp_Mult_nn(p, n, r)
static void p_SetExpVL(poly p, int64 *ev, const ring r)
char * p_String(poly p, ring lmRing, ring tailRing)
BOOLEAN p_HasNotCF(poly p1, poly p2, const ring r)
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)
long pLDeg1(poly p, int *l, ring r)
poly p_CopyPowerProduct(const poly p, const ring r)
like p_Head, but with coefficient 1
static void p_SetExpV(poly p, int *ev, const ring r)
void p_ShallowDelete(poly *p, const ring r)
static poly pp_mm_Mult(poly p, poly m, const ring r)
static poly pp_Mult_mm(poly p, poly m, const ring r)
static int p_LtCmpNoAbs(poly p, poly q, const ring r)
static void p_MemSub_NegWeightAdjust(poly p, const ring r)
poly pp_DivideM(poly a, poly b, const ring r)
long p_WFirstTotalDegree(poly p, ring r)
int p_Weight(int c, const ring r)
static int p_Comp_k_n(poly a, poly b, int k, ring r)
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
static int p_LtCmpOrdSgnEqP(poly p, poly q, const ring r)
void p_ContentForGB(poly p, const ring r)
void p_Vec2Polys(poly v, poly **p, int *len, const ring r)
poly p_DiffOp(poly a, poly b, BOOLEAN multiply, const ring r)
static void p_SetCompP(poly p, int i, 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
poly p_Jet(poly p, int m, const ring R)
poly p_TakeOutComp1(poly *p, int k, const ring r)
static void p_ExpVectorDiff(poly pr, poly p1, poly p2, const ring r)
const char * p_Read(const char *s, poly &p, const ring r)
static long p_MinComp(poly p, ring lmRing, ring tailRing)
void p_String0Long(const poly p, ring lmRing, ring tailRing)
print p in a long way
void p_String0Short(const poly p, ring lmRing, ring tailRing)
print p in a short way, if possible
void p_Shift(poly *p, int i, const ring r)
shifts components of the vector p by i
static long p_GetExpSum(poly p1, poly p2, int i, ring r)
poly p_Power(poly p, int i, const ring r)
poly p_Div_nn(poly p, const number n, const ring r)
static poly p_mm_Mult(poly p, poly m, const ring r)
void p_Normalize(poly p, const ring r)
void p_DeleteComp(poly *p, int k, const ring r)
poly p_MDivide(poly a, poly b, const ring r)
void p_Content(poly p, const ring r)
void p_ProjectiveUnique(poly p, const ring r)
void p_ContentRat(poly &ph, const ring r)
void p_Norm(poly p1, const ring r)
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
poly p_Div_mm(poly p, const poly m, const ring r)
divide polynomial by monomial
poly p_GetMaxExpP(poly p, ring r)
return monomial r such that GetExp(r,i) is maximum of all monomials in p; coeff == 0,...
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 long p_IncrExp(poly p, int v, ring r)
int p_MinDeg(poly p, intvec *w, const ring R)
static void p_ExpVectorSub(poly p1, poly p2, const ring r)
static unsigned long p_AddComp(poly p, unsigned long v, ring r)
int p_MaxExpPerVar(poly p, int i, const ring r)
max exponent of variable x_i in p
int p_Var(poly mi, const ring r)
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,...
int p_Compare(const poly a, const poly b, const ring R)
static void p_Setm(poly p, const ring r)
poly p_mInit(const char *s, BOOLEAN &ok, const ring r)
void p_LmDeleteAndNextRat(poly *p, int ishift, ring r)
static poly p_Copy_noCheck(poly p, const ring r)
returns a copy of p (without any additional testing)
static number p_SetCoeff(poly p, number n, ring r)
static poly p_SortMerge(poly p, const ring r, BOOLEAN revert=FALSE)
static poly p_LmShallowCopyDelete(poly p, const ring r)
static poly pReverse(poly p)
static poly p_Merge_q(poly p, poly q, const ring r)
long pLDegb(poly p, int *l, ring r)
static void p_GetExpVL(poly p, int64 *ev, const ring r)
static int p_LtCmp(poly p, poly q, const ring r)
static BOOLEAN p_LmIsConstantComp(const poly p, const ring r)
static poly p_Head(const poly p, const ring r)
copy the (leading) term of p
static int p_LmCmp(poly p, poly q, const ring r)
poly p_Series(int n, poly p, poly u, intvec *w, const ring R)
long p_WTotaldegree(poly p, const ring r)
static BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
long p_DegW(poly p, const int *w, 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_LmIsConstant(const poly p, const ring r)
p_SetmProc p_GetSetmProc(const ring r)
static long p_MultExp(poly p, int v, long ee, ring r)
static BOOLEAN p_LmDivisibleByNoComp(poly a, poly b, const ring r)
static BOOLEAN p_IsOne(const poly p, const ring R)
either poly(1) or gen(k)?!
static BOOLEAN p_IsConstant(const poly p, const ring r)
static void p_SetExpVLV(poly p, int64 *ev, int64 comp, const ring r)
BOOLEAN p_OneComp(poly p, const ring r)
return TRUE if all monoms have the same component
static BOOLEAN _p_LmDivisibleByNoCompPart(poly a, const ring r_a, poly b, const ring r_b, const int start, const int end)
BOOLEAN p_CheckRing(ring r)
poly p_Cleardenom(poly p, const ring r)
static BOOLEAN _p_LmDivisibleBy(poly a, poly b, const ring r)
static unsigned long p_GetTotalDegree(const unsigned long l, const ring r, const int number_of_exps)
BOOLEAN p_LmCheckIsFromRing(poly p, ring r)
static poly p_New(const ring, omBin bin)
void p_Split(poly p, poly *r)
poly n_PermNumber(const number z, const int *par_perm, const int OldPar, const ring src, const ring dst)
static poly p_GetExp_k_n(poly p, int l, int k, const ring r)
static BOOLEAN p_LmShortDivisibleByNoComp(poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
static poly pp_Mult_nn(poly p, number n, const ring r)
poly p_GetCoeffRat(poly p, int ishift, ring r)
BOOLEAN p_VectorHasUnitB(poly p, int *k, const ring r)
poly p_Vec2Poly(poly v, int k, const ring r)
static BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
poly p_LcmRat(const poly a, const poly b, const long lCompM, const ring r)
static BOOLEAN p_DivisibleBy(poly a, poly b, const ring r)
static BOOLEAN p_ExpVectorEqual(poly p1, poly p2, const ring r)
long pLDeg1_Totaldegree(poly p, int *l, ring r)
void p_SetModDeg(intvec *w, ring r)
static poly p_ShallowCopyDelete(poly p, const ring r, omBin bin)
static int64 p_GetExpVLV(poly p, int64 *ev, const ring r)
void p_TakeOutComp(poly *p, long comp, poly *q, int *lq, const ring r)
static long p_MaxComp(poly p, ring lmRing, ring tailRing)
static poly p_Mult_nn(poly p, number n, const ring r)
static void p_Delete(poly *p, const ring r)
BOOLEAN p_HasNotCFRing(poly p1, poly p2, const ring r)
static long p_DecrExp(poly p, int v, ring r)
static int p_LtCmpOrdSgnDiffM(poly p, poly q, const ring r)
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...
void p_VectorHasUnit(poly p, int *k, int *len, const ring r)
static unsigned pLength(poly a)
static void p_GetExpV(poly p, int *ev, const ring r)
BOOLEAN p_CheckPolyRing(poly p, ring r)
void p_Write0(poly p, ring lmRing, ring tailRing)
long pLDeg1c_Totaldegree(poly p, int *l, ring r)
static long p_GetOrder(poly p, ring r)
int p_IsUnivariate(poly p, const ring r)
return i, if poly depends only on var(i)
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
static poly pp_Mult_qq(poly p, poly q, const ring r)
poly p_PermPoly(poly p, const int *perm, const ring OldRing, const ring dst, nMapFunc nMap, const int *par_perm=NULL, int OldPar=0, BOOLEAN use_mult=FALSE)
static int p_LtCmpOrdSgnEqM(poly p, poly q, const ring r)
static poly p_LmFreeAndNext(poly p, ring)
static poly p_Mult_mm(poly p, poly m, const ring r)
void p_Cleardenom_n(poly p, const ring r, number &c)
long p_WDegree(poly p, const ring r)
long pLDeg1c(poly p, int *l, ring r)
poly p_Last(const poly a, int &l, const ring r)
static void p_LmFree(poly p, ring)
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)
static poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, int &lp, int lq, const ring r)
void pEnlargeSet(poly **p, int length, int increment)
static BOOLEAN p_IsUnit(const poly p, const ring r)
static poly p_Init(const ring r, omBin bin)
BOOLEAN p_IsHomogeneous(poly p, const ring r)
poly p_Head0(const poly p, const ring r)
like p_Head, but allow NULL coeff
static poly p_LmDeleteAndNext(poly p, const ring r)
BOOLEAN pHaveCommonMonoms(poly p, poly q)
unsigned long p_GetShortExpVector(const poly a, const ring r)
static poly pp_Mult_Coeff_mm_DivSelect(poly p, const poly m, const ring r)
poly pp_JetW(poly p, int m, int *w, const ring R)
static BOOLEAN p_LmDivisibleByPart(poly a, poly b, const ring r, const int start, const int end)
long p_Deg(poly a, const ring r)
static poly p_SortAdd(poly p, const ring r, BOOLEAN revert=FALSE)
void p_SimpleContent(poly p, int s, const ring r)
static poly p_Copy(poly p, const ring r)
returns a copy of p
static long p_LDeg(const poly p, int *l, const ring r)
number p_InitContent(poly ph, const ring r)
void p_Vec2Array(poly v, poly *p, int len, const ring r)
julia: vector to already allocated array (len=p_MaxComp(v,r))
static long p_Totaldegree(poly p, const 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 BOOLEAN p_LmExpVectorAddIsOk(const poly p1, const poly p2, const ring r)
static int p_LtCmpOrdSgnDiffP(poly p, poly q, const ring r)
BOOLEAN _pp_Test(poly p, ring lmRing, ring tailRing, int level)
void p_Lcm(const poly a, const poly b, poly m, const ring r)
poly p_ChineseRemainder(poly *xx, number *x, number *q, int rl, CFArray &inv_cache, const ring R)
#define __p_Mult_nn(p, n, r)
poly p_JetW(poly p, int m, int *w, const ring R)
static BOOLEAN p_IsConstantPoly(const poly p, const ring r)
void p_wrp(poly p, ring lmRing, ring tailRing)
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
long pLDeg0c(poly p, int *l, ring r)
static void p_ExpVectorAddSub(poly p1, poly p2, poly p3, const ring r)
BOOLEAN rOrd_SetCompRequiresSetm(const ring r)
return TRUE if p_SetComp requires p_Setm
void(* p_SetmProc)(poly p, const ring r)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
long(* pFDegProc)(poly p, ring r)
long(* pLDegProc)(poly p, int *length, ring r)
static BOOLEAN rIsNCRing(const ring r)
#define rField_is_Ring(R)
poly sBucketSortMerge(poly p, const ring r)
Sorts p with bucketSort: assumes all monomials of p are different.
poly sBucketSortAdd(poly p, const ring r)
Sorts p with bucketSort: p may have equal monomials.