36poly
p_Farey(poly
p, number
N,
const ring r);
70poly
p_One(
const ring r);
74long p_DegW(poly
p,
const int *
w,
const ring
R);
90poly
p_ISet(
long i,
const ring r);
93poly
p_NSet(number n,
const ring r);
123poly
p_Sub(poly a, poly
b,
const ring r);
125poly
p_Power(poly
p,
int i,
const ring r);
155#define pIfThen(cond, check) do {if (cond) {check;}} while (0)
161#define p_Test(p,r) _p_Test(p, r, PDEBUG)
162#define p_LmTest(p,r) _p_LmTest(p, r, PDEBUG)
163#define pp_Test(p, lmRing, tailRing) _pp_Test(p, lmRing, tailRing, PDEBUG)
167#define pIsMonomOf(p, q) (TRUE)
168#define pHaveCommonMonoms(p, q) (TRUE)
169#define p_LmCheckIsFromRing(p,r) (TRUE)
170#define p_LmCheckPolyRing(p,r) (TRUE)
171#define p_CheckIsFromRing(p,r) (TRUE)
172#define p_CheckPolyRing(p,r) (TRUE)
173#define p_CheckRing(r) (TRUE)
174#define P_CheckIf(cond, check) (TRUE)
176#define p_Test(p,r) (TRUE)
177#define p_LmTest(p,r) (TRUE)
178#define pp_Test(p, lmRing, tailRing) (TRUE)
203poly
p_Last(
const poly a,
int &
l,
const ring r);
207void p_Norm(poly p1,
const ring r);
223int p_Size( poly
p,
const ring r );
226poly
p_Homogen (poly
p,
int varnum,
const ring r);
235static inline void p_Setm(poly
p,
const ring r)
243poly
p_Subst(poly
p,
int n, poly e,
const ring r);
246#define p_SetmComp p_Setm
249static inline unsigned long p_SetComp(poly
p,
unsigned long c, ring r)
283static inline void p_SetCompP(poly
p,
int i, ring lmRing, ring tailRing)
294static inline long p_MaxComp(poly
p, ring lmRing, ring tailRing)
298 if(
p==
NULL)
return 0;
315static inline long p_MinComp(poly
p, ring lmRing, ring tailRing)
319 if(
p==
NULL)
return 0;
363void p_String0(poly
p, ring lmRing, ring tailRing);
364char*
p_String(poly
p, ring lmRing, ring tailRing);
365void p_Write(poly
p, ring lmRing, ring tailRing);
366void p_Write0(poly
p, ring lmRing, ring tailRing);
367void p_wrp(poly
p, ring lmRing, ring tailRing);
382static inline long p_FDeg(
const poly
p,
const ring r) {
return r->pFDeg(
p,r); }
383static inline long p_LDeg(
const poly
p,
int *
l,
const ring r) {
return r->pLDeg(
p,
l,r); }
405long p_Deg(poly a,
const ring r);
426 if (r->typ==
NULL)
return ((
p)->
exp[r->pOrdIndex]);
430 switch(r->typ[
i].ord_typ)
443 return ((
p)->
exp[r->pOrdIndex]);
449static inline unsigned long p_AddComp(poly
p,
unsigned long v, ring r)
455static inline unsigned long p_SubComp(poly
p,
unsigned long v, ring r)
471static inline long p_GetExp(
const poly
p,
const unsigned long iBitmask,
const int VarOffset)
473 pAssume2((VarOffset >> (24 + 6)) == 0);
475 int pos=(VarOffset & 0xffffff);
476 int bitpos=(VarOffset >> 24);
477 unsigned long exp=(
p->exp[pos] >> bitmask) & iBitmask;
481 ((
p->exp[(VarOffset & 0xffffff)] >> (VarOffset >> 24))
490static inline unsigned long p_SetExp(poly
p,
const unsigned long e,
const unsigned long iBitmask,
const int VarOffset)
494 pAssume2((VarOffset >> (24 + 6)) == 0);
497 REGISTER int shift = VarOffset >> 24;
498 unsigned long ee = e << shift ;
502 p->exp[
offset] &= ~( iBitmask << shift );
511static inline unsigned long BitMask(
unsigned long bitmask,
int twobits)
517 static const unsigned long _bitmasks[4] = {-1, 0x7fff, 0x7f, 0x3};
518 return bitmask & _bitmasks[twobits];
523static inline long p_GetExp(
const poly
p,
const unsigned long iBitmask,
const int VarOffset)
525 int pos =(VarOffset & 0xffffff);
526 int hbyte= (VarOffset >> 24);
527 int bitpos = hbyte & 0x3f;
528 long bitmask = BitMask(iBitmask, hbyte >> 6);
530 long exp=(
p->exp[pos] >> bitpos) & bitmask;
535static inline long p_SetExp(poly
p,
const long e,
const unsigned long iBitmask,
const int VarOffset)
538 pAssume2(e <= BitMask(iBitmask, VarOffset >> 30));
541 REGISTER int hbyte = VarOffset >> 24;
542 int bitmask = BitMask(iBitmask, hbyte >> 6);
544 long ee = e << shift;
548 p->exp[
offset] &= ~( bitmask << shift );
557static inline long p_GetExp(
const poly
p,
const ring r,
const int VarOffset)
561 return p_GetExp(
p, r->bitmask, VarOffset);
564static inline long p_SetExp(poly
p,
const long e,
const ring r,
const int VarOffset)
568 return p_SetExp(
p, e, r->bitmask, VarOffset);
574static inline long p_GetExp(
const poly
p,
const int v,
const ring r)
579 return p_GetExp(
p, r->bitmask, r->VarOffset[
v]);
584static inline long p_SetExp(poly
p,
const int v,
const long e,
const ring r)
589 return p_SetExp(
p, e, r->bitmask, r->VarOffset[
v]);
663#if (OM_TRACK > 2) && defined(OM_TRACK_CUSTOM)
664static inline poly
p_New(
const ring r,
omBin bin)
679 return p_New(r, r->PolyBin);
682#if (PDEBUG > 2) || defined(XALLOC_BIN)
683static inline void p_LmFree(poly
p, ring r)
695#if (PDEBUG > 2) || defined(XALLOC_BIN)
696static inline void p_LmFree(poly *
p, ring r)
710#if (PDEBUG > 2) || defined(XALLOC_BIN)
777unsigned long p_GetMaxExpL(poly
p,
const ring r,
unsigned long l_max = 0);
783static inline unsigned long p_GetMaxExp(
const unsigned long l,
const ring r)
785 unsigned long bitmask = r->bitmask;
786 unsigned long max = (
l & bitmask);
787 unsigned long j = r->ExpPerLong - 1;
791 unsigned long i = r->BitsPerExp;
795 e = ((
l >>
i) & bitmask);
796 if ((
unsigned long) e >
max)
811static inline unsigned long
814 const unsigned long bitmask = r->bitmask;
815 unsigned long sum = (
l & bitmask);
816 unsigned long j = number_of_exps - 1;
820 unsigned long i = r->BitsPerExp;
823 sum += ((
l >>
i) & bitmask);
844 return r->p_Procs->p_Copy(
p, r);
848static inline poly
p_Copy(poly
p,
const ring r)
862static inline poly
p_Head(
const poly
p,
const ring r)
869 memcpy(np->exp,
p->exp, r->ExpL_Size*
sizeof(
long));
876poly
p_Head0(
const poly
p,
const ring r);
885static inline poly
p_Copy(poly
p,
const ring lmRing,
const ring tailRing)
890 if (tailRing == lmRing)
907 if ((*
p)!=
NULL) r->p_Procs->p_Delete(
p, r);
910static inline void p_Delete(poly *
p,
const ring lmRing,
const ring tailRing)
916 if (tailRing == lmRing)
934 return r->p_Procs->p_ShallowCopyDelete(
p, r, bin);
938static inline poly
p_Add_q(poly
p, poly q,
const ring r)
941 if (q==
NULL)
return p;
942 if (
p==
NULL)
return q;
944 return r->p_Procs->p_Add_q(
p, q, shorter, r);
948static inline poly
p_Add_q(poly
p, poly q,
int &lp,
int lq,
const ring r)
951 if (q==
NULL)
return p;
952 if (
p==
NULL) { lp=
lq;
return q; }
954 poly
res = r->p_Procs->p_Add_q(
p, q, shorter, r);
971 return r->p_Procs->p_Mult_nn(
p, n, r);
973#define __p_Mult_nn(p,n,r) r->p_Procs->p_Mult_nn(p, n, r)
975static inline poly
p_Mult_nn(poly
p, number n,
const ring lmRing,
980 if (lmRing == tailRing)
985 p = lmRing->p_Procs->p_Mult_nn(
p, n, lmRing);
988 pNext(
p) = tailRing->p_Procs->p_Mult_nn(pnext, n, tailRing);
1002 return r->p_Procs->pp_Mult_nn(
p, n, r);
1004#define __pp_Mult_nn(p,n,r) r->p_Procs->pp_Mult_nn(p, n, r)
1011 int i = r->VarL_Size - 1;
1015 if (
p->exp[r->VarL_Offset[
i]] != 0)
1039 return r->p_Procs->pp_Mult_mm(
p,
m, r);
1049 return r->p_Procs->pp_mm_Mult(
p,
m, r);
1059 return r->p_Procs->p_Mult_mm(
p,
m, r);
1069 return r->p_Procs->p_mm_Mult(
p,
m, r);
1073 const poly spNoether,
const ring r)
1076 const poly
res = r->p_Procs->p_Minus_mm_Mult_qq(
p,
m, q, shorter, spNoether, r);
1087 return r->p_Procs->p_Minus_mm_Mult_qq(
p,
m, q, shorter,
NULL, r);
1095 return r->p_Procs->pp_Mult_Coeff_mm_DivSelect(
p,
m, shorter, r);
1103 poly
pp = r->p_Procs->pp_Mult_Coeff_mm_DivSelect(
p,
m, shorter, r);
1109static inline poly
p_Neg(poly
p,
const ring r)
1111 return r->p_Procs->p_Neg(
p, r);
1137 q = r->p_Procs->p_mm_Mult(q,
p, r);
1144 p = r->p_Procs->p_Mult_mm(
p, q, r);
1148#if defined(HAVE_PLURAL) || defined(HAVE_SHIFTBBA)
1168 return r->p_Procs->pp_mm_Mult(q,
p, r);
1173 return r->p_Procs->pp_Mult_mm(
p, q, r);
1181#if defined(HAVE_PLURAL) || defined(HAVE_SHIFTBBA)
1211 number n_neg =
n_Copy(n_old, r->cf);
1214 res = r->p_Procs->p_Minus_mm_Mult_qq(
p,
m, q, shorter,
NULL, r);
1215 lp = (lp +
lq) - shorter;
1231 return r->p_Procs->p_Merge_q(
p, q, r);
1274 p_wrp(
p, p_ring, p_ring);
1280#define _p_LmCmpAction(p, q, r, actionE, actionG, actionS) \
1283 int _cmp = p_LmCmp(p,q,r); \
1284 if (_cmp == 0) actionE; \
1285 if (_cmp == 1) actionG; \
1292#define _p_LmCmpAction(p, q, r, actionE, actionG, actionS) \
1293 p_MemCmp_LengthGeneral_OrdGeneral(p->exp, q->exp, r->CmpL_Size, r->ordsgn, \
1294 actionE, actionG, actionS)
1298#define pDivAssume(x) do {} while (0)
1310 if (r->NegWeightL_Offset !=
NULL)
1312 for (
int i=r->NegWeightL_Size-1;
i>=0;
i--)
1320 if (r->NegWeightL_Offset !=
NULL)
1322 for (
int i=r->NegWeightL_Size-1;
i>=0;
i--)
1333 memcpy(d_p->exp, s_p->exp, r->ExpL_Size*
sizeof(
long));
1348 return p_Init(r, r->PolyBin);
1357 memcpy(np->exp,
p->exp, r->ExpL_Size*
sizeof(
long));
1362static inline poly
p_LmInit(poly s_p,
const ring s_r,
const ring d_r,
omBin d_bin)
1367 poly d_p =
p_Init(d_r, d_bin);
1368 for (
unsigned i=d_r->N;
i!=0;
i--)
1379static inline poly
p_LmInit(poly s_p,
const ring s_r,
const ring d_r)
1382 return p_LmInit(s_p, s_r, d_r, d_r->PolyBin);
1395 memcpy(np->exp,
p->exp, r->ExpL_Size*
sizeof(
long));
1413 poly new_p =
p_New(r);
1414 memcpy(new_p->exp,
p->exp, r->ExpL_Size*
sizeof(
long));
1432 for (
int i=1;
i<=r->N;
i++)
1447 for (
int i=1;
i<=r->N;
i++)
1461 for (
int i=1;
i<=r->N;
i++)
1478 for (
int i=1;
i<=r->N;
i++)
1496 for (
int i=1;
i<=r->N;
i++)
1510 unsigned i = r->ExpL_Size;
1511 unsigned long *ep = p1->exp;
1512 unsigned long *eq = p2->exp;
1517 if (ep[
i] != eq[
i])
return FALSE;
1529 for (
unsigned i=r->VarL_Size-1;
i!=0;
i--)
1539 for (
unsigned j = r->N;
j!=0;
j--)
1548 for (
unsigned j = r->N;
j!=0;
j--)
1555 for (
unsigned j = r->N;
j!=0;
j--)
1563 for (
unsigned j = r->N;
j!=0;
j--)
1572 for (
unsigned j = r->N;
j!=0;
j--)
1583 for (
unsigned j = r->N;
j!=0;
j--)
1601 const unsigned long* _s1 = ((
unsigned long*)
p->exp);
1602 const unsigned long* _s2 = ((
unsigned long*) q->exp);
1605 const unsigned long _l = r->CmpL_Size;
1609 LengthGeneral_OrdGeneral_LoopTop:
1615 if (_i == _l)
return 0;
1616 goto LengthGeneral_OrdGeneral_LoopTop;
1618 const long* _ordsgn = (
long*) r->ordsgn;
1624 return -(_ordsgn[_i]);
1628 if (_ordsgn[_i] == 1)
return 1;
1631 if (_ordsgn[_i] == 1)
return -1;
1687 return(
p_LtCmp(
p,q,r) == r->OrdSgn);
1712 return(
p_LtCmp(
p,q,r) == -r->OrdSgn);
1721 return(
p_LtCmp(
p,q,r) == r->OrdSgn);
1735#define p_LmCmpAction(p, q, r, actionE, actionG, actionS) \
1736 _p_LmCmpAction(p, q, r, actionE, actionG, actionS)
1739#define p_LmEqual(p1, p2, r) p_ExpVectorEqual(p1, p2, r)
1743static inline int p_Cmp(poly p1, poly p2, ring r)
1747 if (p1==
NULL)
return 0;
1759 if (p1==
NULL)
return 0;
1783 int i=r->VarL_Size - 1;
1784 unsigned long divmask = r->divmask;
1785 unsigned long la, lb;
1787 if (r->VarL_LowIndex >= 0)
1789 i += r->VarL_LowIndex;
1795 (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask)))
1802 while (
i>=r->VarL_LowIndex);
1808 la = a->exp[r->VarL_Offset[
i]];
1809 lb =
b->exp[r->VarL_Offset[
i]];
1811 (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask)))
1927 poly
b,
unsigned long not_sev_b,
const ring r)
1935 if (sev_a & not_sev_b)
1942 return pDebugLmShortDivisibleBy(a, sev_a, r,
b, not_sev_b, r);
1947 poly
b,
unsigned long not_sev_b,
const ring r)
1955 if (sev_a & not_sev_b)
1962 return pDebugLmShortDivisibleByNoComp(a, sev_a, r,
b, not_sev_b, r);
2020 unsigned long l1, l2, divmask = r->divmask;
2023 for (
i=0;
i<r->VarL_Size;
i++)
2025 l1 = p1->exp[r->VarL_Offset[
i]];
2026 l2 = p2->exp[r->VarL_Offset[
i]];
2028 if ( (l1 > ULONG_MAX - l2) ||
2029 (((l1 & divmask) ^ (l2 & divmask)) != ((l1 + l2) & divmask)))
2038const char *
p_Read(
const char *
s, poly &
p,
const ring r);
2042poly
p_Div_nn(poly
p,
const number n,
const ring r);
2045void p_Lcm(
const poly a,
const poly
b, poly
m,
const ring r);
2047poly
p_Lcm(
const poly a,
const poly
b,
const ring r);
2050poly
p_LcmRat(
const poly a,
const poly
b,
const long lCompM,
const ring r);
2057poly
p_Diff(poly a,
int k,
const ring r);
2074poly
p_PolyDiv(poly &
p,
const poly divisor,
const BOOLEAN needResult,
const ring r);
2105poly
pp_Jet(poly
p,
int m,
const ring
R);
2107poly
p_Jet(poly
p,
int m,
const ring
R);
2109poly
p_JetW(poly
p,
int m,
int *
w,
const ring
R);
2111poly
n_PermNumber(
const number z,
const int *par_perm,
const int OldPar,
const ring src,
const ring dst);
2113poly
p_PermPoly (poly
p,
const int * perm,
const ring OldRing,
const ring dst,
2121int p_Var(poly mi,
const ring r);
2127void p_Shift (poly *
p,
int i,
const ring r);
2130int p_Compare(
const poly a,
const poly
b,
const ring
R);
2136poly
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 BOOLEAN nCoeff_is_Domain(const coeffs r)
returns TRUE, if r is a field or r has no zero divisors (i.e is a domain)
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 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)
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)
static int pLength(poly a)
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)
poly p_HomogenDP(poly p, int varnum, const ring r)
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)
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,...
poly pp_Jet0(poly p, const 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 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)
BOOLEAN p_IsHomogeneousW(poly p, const intvec *w, 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)
poly _p_Mult_q_Normal_ZeroDiv(poly p, poly q, const int copy, 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)
Splits *p into two polys: *q which consists of all monoms with component == comp and *p of all other ...
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 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)
unsigned long p_GetShortExpVector0(const poly a, 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)
unsigned long p_GetShortExpVector1(const poly a, 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
BOOLEAN p_IsHomogeneousDP(poly p, const ring r)
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.