Macros | Typedefs | Functions | Variables
polys.h File Reference

Compatiblity layer for legacy polynomial operations (over currRing) More...

#include <polys/monomials/ring.h>
#include <polys/monomials/p_polys.h>
#include <coeffs/numbers.h>

Go to the source code of this file.

Macros

#define pSetCoeff(p, n)   p_SetCoeff(p,n,currRing)
 deletes old coeff before setting the new one More...
 
#define pGetOrder(p)   p_GetOrder(p, currRing)
 Order. More...
 
#define pGetComp(p)   (int)__p_GetComp(p, currRing)
 Component. More...
 
#define pSetComp(p, v)   p_SetComp(p,v, currRing)
 
#define pGetExp(p, i)   p_GetExp(p, i, currRing)
 Exponent. More...
 
#define pSetExp(p, i, v)   p_SetExp(p, i, v, currRing)
 
#define pIncrExp(p, i)   p_IncrExp(p,i, currRing)
 
#define pDecrExp(p, i)   p_DecrExp(p,i, currRing)
 
#define pAddExp(p, i, v)   p_AddExp(p,i,v, currRing)
 
#define pSubExp(p, i, v)   p_SubExp(p,i,v, currRing)
 
#define pMultExp(p, i, v)   p_MultExp(p,i,v, currRing)
 
#define pGetExpSum(p1, p2, i)   p_GetExpSum(p1, p2, i, currRing)
 
#define pGetExpDiff(p1, p2, i)   p_GetExpDiff(p1, p2, i, currRing)
 
#define pNew()   p_New(currRing)
 allocates the space for a new monomial – no initialization !!! More...
 
#define pInit()   p_Init(currRing)
 allocates a new monomial and initializes everything to 0 More...
 
#define pLmInit(p)   p_LmInit(p, currRing)
 like pInit, except that expvector is initialized to that of p, p must be != NULL More...
 
#define pHead(p)   p_Head(p, currRing)
 returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL More...
 
#define pLmFreeAndNext(p)   p_LmFreeAndNext(p, currRing)
 assumes p != NULL, deletes p, returns pNext(p) More...
 
#define pLmDelete(p)   p_LmDelete(p, currRing)
 assume p != NULL, deletes Lm(p)->coef and Lm(p) More...
 
#define pLmDeleteAndNext(p)   p_LmDeleteAndNext(p, currRing)
 like pLmDelete, returns pNext(p) More...
 
#define pExpVectorCopy(d_p, s_p)   p_ExpVectorCopy(d_p, s_p, currRing)
 
#define pExpVectorAdd(p1, p2)   p_ExpVectorAdd(p1, p2, currRing)
 
#define pExpVectorSub(p1, p2)   p_ExpVectorSub(p1, p2, currRing)
 
#define pExpVectorAddSub(p1, p2, p3)   p_ExpVectorAddSub(p1, p2, p3, currRing)
 
#define pExpVectorSum(pr, p1, p2)   p_ExpVectorSum(pr, p1, p2, currRing)
 
#define pExpVectorDiff(pr, p1, p2)   p_ExpVectorDiff(pr, p1, p2, currRing)
 
#define pGetExpV(p, e)   p_GetExpV(p, e, currRing)
 Gets a copy of (resp. set) the exponent vector, where e is assumed to point to (r->N +1)*sizeof(long) memory. Exponents are filled in as follows: comp, e_1, .., e_n. More...
 
#define pSetExpV(p, e)   p_SetExpV(p, e, currRing)
 
#define pLmCmp(p, q)   p_LmCmp(p,q,currRing)
 returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering More...
 
#define pLmCmpAction(p, q, actionE, actionG, actionS)   _p_LmCmpAction(p,q,currRing, actionE, actionG,actionS)
 executes axtionE|actionG|actionS if p=q|p>q|p<q w.r.t monomial ordering action should be a "goto ..." More...
 
#define pLmEqual(p1, p2)   p_ExpVectorEqual(p1, p2, currRing)
 
#define pCmp(p1, p2)   p_Cmp(p1, p2, currRing)
 pCmp: args may be NULL returns: (p2==NULL ? 1 : (p1 == NULL ? -1 : p_LmCmp(p1, p2))) More...
 
#define pDivisibleBy(a, b)   p_DivisibleBy(a,b,currRing)
 returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > 0, s.t. b = a + c; More...
 
#define pLmDivisibleBy(a, b)   p_LmDivisibleBy(a,b,currRing)
 like pDivisibleBy, except that it is assumed that a!=NULL, b!=NULL More...
 
#define pLmDivisibleByNoComp(a, b)   p_LmDivisibleByNoComp(a,b,currRing)
 like pLmDivisibleBy, does not check components More...
 
#define pLmShortDivisibleBy(a, sev_a, b, not_sev_b)   p_LmShortDivisibleBy(a, sev_a, b, not_sev_b, currRing)
 Divisibility tests based on Short Exponent vectors sev_a == pGetShortExpVector(a) not_sev_b == ~ pGetShortExpVector(b) More...
 
#define pLmRingShortDivisibleBy(a, sev_a, b, not_sev_b)   p_LmRingShortDivisibleBy(a, sev_a, b, not_sev_b, currRing)
 
#define pGetShortExpVector(a)   p_GetShortExpVector(a, currRing)
 returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl.cc ) More...
 
#define pDivisibleByRingCase(f, g)   p_DivisibleByRingCase(f,g,currRing)
 divisibility check over ground ring (which may contain zero divisors); TRUE iff LT(f) divides LT(g), i.e., LT(f)*c*m = LT(g), for some coefficient c and some monomial m; does not take components into account */ More...
 
#define pCopy(p)   p_Copy(p, currRing)
 return a copy of the poly More...
 
#define pDelete(p_ptr)   p_Delete(p_ptr, currRing)
 
#define pNeg(p)   p_Neg(p, currRing)
 
#define ppMult_nn(p, n)   pp_Mult_nn(p, n, currRing)
 
#define pMult_nn(p, n)   p_Mult_nn(p, n, currRing)
 
#define ppMult_mm(p, m)   pp_Mult_mm(p, m, currRing)
 
#define pMult_mm(p, m)   p_Mult_mm(p, m, currRing)
 
#define pAdd(p, q)   p_Add_q(p, q, currRing)
 
#define pPower(p, q)   p_Power(p, q, currRing)
 
#define pMinus_mm_Mult_qq(p, m, q)   p_Minus_mm_Mult_qq(p, m, q, currRing)
 
#define pPlus_mm_Mult_qq(p, m, q)   p_Plus_mm_Mult_qq(p, m, q, currRing)
 
#define pMult(p, q)   p_Mult_q(p, q, currRing)
 
#define ppMult_qq(p, q)   pp_Mult_qq(p, q, currRing)
 
#define ppMult_Coeff_mm_DivSelect(p, m)   pp_Mult_Coeff_mm_DivSelect(p, m, currRing)
 
#define pSortMerger(p)   p_SortMerge(p, currRing)
 sorts p, assumes all monomials in p are different More...
 
#define pSort(p)   p_SortMerge(p, currRing)
 
#define pSortAdd(p)   p_SortAdd(p, currRing)
 sorts p, p may have equal monomials More...
 
#define pSortCompCorrect(p)   pSort(p)
 Assume: If considerd only as poly in any component of p (say, monomials of other components of p are set to 0), then p is already sorted correctly. More...
 
#define pIsConstantComp(p)   p_IsConstantComp(p, currRing)
 return true if all p is eihter NULL, or if all exponents of p are 0 and Comp of p is zero More...
 
#define pIsConstant(p)   p_IsConstant(p,currRing)
 like above, except that Comp might be != 0 More...
 
#define pIsUnit(p)   p_IsUnit(p,currRing)
 return true if the Lm is a constant <>0 More...
 
#define pLmIsConstantComp(p)   p_LmIsConstantComp(p, currRing)
 like above, except that p must be != NULL More...
 
#define pLmIsConstant(p)   p_LmIsConstant(p,currRing)
 
#define pIsConstantPoly(p)   p_IsConstantPoly(p, currRing)
 return TRUE if all monomials of p are constant More...
 
#define pIsPurePower(p)   p_IsPurePower(p, currRing)
 
#define pIsUnivariate(p)   p_IsUnivariate(p, currRing)
 
#define pIsVector(p)   (pGetComp(p)>0)
 
#define pGetVariables(p, e)   p_GetVariables(p, e, currRing)
 
#define pHasNotCF(p1, p2)   p_HasNotCF(p1,p2,currRing)
 
#define pSplit(p, r)   p_Split(p,r)
 
#define pSetm(p)   p_Setm(p, currRing)
 
#define pSetmComp(p)   p_Setm(p, currRing)
 TODO: More...
 
#define pWTotaldegree(p)   p_WTotaldegree(p,currRing)
 
#define pWDegree(p)   p_WDegree(p,currRing)
 
#define pSub(a, b)   p_Sub(a,b,currRing)
 
#define pmInit(a, b)   p_mInit(a,b,currRing)
 
#define pDivide(a, b)   p_Divide(a,b,currRing)
 
#define pDivideM(a, b)   p_DivideM(a,b,currRing)
 
#define pLcm(a, b, m)   p_Lcm(a,b,m,currRing)
 
#define pDiff(a, b)   p_Diff(a,b,currRing)
 
#define pDiffOp(a, b, m)   p_DiffOp(a,b,m,currRing)
 
#define pMaxComp(p)   p_MaxComp(p, currRing)
 
#define pMinComp(p)   p_MinComp(p, currRing)
 
#define pOneComp(p)   p_OneComp(p, currRing)
 
#define pSetCompP(a, i)   p_SetCompP(a, i, currRing)
 
#define pISet(i)   p_ISet(i,currRing)
 
#define pNSet(n)   p_NSet(n,currRing)
 
#define pOne()   p_One(currRing)
 
#define pNormalize(p)   p_Normalize(p,currRing)
 
#define pSize(p)   p_Size(p,currRing)
 
#define pHomogen(p, varnum)   p_Homogen(p,varnum,currRing)
 homogenizes p by multiplying certain powers of the varnum-th variable More...
 
#define pIsHomogen(p)   p_IsHomogen(p,currRing)
 
#define pVectorHasUnitB(p, k)   p_VectorHasUnitB(p,k,currRing)
 
#define pVectorHasUnit(p, k, l)   p_VectorHasUnit(p,k,l,currRing)
 
#define pTakeOutComp1(p, k)   p_TakeOutComp1(p,k,currRing)
 
#define pDeleteComp(p, k)   p_DeleteComp(p,k,currRing)
 
#define pSubst(p, n, e)   p_Subst(p,n,e,currRing)
 
#define ppJet(p, m)   pp_Jet(p,m,currRing)
 
#define pJet(p, m)   p_Jet(p,m,currRing)
 
#define ppJetW(p, m, iv)   pp_JetW(p,m,iv,currRing)
 
#define pJetW(p, m, iv)   p_JetW(p,m,iv,currRing)
 
#define pMinDeg(p, w)   p_MinDeg(p,w,currRing)
 
#define pSeries(n, p, u, w)   p_Series(n,p,u,w,currRing)
 
#define pInvers(n, p, w)   p_Invers(n,p,w,currRing)
 
#define pDegW(p, w)   p_DegW(p,w,currRing)
 Deprecated: only for compatibility with older code! More...
 
#define pVar(m)   p_Var(m,currRing)
 
#define pEqualPolys(p1, p2)   p_EqualPolys(p1,p2,currRing)
 
#define pTest(p)   _p_Test(p, currRing, PDEBUG)
 
#define pLmTest(p)   _p_LmTest(p, currRing, PDEBUG)
 

Typedefs

typedef polypolyset
 

Functions

void rChangeCurrRing (ring r)
 
static void pLmFree (poly p)
 frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced More...
 
static void pLmFree (poly *p)
 like pLmFree, but advances p More...
 
int pWeight (int i, const ring R=currRing)
 
static long pTotaldegree (poly p)
 
char * pString (poly p)
 
void pString0 (poly p)
 
void pWrite (poly p)
 
void pWrite0 (poly p)
 
void wrp (poly p)
 
BOOLEAN pIsHomogeneous (poly p)
 
void pTakeOutComp (poly *p, long comp, poly *q, int *lq, const ring R=currRing)
 Splits *p into two polys: *q which consists of all monoms with component == comp and *p of all other monoms *lq == pLength(*q) On return all components pf *q == 0. More...
 
poly pTakeOutComp (poly *p, int k, const ring R=currRing)
 This is something weird – Don't use it, unless you know what you are doing. More...
 
void pSetPolyComp (poly p, int comp)
 
void pNorm (poly p, const ring R=currRing)
 
BOOLEAN pCompareChain (poly p, poly p1, poly p2, poly lcm, const ring R=currRing)
 Returns TRUE if. More...
 
BOOLEAN pCompareChainPart (poly p, poly p1, poly p2, poly lcm, const ring R=currRing)
 
static poly pLast (poly a, int &length)
 returns the length of a polynomial (numbers of monomials) respect syzComp More...
 
static poly pLast (poly a)
 

Variables

ring currRing
 Widely used global variable which specifies the current polynomial ring for Singular interpreter and legacy implementatins. : one should avoid using it in newer designs, for example due to possible problems in parallelization with threads. More...
 

Detailed Description

Compatiblity layer for legacy polynomial operations (over currRing)

Macro defines for legacy polynomial operations used in Several involved mathematical algorithms (kernel) and Singular Interpreter and related functionality. They take no ring argument since they work with currRing by default. Notice that they have different prefix: p instead of p_.

See also related global ring variable and the correct ring changeing routine:

Definition in file polys.h.

Macro Definition Documentation

#define pAdd (   p,
 
)    p_Add_q(p, q, currRing)

Definition at line 174 of file polys.h.

#define pAddExp (   p,
  i,
  v 
)    p_AddExp(p,i,v, currRing)

Definition at line 45 of file polys.h.

#define pCmp (   p1,
  p2 
)    p_Cmp(p1, p2, currRing)

pCmp: args may be NULL returns: (p2==NULL ? 1 : (p1 == NULL ? -1 : p_LmCmp(p1, p2)))

Definition at line 115 of file polys.h.

#define pCopy (   p)    p_Copy(p, currRing)

return a copy of the poly

Definition at line 156 of file polys.h.

#define pDecrExp (   p,
  i 
)    p_DecrExp(p,i, currRing)

Definition at line 44 of file polys.h.

#define pDegW (   p,
  w 
)    p_DegW(p,w,currRing)

Deprecated: only for compatibility with older code!

Definition at line 349 of file polys.h.

#define pDelete (   p_ptr)    p_Delete(p_ptr, currRing)

Definition at line 157 of file polys.h.

#define pDeleteComp (   p,
  k 
)    p_DeleteComp(p,k,currRing)

Definition at line 332 of file polys.h.

#define pDiff (   a,
  b 
)    p_Diff(a,b,currRing)

Definition at line 267 of file polys.h.

#define pDiffOp (   a,
  b,
  m 
)    p_DiffOp(a,b,m,currRing)

Definition at line 268 of file polys.h.

#define pDivide (   a,
  b 
)    p_Divide(a,b,currRing)

Definition at line 264 of file polys.h.

#define pDivideM (   a,
  b 
)    p_DivideM(a,b,currRing)

Definition at line 265 of file polys.h.

#define pDivisibleBy (   a,
  b 
)    p_DivisibleBy(a,b,currRing)

returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > 0, s.t. b = a + c;

Definition at line 126 of file polys.h.

#define pDivisibleByRingCase (   f,
  g 
)    p_DivisibleByRingCase(f,g,currRing)

divisibility check over ground ring (which may contain zero divisors); TRUE iff LT(f) divides LT(g), i.e., LT(f)*c*m = LT(g), for some coefficient c and some monomial m; does not take components into account */

Definition at line 147 of file polys.h.

#define pEqualPolys (   p1,
  p2 
)    p_EqualPolys(p1,p2,currRing)

Definition at line 372 of file polys.h.

#define pExpVectorAdd (   p1,
  p2 
)    p_ExpVectorAdd(p1, p2, currRing)

Definition at line 87 of file polys.h.

#define pExpVectorAddSub (   p1,
  p2,
  p3 
)    p_ExpVectorAddSub(p1, p2, p3, currRing)

Definition at line 89 of file polys.h.

#define pExpVectorCopy (   d_p,
  s_p 
)    p_ExpVectorCopy(d_p, s_p, currRing)

Definition at line 86 of file polys.h.

#define pExpVectorDiff (   pr,
  p1,
  p2 
)    p_ExpVectorDiff(pr, p1, p2, currRing)

Definition at line 91 of file polys.h.

#define pExpVectorSub (   p1,
  p2 
)    p_ExpVectorSub(p1, p2, currRing)

Definition at line 88 of file polys.h.

#define pExpVectorSum (   pr,
  p1,
  p2 
)    p_ExpVectorSum(pr, p1, p2, currRing)

Definition at line 90 of file polys.h.

#define pGetComp (   p)    (int)__p_GetComp(p, currRing)

Component.

Definition at line 37 of file polys.h.

#define pGetExp (   p,
  i 
)    p_GetExp(p, i, currRing)

Exponent.

Definition at line 41 of file polys.h.

#define pGetExpDiff (   p1,
  p2,
  i 
)    p_GetExpDiff(p1, p2, i, currRing)

Definition at line 49 of file polys.h.

#define pGetExpSum (   p1,
  p2,
  i 
)    p_GetExpSum(p1, p2, i, currRing)

Definition at line 48 of file polys.h.

#define pGetExpV (   p,
 
)    p_GetExpV(p, e, currRing)

Gets a copy of (resp. set) the exponent vector, where e is assumed to point to (r->N +1)*sizeof(long) memory. Exponents are filled in as follows: comp, e_1, .., e_n.

Definition at line 96 of file polys.h.

#define pGetOrder (   p)    p_GetOrder(p, currRing)

Order.

Definition at line 34 of file polys.h.

#define pGetShortExpVector (   a)    p_GetShortExpVector(a, currRing)

returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl.cc )

Definition at line 140 of file polys.h.

#define pGetVariables (   p,
 
)    p_GetVariables(p, e, currRing)

Definition at line 222 of file polys.h.

#define pHasNotCF (   p1,
  p2 
)    p_HasNotCF(p1,p2,currRing)

Definition at line 233 of file polys.h.

#define pHead (   p)    p_Head(p, currRing)

returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL

Definition at line 67 of file polys.h.

#define pHomogen (   p,
  varnum 
)    p_Homogen(p,varnum,currRing)

homogenizes p by multiplying certain powers of the varnum-th variable

Definition at line 293 of file polys.h.

#define pIncrExp (   p,
  i 
)    p_IncrExp(p,i, currRing)

Definition at line 43 of file polys.h.

#define pInit ( )    p_Init(currRing)

allocates a new monomial and initializes everything to 0

Definition at line 61 of file polys.h.

#define pInvers (   n,
  p,
  w 
)    p_Invers(n,p,w,currRing)

Definition at line 344 of file polys.h.

#define pIsConstant (   p)    p_IsConstant(p,currRing)

like above, except that Comp might be != 0

Definition at line 209 of file polys.h.

#define pIsConstantComp (   p)    p_IsConstantComp(p, currRing)

return true if all p is eihter NULL, or if all exponents of p are 0 and Comp of p is zero

Definition at line 207 of file polys.h.

#define pIsConstantPoly (   p)    p_IsConstantPoly(p, currRing)

return TRUE if all monomials of p are constant

Definition at line 217 of file polys.h.

#define pISet (   i)    p_ISet(i,currRing)

Definition at line 283 of file polys.h.

#define pIsHomogen (   p)    p_IsHomogen(p,currRing)

Definition at line 300 of file polys.h.

#define pIsPurePower (   p)    p_IsPurePower(p, currRing)

Definition at line 219 of file polys.h.

#define pIsUnit (   p)    p_IsUnit(p,currRing)

return true if the Lm is a constant <>0

Definition at line 211 of file polys.h.

#define pIsUnivariate (   p)    p_IsUnivariate(p, currRing)

Definition at line 220 of file polys.h.

#define pIsVector (   p)    (pGetComp(p)>0)

Definition at line 221 of file polys.h.

#define pJet (   p,
  m 
)    p_Jet(p,m,currRing)

Definition at line 339 of file polys.h.

#define pJetW (   p,
  m,
  iv 
)    p_JetW(p,m,iv,currRing)

Definition at line 341 of file polys.h.

#define pLcm (   a,
  b,
  m 
)    p_Lcm(a,b,m,currRing)

Definition at line 266 of file polys.h.

#define pLmCmp (   p,
 
)    p_LmCmp(p,q,currRing)

returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering

Definition at line 105 of file polys.h.

#define pLmCmpAction (   p,
  q,
  actionE,
  actionG,
  actionS 
)    _p_LmCmpAction(p,q,currRing, actionE, actionG,actionS)

executes axtionE|actionG|actionS if p=q|p>q|p<q w.r.t monomial ordering action should be a "goto ..."

Definition at line 108 of file polys.h.

#define pLmDelete (   p)    p_LmDelete(p, currRing)

assume p != NULL, deletes Lm(p)->coef and Lm(p)

Definition at line 76 of file polys.h.

#define pLmDeleteAndNext (   p)    p_LmDeleteAndNext(p, currRing)

like pLmDelete, returns pNext(p)

Definition at line 78 of file polys.h.

#define pLmDivisibleBy (   a,
  b 
)    p_LmDivisibleBy(a,b,currRing)

like pDivisibleBy, except that it is assumed that a!=NULL, b!=NULL

Definition at line 128 of file polys.h.

#define pLmDivisibleByNoComp (   a,
  b 
)    p_LmDivisibleByNoComp(a,b,currRing)

like pLmDivisibleBy, does not check components

Definition at line 130 of file polys.h.

#define pLmEqual (   p1,
  p2 
)    p_ExpVectorEqual(p1, p2, currRing)

Definition at line 111 of file polys.h.

#define pLmFreeAndNext (   p)    p_LmFreeAndNext(p, currRing)

assumes p != NULL, deletes p, returns pNext(p)

Definition at line 74 of file polys.h.

#define pLmInit (   p)    p_LmInit(p, currRing)

like pInit, except that expvector is initialized to that of p, p must be != NULL

Definition at line 64 of file polys.h.

#define pLmIsConstant (   p)    p_LmIsConstant(p,currRing)

Definition at line 214 of file polys.h.

#define pLmIsConstantComp (   p)    p_LmIsConstantComp(p, currRing)

like above, except that p must be != NULL

Definition at line 213 of file polys.h.

#define pLmRingShortDivisibleBy (   a,
  sev_a,
  b,
  not_sev_b 
)    p_LmRingShortDivisibleBy(a, sev_a, b, not_sev_b, currRing)

Definition at line 136 of file polys.h.

#define pLmShortDivisibleBy (   a,
  sev_a,
  b,
  not_sev_b 
)    p_LmShortDivisibleBy(a, sev_a, b, not_sev_b, currRing)

Divisibility tests based on Short Exponent vectors sev_a == pGetShortExpVector(a) not_sev_b == ~ pGetShortExpVector(b)

Definition at line 134 of file polys.h.

#define pLmTest (   p)    _p_LmTest(p, currRing, PDEBUG)

Definition at line 388 of file polys.h.

#define pMaxComp (   p)    p_MaxComp(p, currRing)

Definition at line 270 of file polys.h.

#define pMinComp (   p)    p_MinComp(p, currRing)

Definition at line 271 of file polys.h.

#define pMinDeg (   p,
  w 
)    p_MinDeg(p,w,currRing)

Definition at line 342 of file polys.h.

#define pmInit (   a,
  b 
)    p_mInit(a,b,currRing)

Definition at line 260 of file polys.h.

#define pMinus_mm_Mult_qq (   p,
  m,
 
)    p_Minus_mm_Mult_qq(p, m, q, currRing)

Definition at line 176 of file polys.h.

#define pMult (   p,
 
)    p_Mult_q(p, q, currRing)

Definition at line 178 of file polys.h.

#define pMult_mm (   p,
  m 
)    p_Mult_mm(p, m, currRing)

Definition at line 173 of file polys.h.

#define pMult_nn (   p,
  n 
)    p_Mult_nn(p, n, currRing)

Definition at line 171 of file polys.h.

#define pMultExp (   p,
  i,
  v 
)    p_MultExp(p,i,v, currRing)

Definition at line 47 of file polys.h.

#define pNeg (   p)    p_Neg(p, currRing)

Definition at line 169 of file polys.h.

#define pNew ( )    p_New(currRing)

allocates the space for a new monomial – no initialization !!!

Definition at line 59 of file polys.h.

#define pNormalize (   p)    p_Normalize(p,currRing)

Definition at line 288 of file polys.h.

#define pNSet (   n)    p_NSet(n,currRing)

Definition at line 284 of file polys.h.

#define pOne ( )    p_One(currRing)

Definition at line 286 of file polys.h.

#define pOneComp (   p)    p_OneComp(p, currRing)

Definition at line 273 of file polys.h.

#define ppJet (   p,
  m 
)    pp_Jet(p,m,currRing)

Definition at line 338 of file polys.h.

#define ppJetW (   p,
  m,
  iv 
)    pp_JetW(p,m,iv,currRing)

Definition at line 340 of file polys.h.

#define pPlus_mm_Mult_qq (   p,
  m,
 
)    p_Plus_mm_Mult_qq(p, m, q, currRing)

Definition at line 177 of file polys.h.

#define ppMult_Coeff_mm_DivSelect (   p,
  m 
)    pp_Mult_Coeff_mm_DivSelect(p, m, currRing)

Definition at line 181 of file polys.h.

#define ppMult_mm (   p,
  m 
)    pp_Mult_mm(p, m, currRing)

Definition at line 172 of file polys.h.

#define ppMult_nn (   p,
  n 
)    pp_Mult_nn(p, n, currRing)

Definition at line 170 of file polys.h.

#define ppMult_qq (   p,
 
)    pp_Mult_qq(p, q, currRing)

Definition at line 179 of file polys.h.

#define pPower (   p,
 
)    p_Power(p, q, currRing)

Definition at line 175 of file polys.h.

#define pSeries (   n,
  p,
  u,
  w 
)    p_Series(n,p,u,w,currRing)

Definition at line 343 of file polys.h.

#define pSetCoeff (   p,
  n 
)    p_SetCoeff(p,n,currRing)

deletes old coeff before setting the new one

Definition at line 31 of file polys.h.

#define pSetComp (   p,
  v 
)    p_SetComp(p,v, currRing)

Definition at line 38 of file polys.h.

#define pSetCompP (   a,
  i 
)    p_SetCompP(a, i, currRing)

Definition at line 274 of file polys.h.

#define pSetExp (   p,
  i,
  v 
)    p_SetExp(p, i, v, currRing)

Definition at line 42 of file polys.h.

#define pSetExpV (   p,
 
)    p_SetExpV(p, e, currRing)

Definition at line 97 of file polys.h.

#define pSetm (   p)    p_Setm(p, currRing)

Definition at line 241 of file polys.h.

#define pSetmComp (   p)    p_Setm(p, currRing)

TODO:

Definition at line 243 of file polys.h.

#define pSize (   p)    p_Size(p,currRing)

Definition at line 289 of file polys.h.

#define pSort (   p)    p_SortMerge(p, currRing)

Definition at line 189 of file polys.h.

#define pSortAdd (   p)    p_SortAdd(p, currRing)

sorts p, p may have equal monomials

Definition at line 192 of file polys.h.

#define pSortCompCorrect (   p)    pSort(p)

Assume: If considerd only as poly in any component of p (say, monomials of other components of p are set to 0), then p is already sorted correctly.

Definition at line 198 of file polys.h.

#define pSortMerger (   p)    p_SortMerge(p, currRing)

sorts p, assumes all monomials in p are different

Definition at line 188 of file polys.h.

#define pSplit (   p,
  r 
)    p_Split(p,r)

Definition at line 235 of file polys.h.

#define pSub (   a,
  b 
)    p_Sub(a,b,currRing)

Definition at line 258 of file polys.h.

#define pSubExp (   p,
  i,
  v 
)    p_SubExp(p,i,v, currRing)

Definition at line 46 of file polys.h.

#define pSubst (   p,
  n,
 
)    p_Subst(p,n,e,currRing)

Definition at line 337 of file polys.h.

#define pTakeOutComp1 (   p,
  k 
)    p_TakeOutComp1(p,k,currRing)

Definition at line 305 of file polys.h.

#define pTest (   p)    _p_Test(p, currRing, PDEBUG)

Definition at line 387 of file polys.h.

#define pVar (   m)    p_Var(m,currRing)

Definition at line 353 of file polys.h.

#define pVectorHasUnit (   p,
  k,
  l 
)    p_VectorHasUnit(p,k,l,currRing)

Definition at line 304 of file polys.h.

#define pVectorHasUnitB (   p,
  k 
)    p_VectorHasUnitB(p,k,currRing)

Definition at line 303 of file polys.h.

#define pWDegree (   p)    p_WDegree(p,currRing)

Definition at line 255 of file polys.h.

#define pWTotaldegree (   p)    p_WTotaldegree(p,currRing)

Definition at line 254 of file polys.h.

Typedef Documentation

typedef poly* polyset

Definition at line 230 of file polys.h.

Function Documentation

BOOLEAN pCompareChain ( poly  p,
poly  p1,
poly  p2,
poly  lcm,
const ring  R = currRing 
)

Returns TRUE if.

  • LM(p) | LM(lcm)
  • LC(p) | LC(lcm) only if ring
  • Exists i, j:
    • LE(p, i) != LE(lcm, i)
    • LE(p1, i) != LE(lcm, i) ==> LCM(p1, p) != lcm
    • LE(p, j) != LE(lcm, j)
    • LE(p2, j) != LE(lcm, j) ==> LCM(p2, p) != lcm

Definition at line 21 of file kpolys.cc.

22 {
23  int k, j;
24 
25  if (lcm==NULL) return FALSE;
26 
27  for (j=(R->N); j; j--)
28  if ( p_GetExp(p,j, R) > p_GetExp(lcm,j, R)) return FALSE;
29  if ( pGetComp(p) != pGetComp(lcm)) return FALSE;
30  for (j=(R->N); j; j--)
31  {
32  if (p_GetExp(p1,j, R)!=p_GetExp(lcm,j, R))
33  {
34  if (p_GetExp(p,j, R)!=p_GetExp(lcm,j, R))
35  {
36  for (k=(R->N); k>j; k--)
37  {
38  if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
39  && (p_GetExp(p2,k, R)!=p_GetExp(lcm,k, R)))
40  return TRUE;
41  }
42  for (k=j-1; k; k--)
43  {
44  if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
45  && (p_GetExp(p2,k, R)!=p_GetExp(lcm,k, R)))
46  return TRUE;
47  }
48  return FALSE;
49  }
50  }
51  else if (p_GetExp(p2,j, R)!=p_GetExp(lcm,j, R))
52  {
53  if (p_GetExp(p,j, R)!=p_GetExp(lcm,j, R))
54  {
55  for (k=(R->N); k>j; k--)
56  {
57  if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
58  && (p_GetExp(p1,k, R)!=p_GetExp(lcm,k, R)))
59  return TRUE;
60  }
61  for (k=j-1; k!=0 ; k--)
62  {
63  if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
64  && (p_GetExp(p1,k, R)!=p_GetExp(lcm,k, R)))
65  return TRUE;
66  }
67  return FALSE;
68  }
69  }
70  }
71  return FALSE;
72 }
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:711
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:144
int k
Definition: cfEzgcd.cc:93
#define pGetComp(p)
Component.
Definition: polys.h:37
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
Definition: p_polys.h:465
int j
Definition: myNF.cc:70
#define NULL
Definition: omList.c:10
#define R
Definition: sirandom.c:26
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
BOOLEAN pCompareChainPart ( poly  p,
poly  p1,
poly  p2,
poly  lcm,
const ring  R = currRing 
)

Definition at line 75 of file kpolys.cc.

76 {
77  int k, j;
78 
79  if (lcm==NULL) return FALSE;
80 
81  for (j=R->real_var_end; j>=R->real_var_start; j--)
82  if ( p_GetExp(p,j, R) > p_GetExp(lcm,j, R)) return FALSE;
83  if ( pGetComp(p) != pGetComp(lcm)) return FALSE;
84  for (j=R->real_var_end; j>=R->real_var_start; j--)
85  {
86  if (p_GetExp(p1,j, R)!=p_GetExp(lcm,j, R))
87  {
88  if (p_GetExp(p,j, R)!=p_GetExp(lcm,j, R))
89  {
90  for (k=(R->N); k>j; k--)
91  for (k=R->real_var_end; k>j; k--)
92  {
93  if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
94  && (p_GetExp(p2,k, R)!=p_GetExp(lcm,k, R)))
95  return TRUE;
96  }
97  for (k=j-1; k>=R->real_var_start; k--)
98  {
99  if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
100  && (p_GetExp(p2,k, R)!=p_GetExp(lcm,k, R)))
101  return TRUE;
102  }
103  return FALSE;
104  }
105  }
106  else if (p_GetExp(p2,j, R)!=p_GetExp(lcm,j, R))
107  {
108  if (p_GetExp(p,j, R)!=p_GetExp(lcm,j, R))
109  {
110  for (k=R->real_var_end; k>j; k--)
111  {
112  if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
113  && (p_GetExp(p1,k, R)!=p_GetExp(lcm,k, R)))
114  return TRUE;
115  }
116  for (k=j-1; k>=R->real_var_start; k--)
117  {
118  if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
119  && (p_GetExp(p1,k, R)!=p_GetExp(lcm,k, R)))
120  return TRUE;
121  }
122  return FALSE;
123  }
124  }
125  }
126  return FALSE;
127 }
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:711
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:144
int k
Definition: cfEzgcd.cc:93
#define pGetComp(p)
Component.
Definition: polys.h:37
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
Definition: p_polys.h:465
int j
Definition: myNF.cc:70
#define NULL
Definition: omList.c:10
#define R
Definition: sirandom.c:26
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
BOOLEAN pIsHomogeneous ( poly  p)
static poly pLast ( poly  a,
int &  length 
)
inlinestatic

returns the length of a polynomial (numbers of monomials) respect syzComp

Definition at line 378 of file polys.h.

378 { return p_Last (a, length, currRing); }
const poly a
Definition: syzextra.cc:212
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
poly p_Last(const poly p, int &l, const ring r)
Definition: p_polys.cc:4400
static poly pLast ( poly  a)
inlinestatic

Definition at line 379 of file polys.h.

379 { int l; return pLast(a, l); }
static poly pLast(poly a, int &length)
returns the length of a polynomial (numbers of monomials) respect syzComp
Definition: polys.h:378
const poly a
Definition: syzextra.cc:212
int l
Definition: cfEzgcd.cc:94
static void pLmFree ( poly  p)
inlinestatic

frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced

Definition at line 70 of file polys.h.

70 {p_LmFree(p, currRing);}
return P p
Definition: myNF.cc:203
static void p_LmFree(poly p, ring)
Definition: p_polys.h:679
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
static void pLmFree ( poly p)
inlinestatic

like pLmFree, but advances p

Definition at line 72 of file polys.h.

72 {p_LmFree(p, currRing);}
return P p
Definition: myNF.cc:203
static void p_LmFree(poly p, ring)
Definition: p_polys.h:679
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
void pNorm ( poly  p,
const ring  R = currRing 
)
inline

Definition at line 334 of file polys.h.

334 { p_Norm(p, R); }
return P p
Definition: myNF.cc:203
void p_Norm(poly p1, const ring r)
Definition: p_polys.cc:3565
#define R
Definition: sirandom.c:26
void pSetPolyComp ( poly  p,
int  comp 
)
char* pString ( poly  p)
inline

Definition at line 277 of file polys.h.

277 {return p_String(p, currRing, currRing);}
char * p_String(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:186
return P p
Definition: myNF.cc:203
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
void pString0 ( poly  p)
inline

Definition at line 278 of file polys.h.

return P p
Definition: myNF.cc:203
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
void p_String0(poly p, ring lmRing, ring tailRing)
print p according to ShortOut in lmRing & tailRing
Definition: polys0.cc:136
void pTakeOutComp ( poly p,
long  comp,
poly q,
int *  lq,
const ring  R = currRing 
)
inline

Splits *p into two polys: *q which consists of all monoms with component == comp and *p of all other monoms *lq == pLength(*q) On return all components pf *q == 0.

Definition at line 310 of file polys.h.

311 {
312  return p_TakeOutComp(p, comp, q, lq, R);
313 }
return P p
Definition: myNF.cc:203
void p_TakeOutComp(poly *p, long comp, poly *q, int *lq, const ring r)
Definition: p_polys.cc:3378
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
#define R
Definition: sirandom.c:26
poly pTakeOutComp ( poly p,
int  k,
const ring  R = currRing 
)
inline

This is something weird – Don't use it, unless you know what you are doing.

Definition at line 317 of file polys.h.

318 {
319  return p_TakeOutComp(p, k, R);
320 }
return P p
Definition: myNF.cc:203
void p_TakeOutComp(poly *p, long comp, poly *q, int *lq, const ring r)
Definition: p_polys.cc:3378
int k
Definition: cfEzgcd.cc:93
#define R
Definition: sirandom.c:26
static long pTotaldegree ( poly  p)
inlinestatic

Definition at line 253 of file polys.h.

253 { return p_Totaldegree(p,currRing); }
return P p
Definition: myNF.cc:203
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1435
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
int pWeight ( int  i,
const ring  R = currRing 
)
inline

Definition at line 250 of file polys.h.

250 { return p_Weight(i, R); }
int p_Weight(int i, const ring r)
Definition: p_polys.cc:704
int i
Definition: cfEzgcd.cc:123
#define R
Definition: sirandom.c:26
void pWrite ( poly  p)
inline

Definition at line 279 of file polys.h.

return P p
Definition: myNF.cc:203
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
void p_Write(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:206
void pWrite0 ( poly  p)
inline

Definition at line 280 of file polys.h.

return P p
Definition: myNF.cc:203
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
void p_Write0(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:196
void rChangeCurrRing ( ring  r)

Definition at line 14 of file polys.cc.

15 {
16  #if 0
17  if ((currRing!=NULL)&&(currRing!=r))
18  {
20  }
21  #endif
22  if( r != NULL )
23  {
24  rTest(r);
25 
26  //------------ set global ring vars --------------------------------
27  currRing = r;
28  //------------ global variables related to coefficients ------------
29  assume( r->cf!= NULL );
30  nSetChar(r->cf);
31  //------------ global variables related to polys
32  p_SetGlobals(r);
33  //------------ global variables related to factory -----------------
34  }
35  else
36  {
37  currRing = NULL;
38  }
39 }
unsigned si_opt_1
Definition: options.c:5
static FORCE_INLINE void nSetChar(const coeffs r)
initialisations after each ring change
Definition: coeffs.h:437
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
#define rTest(r)
Definition: ring.h:781
#define NULL
Definition: omList.c:10
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
#define TEST_RINGDEP_OPTS
Definition: options.h:95
void p_SetGlobals(const ring r, BOOLEAN complete)
set all properties of a new ring - also called by rComplete
Definition: ring.cc:3401
void wrp ( poly  p)
inline

Definition at line 281 of file polys.h.

281 {p_wrp(p, currRing, currRing);}
return P p
Definition: myNF.cc:203
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
void p_wrp(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:237

Variable Documentation

ring currRing

Widely used global variable which specifies the current polynomial ring for Singular interpreter and legacy implementatins. : one should avoid using it in newer designs, for example due to possible problems in parallelization with threads.

Definition at line 12 of file polys.cc.