36poly
p_Farey(poly
p, number
N,
const ring r);
68poly
p_One(
const ring r);
72long p_DegW(poly
p,
const int *
w,
const ring
R);
88poly
p_ISet(
long i,
const ring r);
91poly
p_NSet(number n,
const ring r);
121poly
p_Sub(poly a, poly
b,
const ring r);
123poly
p_Power(poly
p,
int i,
const ring r);
153#define pIfThen(cond, check) do {if (cond) {check;}} while (0)
159#define p_Test(p,r) _p_Test(p, r, PDEBUG)
160#define p_LmTest(p,r) _p_LmTest(p, r, PDEBUG)
161#define pp_Test(p, lmRing, tailRing) _pp_Test(p, lmRing, tailRing, PDEBUG)
165#define pIsMonomOf(p, q) (TRUE)
166#define pHaveCommonMonoms(p, q) (TRUE)
167#define p_LmCheckIsFromRing(p,r) (TRUE)
168#define p_LmCheckPolyRing(p,r) (TRUE)
169#define p_CheckIsFromRing(p,r) (TRUE)
170#define p_CheckPolyRing(p,r) (TRUE)
171#define p_CheckRing(r) (TRUE)
172#define P_CheckIf(cond, check) (TRUE)
174#define p_Test(p,r) (TRUE)
175#define p_LmTest(p,r) (TRUE)
176#define pp_Test(p, lmRing, tailRing) (TRUE)
201poly
p_Last(
const poly a,
int &
l,
const ring r);
205void p_Norm(poly p1,
const ring r);
221int p_Size( poly
p,
const ring r );
224poly
p_Homogen (poly
p,
int varnum,
const ring r);
231static inline void p_Setm(poly
p,
const ring r)
239poly
p_Subst(poly
p,
int n, poly e,
const ring r);
242#define p_SetmComp p_Setm
245static inline unsigned long p_SetComp(poly
p,
unsigned long c, ring r)
279static inline void p_SetCompP(poly
p,
int i, ring lmRing, ring tailRing)
290static inline long p_MaxComp(poly
p, ring lmRing, ring tailRing)
294 if(
p==
NULL)
return 0;
311static inline long p_MinComp(poly
p, ring lmRing, ring tailRing)
315 if(
p==
NULL)
return 0;
359void p_String0(poly
p, ring lmRing, ring tailRing);
360char*
p_String(poly
p, ring lmRing, ring tailRing);
361void p_Write(poly
p, ring lmRing, ring tailRing);
362void p_Write0(poly
p, ring lmRing, ring tailRing);
363void p_wrp(poly
p, ring lmRing, ring tailRing);
378static inline long p_FDeg(
const poly
p,
const ring r) {
return r->pFDeg(
p,r); }
379static inline long p_LDeg(
const poly
p,
int *
l,
const ring r) {
return r->pLDeg(
p,
l,r); }
401long p_Deg(poly a,
const ring r);
422 if (r->typ==
NULL)
return ((
p)->
exp[r->pOrdIndex]);
426 switch(r->typ[
i].ord_typ)
439 return ((
p)->
exp[r->pOrdIndex]);
445static inline unsigned long p_AddComp(poly
p,
unsigned long v, ring r)
451static inline unsigned long p_SubComp(poly
p,
unsigned long v, ring r)
467static inline long p_GetExp(
const poly
p,
const unsigned long iBitmask,
const int VarOffset)
469 pAssume2((VarOffset >> (24 + 6)) == 0);
471 int pos=(VarOffset & 0xffffff);
472 int bitpos=(VarOffset >> 24);
473 unsigned long exp=(
p->exp[pos] >> bitmask) & iBitmask;
477 ((
p->exp[(VarOffset & 0xffffff)] >> (VarOffset >> 24))
486static inline unsigned long p_SetExp(poly
p,
const unsigned long e,
const unsigned long iBitmask,
const int VarOffset)
490 pAssume2((VarOffset >> (24 + 6)) == 0);
493 REGISTER int shift = VarOffset >> 24;
494 unsigned long ee = e << shift ;
498 p->exp[
offset] &= ~( iBitmask << shift );
507static inline unsigned long BitMask(
unsigned long bitmask,
int twobits)
513 static const unsigned long _bitmasks[4] = {-1, 0x7fff, 0x7f, 0x3};
514 return bitmask & _bitmasks[twobits];
519static inline long p_GetExp(
const poly
p,
const unsigned long iBitmask,
const int VarOffset)
521 int pos =(VarOffset & 0xffffff);
522 int hbyte= (VarOffset >> 24);
523 int bitpos = hbyte & 0x3f;
524 long bitmask = BitMask(iBitmask, hbyte >> 6);
526 long exp=(
p->exp[pos] >> bitpos) & bitmask;
531static inline long p_SetExp(poly
p,
const long e,
const unsigned long iBitmask,
const int VarOffset)
534 pAssume2(e <= BitMask(iBitmask, VarOffset >> 30));
537 REGISTER int hbyte = VarOffset >> 24;
538 int bitmask = BitMask(iBitmask, hbyte >> 6);
540 long ee = e << shift;
544 p->exp[
offset] &= ~( bitmask << shift );
553static inline long p_GetExp(
const poly
p,
const ring r,
const int VarOffset)
557 return p_GetExp(
p, r->bitmask, VarOffset);
560static inline long p_SetExp(poly
p,
const long e,
const ring r,
const int VarOffset)
564 return p_SetExp(
p, e, r->bitmask, VarOffset);
570static inline long p_GetExp(
const poly
p,
const int v,
const ring r)
575 return p_GetExp(
p, r->bitmask, r->VarOffset[
v]);
580static inline long p_SetExp(poly
p,
const int v,
const long e,
const ring r)
585 return p_SetExp(
p, e, r->bitmask, r->VarOffset[
v]);
659#if (OM_TRACK > 2) && defined(OM_TRACK_CUSTOM)
660static inline poly
p_New(
const ring r,
omBin bin)
675 return p_New(r, r->PolyBin);
678#if (PDEBUG > 2) || defined(XALLOC_BIN)
679static inline void p_LmFree(poly
p, ring r)
691#if (PDEBUG > 2) || defined(XALLOC_BIN)
692static inline void p_LmFree(poly *
p, ring r)
706#if (PDEBUG > 2) || defined(XALLOC_BIN)
773unsigned long p_GetMaxExpL(poly
p,
const ring r,
unsigned long l_max = 0);
779static inline unsigned long p_GetMaxExp(
const unsigned long l,
const ring r)
781 unsigned long bitmask = r->bitmask;
782 unsigned long max = (
l & bitmask);
783 unsigned long j = r->ExpPerLong - 1;
787 unsigned long i = r->BitsPerExp;
791 e = ((
l >>
i) & bitmask);
792 if ((
unsigned long) e >
max)
807static inline unsigned long
810 const unsigned long bitmask = r->bitmask;
811 unsigned long sum = (
l & bitmask);
812 unsigned long j = number_of_exps - 1;
816 unsigned long i = r->BitsPerExp;
819 sum += ((
l >>
i) & bitmask);
840 return r->p_Procs->p_Copy(
p, r);
844static inline poly
p_Copy(poly
p,
const ring r)
858static inline poly
p_Head(
const poly
p,
const ring r)
865 memcpy(np->exp,
p->exp, r->ExpL_Size*
sizeof(
long));
872poly
p_Head0(
const poly
p,
const ring r);
881static inline poly
p_Copy(poly
p,
const ring lmRing,
const ring tailRing)
886 if (tailRing == lmRing)
903 if ((*
p)!=
NULL) r->p_Procs->p_Delete(
p, r);
906static inline void p_Delete(poly *
p,
const ring lmRing,
const ring tailRing)
912 if (tailRing == lmRing)
930 return r->p_Procs->p_ShallowCopyDelete(
p, r, bin);
934static inline poly
p_Add_q(poly
p, poly q,
const ring r)
937 if (q==
NULL)
return p;
938 if (
p==
NULL)
return q;
940 return r->p_Procs->p_Add_q(
p, q, shorter, r);
944static inline poly
p_Add_q(poly
p, poly q,
int &lp,
int lq,
const ring r)
947 if (q==
NULL)
return p;
948 if (
p==
NULL) { lp=
lq;
return q; }
950 poly
res = r->p_Procs->p_Add_q(
p, q, shorter, r);
967 return r->p_Procs->p_Mult_nn(
p, n, r);
969#define __p_Mult_nn(p,n,r) r->p_Procs->p_Mult_nn(p, n, r)
971static inline poly
p_Mult_nn(poly
p, number n,
const ring lmRing,
976 if (lmRing == tailRing)
981 p = lmRing->p_Procs->p_Mult_nn(
p, n, lmRing);
984 pNext(
p) = tailRing->p_Procs->p_Mult_nn(pnext, n, tailRing);
998 return r->p_Procs->pp_Mult_nn(
p, n, r);
1000#define __pp_Mult_nn(p,n,r) r->p_Procs->pp_Mult_nn(p, n, r)
1007 int i = r->VarL_Size - 1;
1011 if (
p->exp[r->VarL_Offset[
i]] != 0)
1035 return r->p_Procs->pp_Mult_mm(
p,
m, r);
1045 return r->p_Procs->pp_mm_Mult(
p,
m, r);
1055 return r->p_Procs->p_Mult_mm(
p,
m, r);
1065 return r->p_Procs->p_mm_Mult(
p,
m, r);
1069 const poly spNoether,
const ring r)
1072 const poly
res = r->p_Procs->p_Minus_mm_Mult_qq(
p,
m, q, shorter, spNoether, r);
1083 return r->p_Procs->p_Minus_mm_Mult_qq(
p,
m, q, shorter,
NULL, r);
1091 return r->p_Procs->pp_Mult_Coeff_mm_DivSelect(
p,
m, shorter, r);
1099 poly
pp = r->p_Procs->pp_Mult_Coeff_mm_DivSelect(
p,
m, shorter, r);
1105static inline poly
p_Neg(poly
p,
const ring r)
1107 return r->p_Procs->p_Neg(
p, r);
1110extern poly
_p_Mult_q(poly
p, poly q,
const int copy,
const ring r);
1129 q = r->p_Procs->p_mm_Mult(q,
p, r);
1136 p = r->p_Procs->p_Mult_mm(
p, q, r);
1140#if defined(HAVE_PLURAL) || defined(HAVE_SHIFTBBA)
1155 return r->p_Procs->pp_mm_Mult(q,
p, r);
1160 return r->p_Procs->pp_Mult_mm(
p, q, r);
1168#if defined(HAVE_PLURAL) || defined(HAVE_SHIFTBBA)
1193 number n_neg =
n_Copy(n_old, r->cf);
1196 res = r->p_Procs->p_Minus_mm_Mult_qq(
p,
m, q, shorter,
NULL, r);
1197 lp = (lp +
lq) - shorter;
1213 return r->p_Procs->p_Merge_q(
p, q, r);
1256 p_wrp(
p, p_ring, p_ring);
1262#define _p_LmCmpAction(p, q, r, actionE, actionG, actionS) \
1265 int _cmp = p_LmCmp(p,q,r); \
1266 if (_cmp == 0) actionE; \
1267 if (_cmp == 1) actionG; \
1274#define _p_LmCmpAction(p, q, r, actionE, actionG, actionS) \
1275 p_MemCmp_LengthGeneral_OrdGeneral(p->exp, q->exp, r->CmpL_Size, r->ordsgn, \
1276 actionE, actionG, actionS)
1280#define pDivAssume(x) do {} while (0)
1292 if (r->NegWeightL_Offset !=
NULL)
1294 for (
int i=r->NegWeightL_Size-1;
i>=0;
i--)
1302 if (r->NegWeightL_Offset !=
NULL)
1304 for (
int i=r->NegWeightL_Size-1;
i>=0;
i--)
1315 memcpy(d_p->exp, s_p->exp, r->ExpL_Size*
sizeof(
long));
1330 return p_Init(r, r->PolyBin);
1339 memcpy(np->exp,
p->exp, r->ExpL_Size*
sizeof(
long));
1344static inline poly
p_LmInit(poly s_p,
const ring s_r,
const ring d_r,
omBin d_bin)
1349 poly d_p =
p_Init(d_r, d_bin);
1350 for (
unsigned i=d_r->N;
i!=0;
i--)
1361static inline poly
p_LmInit(poly s_p,
const ring s_r,
const ring d_r)
1364 return p_LmInit(s_p, s_r, d_r, d_r->PolyBin);
1377 memcpy(np->exp,
p->exp, r->ExpL_Size*
sizeof(
long));
1395 poly new_p =
p_New(r);
1396 memcpy(new_p->exp,
p->exp, r->ExpL_Size*
sizeof(
long));
1414 for (
int i=1;
i<=r->N;
i++)
1429 for (
int i=1;
i<=r->N;
i++)
1443 for (
int i=1;
i<=r->N;
i++)
1460 for (
int i=1;
i<=r->N;
i++)
1478 for (
int i=1;
i<=r->N;
i++)
1492 unsigned i = r->ExpL_Size;
1493 unsigned long *ep = p1->exp;
1494 unsigned long *eq = p2->exp;
1499 if (ep[
i] != eq[
i])
return FALSE;
1511 for (
unsigned i=r->VarL_Size-1;
i!=0;
i--)
1521 for (
unsigned j = r->N;
j!=0;
j--)
1530 for (
unsigned j = r->N;
j!=0;
j--)
1537 for (
unsigned j = r->N;
j!=0;
j--)
1545 for (
unsigned j = r->N;
j!=0;
j--)
1554 for (
unsigned j = r->N;
j!=0;
j--)
1565 for (
unsigned j = r->N;
j!=0;
j--)
1583 const unsigned long* _s1 = ((
unsigned long*)
p->exp);
1584 const unsigned long* _s2 = ((
unsigned long*) q->exp);
1587 const unsigned long _l = r->CmpL_Size;
1591 LengthGeneral_OrdGeneral_LoopTop:
1597 if (_i == _l)
return 0;
1598 goto LengthGeneral_OrdGeneral_LoopTop;
1600 const long* _ordsgn = (
long*) r->ordsgn;
1606 return -(_ordsgn[_i]);
1610 if (_ordsgn[_i] == 1)
return 1;
1613 if (_ordsgn[_i] == 1)
return -1;
1669 return(
p_LtCmp(
p,q,r) == r->OrdSgn);
1694 return(
p_LtCmp(
p,q,r) == -r->OrdSgn);
1703 return(
p_LtCmp(
p,q,r) == r->OrdSgn);
1717#define p_LmCmpAction(p, q, r, actionE, actionG, actionS) \
1718 _p_LmCmpAction(p, q, r, actionE, actionG, actionS)
1721#define p_LmEqual(p1, p2, r) p_ExpVectorEqual(p1, p2, r)
1725static inline int p_Cmp(poly p1, poly p2, ring r)
1729 if (p1==
NULL)
return 0;
1741 if (p1==
NULL)
return 0;
1765 int i=r->VarL_Size - 1;
1766 unsigned long divmask = r->divmask;
1767 unsigned long la, lb;
1769 if (r->VarL_LowIndex >= 0)
1771 i += r->VarL_LowIndex;
1777 (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask)))
1784 while (
i>=r->VarL_LowIndex);
1790 la = a->exp[r->VarL_Offset[
i]];
1791 lb =
b->exp[r->VarL_Offset[
i]];
1793 (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask)))
1909 poly
b,
unsigned long not_sev_b,
const ring r)
1917 if (sev_a & not_sev_b)
1924 return pDebugLmShortDivisibleBy(a, sev_a, r,
b, not_sev_b, r);
1929 poly
b,
unsigned long not_sev_b,
const ring r)
1937 if (sev_a & not_sev_b)
1944 return pDebugLmShortDivisibleByNoComp(a, sev_a, r,
b, not_sev_b, r);
2002 unsigned long l1, l2, divmask = r->divmask;
2005 for (
i=0;
i<r->VarL_Size;
i++)
2007 l1 = p1->exp[r->VarL_Offset[
i]];
2008 l2 = p2->exp[r->VarL_Offset[
i]];
2010 if ( (l1 > ULONG_MAX - l2) ||
2011 (((l1 & divmask) ^ (l2 & divmask)) != ((l1 + l2) & divmask)))
2020const char *
p_Read(
const char *
s, poly &
p,
const ring r);
2024poly
p_Div_nn(poly
p,
const number n,
const ring r);
2027void p_Lcm(
const poly a,
const poly
b, poly
m,
const ring r);
2029poly
p_Lcm(
const poly a,
const poly
b,
const ring r);
2032poly
p_LcmRat(
const poly a,
const poly
b,
const long lCompM,
const ring r);
2039poly
p_Diff(poly a,
int k,
const ring r);
2056poly
p_PolyDiv(poly &
p,
const poly divisor,
const BOOLEAN needResult,
const ring r);
2087poly
pp_Jet(poly
p,
int m,
const ring
R);
2088poly
p_Jet(poly
p,
int m,
const ring
R);
2090poly
p_JetW(poly
p,
int m,
int *
w,
const ring
R);
2092poly
n_PermNumber(
const number z,
const int *par_perm,
const int OldPar,
const ring src,
const ring dst);
2094poly
p_PermPoly (poly
p,
const int * perm,
const ring OldRing,
const ring dst,
2102int p_Var(poly mi,
const ring r);
2108void p_Shift (poly *
p,
int i,
const ring r);
2111int p_Compare(
const poly a,
const poly
b,
const ring
R);
2117poly
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)
if(!FE_OPT_NO_SHELL_FLAG)(void) system(sys)
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)
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,...
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)
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)
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.