My Project  UNKNOWN_GIT_VERSION
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,currRing->PolyBin)
 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 pLtCmp(p, q)   p_LtCmp(p,q,currRing)
 
#define pLtCmpNoAbs(p, q)   p_LtCmpNoAbs(p,q,currRing)
 
#define pLtCmpOrdSgnDiffM(p, q)   p_LtCmpOrdSgnDiffM(p,q,currRing)
 
#define pLtCmpOrdSgnDiffP(p, q)   p_LtCmpOrdSgnDiffP(p,q,currRing)
 
#define pLtCmpOrdSgnEqM(p, q)   p_LtCmpOrdSgnEqM(p,q,currRing)
 
#define pLtCmpOrdSgnEqP(p, q)   p_LtCmpOrdSgnEqP(p,q,currRing)
 
#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 pWeight(i)   p_Weight(i,currRing)
 
#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 pMDivide(a, b)   p_MDivide(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 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 poly * polyset
 

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...
 
poly p_Divide (poly a, poly b, const ring r)
 polynomial division, ignoring the rest via singclap_pdivide resp. idLift destroyes a,b More...
 
poly singclap_gcd (poly f, poly g, const ring r)
 polynomial gcd via singclap_gcd_r resp. idSyzygies destroys f and g More...
 
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. @Note: 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

◆ pAdd

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

Definition at line 198 of file polys.h.

◆ pAddExp

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

Definition at line 45 of file polys.h.

◆ pCmp

#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.

◆ pCopy

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

return a copy of the poly

Definition at line 180 of file polys.h.

◆ pDecrExp

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

Definition at line 44 of file polys.h.

◆ pDegW

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

Deprecated: only for compatibility with older code!

Definition at line 371 of file polys.h.

◆ pDelete

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

Definition at line 181 of file polys.h.

◆ pDeleteComp

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

Definition at line 355 of file polys.h.

◆ pDiff

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

Definition at line 290 of file polys.h.

◆ pDiffOp

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

Definition at line 291 of file polys.h.

◆ pDivideM

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

Definition at line 288 of file polys.h.

◆ pDivisibleBy

#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 138 of file polys.h.

◆ pDivisibleByRingCase

#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 159 of file polys.h.

◆ pEqualPolys

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

Definition at line 394 of file polys.h.

◆ pExpVectorAdd

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

Definition at line 87 of file polys.h.

◆ pExpVectorAddSub

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

Definition at line 89 of file polys.h.

◆ pExpVectorCopy

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

Definition at line 86 of file polys.h.

◆ pExpVectorDiff

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

Definition at line 91 of file polys.h.

◆ pExpVectorSub

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

Definition at line 88 of file polys.h.

◆ pExpVectorSum

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

Definition at line 90 of file polys.h.

◆ pGetComp

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

Component.

Definition at line 37 of file polys.h.

◆ pGetExp

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

Exponent.

Definition at line 41 of file polys.h.

◆ pGetExpDiff

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

Definition at line 49 of file polys.h.

◆ pGetExpSum

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

Definition at line 48 of file polys.h.

◆ pGetExpV

#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.

◆ pGetOrder

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

Order.

Definition at line 34 of file polys.h.

◆ pGetShortExpVector

#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 152 of file polys.h.

◆ pGetVariables

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

Definition at line 246 of file polys.h.

◆ pHasNotCF

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

Definition at line 257 of file polys.h.

◆ pHead

#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.

◆ pHomogen

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

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

Definition at line 316 of file polys.h.

◆ pIncrExp

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

Definition at line 43 of file polys.h.

◆ pInit

#define pInit ( )    p_Init(currRing,currRing->PolyBin)

allocates a new monomial and initializes everything to 0

Definition at line 61 of file polys.h.

◆ pIsConstant

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

like above, except that Comp might be != 0

Definition at line 233 of file polys.h.

◆ pIsConstantComp

#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 231 of file polys.h.

◆ pIsConstantPoly

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

return TRUE if all monomials of p are constant

Definition at line 241 of file polys.h.

◆ pISet

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

Definition at line 306 of file polys.h.

◆ pIsHomogen

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

Definition at line 323 of file polys.h.

◆ pIsPurePower

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

Definition at line 243 of file polys.h.

◆ pIsUnit

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

return true if the Lm is a constant <>0

Definition at line 235 of file polys.h.

◆ pIsUnivariate

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

Definition at line 244 of file polys.h.

◆ pIsVector

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

Definition at line 245 of file polys.h.

◆ pJet

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

Definition at line 362 of file polys.h.

◆ pJetW

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

Definition at line 364 of file polys.h.

◆ pLcm

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

Definition at line 289 of file polys.h.

◆ pLmCmp

#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.

◆ pLmCmpAction

#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.

◆ pLmDelete

#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.

◆ pLmDeleteAndNext

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

like pLmDelete, returns pNext(p)

Definition at line 78 of file polys.h.

◆ pLmDivisibleBy

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

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

Definition at line 140 of file polys.h.

◆ pLmDivisibleByNoComp

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

like pLmDivisibleBy, does not check components

Definition at line 142 of file polys.h.

◆ pLmEqual

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

Definition at line 111 of file polys.h.

◆ pLmFreeAndNext

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

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

Definition at line 74 of file polys.h.

◆ pLmInit

#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.

◆ pLmIsConstant

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

Definition at line 238 of file polys.h.

◆ pLmIsConstantComp

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

like above, except that p must be != NULL

Definition at line 237 of file polys.h.

◆ pLmRingShortDivisibleBy

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

Definition at line 148 of file polys.h.

◆ pLmShortDivisibleBy

#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 146 of file polys.h.

◆ pLmTest

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

Definition at line 410 of file polys.h.

◆ pLtCmp

#define pLtCmp (   p,
 
)    p_LtCmp(p,q,currRing)

Definition at line 123 of file polys.h.

◆ pLtCmpNoAbs

#define pLtCmpNoAbs (   p,
 
)    p_LtCmpNoAbs(p,q,currRing)

Definition at line 124 of file polys.h.

◆ pLtCmpOrdSgnDiffM

#define pLtCmpOrdSgnDiffM (   p,
 
)    p_LtCmpOrdSgnDiffM(p,q,currRing)

Definition at line 125 of file polys.h.

◆ pLtCmpOrdSgnDiffP

#define pLtCmpOrdSgnDiffP (   p,
 
)    p_LtCmpOrdSgnDiffP(p,q,currRing)

Definition at line 126 of file polys.h.

◆ pLtCmpOrdSgnEqM

#define pLtCmpOrdSgnEqM (   p,
 
)    p_LtCmpOrdSgnEqM(p,q,currRing)

Definition at line 127 of file polys.h.

◆ pLtCmpOrdSgnEqP

#define pLtCmpOrdSgnEqP (   p,
 
)    p_LtCmpOrdSgnEqP(p,q,currRing)

Definition at line 128 of file polys.h.

◆ pMaxComp

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

Definition at line 293 of file polys.h.

◆ pMDivide

#define pMDivide (   a,
  b 
)    p_MDivide(a,b,currRing)

Definition at line 287 of file polys.h.

◆ pMinComp

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

Definition at line 294 of file polys.h.

◆ pMinDeg

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

Definition at line 365 of file polys.h.

◆ pmInit

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

Definition at line 283 of file polys.h.

◆ pMinus_mm_Mult_qq

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

Definition at line 200 of file polys.h.

◆ pMult

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

Definition at line 202 of file polys.h.

◆ pMult_mm

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

Definition at line 197 of file polys.h.

◆ pMult_nn

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

Definition at line 195 of file polys.h.

◆ pMultExp

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

Definition at line 47 of file polys.h.

◆ pNeg

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

Definition at line 193 of file polys.h.

◆ pNew

#define pNew ( )    p_New(currRing)

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

Definition at line 59 of file polys.h.

◆ pNormalize

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

Definition at line 311 of file polys.h.

◆ pNSet

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

Definition at line 307 of file polys.h.

◆ pOne

#define pOne ( )    p_One(currRing)

Definition at line 309 of file polys.h.

◆ pOneComp

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

Definition at line 296 of file polys.h.

◆ ppJet

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

Definition at line 361 of file polys.h.

◆ ppJetW

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

Definition at line 363 of file polys.h.

◆ pPlus_mm_Mult_qq

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

Definition at line 201 of file polys.h.

◆ ppMult_Coeff_mm_DivSelect

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

Definition at line 205 of file polys.h.

◆ ppMult_mm

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

Definition at line 196 of file polys.h.

◆ ppMult_nn

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

Definition at line 194 of file polys.h.

◆ ppMult_qq

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

Definition at line 203 of file polys.h.

◆ pPower

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

Definition at line 199 of file polys.h.

◆ pSeries

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

Definition at line 366 of file polys.h.

◆ pSetCoeff

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

deletes old coeff before setting the new one

Definition at line 31 of file polys.h.

◆ pSetComp

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

Definition at line 38 of file polys.h.

◆ pSetCompP

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

Definition at line 297 of file polys.h.

◆ pSetExp

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

Definition at line 42 of file polys.h.

◆ pSetExpV

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

Definition at line 97 of file polys.h.

◆ pSetm

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

Definition at line 265 of file polys.h.

◆ pSetmComp

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

TODO:

Definition at line 267 of file polys.h.

◆ pSize

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

Definition at line 312 of file polys.h.

◆ pSort

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

Definition at line 213 of file polys.h.

◆ pSortAdd

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

sorts p, p may have equal monomials

Definition at line 216 of file polys.h.

◆ pSortCompCorrect

#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 222 of file polys.h.

◆ pSortMerger

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

sorts p, assumes all monomials in p are different

Definition at line 212 of file polys.h.

◆ pSplit

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

Definition at line 259 of file polys.h.

◆ pSub

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

Definition at line 281 of file polys.h.

◆ pSubExp

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

Definition at line 46 of file polys.h.

◆ pSubst

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

Definition at line 360 of file polys.h.

◆ pTakeOutComp1

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

Definition at line 328 of file polys.h.

◆ pTest

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

Definition at line 409 of file polys.h.

◆ pVar

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

Definition at line 375 of file polys.h.

◆ pVectorHasUnit

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

Definition at line 327 of file polys.h.

◆ pVectorHasUnitB

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

Definition at line 326 of file polys.h.

◆ pWDegree

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

Definition at line 278 of file polys.h.

◆ pWeight

#define pWeight (   i)    p_Weight(i,currRing)

Definition at line 274 of file polys.h.

◆ pWTotaldegree

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

Definition at line 277 of file polys.h.

Typedef Documentation

◆ polyset

typedef poly* polyset

Definition at line 254 of file polys.h.

Function Documentation

◆ p_Divide()

poly p_Divide ( poly  a,
poly  b,
const ring  r 
)

polynomial division, ignoring the rest via singclap_pdivide resp. idLift destroyes a,b

Definition at line 31 of file polys.cc.

32 {
33  assume(q!=NULL);
34  if (q==NULL)
35  {
36  WerrorS("div. by 0");
37  return NULL;
38  }
39  if (p==NULL)
40  {
41  p_Delete(&q,r);
42  return NULL;
43  }
44  if (pNext(q)!=NULL)
45  { /* This means that q != 0 consists of at least two terms*/
46  if(p_GetComp(p,r)==0)
47  {
48  if ((r->cf->convSingNFactoryN!=ndConvSingNFactoryN)
49  &&(!rField_is_Ring(r)))
50  {
51  poly res=singclap_pdivide(p, q, r);
52  p_Delete(&p,r);
53  p_Delete(&q,r);
54  return res;
55  }
56  else
57  {
58  ideal vi=idInit(1,1); vi->m[0]=q;
59  ideal ui=idInit(1,1); ui->m[0]=p;
60  ideal R; matrix U;
61  ring save_ring=currRing;
62  if (r!=currRing) rChangeCurrRing(r);
63  int save_opt;
64  SI_SAVE_OPT1(save_opt);
65  si_opt_1 &= ~(Sy_bit(OPT_PROT));
66  ideal m = idLift(vi,ui,&R, FALSE,TRUE,TRUE,&U);
67  SI_RESTORE_OPT1(save_opt);
68  if (r!=save_ring) rChangeCurrRing(save_ring);
69  if (idIs0(R))
70  {
72  p=MATELEM(T,1,1); MATELEM(T,1,1)=NULL;
73  id_Delete((ideal *)&T,r);
74  }
75  else p=NULL;
76  id_Delete((ideal *)&U,r);
77  id_Delete(&R,r);
78  //vi->m[0]=NULL; ui->m[0]=NULL;
79  id_Delete(&vi,r);
80  id_Delete(&ui,r);
81  return p;
82  }
83  }
84  else
85  {
86  int comps=p_MaxComp(p,r);
87  ideal I=idInit(comps,1);
88  poly h;
89  int i;
90  // conversion to a list of polys:
91  while (p!=NULL)
92  {
93  i=p_GetComp(p,r)-1;
94  h=pNext(p);
95  pNext(p)=NULL;
96  p_SetComp(p,0,r);
97  I->m[i]=p_Add_q(I->m[i],p,r);
98  p=h;
99  }
100  // division and conversion to vector:
101  h=NULL;
102  p=NULL;
103  for(i=comps-1;i>=0;i--)
104  {
105  if (I->m[i]!=NULL)
106  {
107  if ((r->cf->convSingNFactoryN!=ndConvSingNFactoryN)
108  &&(!rField_is_Ring(r)))
109  h=singclap_pdivide(I->m[i],q,r);
110  else
111  {
112  ideal vi=idInit(1,1); vi->m[0]=q;
113  ideal ui=idInit(1,1); ui->m[0]=I->m[i];
114  ideal R; matrix U;
115  ring save_ring=currRing;
116  if (r!=currRing) rChangeCurrRing(r);
117  int save_opt;
118  SI_SAVE_OPT1(save_opt);
119  si_opt_1 &= ~(Sy_bit(OPT_PROT));
120  ideal m = idLift(vi,ui,&R, FALSE,TRUE,TRUE,&U);
121  SI_RESTORE_OPT1(save_opt);
122  if (r!=save_ring) rChangeCurrRing(save_ring);
123  if (idIs0(R))
124  {
126  p=MATELEM(T,1,1); MATELEM(T,1,1)=NULL;
127  id_Delete((ideal *)&T,r);
128  }
129  else p=NULL;
130  id_Delete((ideal*)&U,r);
131  id_Delete(&R,r);
132  vi->m[0]=NULL; ui->m[0]=NULL;
133  id_Delete(&vi,r);
134  id_Delete(&ui,r);
135  }
136  p_SetCompP(h,i+1,r);
137  p=p_Add_q(p,h,r);
138  }
139  }
140  id_Delete(&I,r);
141  p_Delete(&q,r);
142  return p;
143  }
144  }
145  else
146  { /* This means that q != 0 consists of just one term,
147  or that r is over a coefficient ring. */
148 #ifdef HAVE_RINGS
149  if (!rField_is_Domain(r))
150  {
151  WerrorS("division only defined over coefficient domains");
152  return NULL;
153  }
154  if (pNext(q)!=NULL)
155  {
156  WerrorS("division over a coefficient domain only implemented for terms");
157  return NULL;
158  }
159 #endif
160  return p_DivideM(p,q,r);
161  }
162  return FALSE;
163 }

◆ pCompareChain()

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 20 of file kpolys.cc.

21 {
22  int k, j;
23 
24  if (lcm==NULL) return FALSE;
25 
26  for (j=(R->N); j; j--)
27  if ( p_GetExp(p,j, R) > p_GetExp(lcm,j, R)) return FALSE;
28  if ( pGetComp(p) != pGetComp(lcm)) return FALSE;
29  for (j=(R->N); j; j--)
30  {
31  if (p_GetExp(p1,j, R)!=p_GetExp(lcm,j, R))
32  {
33  if (p_GetExp(p,j, R)!=p_GetExp(lcm,j, R))
34  {
35  for (k=(R->N); k>j; k--)
36  {
37  if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
38  && (p_GetExp(p2,k, R)!=p_GetExp(lcm,k, R)))
39  return TRUE;
40  }
41  for (k=j-1; k; k--)
42  {
43  if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
44  && (p_GetExp(p2,k, R)!=p_GetExp(lcm,k, R)))
45  return TRUE;
46  }
47  return FALSE;
48  }
49  }
50  else if (p_GetExp(p2,j, R)!=p_GetExp(lcm,j, R))
51  {
52  if (p_GetExp(p,j, R)!=p_GetExp(lcm,j, R))
53  {
54  for (k=(R->N); k>j; k--)
55  {
56  if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
57  && (p_GetExp(p1,k, R)!=p_GetExp(lcm,k, R)))
58  return TRUE;
59  }
60  for (k=j-1; k!=0 ; k--)
61  {
62  if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
63  && (p_GetExp(p1,k, R)!=p_GetExp(lcm,k, R)))
64  return TRUE;
65  }
66  return FALSE;
67  }
68  }
69  }
70  return FALSE;
71 }

◆ pCompareChainPart()

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

Definition at line 74 of file kpolys.cc.

75 {
76  int k, j;
77 
78  if (lcm==NULL) return FALSE;
79 
80  for (j=R->real_var_end; j>=R->real_var_start; j--)
81  if ( p_GetExp(p,j, R) > p_GetExp(lcm,j, R)) return FALSE;
82  if ( pGetComp(p) != pGetComp(lcm)) return FALSE;
83  for (j=R->real_var_end; j>=R->real_var_start; j--)
84  {
85  if (p_GetExp(p1,j, R)!=p_GetExp(lcm,j, R))
86  {
87  if (p_GetExp(p,j, R)!=p_GetExp(lcm,j, R))
88  {
89  for (k=(R->N); k>j; k--)
90  for (k=R->real_var_end; k>j; k--)
91  {
92  if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
93  && (p_GetExp(p2,k, R)!=p_GetExp(lcm,k, R)))
94  return TRUE;
95  }
96  for (k=j-1; k>=R->real_var_start; k--)
97  {
98  if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
99  && (p_GetExp(p2,k, R)!=p_GetExp(lcm,k, R)))
100  return TRUE;
101  }
102  return FALSE;
103  }
104  }
105  else if (p_GetExp(p2,j, R)!=p_GetExp(lcm,j, R))
106  {
107  if (p_GetExp(p,j, R)!=p_GetExp(lcm,j, R))
108  {
109  for (k=R->real_var_end; k>j; k--)
110  {
111  if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
112  && (p_GetExp(p1,k, R)!=p_GetExp(lcm,k, R)))
113  return TRUE;
114  }
115  for (k=j-1; k>=R->real_var_start; k--)
116  {
117  if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
118  && (p_GetExp(p1,k, R)!=p_GetExp(lcm,k, R)))
119  return TRUE;
120  }
121  return FALSE;
122  }
123  }
124  }
125  return FALSE;
126 }

◆ pIsHomogeneous()

BOOLEAN pIsHomogeneous ( poly  p)

◆ pLast() [1/2]

static poly pLast ( poly  a)
inlinestatic

Definition at line 401 of file polys.h.

401 { int l; return pLast(a, l); }

◆ pLast() [2/2]

static poly pLast ( poly  a,
int &  length 
)
inlinestatic

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

Definition at line 400 of file polys.h.

400 { return p_Last (a, length, currRing); }

◆ pLmFree() [1/2]

static void pLmFree ( poly *  p)
inlinestatic

like pLmFree, but advances p

Definition at line 72 of file polys.h.

72 {p_LmFree(p, currRing);}

◆ pLmFree() [2/2]

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);}

◆ pNorm()

void pNorm ( poly  p,
const ring  R = currRing 
)
inline

Definition at line 357 of file polys.h.

357 { p_Norm(p, R); }

◆ pSetPolyComp()

void pSetPolyComp ( poly  p,
int  comp 
)

◆ pString()

char* pString ( poly  p)
inline

Definition at line 300 of file polys.h.

300 {return p_String(p, currRing, currRing);}

◆ pString0()

void pString0 ( poly  p)
inline

Definition at line 301 of file polys.h.

◆ pTakeOutComp() [1/2]

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 340 of file polys.h.

341 {
342  return p_TakeOutComp(p, k, R);
343 }

◆ pTakeOutComp() [2/2]

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 333 of file polys.h.

334 {
335  return p_TakeOutComp(p, comp, q, lq, R);
336 }

◆ pTotaldegree()

static long pTotaldegree ( poly  p)
inlinestatic

Definition at line 276 of file polys.h.

276 { return p_Totaldegree(p,currRing); }

◆ pWrite()

void pWrite ( poly  p)
inline

Definition at line 302 of file polys.h.

◆ pWrite0()

void pWrite0 ( poly  p)
inline

Definition at line 303 of file polys.h.

◆ rChangeCurrRing()

void rChangeCurrRing ( ring  r)

Definition at line 15 of file polys.cc.

16 {
17  //------------ set global ring vars --------------------------------
18  currRing = r;
19  if( r != NULL )
20  {
21  rTest(r);
22  //------------ global variables related to coefficients ------------
23  assume( r->cf!= NULL );
24  nSetChar(r->cf);
25  //------------ global variables related to polys
26  p_SetGlobals(r); // also setting TEST_RINGDEP_OPTS
27  //------------ global variables related to factory -----------------
28  }
29 }

◆ singclap_gcd()

poly singclap_gcd ( poly  f,
poly  g,
const ring  r 
)

polynomial gcd via singclap_gcd_r resp. idSyzygies destroys f and g

Definition at line 165 of file polys.cc.

166 {
167  poly res=NULL;
168 
169  if (f!=NULL)
170  {
171  //if (r->cf->has_simple_Inverse) p_Norm(f,r);
172  if (rField_is_Zp(r)) p_Norm(f,r);
173  else p_Cleardenom(f, r);
174  }
175  if (g!=NULL)
176  {
177  //if (r->cf->has_simple_Inverse) p_Norm(g,r);
178  if (rField_is_Zp(r)) p_Norm(g,r);
179  else p_Cleardenom(g, r);
180  }
181  else return f; // g==0 => gcd=f (but do a p_Cleardenom/pNorm)
182  if (f==NULL) return g; // f==0 => gcd=g (but do a p_Cleardenom/pNorm)
185  {
186  res=p_One(currRing);
187  }
188  else if (r->cf->convSingNFactoryN!=ndConvSingNFactoryN)
189  {
190  res=singclap_gcd_r(f,g,r);
191  }
192  else
193  {
194  ideal I=idInit(2,1);
195  I->m[0]=f;
196  I->m[1]=p_Copy(g,r);
197  intvec *w=NULL;
198  ring save_ring=currRing;
199  if (r!=currRing) rChangeCurrRing(r);
200  int save_opt;
201  SI_SAVE_OPT1(save_opt);
202  si_opt_1 &= ~(Sy_bit(OPT_PROT));
203  ideal S1=idSyzygies(I,testHomog,&w);
204  if (w!=NULL) delete w;
205  // expect S1->m[0]=(-g/gcd,f/gcd)
206  if (IDELEMS(S1)!=1) WarnS("error in syzygy computation for GCD");
207  int lp;
208  p_TakeOutComp(&S1->m[0],1,&res,&lp,r);
209  p_Delete(&S1->m[0],r);
210  // GCD is g divided iby (-g/gcd):
211  res=p_Divide(g,res,r);
212  // restore, r, opt:
213  SI_RESTORE_OPT1(save_opt);
214  if (r!=save_ring) rChangeCurrRing(save_ring);
215  // clean the result
216  res=p_Cleardenom(res,r);
217  p_Content(res,r);
218  return res;
219  }
220  p_Delete(&f, r);
221  p_Delete(&g, r);
222  return res;
223 }

◆ wrp()

void wrp ( poly  p)
inline

Definition at line 304 of file polys.h.

304 {p_wrp(p, currRing, currRing);}

Variable Documentation

◆ currRing

ring currRing
extern

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

Definition at line 13 of file polys.cc.

FALSE
#define FALSE
Definition: auxiliary.h:94
p_Divide
poly p_Divide(poly p, poly q, const ring r)
polynomial division, ignoring the rest via singclap_pdivide resp. idLift destroyes a,...
Definition: polys.cc:31
idLift
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit, GbVariant alg)
Definition: ideals.cc:1113
p_GetComp
#define p_GetComp(p, r)
Definition: monomials.h:65
ip_smatrix
Definition: matpol.h:15
nSetChar
static FORCE_INLINE void nSetChar(const coeffs r)
initialisations after each ring change
Definition: coeffs.h:436
pGetComp
#define pGetComp(p)
Component.
Definition: polys.h:37
p_GetExp
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
Definition: p_polys.h:470
j
int j
Definition: facHensel.cc:105
f
FILE * f
Definition: checklibs.c:9
k
int k
Definition: cfEzgcd.cc:92
p_Write0
void p_Write0(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:194
MATELEM
#define MATELEM(mat, i, j)
Definition: matpol.h:28
rField_is_Domain
static BOOLEAN rField_is_Domain(const ring r)
Definition: ring.h:478
rChangeCurrRing
void rChangeCurrRing(ring r)
Definition: polys.cc:15
lq
Definition: lq.h:40
p_SetCompP
static void p_SetCompP(poly p, int i, ring r)
Definition: p_polys.h:255
length
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
singclap_pdivide
poly singclap_pdivide(poly f, poly g, const ring r)
Definition: clapsing.cc:557
SI_SAVE_OPT1
#define SI_SAVE_OPT1(A)
Definition: options.h:22
g
g
Definition: cfModGcd.cc:4031
p_wrp
void p_wrp(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:235
rTest
#define rTest(r)
Definition: ring.h:776
testHomog
@ testHomog
Definition: structs.h:41
idIs0
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
Definition: simpleideals.cc:768
w
const CanonicalForm & w
Definition: facAbsFact.cc:55
currRing
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:813
currRing
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
TRUE
#define TRUE
Definition: auxiliary.h:98
i
int i
Definition: cfEzgcd.cc:125
id_Delete
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
Definition: simpleideals.cc:114
res
CanonicalForm res
Definition: facAbsFact.cc:64
Sy_bit
#define Sy_bit(x)
Definition: options.h:32
p_SetGlobals
void p_SetGlobals(const ring r, BOOLEAN complete)
set all properties of a new ring - also called by rComplete
Definition: ring.cc:3334
p_String
char * p_String(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:184
T
static jList * T
Definition: janet.cc:31
rField_is_Ring
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:475
p_DivideM
poly p_DivideM(poly a, poly b, const ring r)
Definition: p_polys.cc:1540
h
static Poly * h
Definition: janet.cc:972
pLast
static poly pLast(poly a, int &length)
returns the length of a polynomial (numbers of monomials) respect syzComp
Definition: polys.h:400
p_String0
void p_String0(poly p, ring lmRing, ring tailRing)
print p according to ShortOut in lmRing & tailRing
Definition: polys0.cc:134
p_Write
void p_Write(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:204
intvec
Definition: intvec.h:21
p_Cleardenom
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2782
p_Last
poly p_Last(const poly p, int &l, const ring r)
Definition: p_polys.cc:4519
p_LmFree
static void p_LmFree(poly p, ring)
Definition: p_polys.h:684
p_Content
void p_Content(poly ph, const ring r)
Definition: p_polys.cc:2238
p_Delete
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:858
p_Add_q
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:893
p_One
poly p_One(const ring r)
Definition: p_polys.cc:1305
singclap_gcd_r
poly singclap_gcd_r(poly f, poly g, const ring r)
Definition: clapsing.cc:43
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:37
WerrorS
void WerrorS(const char *s)
Definition: feFopen.cc:24
m
int m
Definition: cfEzgcd.cc:121
WarnS
#define WarnS
Definition: emacs.cc:78
assume
#define assume(x)
Definition: mod2.h:390
NULL
#define NULL
Definition: omList.c:10
p_TakeOutComp
void p_TakeOutComp(poly *p, long comp, poly *q, int *lq, const ring r)
Definition: p_polys.cc:3446
idSyzygies
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg, GbVariant alg)
Definition: ideals.cc:730
p_SetComp
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:248
l
int l
Definition: cfEzgcd.cc:93
lcm
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:709
R
#define R
Definition: sirandom.c:26
p_Totaldegree
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1444
p
int p
Definition: cfModGcd.cc:4019
p_IsConstant
static BOOLEAN p_IsConstant(const poly p, const ring r)
Definition: p_polys.h:1929
ndConvSingNFactoryN
CanonicalForm ndConvSingNFactoryN(number, BOOLEAN, const coeffs)
Definition: numbers.cc:273
SI_RESTORE_OPT1
#define SI_RESTORE_OPT1(A)
Definition: options.h:25
IDELEMS
#define IDELEMS(i)
Definition: simpleideals.h:24
p_Norm
void p_Norm(poly p1, const ring r)
Definition: p_polys.cc:3670
id_Module2formatedMatrix
matrix id_Module2formatedMatrix(ideal mod, int rows, int cols, const ring R)
Definition: simpleideals.cc:1247
comp
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
Definition: facSparseHensel.h:25
rField_is_Zp
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:491
p_MaxComp
static long p_MaxComp(poly p, ring lmRing, ring tailRing)
Definition: p_polys.h:293
pNext
#define pNext(p)
Definition: monomials.h:37
OPT_PROT
#define OPT_PROT
Definition: options.h:74
si_opt_1
unsigned si_opt_1
Definition: options.c:5