Macros | Functions
p_polys.h File Reference
#include <omalloc/omalloc.h>
#include <misc/mylimits.h>
#include <misc/intvec.h>
#include <coeffs/coeffs.h>
#include <polys/monomials/monomials.h>
#include <polys/monomials/ring.h>
#include <polys/templates/p_MemAdd.h>
#include <polys/templates/p_MemCmp.h>
#include <polys/templates/p_Procs.h>
#include <polys/sbuckets.h>
#include <polys/nc/nc.h>

Go to the source code of this file.

Macros

#define pIfThen(cond, check)   do {if (cond) {check;}} while (0)
 
#define p_Test(p, r)   _p_Test(p, r, PDEBUG)
 
#define p_LmTest(p, r)   _p_LmTest(p, r, PDEBUG)
 
#define pp_Test(p, lmRing, tailRing)   _pp_Test(p, lmRing, tailRing, PDEBUG)
 
#define p_SetmComp   p_Setm
 
#define _p_LmCmpAction(p, q, r, actionE, actionG, actionS)
 
#define pDivAssume(x)   do {} while (0)
 
#define p_LmCmpAction(p, q, r, actionE, actionG, actionS)   _p_LmCmpAction(p, q, r, actionE, actionG, actionS)
 
#define p_LmEqual(p1, p2, r)   p_ExpVectorEqual(p1, p2, r)
 

Functions

poly p_Farey (poly p, number N, const ring r)
 
poly p_ChineseRemainder (poly *xx, number *x, number *q, int rl, CFArray &inv_cache, const ring R)
 
unsigned long p_GetShortExpVector (const poly a, const ring r)
 
unsigned long p_GetShortExpVector (const poly p, const poly pp, const ring r)
 p_GetShortExpVector of p * pp More...
 
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), i.e., LT(f)*c*m = LT(g), for some coefficient c and some monomial m; does not take components into account More...
 
poly p_One (const ring r)
 
int p_MinDeg (poly p, intvec *w, const ring R)
 
long p_DegW (poly p, const short *w, const ring R)
 
BOOLEAN p_OneComp (poly p, const ring r)
 return TRUE if all monoms have the same component More...
 
int p_IsPurePower (const poly p, const ring r)
 return i, if head depends only on var(i) More...
 
int p_IsUnivariate (poly p, const ring r)
 return i, if poly depends only on var(i) More...
 
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) More...
 
poly p_ISet (long i, const ring r)
 returns the poly representing the integer i More...
 
poly p_NSet (number n, const ring r)
 returns the poly representing the number n, destroys n More...
 
void p_Vec2Polys (poly v, poly **p, int *len, const ring r)
 
void p_ShallowDelete (poly *p, const ring r)
 
poly p_Sub (poly a, poly b, const ring r)
 
poly p_Power (poly p, int i, const ring r)
 
BOOLEAN pIsMonomOf (poly p, poly m)
 
BOOLEAN pHaveCommonMonoms (poly p, poly q)
 
BOOLEAN p_LmCheckIsFromRing (poly p, ring r)
 
BOOLEAN p_LmCheckPolyRing (poly p, ring r)
 
BOOLEAN p_CheckIsFromRing (poly p, ring r)
 
BOOLEAN p_CheckPolyRing (poly p, ring r)
 
BOOLEAN p_CheckRing (ring r)
 
BOOLEAN _p_Test (poly p, ring r, int level)
 
BOOLEAN _p_LmTest (poly p, ring r, int level)
 
BOOLEAN _pp_Test (poly p, ring lmRing, ring tailRing, int level)
 
static int pLength (poly a)
 
poly p_Last (const poly a, int &l, const ring r)
 
void p_Norm (poly p1, const ring r)
 
void p_Normalize (poly p, const ring r)
 
void p_ProjectiveUnique (poly p, const ring r)
 
void p_Content (poly p, const ring r)
 
void p_SimpleContent (poly p, int s, const ring r)
 
poly p_Cleardenom (poly p, const ring r)
 
void p_Cleardenom_n (poly p, const ring r, number &c)
 
int p_Size (poly p, const ring r)
 
poly p_Homogen (poly p, int varnum, const ring r)
 
BOOLEAN p_IsHomogeneous (poly p, const ring r)
 
static void p_Setm (poly p, const ring r)
 
p_SetmProc p_GetSetmProc (ring r)
 
poly p_Subst (poly p, int n, poly e, const ring r)
 
static unsigned long p_SetComp (poly p, unsigned long c, ring r)
 
static void p_SetCompP (poly p, int i, ring r)
 
static void p_SetCompP (poly p, int i, ring lmRing, ring tailRing)
 
static long p_MaxComp (poly p, ring lmRing, ring tailRing)
 
static long p_MaxComp (poly p, ring lmRing)
 
static long p_MinComp (poly p, ring lmRing, ring tailRing)
 
static long p_MinComp (poly p, ring lmRing)
 
static poly pReverse (poly p)
 
void pEnlargeSet (poly **p, int length, int increment)
 
void p_String0 (poly p, ring lmRing, ring tailRing)
 print p according to ShortOut in lmRing & tailRing More...
 
char * p_String (poly p, ring lmRing, ring tailRing)
 
void p_Write (poly p, ring lmRing, ring tailRing)
 
void p_Write0 (poly p, ring lmRing, ring tailRing)
 
void p_wrp (poly p, ring lmRing, ring tailRing)
 
void p_String0Short (const poly p, ring lmRing, ring tailRing)
 print p in a short way, if possible More...
 
void p_String0Long (const poly p, ring lmRing, ring tailRing)
 print p in a long way More...
 
static long p_FDeg (const poly p, const ring r)
 
static long p_LDeg (const poly p, int *l, const ring r)
 
long p_WFirstTotalDegree (poly p, ring r)
 
long p_WTotaldegree (poly p, const ring r)
 
long p_WDegree (poly p, const ring r)
 
long pLDeg0 (poly p, int *l, ring r)
 
long pLDeg0c (poly p, int *l, ring r)
 
long pLDegb (poly p, int *l, ring r)
 
long pLDeg1 (poly p, int *l, ring r)
 
long pLDeg1c (poly p, int *l, ring r)
 
long pLDeg1_Deg (poly p, int *l, ring r)
 
long pLDeg1c_Deg (poly p, int *l, ring r)
 
long pLDeg1_Totaldegree (poly p, int *l, ring r)
 
long pLDeg1c_Totaldegree (poly p, int *l, ring r)
 
long pLDeg1_WFirstTotalDegree (poly p, int *l, ring r)
 
long pLDeg1c_WFirstTotalDegree (poly p, int *l, ring r)
 
BOOLEAN p_EqualPolys (poly p1, poly p2, const ring r)
 
BOOLEAN p_EqualPolys (poly p1, poly p2, const ring r1, const ring r2)
 same as the usual p_EqualPolys for polys belonging to equal rings More...
 
long p_Deg (poly a, const ring r)
 
static number p_SetCoeff (poly p, number n, ring r)
 
static long p_GetOrder (poly p, ring r)
 
static unsigned long p_AddComp (poly p, unsigned long v, ring r)
 
static unsigned long p_SubComp (poly p, unsigned long v, ring r)
 
static long p_GetExp (const poly p, const unsigned long iBitmask, const int VarOffset)
 get a single variable exponent : the integer VarOffset encodes: More...
 
static unsigned long p_SetExp (poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
 set a single variable exponent : VarOffset encodes the position in p->exp More...
 
static long p_GetExp (const poly p, const ring r, const int VarOffset)
 
static long p_SetExp (poly p, const long e, const ring r, const int VarOffset)
 
static long p_GetExp (const poly p, const int v, const ring r)
 get v^th exponent for a monomial More...
 
static long p_SetExp (poly p, const int v, const long e, const ring r)
 set v^th exponent for a monomial More...
 
static long p_IncrExp (poly p, int v, ring r)
 
static long p_DecrExp (poly p, int v, ring r)
 
static long p_AddExp (poly p, int v, long ee, ring r)
 
static long p_SubExp (poly p, int v, long ee, ring r)
 
static long p_MultExp (poly p, int v, long ee, ring r)
 
static long p_GetExpSum (poly p1, poly p2, int i, ring r)
 
static long p_GetExpDiff (poly p1, poly p2, int i, ring r)
 
static int p_Comp_k_n (poly a, poly b, int k, ring r)
 
static poly p_New (const ring, omBin bin)
 
static poly p_New (ring r)
 
static void p_LmFree (poly p, ring)
 
static void p_LmFree (poly *p, ring)
 
static poly p_LmFreeAndNext (poly p, ring)
 
static void p_LmDelete (poly p, const ring r)
 
static void p_LmDelete (poly *p, const ring r)
 
static poly p_LmDeleteAndNext (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 More...
 
poly p_GetMaxExpP (poly p, ring r)
 return monomial r such that GetExp(r,i) is maximum of all monomials in p; coeff == 0, next == NULL, ord is not set More...
 
static unsigned long p_GetMaxExp (const unsigned long l, const ring r)
 
static unsigned long p_GetMaxExp (const poly p, const ring r)
 
static unsigned long p_GetTotalDegree (const unsigned long l, const ring r, const int number_of_exps)
 
static unsigned long p_GetTotalDegree (const unsigned long l, const ring r)
 
static poly p_Copy_noCheck (poly p, const ring r)
 returns a copy of p (without any additional testing) More...
 
static poly p_Copy (poly p, const ring r)
 returns a copy of p More...
 
static poly p_Head (poly p, const ring r)
 
static poly p_Copy (poly p, const ring lmRing, const ring tailRing)
 
static void p_Delete (poly *p, const ring r)
 
static void p_Delete (poly *p, const ring lmRing, const ring tailRing)
 
static poly p_ShallowCopyDelete (poly p, const ring r, omBin bin)
 
static poly p_Add_q (poly p, poly q, const ring r)
 
static poly p_Add_q (poly p, poly q, int &lp, int lq, const ring r)
 like p_Add_q, except that if lp == pLength(lp) lq == pLength(lq) then lp == pLength(p+q) More...
 
static poly p_Mult_nn (poly p, number n, const ring r)
 
static poly p_Mult_nn (poly p, number n, const ring lmRing, const ring tailRing)
 
static poly pp_Mult_nn (poly p, number n, const ring r)
 
static BOOLEAN p_LmIsConstantComp (const poly p, const ring r)
 
static BOOLEAN p_LmIsConstant (const poly p, const ring r)
 
static poly pp_Mult_mm (poly p, poly m, const ring r)
 
static poly p_Mult_mm (poly p, poly m, const ring r)
 
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_Minus_mm_Mult_qq (poly p, const poly m, const poly q, const ring r)
 
static poly pp_Mult_Coeff_mm_DivSelect (poly p, const poly m, const ring r)
 
static poly pp_Mult_Coeff_mm_DivSelect (poly p, int &lp, const poly m, const ring r)
 
static poly p_Neg (poly p, 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. More...
 
static poly p_Mult_q (poly p, poly q, const ring r)
 
static poly pp_Mult_qq (poly p, poly q, const ring r)
 
static poly p_Plus_mm_Mult_qq (poly p, poly m, poly q, int &lp, int lq, const ring r)
 
static poly p_Plus_mm_Mult_qq (poly p, poly m, poly q, const ring r)
 
static poly p_Merge_q (poly p, poly q, const ring r)
 
static poly p_SortAdd (poly p, const ring r, BOOLEAN revert=FALSE)
 
static poly p_SortMerge (poly p, const ring r, BOOLEAN revert=FALSE)
 
static char * p_String (poly p, ring p_ring)
 
static void p_String0 (poly p, ring p_ring)
 
static void p_Write (poly p, ring p_ring)
 
static void p_Write0 (poly p, ring p_ring)
 
static void p_wrp (poly p, ring p_ring)
 
static void p_MemAdd_NegWeightAdjust (poly p, const ring r)
 
static void p_MemSub_NegWeightAdjust (poly p, const ring r)
 
static void p_ExpVectorCopy (poly d_p, poly s_p, const ring r)
 
static poly p_Init (const ring r, omBin bin)
 
static poly p_Init (const ring r)
 
static poly p_LmInit (poly p, const ring r)
 
static poly p_LmInit (poly s_p, const ring s_r, const ring d_r, omBin d_bin)
 
static poly p_LmInit (poly s_p, const ring s_r, const ring d_r)
 
static poly p_GetExp_k_n (poly p, int l, int k, const ring r)
 
static poly p_LmShallowCopyDelete (poly p, const ring r)
 
static void p_ExpVectorAdd (poly p1, poly p2, const ring r)
 
static void p_ExpVectorSum (poly pr, poly p1, poly p2, const ring r)
 
static void p_ExpVectorSub (poly p1, poly p2, const ring r)
 
static void p_ExpVectorAddSub (poly p1, poly p2, poly p3, const ring r)
 
static void p_ExpVectorDiff (poly pr, poly p1, poly p2, const ring r)
 
static BOOLEAN p_ExpVectorEqual (poly p1, poly p2, const ring r)
 
static long p_Totaldegree (poly p, const ring r)
 
static void p_GetExpV (poly p, int *ev, const ring r)
 
static void p_SetExpV (poly p, int *ev, const ring r)
 
static int p_LmCmp (poly p, poly q, const ring r)
 
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 More...
 
static int p_Cmp (poly p1, poly p2, 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 vars, instead of single exponents (2) Clearly, if la > lb, then FALSE (3) Suppose la <= lb, and consider first bits of single exponents in l: if TRUE, then value of these bits is la ^ lb if FALSE, then la-lb causes an "overflow" into one of those bits, i.e., la ^ lb != la - lb More...
 
static BOOLEAN _p_LmDivisibleByNoComp (poly a, const ring r_a, poly b, const ring r_b)
 
static BOOLEAN _p_LmDivisibleByNoCompPart (poly a, const ring r_a, poly b, const ring r_b, const int start, const int end)
 
static BOOLEAN _p_LmDivisibleByPart (poly a, const ring r_a, poly b, const ring r_b, const int start, const int end)
 
static BOOLEAN p_LmDivisibleByPart (poly a, poly b, const ring r, const int start, const int end)
 
static BOOLEAN _p_LmDivisibleBy (poly a, poly b, const ring r)
 
static BOOLEAN _p_LmDivisibleBy (poly a, const ring r_a, poly b, const ring r_b)
 
static BOOLEAN p_LmDivisibleByNoComp (poly a, poly b, const ring r)
 
static BOOLEAN p_LmDivisibleByNoComp (poly a, const ring ra, poly b, const ring rb)
 
static BOOLEAN p_LmDivisibleBy (poly a, poly b, const ring r)
 
static BOOLEAN p_DivisibleBy (poly a, poly b, const ring r)
 
static BOOLEAN p_DivisibleBy (poly a, const ring r_a, poly b, const ring r_b)
 
static BOOLEAN p_LmDivisibleBy (poly a, const ring r_a, poly b, const ring r_b)
 
static BOOLEAN p_LmShortDivisibleBy (poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
 
static BOOLEAN p_LmShortDivisibleByNoComp (poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
 
static BOOLEAN p_LmShortDivisibleBy (poly a, unsigned long sev_a, const ring r_a, poly b, unsigned long not_sev_b, const ring r_b)
 
static BOOLEAN p_IsConstantComp (const poly p, const ring r)
 
static BOOLEAN p_IsConstant (const poly p, const ring r)
 
static BOOLEAN p_IsOne (const poly p, const ring R)
 either poly(1) or gen(k)?! More...
 
static BOOLEAN p_IsConstantPoly (const poly p, const ring r)
 
static BOOLEAN p_IsUnit (const poly p, const ring r)
 
static BOOLEAN p_LmExpVectorAddIsOk (const poly p1, const poly p2, const ring r)
 
void p_Split (poly p, poly *r)
 
BOOLEAN p_HasNotCF (poly p1, poly p2, const ring r)
 
poly p_mInit (const char *s, BOOLEAN &ok, const ring r)
 
const char * p_Read (const char *s, poly &p, const ring r)
 
poly p_Divide (poly a, poly b, const ring r)
 
poly p_DivideM (poly a, poly b, const ring r)
 
poly p_Div_nn (poly p, const number n, const ring r)
 
void p_Lcm (const poly a, const poly b, poly m, const ring r)
 
poly p_LcmRat (const poly a, const poly b, const long lCompM, const ring r)
 
poly p_GetCoeffRat (poly p, int ishift, ring r)
 
void p_LmDeleteAndNextRat (poly *p, int ishift, ring r)
 
void p_ContentRat (poly &ph, const ring r)
 
poly p_Diff (poly a, int k, const ring r)
 
poly p_DiffOp (poly a, poly b, BOOLEAN multiply, const ring r)
 
int p_Weight (int c, 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 divisor != NULL; p may be NULL; assumes a global monomial ordering in r; performs polynomial division of p by divisor: More...
 
BOOLEAN p_VectorHasUnitB (poly p, int *k, const ring r)
 
void p_VectorHasUnit (poly p, int *k, int *len, const ring r)
 
poly p_TakeOutComp1 (poly *p, int k, const ring r)
 
void p_TakeOutComp (poly *p, long comp, poly *q, int *lq, const ring r)
 
poly p_TakeOutComp (poly *p, int k, const ring r)
 
void p_DeleteComp (poly *p, int k, const ring r)
 
void pSetDegProcs (ring r, pFDegProc new_FDeg, pLDegProc new_lDeg=NULL)
 
void pRestoreDegProcs (ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
 
void p_SetModDeg (intvec *w, ring r)
 
poly pp_Jet (poly p, int m, const ring R)
 
poly p_Jet (poly p, int m, const ring R)
 
poly pp_JetW (poly p, int m, short *w, const ring R)
 
poly p_JetW (poly p, int m, short *w, const ring R)
 
poly n_PermNumber (const number z, const int *par_perm, const int OldPar, const ring src, const ring dst)
 
poly p_PermPoly (poly p, const int *perm, const ring OldRing, const ring dst, nMapFunc nMap, const int *par_perm=NULL, int OldPar=0)
 
poly p_Series (int n, poly p, poly u, intvec *w, const ring R)
 
poly p_Invers (int n, poly u, intvec *w, const ring R)
 
int p_Var (poly mi, const ring r)
 
int p_LowVar (poly p, const ring r)
 the minimal index of used variables - 1 More...
 
void p_Shift (poly *p, int i, const ring r)
 shifts components of the vector p by i More...
 

Macro Definition Documentation

#define _p_LmCmpAction (   p,
  q,
  r,
  actionE,
  actionG,
  actionS 
)
Value:
p_MemCmp_LengthGeneral_OrdGeneral(p->exp, q->exp, r->CmpL_Size, r->ordsgn, \
actionE, actionG, actionS)
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
#define p_MemCmp_LengthGeneral_OrdGeneral(s1, s2, length, ordsgn, actionE, actionG, actionS)
Definition: p_MemCmp.h:719

Definition at line 1204 of file p_polys.h.

#define p_LmCmpAction (   p,
  q,
  r,
  actionE,
  actionG,
  actionS 
)    _p_LmCmpAction(p, q, r, actionE, actionG, actionS)

Definition at line 1515 of file p_polys.h.

#define p_LmEqual (   p1,
  p2,
  r 
)    p_ExpVectorEqual(p1, p2, r)

Definition at line 1519 of file p_polys.h.

#define p_LmTest (   p,
  r 
)    _p_LmTest(p, r, PDEBUG)

Definition at line 161 of file p_polys.h.

#define p_SetmComp   p_Setm

Definition at line 233 of file p_polys.h.

#define p_Test (   p,
  r 
)    _p_Test(p, r, PDEBUG)

Definition at line 160 of file p_polys.h.

#define pDivAssume (   x)    do {} while (0)

Definition at line 1210 of file p_polys.h.

#define pIfThen (   cond,
  check 
)    do {if (cond) {check;}} while (0)

Definition at line 154 of file p_polys.h.

#define pp_Test (   p,
  lmRing,
  tailRing 
)    _pp_Test(p, lmRing, tailRing, PDEBUG)

Definition at line 162 of file p_polys.h.

Function Documentation

static BOOLEAN _p_LmDivisibleBy ( poly  a,
poly  b,
const ring  r 
)
inlinestatic

Definition at line 1650 of file p_polys.h.

1651 {
1652  if (p_GetComp(a, r) == 0 || p_GetComp(a,r) == p_GetComp(b,r))
1653  return _p_LmDivisibleByNoComp(a, b, r);
1654  return FALSE;
1655 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
#define p_GetComp(p, r)
Definition: monomials.h:72
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...
Definition: p_polys.h:1546
const ring r
Definition: syzextra.cc:208
const poly b
Definition: syzextra.cc:213
static BOOLEAN _p_LmDivisibleBy ( poly  a,
const ring  r_a,
poly  b,
const ring  r_b 
)
inlinestatic

Definition at line 1656 of file p_polys.h.

1657 {
1658  if (p_GetComp(a, r_a) == 0 || p_GetComp(a,r_a) == p_GetComp(b,r_b))
1659  return _p_LmDivisibleByNoComp(a, r_a, b, r_b);
1660  return FALSE;
1661 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
#define p_GetComp(p, r)
Definition: monomials.h:72
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...
Definition: p_polys.h:1546
const poly b
Definition: syzextra.cc:213
static BOOLEAN _p_LmDivisibleByNoComp ( poly  a,
poly  b,
const ring  r 
)
inlinestatic

return: FALSE, if there exists i, such that a->exp[i] > b->exp[i] TRUE, otherwise (1) Consider long vars, instead of single exponents (2) Clearly, if la > lb, then FALSE (3) Suppose la <= lb, and consider first bits of single exponents in l: if TRUE, then value of these bits is la ^ lb if FALSE, then la-lb causes an "overflow" into one of those bits, i.e., la ^ lb != la - lb

Definition at line 1546 of file p_polys.h.

1547 {
1548  int i=r->VarL_Size - 1;
1549  unsigned long divmask = r->divmask;
1550  unsigned long la, lb;
1551 
1552  if (r->VarL_LowIndex >= 0)
1553  {
1554  i += r->VarL_LowIndex;
1555  do
1556  {
1557  la = a->exp[i];
1558  lb = b->exp[i];
1559  if ((la > lb) ||
1560  (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask)))
1561  {
1563  return FALSE;
1564  }
1565  i--;
1566  }
1567  while (i>=r->VarL_LowIndex);
1568  }
1569  else
1570  {
1571  do
1572  {
1573  la = a->exp[r->VarL_Offset[i]];
1574  lb = b->exp[r->VarL_Offset[i]];
1575  if ((la > lb) ||
1576  (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask)))
1577  {
1579  return FALSE;
1580  }
1581  i--;
1582  }
1583  while (i>=0);
1584  }
1585 /*#ifdef HAVE_RINGS
1586  pDivAssume(p_DebugLmDivisibleByNoComp(a, b, r) == n_DivBy(p_GetCoeff(b, r), p_GetCoeff(a, r), r->cf));
1587  return (!rField_is_Ring(r)) || n_DivBy(p_GetCoeff(b, r), p_GetCoeff(a, r), r->cf);
1588 #else
1589 */
1591  return TRUE;
1592 //#endif
1593 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
BOOLEAN p_DebugLmDivisibleByNoComp(poly a, poly b, ring r)
Definition: pDebug.cc:140
#define TRUE
Definition: auxiliary.h:144
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
#define pDivAssume(x)
Definition: p_polys.h:1210
const poly b
Definition: syzextra.cc:213
static BOOLEAN _p_LmDivisibleByNoComp ( poly  a,
const ring  r_a,
poly  b,
const ring  r_b 
)
inlinestatic

Definition at line 1595 of file p_polys.h.

1596 {
1597  int i=r_a->N;
1598  pAssume1(r_a->N == r_b->N);
1599 
1600  do
1601  {
1602  if (p_GetExp(a,i,r_a) > p_GetExp(b,i,r_b))
1603  return FALSE;
1604  i--;
1605  }
1606  while (i);
1607 /*#ifdef HAVE_RINGS
1608  return n_DivBy(p_GetCoeff(b, r_b), p_GetCoeff(a, r_a), r_a->cf);
1609 #else
1610 */
1611  return TRUE;
1612 //#endif
1613 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
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 i
Definition: cfEzgcd.cc:123
#define pAssume1(cond)
Definition: monomials.h:179
const poly b
Definition: syzextra.cc:213
static BOOLEAN _p_LmDivisibleByNoCompPart ( poly  a,
const ring  r_a,
poly  b,
const ring  r_b,
const int  start,
const int  end 
)
inlinestatic

Definition at line 1616 of file p_polys.h.

1617 {
1618  int i=end;
1619  pAssume1(r_a->N == r_b->N);
1620 
1621  do
1622  {
1623  if (p_GetExp(a,i,r_a) > p_GetExp(b,i,r_b))
1624  return FALSE;
1625  i--;
1626  }
1627  while (i>=start);
1628 /*#ifdef HAVE_RINGS
1629  return n_DivBy(p_GetCoeff(b, r_b), p_GetCoeff(a, r_a), r_a->cf);
1630 #else
1631 */
1632  return TRUE;
1633 //#endif
1634 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
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 i
Definition: cfEzgcd.cc:123
#define pAssume1(cond)
Definition: monomials.h:179
const poly b
Definition: syzextra.cc:213
static BOOLEAN _p_LmDivisibleByPart ( poly  a,
const ring  r_a,
poly  b,
const ring  r_b,
const int  start,
const int  end 
)
inlinestatic

Definition at line 1635 of file p_polys.h.

1636 {
1637  if (p_GetComp(a, r_a) == 0 || p_GetComp(a,r_a) == p_GetComp(b,r_b))
1638  return _p_LmDivisibleByNoCompPart(a, r_a, b, r_b,start,end);
1639  return FALSE;
1640 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
#define p_GetComp(p, r)
Definition: monomials.h:72
static BOOLEAN _p_LmDivisibleByNoCompPart(poly a, const ring r_a, poly b, const ring r_b, const int start, const int end)
Definition: p_polys.h:1616
const poly b
Definition: syzextra.cc:213
BOOLEAN _p_LmTest ( poly  p,
ring  r,
int  level 
)

Definition at line 322 of file pDebug.cc.

323 {
324  if (level < 0 || p == NULL) return TRUE;
325  poly pnext = pNext(p);
326  pNext(p) = NULL;
327  BOOLEAN test_res = _p_Test(p, r, level);
328  pNext(p) = pnext;
329  return test_res;
330 }
int level(const CanonicalForm &f)
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:144
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
BOOLEAN _p_Test(poly p, ring r, int level)
Definition: pDebug.cc:211
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:131
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.

Definition at line 273 of file p_Mult_q.cc.

274 {
275  assume(r != NULL);
276 #ifdef HAVE_RINGS
277  if (!nCoeff_is_Domain(r->cf))
278  return _p_Mult_q_Normal_ZeroDiv(p, q, copy, r);
279 #endif
280  int lp, lq, l;
281  poly pt;
282 
283  pqLength(p, q, lp, lq, MIN_LENGTH_BUCKET);
284 
285  if (lp < lq)
286  {
287  pt = p;
288  p = q;
289  q = pt;
290  l = lp;
291  lp = lq;
292  lq = l;
293  }
295  return _p_Mult_q_Normal(p, q, copy, r);
296  else
297  {
298  assume(lp == pLength(p));
299  assume(lq == pLength(q));
300  return _p_Mult_q_Bucket(p, lp, q, lq, copy, r);
301  }
302 }
CFArray copy(const CFList &list)
write elements of list into an array
return P p
Definition: myNF.cc:203
#define MIN_LENGTH_BUCKET
Definition: p_Mult_q.h:22
static poly _p_Mult_q_Normal_ZeroDiv(poly p, poly q, const int copy, const ring r)
Definition: p_Mult_q.cc:163
static int pLength(poly a)
Definition: p_polys.h:189
#define TEST_OPT_NOT_BUCKETS
Definition: options.h:100
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
static poly _p_Mult_q_Normal(poly p, poly q, const int copy, const ring r)
Definition: p_Mult_q.cc:191
BOOLEAN pqLength(poly p, poly q, int &lp, int &lq, const int min)
Definition: p_Mult_q.cc:27
static FORCE_INLINE BOOLEAN nCoeff_is_Domain(const coeffs r)
returns TRUE, if r is a field or r has no zero divisors (i.e is a domain)
Definition: coeffs.h:757
#define NULL
Definition: omList.c:10
static poly _p_Mult_q_Bucket(poly p, const int lp, poly q, const int lq, const int copy, const ring r)
Definition: p_Mult_q.cc:66
polyrec * poly
Definition: hilb.h:10
int l
Definition: cfEzgcd.cc:94
BOOLEAN _p_Test ( poly  p,
ring  r,
int  level 
)

Definition at line 211 of file pDebug.cc.

212 {
213  assume(r->cf !=NULL);
214 
215  if (PDEBUG > level) level = PDEBUG;
216  if (level < 0 || p == NULL) return TRUE;
217 
218  poly p_prev = NULL;
219 
220  #ifndef OM_NDEBUG
221  #ifndef X_OMALLOC
222  // check addr with level+1 so as to check bin/page of addr
223  _pPolyAssumeReturnMsg(omTestBinAddrSize(p, (omSizeWOfBin(r->PolyBin))*SIZEOF_LONG, level+1)
224  == omError_NoError, "memory error",p,r);
225  #endif
226  #endif
227 
229 
230  // this checks that p does not contain a loop: rather expensive O(length^2)
231  #ifndef OM_NDEBUG
232  if (level > 1)
234  #endif
235 
236  int ismod = p_GetComp(p, r) != 0;
237 
238  while (p != NULL)
239  {
240  // ring check
242  #ifndef OM_NDEBUG
243  #ifndef X_OMALLOC
244  // omAddr check
245  _pPolyAssumeReturnMsg(omTestBinAddrSize(p, (omSizeWOfBin(r->PolyBin))*SIZEOF_LONG, 1)
246  == omError_NoError, "memory error",p,r);
247  #endif
248  #endif
249  // number/coef check
250  _pPolyAssumeReturnMsg(p->coef != NULL || (n_GetChar(r->cf) >= 2), "NULL coef",p,r);
251 
252  #ifdef LDEBUG
253  _pPolyAssumeReturnMsg(n_Test(p->coef,r->cf),"coeff err",p,r);
254  #endif
255  _pPolyAssumeReturnMsg(!n_IsZero(p->coef, r->cf), "Zero coef",p,r);
256 
257  // check for valid comp
258  _pPolyAssumeReturnMsg(p_GetComp(p, r) >= 0 && (p_GetComp(p, r)<65000), "component out of range ?",p,r);
259  // check for mix poly/vec representation
260  _pPolyAssumeReturnMsg(ismod == (p_GetComp(p, r) != 0), "mixed poly/vector",p,r);
261 
262  // special check for ringorder_s/S
263  if ((r->typ!=NULL) && (r->typ[0].ord_typ == ro_syzcomp))
264  {
265  long c1, cc1, ccc1, ec1;
266  sro_ord* o = &(r->typ[0]);
267 
268  c1 = p_GetComp(p, r);
269  if (o->data.syzcomp.Components!=NULL)
270  {
271  cc1 = o->data.syzcomp.Components[c1];
272  ccc1 = o->data.syzcomp.ShiftedComponents[cc1];
273  }
274  else { cc1=0; ccc1=0; }
275  _pPolyAssumeReturnMsg(c1 == 0 || cc1 != 0, "Component <-> TrueComponent zero mismatch",p,r);
276  _pPolyAssumeReturnMsg(c1 == 0 || ccc1 != 0,"Component <-> ShiftedComponent zero mismatch",p,r);
277  ec1 = p->exp[o->data.syzcomp.place];
278  //pPolyAssumeReturnMsg(ec1 == ccc1, "Shifted comp out of sync. should %d, is %d");
279  if (ec1 != ccc1)
280  {
281  dPolyReportError(p,r,"Shifted comp out of sync. should %d, is %d",ccc1,ec1);
282  return FALSE;
283  }
284  }
285 
286  // check that p_Setm works ok
287  if (level > 0)
288  {
289  poly p_should_equal = p_DebugInit(p, r, r);
290  _pPolyAssumeReturnMsg(p_ExpVectorEqual(p, p_should_equal, r), "p_Setm field(s) out of sync",p,r);
291  p_LmFree(p_should_equal, r);
292  }
293 
294  // check order
295  if (p_prev != NULL)
296  {
297  int cmp = p_LmCmp(p_prev, p, r);
298  if (cmp == 0)
299  {
300  _pPolyAssumeReturnMsg(0, "monoms p and p->next are equal", p_prev, r);
301  }
302  else
303  _pPolyAssumeReturnMsg(p_LmCmp(p_prev, p, r) == 1, "wrong order", p_prev, r);
304 
305  // check that compare worked sensibly
306  if (level > 1 && p_GetComp(p_prev, r) == p_GetComp(p, r))
307  {
308  int i;
309  for (i=r->N; i>0; i--)
310  {
311  if (p_GetExp(p_prev, i, r) != p_GetExp(p, i, r)) break;
312  }
313  _pPolyAssumeReturnMsg(i > 0, "Exponents equal but compare different", p_prev, r);
314  }
315  }
316  p_prev = p;
317  pIter(p);
318  }
319  return TRUE;
320 }
int level(const CanonicalForm &f)
static poly p_DebugInit(poly p, ring src_ring, ring dest_ring)
Definition: pDebug.cc:194
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define omTestList(ptr, level)
Definition: omList.h:81
#define p_GetComp(p, r)
Definition: monomials.h:72
omError_t omTestBinAddrSize(void *addr, size_t size, int check_level)
Definition: omDebug.c:44
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
Definition: coeffs.h:445
#define TRUE
Definition: auxiliary.h:144
BOOLEAN dPolyReportError(poly p, ring r, const char *fmt,...)
Definition: pDebug.cc:44
static void p_LmFree(poly p, ring)
Definition: p_polys.h:679
union sro_ord::@0 data
#define pIter(p)
Definition: monomials.h:44
#define pFalseReturn(cond)
Definition: monomials.h:147
BOOLEAN p_LmCheckIsFromRing(poly p, ring r)
Definition: pDebug.cc:71
const ring r
Definition: syzextra.cc:208
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
#define assume(x)
Definition: mod2.h:405
#define PDEBUG
Definition: auxiliary.h:227
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:923
Definition: ring.h:180
static int p_LmCmp(poly p, poly q, const ring r)
Definition: p_polys.h:1472
int i
Definition: cfEzgcd.cc:123
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the zero element.
Definition: coeffs.h:465
BOOLEAN p_CheckRing(ring r)
Definition: pDebug.cc:127
#define NULL
Definition: omList.c:10
#define omSizeWOfBin(bin_ptr)
static BOOLEAN p_ExpVectorEqual(poly p1, poly p2, const ring r1, const ring r2)
Definition: p_polys.cc:4303
polyrec * poly
Definition: hilb.h:10
#define _pPolyAssumeReturnMsg(cond, msg, p, r)
Definition: monomials.h:132
BOOLEAN _pp_Test ( poly  p,
ring  lmRing,
ring  tailRing,
int  level 
)

Definition at line 332 of file pDebug.cc.

333 {
334  if (PDEBUG > level) level = PDEBUG;
335  if (level < 0 || p == NULL) return TRUE;
336  if (pNext(p) == NULL || lmRing == tailRing) return _p_Test(p, lmRing, level);
337 
340 
341  // check that lm > Lm(tail)
342  if (level > 1)
343  {
344  poly lm = p;
345  poly tail = p_DebugInit(pNext(p), tailRing, lmRing);
346  poly pnext = pNext(lm);
347  pNext(lm) = tail;
348  BOOLEAN cmp = p_LmCmp(lm, tail, lmRing);
349  if (cmp != 1)
350  dPolyReportError(lm, lmRing, "wrong order: lm <= Lm(tail)");
351  p_LmFree(tail, lmRing);
352  pNext(lm) = pnext;
353  return (cmp == 1);
354  }
355  return TRUE;
356 }
int level(const CanonicalForm &f)
static poly p_DebugInit(poly p, ring src_ring, ring dest_ring)
Definition: pDebug.cc:194
BEGIN_NAMESPACE_SINGULARXX const ring lmRing
Definition: DebugPrint.h:30
return P p
Definition: myNF.cc:203
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
Definition: DebugPrint.h:30
#define TRUE
Definition: auxiliary.h:144
BOOLEAN dPolyReportError(poly p, ring r, const char *fmt,...)
Definition: pDebug.cc:44
static void p_LmFree(poly p, ring)
Definition: p_polys.h:679
BOOLEAN _p_LmTest(poly p, ring r, int level)
Definition: pDebug.cc:322
#define pFalseReturn(cond)
Definition: monomials.h:147
#define PDEBUG
Definition: auxiliary.h:227
static int p_LmCmp(poly p, poly q, const ring r)
Definition: p_polys.h:1472
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
BOOLEAN _p_Test(poly p, ring r, int level)
Definition: pDebug.cc:211
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:131
poly n_PermNumber ( const number  z,
const int *  par_perm,
const int  OldPar,
const ring  src,
const ring  dst 
)

Definition at line 3822 of file p_polys.cc.

3823 {
3824 #if 0
3825  PrintS("\nSource Ring: \n");
3826  rWrite(src);
3827 
3828  if(0)
3829  {
3830  number zz = n_Copy(z, src->cf);
3831  PrintS("z: "); n_Write(zz, src);
3832  n_Delete(&zz, src->cf);
3833  }
3834 
3835  PrintS("\nDestination Ring: \n");
3836  rWrite(dst);
3837 
3838  /*Print("\nOldPar: %d\n", OldPar);
3839  for( int i = 1; i <= OldPar; i++ )
3840  {
3841  Print("par(%d) -> par/var (%d)\n", i, par_perm[i-1]);
3842  }*/
3843 #endif
3844  if( z == NULL )
3845  return NULL;
3846 
3847  const coeffs srcCf = src->cf;
3848  assume( srcCf != NULL );
3849 
3850  assume( !nCoeff_is_GF(srcCf) );
3851  assume( src->cf->extRing!=NULL );
3852 
3853  poly zz = NULL;
3854 
3855  const ring srcExtRing = srcCf->extRing;
3856  assume( srcExtRing != NULL );
3857 
3858  const coeffs dstCf = dst->cf;
3859  assume( dstCf != NULL );
3860 
3861  if( nCoeff_is_algExt(srcCf) ) // nCoeff_is_GF(srcCf)?
3862  {
3863  zz = (poly) z;
3864  if( zz == NULL ) return NULL;
3865  }
3866  else if (nCoeff_is_transExt(srcCf))
3867  {
3868  assume( !IS0(z) );
3869 
3870  zz = NUM((fraction)z);
3871  p_Test (zz, srcExtRing);
3872 
3873  if( zz == NULL ) return NULL;
3874  if( !DENIS1((fraction)z) )
3875  {
3876  if (!p_IsConstant(DEN((fraction)z),srcExtRing))
3877  WarnS("Not defined: Cannot map a rational fraction and make a polynomial out of it! Ignoring the denumerator.");
3878  }
3879  }
3880  else
3881  {
3882  assume (FALSE);
3883  Werror("Number permutation is not implemented for this data yet!");
3884  return NULL;
3885  }
3886 
3887  assume( zz != NULL );
3888  p_Test (zz, srcExtRing);
3889 
3890  nMapFunc nMap = n_SetMap(srcExtRing->cf, dstCf);
3891 
3892  assume( nMap != NULL );
3893 
3894  poly qq;
3895  if ((par_perm == NULL) && (rPar(dst) != 0 && rVar (srcExtRing) > 0))
3896  {
3897  int* perm;
3898  perm=(int *)omAlloc0((rVar(srcExtRing)+1)*sizeof(int));
3899  perm[0]= 0;
3900  for(int i=si_min(rVar(srcExtRing),rPar(dst));i>0;i--)
3901  perm[i]=-i;
3902  qq = p_PermPoly(zz, perm, srcExtRing, dst, nMap, NULL, rVar(srcExtRing)-1);
3903  omFreeSize ((ADDRESS)perm, (rVar(srcExtRing)+1)*sizeof(int));
3904  }
3905  else
3906  qq = p_PermPoly(zz, par_perm-1, srcExtRing, dst, nMap, NULL, rVar (srcExtRing)-1);
3907 
3908  if(nCoeff_is_transExt(srcCf)
3909  && (!DENIS1((fraction)z))
3910  && p_IsConstant(DEN((fraction)z),srcExtRing))
3911  {
3912  number n=nMap(pGetCoeff(DEN((fraction)z)),srcExtRing->cf, dstCf);
3913  qq=p_Div_nn(qq,n,dst);
3914  n_Delete(&n,dstCf);
3915  p_Normalize(qq,dst);
3916  }
3917  p_Test (qq, dst);
3918 
3919  return qq;
3920 }
static int si_min(const int a, const int b)
Definition: auxiliary.h:167
#define FALSE
Definition: auxiliary.h:140
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:547
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
poly p_Div_nn(poly p, const number n, const ring r)
Definition: p_polys.cc:1480
void * ADDRESS
Definition: auxiliary.h:161
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
#define WarnS
Definition: emacs.cc:81
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
Definition: coeffs.h:911
#define assume(x)
Definition: mod2.h:405
static BOOLEAN p_IsConstant(const poly p, const ring r)
Definition: p_polys.h:1784
The main handler for Singular numbers which are suitable for Singular polynomials.
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:72
static FORCE_INLINE void n_Write(number &n, const coeffs r, const BOOLEAN bShortOut=TRUE)
Definition: coeffs.h:592
static FORCE_INLINE BOOLEAN nCoeff_is_transExt(const coeffs r)
TRUE iff r represents a transcendental extension field.
Definition: coeffs.h:919
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:294
void rWrite(ring r, BOOLEAN details)
Definition: ring.cc:236
static FORCE_INLINE BOOLEAN nCoeff_is_GF(const coeffs r)
Definition: coeffs.h:837
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:720
#define p_Test(p, r)
Definition: p_polys.h:160
void p_Normalize(poly p, const ring r)
Definition: p_polys.cc:3621
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar)
Definition: p_polys.cc:3926
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of &#39;n&#39;
Definition: coeffs.h:452
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
polyrec * poly
Definition: hilb.h:10
void Werror(const char *fmt,...)
Definition: reporter.cc:199
#define omAlloc0(size)
Definition: omAllocDecl.h:211
static poly p_Add_q ( poly  p,
poly  q,
const ring  r 
)
inlinestatic

Definition at line 884 of file p_polys.h.

885 {
886  assume( (p != q) || (p == NULL && q == NULL) );
887  int shorter;
888  return r->p_Procs->p_Add_q(p, q, shorter, r);
889 }
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static poly p_Add_q ( poly  p,
poly  q,
int &  lp,
int  lq,
const ring  r 
)
inlinestatic

like p_Add_q, except that if lp == pLength(lp) lq == pLength(lq) then lp == pLength(p+q)

Definition at line 892 of file p_polys.h.

893 {
894  assume( (p != q) || (p == NULL && q == NULL) );
895  int shorter;
896  poly res = r->p_Procs->p_Add_q(p, q, shorter, r);
897  lp = (lp + lq) - shorter;
898  return res;
899 }
return P p
Definition: myNF.cc:203
poly res
Definition: myNF.cc:322
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
static unsigned long p_AddComp ( poly  p,
unsigned long  v,
ring  r 
)
inlinestatic

Definition at line 443 of file p_polys.h.

444 {
447  return __p_GetComp(p,r) += v;
448 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
#define __p_GetComp(p, r)
Definition: monomials.h:71
return P p
Definition: myNF.cc:203
#define pAssume2(cond)
Definition: monomials.h:201
const ring r
Definition: syzextra.cc:208
#define rRing_has_Comp(r)
Definition: monomials.h:274
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
static long p_AddExp ( poly  p,
int  v,
long  ee,
ring  r 
)
inlinestatic

Definition at line 602 of file p_polys.h.

603 {
605  int e = p_GetExp(p,v,r);
606  e += ee;
607  return p_SetExp(p,v,e,r);
608 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
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
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:484
BOOLEAN p_CheckIsFromRing ( poly  p,
ring  r 
)

Definition at line 101 of file pDebug.cc.

102 {
103  while (p!=NULL)
104  {
106  pIter(p);
107  }
108  return TRUE;
109 }
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:144
#define pIter(p)
Definition: monomials.h:44
#define pFalseReturn(cond)
Definition: monomials.h:147
BOOLEAN p_LmCheckIsFromRing(poly p, ring r)
Definition: pDebug.cc:71
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
BOOLEAN p_CheckPolyRing ( poly  p,
ring  r 
)

Definition at line 111 of file pDebug.cc.

112 {
113  #ifndef X_OMALLOC
114  pAssumeReturn(r != NULL && r->PolyBin != NULL);
115  #endif
116  return p_CheckIsFromRing(p, r);
117 }
return P p
Definition: myNF.cc:203
#define pAssumeReturn(cond)
Definition: monomials.h:86
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
BOOLEAN p_CheckIsFromRing(poly p, ring r)
Definition: pDebug.cc:101
BOOLEAN p_CheckRing ( ring  r)

Definition at line 127 of file pDebug.cc.

128 {
129  #ifndef X_OMALLOC
130  pAssumeReturn(r != NULL && r->PolyBin != NULL);
131  #endif
132  return TRUE;
133 }
#define TRUE
Definition: auxiliary.h:144
#define pAssumeReturn(cond)
Definition: monomials.h:86
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
poly p_ChineseRemainder ( poly xx,
number *  x,
number *  q,
int  rl,
CFArray inv_cache,
const ring  R 
)

Definition at line 94 of file p_polys.cc.

95 {
96  poly r,h,hh;
97  int j;
98  poly res_p=NULL;
99  loop
100  {
101  /* search the lead term */
102  r=NULL;
103  for(j=rl-1;j>=0;j--)
104  {
105  h=xx[j];
106  if ((h!=NULL)
107  &&((r==NULL)||(p_LmCmp(r,h,R)==-1)))
108  r=h;
109  }
110  /* nothing found -> return */
111  if (r==NULL) break;
112  /* create the monomial in h */
113  h=p_Head(r,R);
114  /* collect the coeffs in x[..]*/
115  for(j=rl-1;j>=0;j--)
116  {
117  hh=xx[j];
118  if ((hh!=NULL) && (p_LmCmp(h,hh,R)==0))
119  {
120  x[j]=pGetCoeff(hh);
121  hh=p_LmFreeAndNext(hh,R);
122  xx[j]=hh;
123  }
124  else
125  x[j]=n_Init(0, R);
126  }
127  number n=n_ChineseRemainderSym(x,q,rl,TRUE,inv_cache,R->cf);
128  for(j=rl-1;j>=0;j--)
129  {
130  x[j]=NULL; // n_Init(0...) takes no memory
131  }
132  if (n_IsZero(n,R)) p_Delete(&h,R);
133  else
134  {
135  //Print("new mon:");pWrite(h);
136  p_SetCoeff(h,n,R);
137  pNext(h)=res_p;
138  res_p=h; // building res_p in reverse order!
139  }
140  }
141  res_p=pReverse(res_p);
142  p_Test(res_p, R);
143  return res_p;
144 }
loop
Definition: myNF.cc:98
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:539
#define TRUE
Definition: auxiliary.h:144
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:401
static poly p_Head(poly p, const ring r)
Definition: p_polys.h:819
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
static FORCE_INLINE number n_ChineseRemainderSym(number *a, number *b, int rl, BOOLEAN sym, CFArray &inv_cache, const coeffs r)
Definition: coeffs.h:782
const ring R
Definition: DebugPrint.cc:36
static int p_LmCmp(poly p, poly q, const ring r)
Definition: p_polys.h:1472
static poly p_LmFreeAndNext(poly p, ring)
Definition: p_polys.h:699
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the zero element.
Definition: coeffs.h:465
static poly pReverse(poly p)
Definition: p_polys.h:324
#define p_Test(p, r)
Definition: p_polys.h:160
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
#define NULL
Definition: omList.c:10
Variable x
Definition: cfModGcd.cc:4023
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
poly p_Cleardenom ( poly  p,
const ring  r 
)

Definition at line 2682 of file p_polys.cc.

2683 {
2684  if( p == NULL )
2685  return NULL;
2686 
2687  assume( r != NULL ); assume( r->cf != NULL ); const coeffs C = r->cf;
2688 
2689 #if CLEARENUMERATORS
2690  if( 0 )
2691  {
2692  CPolyCoeffsEnumerator itr(p);
2693 
2694  n_ClearDenominators(itr, C);
2695 
2696  n_ClearContent(itr, C); // divide out the content
2697 
2698  p_Test(p, r); n_Test(pGetCoeff(p), C);
2699  assume(n_GreaterZero(pGetCoeff(p), C)); // ??
2700 // if(!n_GreaterZero(pGetCoeff(p),C)) p = p_Neg(p,r);
2701 
2702  return p;
2703  }
2704 #endif
2705 
2706 
2707  number d, h;
2708 
2709 #ifdef HAVE_RINGS
2710  if (rField_is_Ring(r))
2711  {
2712  p_Content(p,r);
2713  if(!n_GreaterZero(pGetCoeff(p),C)) p = p_Neg(p,r);
2714  return p;
2715  }
2716 #endif
2717 
2719  {
2720  if(!n_GreaterZero(pGetCoeff(p),C)) p = p_Neg(p,r);
2721  return p;
2722  }
2723 
2724  assume(p != NULL);
2725 
2726  if(pNext(p)==NULL)
2727  {
2728  /*
2729  if (TEST_OPT_CONTENTSB)
2730  {
2731  number n=n_GetDenom(pGetCoeff(p),r->cf);
2732  if (!n_IsOne(n,r->cf))
2733  {
2734  number nn=n_Mult(pGetCoeff(p),n,r->cf);
2735  n_Normalize(nn,r->cf);
2736  p_SetCoeff(p,nn,r);
2737  }
2738  n_Delete(&n,r->cf);
2739  }
2740  else
2741  */
2742  p_SetCoeff(p,n_Init(1,r->cf),r);
2743 
2744  /*assume( n_GreaterZero(pGetCoeff(p),C) );
2745  if(!n_GreaterZero(pGetCoeff(p),C)) p = p_Neg(p,r);
2746  */
2747  return p;
2748  }
2749 
2750  assume(pNext(p)!=NULL);
2751  poly start=p;
2752 
2753 #if 0 && CLEARENUMERATORS
2754 //CF: does not seem to work that well..
2755 
2756  if( nCoeff_is_Q(C) || nCoeff_is_Q_a(C) )
2757  {
2758  CPolyCoeffsEnumerator itr(p);
2759 
2760  n_ClearDenominators(itr, C);
2761 
2762  n_ClearContent(itr, C); // divide out the content
2763 
2764  p_Test(p, r); n_Test(pGetCoeff(p), C);
2765  assume(n_GreaterZero(pGetCoeff(p), C)); // ??
2766 // if(!n_GreaterZero(pGetCoeff(p),C)) p = p_Neg(p,r);
2767 
2768  return start;
2769  }
2770 #endif
2771 
2772  if(1)
2773  {
2774  h = n_Init(1,r->cf);
2775  while (p!=NULL)
2776  {
2777  n_Normalize(pGetCoeff(p),r->cf);
2778  d=n_NormalizeHelper(h,pGetCoeff(p),r->cf);
2779  n_Delete(&h,r->cf);
2780  h=d;
2781  pIter(p);
2782  }
2783  /* contains the 1/lcm of all denominators */
2784  if(!n_IsOne(h,r->cf))
2785  {
2786  p = start;
2787  while (p!=NULL)
2788  {
2789  /* should be: // NOTE: don't use ->coef!!!!
2790  * number hh;
2791  * nGetDenom(p->coef,&hh);
2792  * nMult(&h,&hh,&d);
2793  * nNormalize(d);
2794  * nDelete(&hh);
2795  * nMult(d,p->coef,&hh);
2796  * nDelete(&d);
2797  * nDelete(&(p->coef));
2798  * p->coef =hh;
2799  */
2800  d=n_Mult(h,pGetCoeff(p),r->cf);
2801  n_Normalize(d,r->cf);
2802  p_SetCoeff(p,d,r);
2803  pIter(p);
2804  }
2805  n_Delete(&h,r->cf);
2806  }
2807  n_Delete(&h,r->cf);
2808  p=start;
2809 
2810  p_Content(p,r);
2811 #ifdef HAVE_RATGRING
2812  if (rIsRatGRing(r))
2813  {
2814  /* quick unit detection in the rational case is done in gr_nc_bba */
2815  p_ContentRat(p, r);
2816  start=p;
2817  }
2818 #endif
2819  }
2820 
2821  if(!n_GreaterZero(pGetCoeff(p),C)) p = p_Neg(p,r);
2822 
2823  return start;
2824 }
return P p
Definition: myNF.cc:203
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the one element.
Definition: coeffs.h:469
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:539
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition: coeffs.h:579
static FORCE_INLINE number n_NormalizeHelper(number a, number b, const coeffs r)
assume that r is a quotient field (otherwise, return 1) for arguments (a1/a2,b1/b2) return (lcm(a1...
Definition: coeffs.h:716
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:824
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:401
static FORCE_INLINE BOOLEAN nCoeff_is_Q_a(const coeffs r)
Definition: coeffs.h:883
#define pIter(p)
Definition: monomials.h:44
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of &#39;a&#39; and &#39;b&#39;, i.e., a*b
Definition: coeffs.h:635
void p_ContentRat(poly &ph, const ring r)
Definition: p_polys.cc:1655
static FORCE_INLINE void n_ClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs r)
Computes the content and (inplace) divides it out on a collection of numbers number c is the content ...
Definition: coeffs.h:932
const ring r
Definition: syzextra.cc:208
#define TEST_OPT_INTSTRATEGY
Definition: options.h:105
This is a polynomial enumerator for simple iteration over coefficients of polynomials.
#define assume(x)
Definition: mod2.h:405
The main handler for Singular numbers which are suitable for Singular polynomials.
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:923
void p_Content(poly ph, const ring r)
Definition: p_polys.cc:2182
#define p_Test(p, r)
Definition: p_polys.h:160
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:455
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:437
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1018
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff &#39;n&#39; is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2), where m is the long representing n in C: TRUE iff (Im(n) != 0 and Im(n) >= 0) or (Im(n) == 0 and Re(n) >= 0) in K(a)/<p(a)>: TRUE iff (n != 0 and (LC(n) > 0 or deg(n) > 0)) in K(t_1, ..., t_n): TRUE iff (LC(numerator(n) is a constant and > 0) or (LC(numerator(n) is not a constant) in Z/2^kZ: TRUE iff 0 < n <= 2^(k-1) in Z/mZ: TRUE iff the internal mpz is greater than zero in Z: TRUE iff n > 0
Definition: coeffs.h:495
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
static bool rIsRatGRing(const ring r)
Definition: ring.h:372
static FORCE_INLINE void n_ClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &d, const coeffs r)
(inplace) Clears denominators on a collection of numbers number d is the LCM of all the coefficient d...
Definition: coeffs.h:939
void p_Cleardenom_n ( poly  p,
const ring  r,
number &  c 
)

Definition at line 2826 of file p_polys.cc.

2827 {
2828  const coeffs C = r->cf;
2829  number d, h;
2830 
2831  assume( ph != NULL );
2832 
2833  poly p = ph;
2834 
2835 #if CLEARENUMERATORS
2836  if( 0 )
2837  {
2838  CPolyCoeffsEnumerator itr(ph);
2839 
2840  n_ClearDenominators(itr, d, C); // multiply with common denom. d
2841  n_ClearContent(itr, h, C); // divide by the content h
2842 
2843  c = n_Div(d, h, C); // d/h
2844 
2845  n_Delete(&d, C);
2846  n_Delete(&h, C);
2847 
2848  n_Test(c, C);
2849 
2850  p_Test(ph, r); n_Test(pGetCoeff(ph), C);
2851  assume(n_GreaterZero(pGetCoeff(ph), C)); // ??
2852 /*
2853  if(!n_GreaterZero(pGetCoeff(ph),C))
2854  {
2855  ph = p_Neg(ph,r);
2856  c = n_InpNeg(c, C);
2857  }
2858 */
2859  return;
2860  }
2861 #endif
2862 
2863 
2864  if( pNext(p) == NULL )
2865  {
2866  c=n_Invers(pGetCoeff(p), C);
2867  p_SetCoeff(p, n_Init(1, C), r);
2868 
2869  assume( n_GreaterZero(pGetCoeff(ph),C) );
2870  if(!n_GreaterZero(pGetCoeff(ph),C))
2871  {
2872  ph = p_Neg(ph,r);
2873  c = n_InpNeg(c, C);
2874  }
2875 
2876  return;
2877  }
2878 
2879  assume( pNext(p) != NULL );
2880 
2881 #if CLEARENUMERATORS
2882  if( nCoeff_is_Q(C) || nCoeff_is_Q_a(C) )
2883  {
2884  CPolyCoeffsEnumerator itr(ph);
2885 
2886  n_ClearDenominators(itr, d, C); // multiply with common denom. d
2887  n_ClearContent(itr, h, C); // divide by the content h
2888 
2889  c = n_Div(d, h, C); // d/h
2890 
2891  n_Delete(&d, C);
2892  n_Delete(&h, C);
2893 
2894  n_Test(c, C);
2895 
2896  p_Test(ph, r); n_Test(pGetCoeff(ph), C);
2897  assume(n_GreaterZero(pGetCoeff(ph), C)); // ??
2898 /*
2899  if(!n_GreaterZero(pGetCoeff(ph),C))
2900  {
2901  ph = p_Neg(ph,r);
2902  c = n_InpNeg(c, C);
2903  }
2904 */
2905  return;
2906  }
2907 #endif
2908 
2909 
2910 
2911 
2912  if(1)
2913  {
2914  h = n_Init(1,r->cf);
2915  while (p!=NULL)
2916  {
2917  n_Normalize(pGetCoeff(p),r->cf);
2918  d=n_NormalizeHelper(h,pGetCoeff(p),r->cf);
2919  n_Delete(&h,r->cf);
2920  h=d;
2921  pIter(p);
2922  }
2923  c=h;
2924  /* contains the 1/lcm of all denominators */
2925  if(!n_IsOne(h,r->cf))
2926  {
2927  p = ph;
2928  while (p!=NULL)
2929  {
2930  /* should be: // NOTE: don't use ->coef!!!!
2931  * number hh;
2932  * nGetDenom(p->coef,&hh);
2933  * nMult(&h,&hh,&d);
2934  * nNormalize(d);
2935  * nDelete(&hh);
2936  * nMult(d,p->coef,&hh);
2937  * nDelete(&d);
2938  * nDelete(&(p->coef));
2939  * p->coef =hh;
2940  */
2941  d=n_Mult(h,pGetCoeff(p),r->cf);
2942  n_Normalize(d,r->cf);
2943  p_SetCoeff(p,d,r);
2944  pIter(p);
2945  }
2946  if (rField_is_Q_a(r))
2947  {
2948  loop
2949  {
2950  h = n_Init(1,r->cf);
2951  p=ph;
2952  while (p!=NULL)
2953  {
2954  d=n_NormalizeHelper(h,pGetCoeff(p),r->cf);
2955  n_Delete(&h,r->cf);
2956  h=d;
2957  pIter(p);
2958  }
2959  /* contains the 1/lcm of all denominators */
2960  if(!n_IsOne(h,r->cf))
2961  {
2962  p = ph;
2963  while (p!=NULL)
2964  {
2965  /* should be: // NOTE: don't use ->coef!!!!
2966  * number hh;
2967  * nGetDenom(p->coef,&hh);
2968  * nMult(&h,&hh,&d);
2969  * nNormalize(d);
2970  * nDelete(&hh);
2971  * nMult(d,p->coef,&hh);
2972  * nDelete(&d);
2973  * nDelete(&(p->coef));
2974  * p->coef =hh;
2975  */
2976  d=n_Mult(h,pGetCoeff(p),r->cf);
2977  n_Normalize(d,r->cf);
2978  p_SetCoeff(p,d,r);
2979  pIter(p);
2980  }
2981  number t=n_Mult(c,h,r->cf);
2982  n_Delete(&c,r->cf);
2983  c=t;
2984  }
2985  else
2986  {
2987  break;
2988  }
2989  n_Delete(&h,r->cf);
2990  }
2991  }
2992  }
2993  }
2994 
2995  if(!n_GreaterZero(pGetCoeff(ph),C))
2996  {
2997  ph = p_Neg(ph,r);
2998  c = n_InpNeg(c, C);
2999  }
3000 
3001 }
loop
Definition: myNF.cc:98
return P p
Definition: myNF.cc:203
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the one element.
Definition: coeffs.h:469
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:539
static BOOLEAN rField_is_Q_a(const ring r)
Definition: ring.h:488
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition: coeffs.h:579
static FORCE_INLINE number n_NormalizeHelper(number a, number b, const coeffs r)
assume that r is a quotient field (otherwise, return 1) for arguments (a1/a2,b1/b2) return (lcm(a1...
Definition: coeffs.h:716
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:824
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:401
static FORCE_INLINE BOOLEAN nCoeff_is_Q_a(const coeffs r)
Definition: coeffs.h:883
#define pIter(p)
Definition: monomials.h:44
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of &#39;a&#39; and &#39;b&#39;, i.e., a*b
Definition: coeffs.h:635
static FORCE_INLINE void n_ClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs r)
Computes the content and (inplace) divides it out on a collection of numbers number c is the content ...
Definition: coeffs.h:932
const ring r
Definition: syzextra.cc:208
This is a polynomial enumerator for simple iteration over coefficients of polynomials.
#define assume(x)
Definition: mod2.h:405
The main handler for Singular numbers which are suitable for Singular polynomials.
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:923
static FORCE_INLINE number n_Invers(number a, const coeffs r)
return the multiplicative inverse of &#39;a&#39;; raise an error if &#39;a&#39; is not invertible ...
Definition: coeffs.h:565
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)
Definition: coeffs.h:558
#define p_Test(p, r)
Definition: p_polys.h:160
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of &#39;a&#39; and &#39;b&#39;, i.e., a/b; raises an error if &#39;b&#39; is not invertible in r exceptio...
Definition: coeffs.h:615
#define pNext(p)
Definition: monomials.h:43
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1018
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff &#39;n&#39; is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2), where m is the long representing n in C: TRUE iff (Im(n) != 0 and Im(n) >= 0) or (Im(n) == 0 and Re(n) >= 0) in K(a)/<p(a)>: TRUE iff (n != 0 and (LC(n) > 0 or deg(n) > 0)) in K(t_1, ..., t_n): TRUE iff (LC(numerator(n) is a constant and > 0) or (LC(numerator(n) is not a constant) in Z/2^kZ: TRUE iff 0 < n <= 2^(k-1) in Z/mZ: TRUE iff the internal mpz is greater than zero in Z: TRUE iff n > 0
Definition: coeffs.h:495
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
static FORCE_INLINE void n_ClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &d, const coeffs r)
(inplace) Clears denominators on a collection of numbers number d is the LCM of all the coefficient d...
Definition: coeffs.h:939
static int p_Cmp ( poly  p1,
poly  p2,
ring  r 
)
inlinestatic

Definition at line 1523 of file p_polys.h.

1524 {
1525  if (p2==NULL)
1526  return 1;
1527  if (p1==NULL)
1528  return -1;
1529  return p_LmCmp(p1,p2,r);
1530 }
const ring r
Definition: syzextra.cc:208
static int p_LmCmp(poly p, poly q, const ring r)
Definition: p_polys.h:1472
#define NULL
Definition: omList.c:10
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
static int p_Comp_k_n ( poly  a,
poly  b,
int  k,
ring  r 
)
inlinestatic

Definition at line 636 of file p_polys.h.

637 {
638  if ((a==NULL) || (b==NULL) ) return FALSE;
641  pAssume2(k > 0 && k <= r->N);
642  int i=k;
643  for(;i<=r->N;i++)
644  {
645  if (p_GetExp(a,i,r) != p_GetExp(b,i,r)) return FALSE;
646  // if (a->exp[(r->VarOffset[i] & 0xffffff)] != b->exp[(r->VarOffset[i] & 0xffffff)]) return FALSE;
647  }
648  return TRUE;
649 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
int k
Definition: cfEzgcd.cc:93
#define pAssume2(cond)
Definition: monomials.h:201
const ring r
Definition: syzextra.cc:208
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:49
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 i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
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

Definition at line 4353 of file p_polys.cc.

4354 {
4355  number n,nn;
4356  pAssume(p1 != NULL && p2 != NULL);
4357 
4358  if (!p_LmEqual(p1,p2,r)) //compare leading mons
4359  return FALSE;
4360  if ((pNext(p1)==NULL) && (pNext(p2)!=NULL))
4361  return FALSE;
4362  if ((pNext(p2)==NULL) && (pNext(p1)!=NULL))
4363  return FALSE;
4364  if (pLength(p1) != pLength(p2))
4365  return FALSE;
4366 #ifdef HAVE_RINGS
4367  if (rField_is_Ring(r))
4368  {
4369  if (!n_DivBy(p_GetCoeff(p1, r), p_GetCoeff(p2, r), r)) return FALSE;
4370  }
4371 #endif
4372  n=n_Div(p_GetCoeff(p1,r),p_GetCoeff(p2,r),r);
4373  while ((p1 != NULL) /*&& (p2 != NULL)*/)
4374  {
4375  if ( ! p_LmEqual(p1, p2,r))
4376  {
4377  n_Delete(&n, r);
4378  return FALSE;
4379  }
4380  if (!n_Equal(p_GetCoeff(p1, r), nn = n_Mult(p_GetCoeff(p2, r),n, r->cf), r->cf))
4381  {
4382  n_Delete(&n, r);
4383  n_Delete(&nn, r);
4384  return FALSE;
4385  }
4386  n_Delete(&nn, r);
4387  pIter(p1);
4388  pIter(p2);
4389  }
4390  n_Delete(&n, r);
4391  return TRUE;
4392 }
#define FALSE
Definition: auxiliary.h:140
#define pAssume(cond)
Definition: monomials.h:98
#define TRUE
Definition: auxiliary.h:144
static int pLength(poly a)
Definition: p_polys.h:189
#define pIter(p)
Definition: monomials.h:44
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of &#39;a&#39; and &#39;b&#39;, i.e., a*b
Definition: coeffs.h:635
const ring r
Definition: syzextra.cc:208
static FORCE_INLINE BOOLEAN n_DivBy(number a, number b, const coeffs r)
test whether &#39;a&#39; is divisible &#39;b&#39;; for r encoding a field: TRUE iff &#39;b&#39; does not represent zero in Z:...
Definition: coeffs.h:771
#define p_LmEqual(p1, p2, r)
Definition: p_polys.h:1519
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:437
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of &#39;a&#39; and &#39;b&#39;, i.e., a/b; raises an error if &#39;b&#39; is not invertible in r exceptio...
Definition: coeffs.h:615
#define pNext(p)
Definition: monomials.h:43
static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
TRUE iff &#39;a&#39; and &#39;b&#39; represent the same number; they may have different representations.
Definition: coeffs.h:461
#define p_GetCoeff(p, r)
Definition: monomials.h:57
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
void p_Content ( poly  p,
const ring  r 
)

Definition at line 2182 of file p_polys.cc.

2183 {
2184  assume( ph != NULL );
2185 
2186  assume( r != NULL ); assume( r->cf != NULL );
2187 
2188 
2189 #if CLEARENUMERATORS
2190  if( 0 )
2191  {
2192  const coeffs C = r->cf;
2193  // experimentall (recursive enumerator treatment) of alg. Ext!
2194  CPolyCoeffsEnumerator itr(ph);
2195  n_ClearContent(itr, r->cf);
2196 
2197  p_Test(ph, r); n_Test(pGetCoeff(ph), C);
2198  assume(n_GreaterZero(pGetCoeff(ph), C)); // ??
2199 
2200  // if(!n_GreaterZero(pGetCoeff(ph),r->cf)) ph = p_Neg(ph,r);
2201  return;
2202  }
2203 #endif
2204 
2205 
2206 #ifdef HAVE_RINGS
2207  if (rField_is_Ring(r))
2208  {
2209  if (rField_has_Units(r))
2210  {
2211  number k = n_GetUnit(pGetCoeff(ph),r->cf);
2212  if (!n_IsOne(k,r->cf))
2213  {
2214  number tmpGMP = k;
2215  k = n_Invers(k,r->cf);
2216  n_Delete(&tmpGMP,r->cf);
2217  poly h = pNext(ph);
2218  p_SetCoeff(ph, n_Mult(pGetCoeff(ph), k,r->cf),r);
2219  while (h != NULL)
2220  {
2221  p_SetCoeff(h, n_Mult(pGetCoeff(h), k,r->cf),r);
2222  pIter(h);
2223  }
2224 // assume( n_GreaterZero(pGetCoeff(ph),r->cf) );
2225 // if(!n_GreaterZero(pGetCoeff(ph),r->cf)) ph = p_Neg(ph,r);
2226  }
2227  n_Delete(&k,r->cf);
2228  }
2229  return;
2230  }
2231 #endif
2232  number h,d;
2233  poly p;
2234 
2235  if(TEST_OPT_CONTENTSB) return;
2236  if(pNext(ph)==NULL)
2237  {
2238  p_SetCoeff(ph,n_Init(1,r->cf),r);
2239  }
2240  else
2241  {
2242  assume( pNext(ph) != NULL );
2243 #if CLEARENUMERATORS
2244  if( nCoeff_is_Q(r->cf) )
2245  {
2246  // experimentall (recursive enumerator treatment) of alg. Ext!
2247  CPolyCoeffsEnumerator itr(ph);
2248  n_ClearContent(itr, r->cf);
2249 
2250  p_Test(ph, r); n_Test(pGetCoeff(ph), r->cf);
2251  assume(n_GreaterZero(pGetCoeff(ph), r->cf)); // ??
2252 
2253  // if(!n_GreaterZero(pGetCoeff(ph),r->cf)) ph = p_Neg(ph,r);
2254  return;
2255  }
2256 #endif
2257 
2258  n_Normalize(pGetCoeff(ph),r->cf);
2259  if(!n_GreaterZero(pGetCoeff(ph),r->cf)) ph = p_Neg(ph,r);
2260  if (rField_is_Q(r)||(getCoeffType(r->cf)==n_transExt)) // should not be used anymore if CLEARENUMERATORS is 1
2261  {
2262  h=p_InitContent(ph,r);
2263  p=ph;
2264  }
2265  else
2266  {
2267  h=n_Copy(pGetCoeff(ph),r->cf);
2268  p = pNext(ph);
2269  }
2270  while (p!=NULL)
2271  {
2272  n_Normalize(pGetCoeff(p),r->cf);
2273  d=n_SubringGcd(h,pGetCoeff(p),r->cf);
2274  n_Delete(&h,r->cf);
2275  h = d;
2276  if(n_IsOne(h,r->cf))
2277  {
2278  break;
2279  }
2280  pIter(p);
2281  }
2282  p = ph;
2283  //number tmp;
2284  if(!n_IsOne(h,r->cf))
2285  {
2286  while (p!=NULL)
2287  {
2288  //d = nDiv(pGetCoeff(p),h);
2289  //tmp = nExactDiv(pGetCoeff(p),h);
2290  //if (!nEqual(d,tmp))
2291  //{
2292  // StringSetS("** div0:");nWrite(pGetCoeff(p));StringAppendS("/");
2293  // nWrite(h);StringAppendS("=");nWrite(d);StringAppendS(" int:");
2294  // nWrite(tmp);Print(StringEndS("\n")); // NOTE/TODO: use StringAppendS("\n"); omFree(s);
2295  //}
2296  //nDelete(&tmp);
2297  d = n_ExactDiv(pGetCoeff(p),h,r->cf);
2298  p_SetCoeff(p,d,r);
2299  pIter(p);
2300  }
2301  }
2302  n_Delete(&h,r->cf);
2303  if (rField_is_Q_a(r))
2304  {
2305  // special handling for alg. ext.:
2306  if (getCoeffType(r->cf)==n_algExt)
2307  {
2308  h = n_Init(1, r->cf->extRing->cf);
2309  p=ph;
2310  while (p!=NULL)
2311  { // each monom: coeff in Q_a
2312  poly c_n_n=(poly)pGetCoeff(p);
2313  poly c_n=c_n_n;
2314  while (c_n!=NULL)
2315  { // each monom: coeff in Q
2316  d=n_NormalizeHelper(h,pGetCoeff(c_n),r->cf->extRing->cf);
2317  n_Delete(&h,r->cf->extRing->cf);
2318  h=d;
2319  pIter(c_n);
2320  }
2321  pIter(p);
2322  }
2323  /* h contains the 1/lcm of all denominators in c_n_n*/
2324  //n_Normalize(h,r->cf->extRing->cf);
2325  if(!n_IsOne(h,r->cf->extRing->cf))
2326  {
2327  p=ph;
2328  while (p!=NULL)
2329  { // each monom: coeff in Q_a
2330  poly c_n=(poly)pGetCoeff(p);
2331  while (c_n!=NULL)
2332  { // each monom: coeff in Q
2333  d=n_Mult(h,pGetCoeff(c_n),r->cf->extRing->cf);
2334  n_Normalize(d,r->cf->extRing->cf);
2335  n_Delete(&pGetCoeff(c_n),r->cf->extRing->cf);
2336  pGetCoeff(c_n)=d;
2337  pIter(c_n);
2338  }
2339  pIter(p);
2340  }
2341  }
2342  n_Delete(&h,r->cf->extRing->cf);
2343  }
2344  /*else
2345  {
2346  // special handling for rat. functions.:
2347  number hzz =NULL;
2348  p=ph;
2349  while (p!=NULL)
2350  { // each monom: coeff in Q_a (Z_a)
2351  fraction f=(fraction)pGetCoeff(p);
2352  poly c_n=NUM(f);
2353  if (hzz==NULL)
2354  {
2355  hzz=n_Copy(pGetCoeff(c_n),r->cf->extRing->cf);
2356  pIter(c_n);
2357  }
2358  while ((c_n!=NULL)&&(!n_IsOne(hzz,r->cf->extRing->cf)))
2359  { // each monom: coeff in Q (Z)
2360  d=n_Gcd(hzz,pGetCoeff(c_n),r->cf->extRing->cf);
2361  n_Delete(&hzz,r->cf->extRing->cf);
2362  hzz=d;
2363  pIter(c_n);
2364  }
2365  pIter(p);
2366  }
2367  // hzz contains the gcd of all numerators in f
2368  h=n_Invers(hzz,r->cf->extRing->cf);
2369  n_Delete(&hzz,r->cf->extRing->cf);
2370  n_Normalize(h,r->cf->extRing->cf);
2371  if(!n_IsOne(h,r->cf->extRing->cf))
2372  {
2373  p=ph;
2374  while (p!=NULL)
2375  { // each monom: coeff in Q_a (Z_a)
2376  fraction f=(fraction)pGetCoeff(p);
2377  NUM(f)=p_Mult_nn(NUM(f),h,r->cf->extRing);
2378  p_Normalize(NUM(f),r->cf->extRing);
2379  pIter(p);
2380  }
2381  }
2382  n_Delete(&h,r->cf->extRing->cf);
2383  }*/
2384  }
2385  }
2386  if(!n_GreaterZero(pGetCoeff(ph),r->cf)) ph = p_Neg(ph,r);
2387 }
static FORCE_INLINE number n_GetUnit(number n, const coeffs r)
in Z: 1 in Z/kZ (where k is not a prime): largest divisor of n (taken in Z) that is co-prime with k i...
Definition: coeffs.h:533
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition: coeffs.h:38
return P p
Definition: myNF.cc:203
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the one element.
Definition: coeffs.h:469
#define TEST_OPT_CONTENTSB
Definition: options.h:121
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:539
static BOOLEAN rField_is_Q_a(const ring r)
Definition: ring.h:488
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition: coeffs.h:579
int k
Definition: cfEzgcd.cc:93
static FORCE_INLINE number n_NormalizeHelper(number a, number b, const coeffs r)
assume that r is a quotient field (otherwise, return 1) for arguments (a1/a2,b1/b2) return (lcm(a1...
Definition: coeffs.h:716
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:824
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:401
#define pIter(p)
Definition: monomials.h:44
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of &#39;a&#39; and &#39;b&#39;, i.e., a*b
Definition: coeffs.h:635
static FORCE_INLINE void n_ClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs r)
Computes the content and (inplace) divides it out on a collection of numbers number c is the content ...
Definition: coeffs.h:932
const ring r
Definition: syzextra.cc:208
This is a polynomial enumerator for simple iteration over coefficients of polynomials.
#define assume(x)
Definition: mod2.h:405
The main handler for Singular numbers which are suitable for Singular polynomials.
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:923
static FORCE_INLINE number n_Invers(number a, const coeffs r)
return the multiplicative inverse of &#39;a&#39;; raise an error if &#39;a&#39; is not invertible ...
Definition: coeffs.h:565
static number p_InitContent(poly ph, const ring r)
Definition: p_polys.cc:2449
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:461
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:422
#define p_Test(p, r)
Definition: p_polys.h:160
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:437
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of &#39;n&#39;
Definition: coeffs.h:452
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic ...
Definition: coeffs.h:35
#define pNext(p)
Definition: monomials.h:43
static FORCE_INLINE number n_ExactDiv(number a, number b, const coeffs r)
assume that there is a canonical subring in cf and we know that division is possible for these a and ...
Definition: coeffs.h:622
static FORCE_INLINE number n_SubringGcd(number a, number b, const coeffs r)
Definition: coeffs.h:687
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1018
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff &#39;n&#39; is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2), where m is the long representing n in C: TRUE iff (Im(n) != 0 and Im(n) >= 0) or (Im(n) == 0 and Re(n) >= 0) in K(a)/<p(a)>: TRUE iff (n != 0 and (LC(n) > 0 or deg(n) > 0)) in K(t_1, ..., t_n): TRUE iff (LC(numerator(n) is a constant and > 0) or (LC(numerator(n) is not a constant) in Z/2^kZ: TRUE iff 0 < n <= 2^(k-1) in Z/mZ: TRUE iff the internal mpz is greater than zero in Z: TRUE iff n > 0
Definition: coeffs.h:495
polyrec * poly
Definition: hilb.h:10
static BOOLEAN rField_has_Units(const ring r)
Definition: ring.h:443
static Poly * h
Definition: janet.cc:978
void p_ContentRat ( poly ph,
const ring  r 
)

Definition at line 1655 of file p_polys.cc.

1658 {
1659  // init array of RatLeadCoeffs
1660  // poly p_GetCoeffRat(poly p, int ishift, ring r);
1661 
1662  int len=pLength(ph);
1663  poly *C = (poly *)omAlloc0((len+1)*sizeof(poly)); //rat coeffs
1664  poly *LM = (poly *)omAlloc0((len+1)*sizeof(poly)); // rat lead terms
1665  int *D = (int *)omAlloc0((len+1)*sizeof(int)); //degrees of coeffs
1666  int *L = (int *)omAlloc0((len+1)*sizeof(int)); //lengths of coeffs
1667  int k = 0;
1668  poly p = p_Copy(ph, r); // ph will be needed below
1669  int mintdeg = p_Totaldegree(p, r);
1670  int minlen = len;
1671  int dd = 0; int i;
1672  int HasConstantCoef = 0;
1673  int is = r->real_var_start - 1;
1674  while (p!=NULL)
1675  {
1676  LM[k] = p_GetExp_k_n(p,1,is, r); // need LmRat istead of p_HeadRat(p, is, currRing); !
1677  C[k] = p_GetCoeffRat(p, is, r);
1678  D[k] = p_Totaldegree(C[k], r);
1679  mintdeg = si_min(mintdeg,D[k]);
1680  L[k] = pLength(C[k]);
1681  minlen = si_min(minlen,L[k]);
1682  if (p_IsConstant(C[k], r))
1683  {
1684  // C[k] = const, so the content will be numerical
1685  HasConstantCoef = 1;
1686  // smth like goto cleanup and return(pContent(p));
1687  }
1688  p_LmDeleteAndNextRat(&p, is, r);
1689  k++;
1690  }
1691 
1692  // look for 1 element of minimal degree and of minimal length
1693  k--;
1694  poly d;
1695  int mindeglen = len;
1696  if (k<=0) // this poly is not a ratgring poly -> pContent
1697  {
1698  p_Delete(&C[0], r);
1699  p_Delete(&LM[0], r);
1700  p_Content(ph, r);
1701  goto cleanup;
1702  }
1703 
1704  int pmindeglen;
1705  for(i=0; i<=k; i++)
1706  {
1707  if (D[i] == mintdeg)
1708  {
1709  if (L[i] < mindeglen)
1710  {
1711  mindeglen=L[i];
1712  pmindeglen = i;
1713  }
1714  }
1715  }
1716  d = p_Copy(C[pmindeglen], r);
1717  // there are dd>=1 mindeg elements
1718  // and pmideglen is the coordinate of one of the smallest among them
1719 
1720  // poly g = singclap_gcd(p_Copy(p,r),p_Copy(q,r));
1721  // return naGcd(d,d2,currRing);
1722 
1723  // adjoin pContentRat here?
1724  for(i=0; i<=k; i++)
1725  {
1726  d=singclap_gcd(d,p_Copy(C[i], r), r);
1727  if (p_Totaldegree(d, r)==0)
1728  {
1729  // cleanup, pContent, return
1730  p_Delete(&d, r);
1731  for(;k>=0;k--)
1732  {
1733  p_Delete(&C[k], r);
1734  p_Delete(&LM[k], r);
1735  }
1736  p_Content(ph, r);
1737  goto cleanup;
1738  }
1739  }
1740  for(i=0; i<=k; i++)
1741  {
1742  poly h=singclap_pdivide(C[i],d, r);
1743  p_Delete(&C[i], r);
1744  C[i]=h;
1745  }
1746 
1747  // zusammensetzen,
1748  p=NULL; // just to be sure
1749  for(i=0; i<=k; i++)
1750  {
1751  p = p_Add_q(p, p_Mult_q(C[i],LM[i], r), r);
1752  C[i]=NULL; LM[i]=NULL;
1753  }
1754  p_Delete(&ph, r); // do not need it anymore
1755  ph = p;
1756  // aufraeumen, return
1757 cleanup:
1758  omFree(C);
1759  omFree(LM);
1760  omFree(D);
1761  omFree(L);
1762 }
#define D(A)
Definition: gentable.cc:119
static int si_min(const int a, const int b)
Definition: auxiliary.h:167
return P p
Definition: myNF.cc:203
poly singclap_gcd(poly f, poly g, const ring r)
destroys f and g
Definition: clapsing.cc:287
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1435
int k
Definition: cfEzgcd.cc:93
poly singclap_pdivide(poly f, poly g, const ring r)
Definition: clapsing.cc:547
static int pLength(poly a)
Definition: p_polys.h:189
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:811
const ring r
Definition: syzextra.cc:208
#define omFree(addr)
Definition: omAllocDecl.h:261
static BOOLEAN p_IsConstant(const poly p, const ring r)
Definition: p_polys.h:1784
void p_LmDeleteAndNextRat(poly *p, int ishift, ring r)
Definition: p_polys.cc:1611
poly p_GetCoeffRat(poly p, int ishift, ring r)
Definition: p_polys.cc:1633
int i
Definition: cfEzgcd.cc:123
void p_Content(poly ph, const ring r)
Definition: p_polys.cc:2182
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
#define NULL
Definition: omList.c:10
static poly p_GetExp_k_n(poly p, int l, int k, const ring r)
Definition: p_polys.h:1300
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
static Poly * h
Definition: janet.cc:978
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1025
#define omAlloc0(size)
Definition: omAllocDecl.h:211
static poly p_Copy ( poly  p,
const ring  r 
)
inlinestatic

returns a copy of p

Definition at line 811 of file p_polys.h.

812 {
813  p_Test(p,r);
814  const poly pp = p_Copy_noCheck(p, r);
815  p_Test(pp,r);
816  return pp;
817 }
return P p
Definition: myNF.cc:203
poly pp
Definition: myNF.cc:296
static poly p_Copy_noCheck(poly p, const ring r)
returns a copy of p (without any additional testing)
Definition: p_polys.h:804
const ring r
Definition: syzextra.cc:208
#define p_Test(p, r)
Definition: p_polys.h:160
polyrec * poly
Definition: hilb.h:10
static poly p_Copy ( poly  p,
const ring  lmRing,
const ring  tailRing 
)
inlinestatic

Definition at line 833 of file p_polys.h.

834 {
835  if (p != NULL)
836  {
837 #ifndef PDEBUG
838  if (tailRing == lmRing)
839  return p_Copy_noCheck(p, tailRing);
840 #endif
841  poly pres = p_Head(p, lmRing);
842  pNext(pres) = p_Copy_noCheck(pNext(p), tailRing);
843  return pres;
844  }
845  else
846  return NULL;
847 }
BEGIN_NAMESPACE_SINGULARXX const ring lmRing
Definition: DebugPrint.h:30
return P p
Definition: myNF.cc:203
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
Definition: DebugPrint.h:30
static poly p_Copy_noCheck(poly p, const ring r)
returns a copy of p (without any additional testing)
Definition: p_polys.h:804
static poly p_Head(poly p, const ring r)
Definition: p_polys.h:819
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
static poly p_Copy_noCheck ( poly  p,
const ring  r 
)
inlinestatic

returns a copy of p (without any additional testing)

Definition at line 804 of file p_polys.h.

805 {
806  assume(r != NULL); assume(r->p_Procs != NULL); assume(r->p_Procs->p_Copy != NULL);
807  return r->p_Procs->p_Copy(p, r);
808 }
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static long p_DecrExp ( poly  p,
int  v,
ring  r 
)
inlinestatic

Definition at line 594 of file p_polys.h.

595 {
597  int e = p_GetExp(p,v,r);
598  pAssume2(e > 0);
599  e--;
600  return p_SetExp(p,v,e,r);
601 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
return P p
Definition: myNF.cc:203
#define pAssume2(cond)
Definition: monomials.h:201
const ring r
Definition: syzextra.cc:208
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
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:484
long p_Deg ( poly  a,
const ring  r 
)

Definition at line 586 of file p_polys.cc.

587 {
589 // assume(p_GetOrder(a, r) == p_WTotaldegree(a, r)); // WRONG assume!
590  return p_GetOrder(a, r);
591 }
const poly a
Definition: syzextra.cc:212
const ring r
Definition: syzextra.cc:208
static long p_GetOrder(poly p, ring r)
Definition: p_polys.h:410
BOOLEAN p_LmCheckPolyRing(poly p, ring r)
Definition: pDebug.cc:119
long p_DegW ( poly  p,
const short *  w,
const ring  R 
)

Definition at line 689 of file p_polys.cc.

690 {
691  p_Test(p, R);
692  assume( w != NULL );
693  long r=-LONG_MAX;
694 
695  while (p!=NULL)
696  {
697  long t=totaldegreeWecart_IV(p,R,w);
698  if (t>r) r=t;
699  pIter(p);
700  }
701  return r;
702 }
return P p
Definition: myNF.cc:203
long totaldegreeWecart_IV(poly p, ring r, const short *w)
Definition: weight.cc:239
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
const ring R
Definition: DebugPrint.cc:36
#define p_Test(p, r)
Definition: p_polys.h:160
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
static void p_Delete ( poly p,
const ring  r 
)
inlinestatic

Definition at line 850 of file p_polys.h.

851 {
852  assume( p!= NULL );
853  r->p_Procs->p_Delete(p, r);
854 }
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static void p_Delete ( poly p,
const ring  lmRing,
const ring  tailRing 
)
inlinestatic

Definition at line 856 of file p_polys.h.

857 {
858  assume( p!= NULL );
859  if (*p != NULL)
860  {
861 #ifndef PDEBUG
862  if (tailRing == lmRing)
863  {
864  p_Delete(p, tailRing);
865  return;
866  }
867 #endif
868  if (pNext(*p) != NULL)
869  p_Delete(&pNext(*p), tailRing);
870  p_LmDelete(p, lmRing);
871  }
872 }
BEGIN_NAMESPACE_SINGULARXX const ring lmRing
Definition: DebugPrint.h:30
return P p
Definition: myNF.cc:203
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
Definition: DebugPrint.h:30
#define assume(x)
Definition: mod2.h:405
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static void p_LmDelete(poly p, const ring r)
Definition: p_polys.h:707
void p_DeleteComp ( poly p,
int  k,
const ring  r 
)

Definition at line 3426 of file p_polys.cc.

3427 {
3428  poly q;
3429 
3430  while ((*p!=NULL) && (p_GetComp(*p,r)==k)) p_LmDelete(p,r);
3431  if (*p==NULL) return;
3432  q = *p;
3433  if (p_GetComp(q,r)>k)
3434  {
3435  p_SubComp(q,1,r);
3436  p_SetmComp(q,r);
3437  }
3438  while (pNext(q)!=NULL)
3439  {
3440  if (p_GetComp(pNext(q),r)==k)
3441  p_LmDelete(&(pNext(q)),r);
3442  else
3443  {
3444  pIter(q);
3445  if (p_GetComp(q,r)>k)
3446  {
3447  p_SubComp(q,1,r);
3448  p_SetmComp(q,r);
3449  }
3450  }
3451  }
3452 }
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
int k
Definition: cfEzgcd.cc:93
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
static unsigned long p_SubComp(poly p, unsigned long v, ring r)
Definition: p_polys.h:449
#define p_SetmComp
Definition: p_polys.h:233
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static void p_LmDelete(poly p, const ring r)
Definition: p_polys.h:707
polyrec * poly
Definition: hilb.h:10
poly p_Diff ( poly  a,
int  k,
const ring  r 
)

Definition at line 1809 of file p_polys.cc.

1810 {
1811  poly res, f, last;
1812  number t;
1813 
1814  last = res = NULL;
1815  while (a!=NULL)
1816  {
1817  if (p_GetExp(a,k,r)!=0)
1818  {
1819  f = p_LmInit(a,r);
1820  t = n_Init(p_GetExp(a,k,r),r->cf);
1821  pSetCoeff0(f,n_Mult(t,pGetCoeff(a),r->cf));
1822  n_Delete(&t,r->cf);
1823  if (n_IsZero(pGetCoeff(f),r->cf))
1824  p_LmDelete(&f,r);
1825  else
1826  {
1827  p_DecrExp(f,k,r);
1828  p_Setm(f,r);
1829  if (res==NULL)
1830  {
1831  res=last=f;
1832  }
1833  else
1834  {
1835  pNext(last)=f;
1836  last=f;
1837  }
1838  }
1839  }
1840  pIter(a);
1841  }
1842  return res;
1843 }
const poly a
Definition: syzextra.cc:212
f
Definition: cfModGcd.cc:4022
static poly last
Definition: hdegree.cc:1075
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:539
int k
Definition: cfEzgcd.cc:93
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
#define pIter(p)
Definition: monomials.h:44
poly res
Definition: myNF.cc:322
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of &#39;a&#39; and &#39;b&#39;, i.e., a*b
Definition: coeffs.h:635
const ring r
Definition: syzextra.cc:208
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
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the zero element.
Definition: coeffs.h:465
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static poly p_LmInit(poly p, const ring r)
Definition: p_polys.h:1263
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:436
#define pSetCoeff0(p, n)
Definition: monomials.h:67
static void p_LmDelete(poly p, const ring r)
Definition: p_polys.h:707
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
static long p_DecrExp(poly p, int v, ring r)
Definition: p_polys.h:594
polyrec * poly
Definition: hilb.h:10
poly p_DiffOp ( poly  a,
poly  b,
BOOLEAN  multiply,
const ring  r 
)

Definition at line 1884 of file p_polys.cc.

1885 {
1886  poly result=NULL;
1887  poly h;
1888  for(;a!=NULL;pIter(a))
1889  {
1890  for(h=b;h!=NULL;pIter(h))
1891  {
1892  result=p_Add_q(result,p_DiffOpM(a,h,multiply,r),r);
1893  }
1894  }
1895  return result;
1896 }
const poly a
Definition: syzextra.cc:212
static poly p_DiffOpM(poly a, poly b, BOOLEAN multiply, const ring r)
Definition: p_polys.cc:1845
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
static Poly * h
Definition: janet.cc:978
const poly b
Definition: syzextra.cc:213
return result
Definition: facAbsBiFact.cc:76
poly p_Div_nn ( poly  p,
const number  n,
const ring  r 
)

Definition at line 1480 of file p_polys.cc.

1481 {
1482  pAssume(!n_IsZero(n,r->cf));
1483  p_Test(p, r);
1484 
1485  poly q = p;
1486  while (p != NULL)
1487  {
1488  number nc = pGetCoeff(p);
1489  pSetCoeff0(p, n_Div(nc, n, r->cf));
1490  n_Delete(&nc, r->cf);
1491  pIter(p);
1492  }
1493  p_Test(q, r);
1494  return q;
1495 }
return P p
Definition: myNF.cc:203
#define pAssume(cond)
Definition: monomials.h:98
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the zero element.
Definition: coeffs.h:465
#define p_Test(p, r)
Definition: p_polys.h:160
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of &#39;a&#39; and &#39;b&#39;, i.e., a/b; raises an error if &#39;b&#39; is not invertible in r exceptio...
Definition: coeffs.h:615
#define pSetCoeff0(p, n)
Definition: monomials.h:67
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
polyrec * poly
Definition: hilb.h:10
poly p_Divide ( poly  a,
poly  b,
const ring  r 
)

Definition at line 1467 of file p_polys.cc.

1468 {
1469  assume((p_GetComp(a,r)==p_GetComp(b,r)) || (p_GetComp(b,r)==0));
1470  int i;
1471  poly result = p_Init(r);
1472 
1473  for(i=(int)r->N; i; i--)
1474  p_SetExp(result,i, p_GetExp(a,i,r)- p_GetExp(b,i,r),r);
1475  p_SetComp(result, p_GetComp(a,r) - p_GetComp(b,r),r);
1476  p_Setm(result,r);
1477  return result;
1478 }
const poly a
Definition: syzextra.cc:212
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:236
#define p_GetComp(p, r)
Definition: monomials.h:72
const ring r
Definition: syzextra.cc:208
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
#define assume(x)
Definition: mod2.h:405
int i
Definition: cfEzgcd.cc:123
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:484
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:436
polyrec * poly
Definition: hilb.h:10
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1248
const poly b
Definition: syzextra.cc:213
return result
Definition: facAbsBiFact.cc:76
poly p_DivideM ( poly  a,
poly  b,
const ring  r 
)

Definition at line 1501 of file p_polys.cc.

1502 {
1503  if (a==NULL) { p_Delete(&b,r); return NULL; }
1504  poly result=a;
1505  poly prev=NULL;
1506  int i;
1507 #ifdef HAVE_RINGS
1508  number inv=pGetCoeff(b);
1509 #else
1510  number inv=n_Invers(pGetCoeff(b),r->cf);
1511 #endif
1512 
1513  while (a!=NULL)
1514  {
1515  if (p_DivisibleBy(b,a,r))
1516  {
1517  for(i=(int)r->N; i; i--)
1518  p_SubExp(a,i, p_GetExp(b,i,r),r);
1519  p_SubComp(a, p_GetComp(b,r),r);
1520  p_Setm(a,r);
1521  prev=a;
1522  pIter(a);
1523  }
1524  else
1525  {
1526  if (prev==NULL)
1527  {
1528  p_LmDelete(&result,r);
1529  a=result;
1530  }
1531  else
1532  {
1533  p_LmDelete(&pNext(prev),r);
1534  a=pNext(prev);
1535  }
1536  }
1537  }
1538 #ifdef HAVE_RINGS
1539  if (n_IsUnit(inv,r->cf))
1540  {
1541  inv = n_Invers(inv,r->cf);
1542  p_Mult_nn(result,inv,r);
1543  n_Delete(&inv, r->cf);
1544  }
1545  else
1546  {
1547  p_Div_nn(result,inv,r);
1548  }
1549 #else
1550  p_Mult_nn(result,inv,r);
1551  n_Delete(&inv, r->cf);
1552 #endif
1553  p_Delete(&b, r);
1554  return result;
1555 }
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.
Definition: coeffs.h:516
const poly a
Definition: syzextra.cc:212
#define p_GetComp(p, r)
Definition: monomials.h:72
poly p_Div_nn(poly p, const number n, const ring r)
Definition: p_polys.cc:1480
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static long p_SubExp(poly p, int v, long ee, ring r)
Definition: p_polys.h:609
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
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
static BOOLEAN p_DivisibleBy(poly a, poly b, const ring r)
Definition: p_polys.h:1685
static FORCE_INLINE number n_Invers(number a, const coeffs r)
return the multiplicative inverse of &#39;a&#39;; raise an error if &#39;a&#39; is not invertible ...
Definition: coeffs.h:565
int i
Definition: cfEzgcd.cc:123
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:902
static unsigned long p_SubComp(poly p, unsigned long v, ring r)
Definition: p_polys.h:449
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:436
static void p_LmDelete(poly p, const ring r)
Definition: p_polys.h:707
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
polyrec * poly
Definition: hilb.h:10
const poly b
Definition: syzextra.cc:213
return result
Definition: facAbsBiFact.cc:76
static BOOLEAN p_DivisibleBy ( poly  a,
poly  b,
const ring  r 
)
inlinestatic

Definition at line 1685 of file p_polys.h.

1686 {
1689 
1690  if (a != NULL && (p_GetComp(a, r) == 0 || p_GetComp(a,r) == p_GetComp(b,r)))
1691  return _p_LmDivisibleByNoComp(a,b,r);
1692  return FALSE;
1693 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
#define p_GetComp(p, r)
Definition: monomials.h:72
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...
Definition: p_polys.h:1546
const ring r
Definition: syzextra.cc:208
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
#define pIfThen1(cond, check)
Definition: monomials.h:187
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
static BOOLEAN p_DivisibleBy ( poly  a,
const ring  r_a,
poly  b,
const ring  r_b 
)
inlinestatic

Definition at line 1694 of file p_polys.h.

1695 {
1696  pIfThen1(b!=NULL, p_LmCheckPolyRing1(b, r_b));
1697  pIfThen1(a!=NULL, p_LmCheckPolyRing1(a, r_a));
1698  if (a != NULL) {
1699  return _p_LmDivisibleBy(a, r_a, b, r_b);
1700  }
1701  return FALSE;
1702 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
static BOOLEAN _p_LmDivisibleBy(poly a, poly b, const ring r)
Definition: p_polys.h:1650
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
#define pIfThen1(cond, check)
Definition: monomials.h:187
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
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), 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 1559 of file p_polys.cc.

1560 {
1561  int exponent;
1562  for(int i = (int)rVar(r); i>0; i--)
1563  {
1564  exponent = p_GetExp(g, i, r) - p_GetExp(f, i, r);
1565  if (exponent < 0) return FALSE;
1566  }
1567  return n_DivBy(pGetCoeff(g), pGetCoeff(f), r->cf);
1568 }
#define FALSE
Definition: auxiliary.h:140
f
Definition: cfModGcd.cc:4022
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
g
Definition: cfModGcd.cc:4031
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
const ring r
Definition: syzextra.cc:208
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
static FORCE_INLINE BOOLEAN n_DivBy(number a, number b, const coeffs r)
test whether &#39;a&#39; is divisible &#39;b&#39;; for r encoding a field: TRUE iff &#39;b&#39; does not represent zero in Z:...
Definition: coeffs.h:771
int i
Definition: cfEzgcd.cc:123
int exponent(const CanonicalForm &f, int q)
int exponent ( const CanonicalForm & f, int q )
BOOLEAN p_EqualPolys ( poly  p1,
poly  p2,
const ring  r 
)

Definition at line 4289 of file p_polys.cc.

4290 {
4291  while ((p1 != NULL) && (p2 != NULL))
4292  {
4293  if (! p_LmEqual(p1, p2,r))
4294  return FALSE;
4295  if (! n_Equal(p_GetCoeff(p1,r), p_GetCoeff(p2,r),r->cf ))
4296  return FALSE;
4297  pIter(p1);
4298  pIter(p2);
4299  }
4300  return (p1==p2);
4301 }
#define FALSE
Definition: auxiliary.h:140
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
#define p_LmEqual(p1, p2, r)
Definition: p_polys.h:1519
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
TRUE iff &#39;a&#39; and &#39;b&#39; represent the same number; they may have different representations.
Definition: coeffs.h:461
#define p_GetCoeff(p, r)
Definition: monomials.h:57
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
BOOLEAN p_EqualPolys ( poly  p1,
poly  p2,
const ring  r1,
const ring  r2 
)

same as the usual p_EqualPolys for polys belonging to equal rings

Definition at line 4327 of file p_polys.cc.

4328 {
4329  assume( r1 == r2 || rSamePolyRep(r1, r2) ); // will be used in rEqual!
4330  assume( r1->cf == r2->cf );
4331 
4332  while ((p1 != NULL) && (p2 != NULL))
4333  {
4334  // returns 1 if ExpVector(p)==ExpVector(q): does not compare numbers !!
4335  // #define p_LmEqual(p1, p2, r) p_ExpVectorEqual(p1, p2, r)
4336 
4337  if (! p_ExpVectorEqual(p1, p2, r1, r2))
4338  return FALSE;
4339 
4340  if (! n_Equal(p_GetCoeff(p1,r1), p_GetCoeff(p2,r2), r1->cf ))
4341  return FALSE;
4342 
4343  pIter(p1);
4344  pIter(p2);
4345  }
4346  return (p1==p2);
4347 }
#define FALSE
Definition: auxiliary.h:140
#define pIter(p)
Definition: monomials.h:44
#define assume(x)
Definition: mod2.h:405
BOOLEAN rSamePolyRep(ring r1, ring r2)
returns TRUE, if r1 and r2 represents the monomials in the same way FALSE, otherwise this is an analo...
Definition: ring.cc:1681
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
TRUE iff &#39;a&#39; and &#39;b&#39; represent the same number; they may have different representations.
Definition: coeffs.h:461
#define p_GetCoeff(p, r)
Definition: monomials.h:57
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
static BOOLEAN p_ExpVectorEqual(poly p1, poly p2, const ring r1, const ring r2)
Definition: p_polys.cc:4303
static void p_ExpVectorAdd ( poly  p1,
poly  p2,
const ring  r 
)
inlinestatic

Definition at line 1339 of file p_polys.h.

1340 {
1341  p_LmCheckPolyRing1(p1, r);
1343 #if PDEBUG >= 1
1344  for (int i=1; i<=r->N; i++)
1345  pAssume1((unsigned long) (p_GetExp(p1, i, r) + p_GetExp(p2, i, r)) <= r->bitmask);
1346  pAssume1(p_GetComp(p1, r) == 0 || p_GetComp(p2, r) == 0);
1347 #endif
1348 
1349  p_MemAdd_LengthGeneral(p1->exp, p2->exp, r->ExpL_Size);
1351 }
#define p_GetComp(p, r)
Definition: monomials.h:72
const ring r
Definition: syzextra.cc:208
#define p_MemAdd_LengthGeneral(r, s, length)
Definition: p_MemAdd.h:173
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
static void p_MemAdd_NegWeightAdjust(poly p, const ring r)
Definition: p_polys.h:1220
int i
Definition: cfEzgcd.cc:123
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
#define pAssume1(cond)
Definition: monomials.h:179
static void p_ExpVectorAddSub ( poly  p1,
poly  p2,
poly  p3,
const ring  r 
)
inlinestatic

Definition at line 1384 of file p_polys.h.

1385 {
1386  p_LmCheckPolyRing1(p1, r);
1388  p_LmCheckPolyRing1(p3, r);
1389 #if PDEBUG >= 1
1390  for (int i=1; i<=r->N; i++)
1391  pAssume1(p_GetExp(p1, i, r) + p_GetExp(p2, i, r) >= p_GetExp(p3, i, r));
1392  pAssume1(p_GetComp(p1, r) == 0 ||
1393  (p_GetComp(p2, r) - p_GetComp(p3, r) == 0) ||
1394  (p_GetComp(p1, r) == p_GetComp(p2, r) - p_GetComp(p3, r)));
1395 #endif
1396 
1397  p_MemAddSub_LengthGeneral(p1->exp, p2->exp, p3->exp, r->ExpL_Size);
1398  // no need to adjust in case of NegWeights
1399 }
#define p_GetComp(p, r)
Definition: monomials.h:72
#define p_MemAddSub_LengthGeneral(r, s, t, length)
Definition: p_MemAdd.h:372
const ring r
Definition: syzextra.cc:208
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 i
Definition: cfEzgcd.cc:123
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
#define pAssume1(cond)
Definition: monomials.h:179
static void p_ExpVectorCopy ( poly  d_p,
poly  s_p,
const ring  r 
)
inlinestatic

Definition at line 1241 of file p_polys.h.

1242 {
1243  p_LmCheckPolyRing1(d_p, r);
1244  p_LmCheckPolyRing1(s_p, r);
1245  memcpy(d_p->exp, s_p->exp, r->ExpL_Size*sizeof(long));
1246 }
const ring r
Definition: syzextra.cc:208
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
static void p_ExpVectorDiff ( poly  pr,
poly  p1,
poly  p2,
const ring  r 
)
inlinestatic

Definition at line 1402 of file p_polys.h.

1403 {
1404  p_LmCheckPolyRing1(p1, r);
1406  p_LmCheckPolyRing1(pr, r);
1407 #if PDEBUG >= 2
1408  for (int i=1; i<=r->N; i++)
1409  pAssume1(p_GetExp(p1, i, r) >= p_GetExp(p2, i, r));
1410  pAssume1(!rRing_has_Comp(r) || p_GetComp(p1, r) == p_GetComp(p2, r));
1411 #endif
1412 
1413  p_MemDiff_LengthGeneral(pr->exp, p1->exp, p2->exp, r->ExpL_Size);
1415 }
#define p_GetComp(p, r)
Definition: monomials.h:72
static void p_MemSub_NegWeightAdjust(poly p, const ring r)
Definition: p_polys.h:1230
const ring r
Definition: syzextra.cc:208
#define p_MemDiff_LengthGeneral(r, s1, s2, length)
Definition: p_MemAdd.h:262
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 i
Definition: cfEzgcd.cc:123
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
#define rRing_has_Comp(r)
Definition: monomials.h:274
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
#define pAssume1(cond)
Definition: monomials.h:179
static BOOLEAN p_ExpVectorEqual ( poly  p1,
poly  p2,
const ring  r 
)
inlinestatic

Definition at line 1417 of file p_polys.h.

1418 {
1419  p_LmCheckPolyRing1(p1, r);
1421 
1422  int i = r->ExpL_Size;
1423  unsigned long *ep = p1->exp;
1424  unsigned long *eq = p2->exp;
1425 
1426  do
1427  {
1428  i--;
1429  if (ep[i] != eq[i]) return FALSE;
1430  }
1431  while (i);
1432  return TRUE;
1433 }
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
static void p_ExpVectorSub ( poly  p1,
poly  p2,
const ring  r 
)
inlinestatic

Definition at line 1368 of file p_polys.h.

1369 {
1370  p_LmCheckPolyRing1(p1, r);
1372 #if PDEBUG >= 1
1373  for (int i=1; i<=r->N; i++)
1374  pAssume1(p_GetExp(p1, i, r) >= p_GetExp(p2, i, r));
1375  pAssume1(p_GetComp(p1, r) == 0 || p_GetComp(p2, r) == 0 ||
1376  p_GetComp(p1, r) == p_GetComp(p2, r));
1377 #endif
1378 
1379  p_MemSub_LengthGeneral(p1->exp, p2->exp, r->ExpL_Size);
1381 
1382 }
#define p_GetComp(p, r)
Definition: monomials.h:72
static void p_MemSub_NegWeightAdjust(poly p, const ring r)
Definition: p_polys.h:1230
const ring r
Definition: syzextra.cc:208
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 i
Definition: cfEzgcd.cc:123
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
#define p_MemSub_LengthGeneral(r, s, length)
Definition: p_MemAdd.h:351
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
#define pAssume1(cond)
Definition: monomials.h:179
static void p_ExpVectorSum ( poly  pr,
poly  p1,
poly  p2,
const ring  r 
)
inlinestatic

Definition at line 1353 of file p_polys.h.

1354 {
1355  p_LmCheckPolyRing1(p1, r);
1357  p_LmCheckPolyRing1(pr, r);
1358 #if PDEBUG >= 1
1359  for (int i=1; i<=r->N; i++)
1360  pAssume1((unsigned long) (p_GetExp(p1, i, r) + p_GetExp(p2, i, r)) <= r->bitmask);
1361  pAssume1(p_GetComp(p1, r) == 0 || p_GetComp(p2, r) == 0);
1362 #endif
1363 
1364  p_MemSum_LengthGeneral(pr->exp, p1->exp, p2->exp, r->ExpL_Size);
1366 }
#define p_MemSum_LengthGeneral(r, s1, s2, length)
Definition: p_MemAdd.h:86
#define p_GetComp(p, r)
Definition: monomials.h:72
const ring r
Definition: syzextra.cc:208
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
static void p_MemAdd_NegWeightAdjust(poly p, const ring r)
Definition: p_polys.h:1220
int i
Definition: cfEzgcd.cc:123
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
#define pAssume1(cond)
Definition: monomials.h:179
poly p_Farey ( poly  p,
number  N,
const ring  r 
)

Definition at line 61 of file p_polys.cc.

62 {
63  poly h=p_Copy(p,r);
64  poly hh=h;
65  while(h!=NULL)
66  {
67  number c=pGetCoeff(h);
68  pSetCoeff0(h,n_Farey(c,N,r->cf));
69  n_Delete(&c,r->cf);
70  pIter(h);
71  }
72  while((hh!=NULL)&&(n_IsZero(pGetCoeff(hh),r->cf)))
73  {
74  p_LmDelete(&hh,r);
75  }
76  h=hh;
77  while((h!=NULL) && (pNext(h)!=NULL))
78  {
79  if(n_IsZero(pGetCoeff(pNext(h)),r->cf))
80  {
81  p_LmDelete(&pNext(h),r);
82  }
83  else pIter(h);
84  }
85  return hh;
86 }
return P p
Definition: myNF.cc:203
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:811
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:49
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the zero element.
Definition: coeffs.h:465
static FORCE_INLINE number n_Farey(number a, number b, const coeffs r)
Definition: coeffs.h:785
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
#define pSetCoeff0(p, n)
Definition: monomials.h:67
static void p_LmDelete(poly p, const ring r)
Definition: p_polys.h:707
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
static long p_FDeg ( const poly  p,
const ring  r 
)
inlinestatic

Definition at line 369 of file p_polys.h.

369 { return r->pFDeg(p,r); }
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
poly p_GetCoeffRat ( poly  p,
int  ishift,
ring  r 
)

Definition at line 1633 of file p_polys.cc.

1634 {
1635  poly q = pNext(p);
1636  poly res; // = p_Head(p,r);
1637  res = p_GetExp_k_n(p, ishift+1, r->N, r); // does pSetm internally
1638  p_SetCoeff(res,n_Copy(p_GetCoeff(p,r),r),r);
1639  poly s;
1640  long cmp = p_GetComp(p, r);
1641  while ( (q!= NULL) && (p_Comp_k_n(p, q, ishift+1, r)) && (p_GetComp(q, r) == cmp) )
1642  {
1643  s = p_GetExp_k_n(q, ishift+1, r->N, r);
1644  p_SetCoeff(s,n_Copy(p_GetCoeff(q,r),r),r);
1645  res = p_Add_q(res,s,r);
1646  q = pNext(q);
1647  }
1648  cmp = 0;
1649  p_SetCompP(res,cmp,r);
1650  return res;
1651 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:401
poly res
Definition: myNF.cc:322
const ring r
Definition: syzextra.cc:208
static int p_Comp_k_n(poly a, poly b, int k, ring r)
Definition: p_polys.h:636
static void p_SetCompP(poly p, int i, ring r)
Definition: p_polys.h:243
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of &#39;n&#39;
Definition: coeffs.h:452
#define pNext(p)
Definition: monomials.h:43
#define p_GetCoeff(p, r)
Definition: monomials.h:57
static poly p_GetExp_k_n(poly p, int l, int k, const ring r)
Definition: p_polys.h:1300
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
static long p_GetExp ( const poly  p,
const unsigned long  iBitmask,
const int  VarOffset 
)
inlinestatic

get a single variable exponent : the integer VarOffset encodes:

  1. the position of a variable in the exponent vector p->exp (lower 24 bits)
  2. number of bits to shift to the right in the upper 8 bits (which takes at most 6 bits for 64 bit) Thus VarOffset always has 2 zero higher bits!

Definition at line 465 of file p_polys.h.

466 {
467  pAssume2((VarOffset >> (24 + 6)) == 0);
468 #if 0
469  int pos=(VarOffset & 0xffffff);
470  int bitpos=(VarOffset >> 24);
471  unsigned long exp=(p->exp[pos] >> bitmask) & iBitmask;
472  return exp;
473 #else
474  return (long)
475  ((p->exp[(VarOffset & 0xffffff)] >> (VarOffset >> 24))
476  & iBitmask);
477 #endif
478 }
return P p
Definition: myNF.cc:203
#define pAssume2(cond)
Definition: monomials.h:201
p exp[i]
Definition: DebugPrint.cc:39
static long p_GetExp ( const poly  p,
const ring  r,
const int  VarOffset 
)
inlinestatic

Definition at line 551 of file p_polys.h.

552 {
554  pAssume2(VarOffset != -1);
555  return p_GetExp(p, r->bitmask, VarOffset);
556 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
return P p
Definition: myNF.cc:203
#define pAssume2(cond)
Definition: monomials.h:201
const ring r
Definition: syzextra.cc:208
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
static long p_GetExp ( const poly  p,
const int  v,
const ring  r 
)
inlinestatic

get v^th exponent for a monomial

Definition at line 568 of file p_polys.h.

569 {
571  pAssume2(v>0 && v <= r->N);
572  pAssume2(r->VarOffset[v] != -1);
573  return p_GetExp(p, r->bitmask, r->VarOffset[v]);
574 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
return P p
Definition: myNF.cc:203
#define pAssume2(cond)
Definition: monomials.h:201
const ring r
Definition: syzextra.cc:208
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:49
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
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
static poly p_GetExp_k_n ( poly  p,
int  l,
int  k,
const ring  r 
)
inlinestatic

Definition at line 1300 of file p_polys.h.

1301 {
1302  if (p == NULL) return NULL;
1304  poly np;
1305  omTypeAllocBin(poly, np, r->PolyBin);
1306  p_SetRingOfLm(np, r);
1307  memcpy(np->exp, p->exp, r->ExpL_Size*sizeof(long));
1308  pNext(np) = NULL;
1309  pSetCoeff0(np, n_Init(1, r->cf));
1310  int i;
1311  for(i=l;i<=k;i++)
1312  {
1313  //np->exp[(r->VarOffset[i] & 0xffffff)] =0;
1314  p_SetExp(np,i,0,r);
1315  }
1316  p_Setm(np,r);
1317  return np;
1318 }
return P p
Definition: myNF.cc:203
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:539
int k
Definition: cfEzgcd.cc:93
#define omTypeAllocBin(type, addr, bin)
Definition: omAllocDecl.h:203
const ring r
Definition: syzextra.cc:208
#define p_SetRingOfLm(p, r)
Definition: monomials.h:152
int i
Definition: cfEzgcd.cc:123
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:484
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:436
#define pSetCoeff0(p, n)
Definition: monomials.h:67
polyrec * poly
Definition: hilb.h:10
int l
Definition: cfEzgcd.cc:94
static long p_GetExpDiff ( poly  p1,
poly  p2,
int  i,
ring  r 
)
inlinestatic

Definition at line 631 of file p_polys.h.

632 {
633  return p_GetExp(p1,i,r) - p_GetExp(p2,i,r);
634 }
const ring r
Definition: syzextra.cc:208
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 i
Definition: cfEzgcd.cc:123
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
static long p_GetExpSum ( poly  p1,
poly  p2,
int  i,
ring  r 
)
inlinestatic

Definition at line 625 of file p_polys.h.

626 {
627  p_LmCheckPolyRing2(p1, r);
629  return p_GetExp(p1,i,r) + p_GetExp(p2,i,r);
630 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
const ring r
Definition: syzextra.cc:208
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 i
Definition: cfEzgcd.cc:123
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
static void p_GetExpV ( poly  p,
int *  ev,
const ring  r 
)
inlinestatic

Definition at line 1448 of file p_polys.h.

1449 {
1451  for (int j = r->N; j; j--)
1452  ev[j] = p_GetExp(p, j, r);
1453 
1454  ev[0] = p_GetComp(p, r);
1455 }
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
const ring r
Definition: syzextra.cc:208
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 p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
static unsigned long p_GetMaxExp ( const unsigned long  l,
const ring  r 
)
inlinestatic

Definition at line 743 of file p_polys.h.

744 {
745  unsigned long bitmask = r->bitmask;
746  unsigned long max = (l & bitmask);
747  unsigned long j = r->ExpPerLong - 1;
748 
749  if (j > 0)
750  {
751  unsigned long i = r->BitsPerExp;
752  long e;
753  loop
754  {
755  e = ((l >> i) & bitmask);
756  if ((unsigned long) e > max)
757  max = e;
758  j--;
759  if (j==0) break;
760  i += r->BitsPerExp;
761  }
762  }
763  return max;
764 }
loop
Definition: myNF.cc:98
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
static int max(int a, int b)
Definition: fast_mult.cc:264
int i
Definition: cfEzgcd.cc:123
int l
Definition: cfEzgcd.cc:94
static unsigned long p_GetMaxExp ( const poly  p,
const ring  r 
)
inlinestatic

Definition at line 766 of file p_polys.h.

767 {
768  return p_GetMaxExp(p_GetMaxExpL(p, r), r);
769 }
return P p
Definition: myNF.cc:203
static unsigned long p_GetMaxExp(const unsigned long l, const ring r)
Definition: p_polys.h:743
const ring r
Definition: syzextra.cc:208
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
Definition: p_polys.cc:1174
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

Definition at line 1174 of file p_polys.cc.

1175 {
1176  unsigned long l_p, divmask = r->divmask;
1177  int i;
1178 
1179  while (p != NULL)
1180  {
1181  l_p = p->exp[r->VarL_Offset[0]];
1182  if (l_p > l_max ||
1183  (((l_max & divmask) ^ (l_p & divmask)) != ((l_max-l_p) & divmask)))
1184  l_max = p_GetMaxExpL2(l_max, l_p, r);
1185  for (i=1; i<r->VarL_Size; i++)
1186  {
1187  l_p = p->exp[r->VarL_Offset[i]];
1188  // do the divisibility trick to find out whether l has an exponent
1189  if (l_p > l_max ||
1190  (((l_max & divmask) ^ (l_p & divmask)) != ((l_max-l_p) & divmask)))
1191  l_max = p_GetMaxExpL2(l_max, l_p, r);
1192  }
1193  pIter(p);
1194  }
1195  return l_max;
1196 }
return P p
Definition: myNF.cc:203
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
static unsigned long p_GetMaxExpL2(unsigned long l1, unsigned long l2, const ring r, unsigned long number_of_exp)
Definition: p_polys.cc:1106
poly p_GetMaxExpP ( poly  p,
ring  r 
)

return monomial r such that GetExp(r,i) is maximum of all monomials in p; coeff == 0, next == NULL, ord is not set

Definition at line 1137 of file p_polys.cc.

1138 {
1139  p_CheckPolyRing(p, r);
1140  if (p == NULL) return p_Init(r);
1141  poly max = p_LmInit(p, r);
1142  pIter(p);
1143  if (p == NULL) return max;
1144  int i, offset;
1145  unsigned long l_p, l_max;
1146  unsigned long divmask = r->divmask;
1147 
1148  do
1149  {
1150  offset = r->VarL_Offset[0];
1151  l_p = p->exp[offset];
1152  l_max = max->exp[offset];
1153  // do the divisibility trick to find out whether l has an exponent
1154  if (l_p > l_max ||
1155  (((l_max & divmask) ^ (l_p & divmask)) != ((l_max-l_p) & divmask)))
1156  max->exp[offset] = p_GetMaxExpL2(l_max, l_p, r);
1157 
1158  for (i=1; i<r->VarL_Size; i++)
1159  {
1160  offset = r->VarL_Offset[i];
1161  l_p = p->exp[offset];
1162  l_max = max->exp[offset];
1163  // do the divisibility trick to find out whether l has an exponent
1164  if (l_p > l_max ||
1165  (((l_max & divmask) ^ (l_p & divmask)) != ((l_max-l_p) & divmask)))
1166  max->exp[offset] = p_GetMaxExpL2(l_max, l_p, r);
1167  }
1168  pIter(p);
1169  }
1170  while (p != NULL);
1171  return max;
1172 }
return P p
Definition: myNF.cc:203
#define pIter(p)
Definition: monomials.h:44
BOOLEAN p_CheckPolyRing(poly p, ring r)
Definition: pDebug.cc:111
const ring r
Definition: syzextra.cc:208
static int max(int a, int b)
Definition: fast_mult.cc:264
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
static poly p_LmInit(poly p, const ring r)
Definition: p_polys.h:1263
static unsigned long p_GetMaxExpL2(unsigned long l1, unsigned long l2, const ring r, unsigned long number_of_exp)
Definition: p_polys.cc:1106
polyrec * poly
Definition: hilb.h:10
int offset
Definition: libparse.cc:1091
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1248
static long p_GetOrder ( poly  p,
ring  r 
)
inlinestatic

Definition at line 410 of file p_polys.h.

411 {
413  if (r->typ==NULL) return ((p)->exp[r->pOrdIndex]);
414  int i=0;
415  loop
416  {
417  switch(r->typ[i].ord_typ)
418  {
419  case ro_am:
420  case ro_wp_neg:
421  return ((p->exp[r->pOrdIndex])-POLY_NEGWEIGHT_OFFSET);
422  case ro_syzcomp:
423  case ro_syz:
424  case ro_cp:
425  i++;
426  break;
427  //case ro_dp:
428  //case ro_wp:
429  default:
430  return ((p)->exp[r->pOrdIndex]);
431  }
432  }
433 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
Definition: ring.h:68
#define POLY_NEGWEIGHT_OFFSET
Definition: monomials.h:244
loop
Definition: myNF.cc:98
return P p
Definition: myNF.cc:203
Definition: ring.h:66
Definition: ring.h:64
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
Definition: ring.h:62
p exp[i]
Definition: DebugPrint.cc:39
p_SetmProc p_GetSetmProc ( ring  r)

Definition at line 559 of file p_polys.cc.

560 {
561  // covers lp, rp, ls,
562  if (r->typ == NULL) return p_Setm_Dummy;
563 
564  if (r->OrdSize == 1)
565  {
566  if (r->typ[0].ord_typ == ro_dp &&
567  r->typ[0].data.dp.start == 1 &&
568  r->typ[0].data.dp.end == r->N &&
569  r->typ[0].data.dp.place == r->pOrdIndex)
570  return p_Setm_TotalDegree;
571  if (r->typ[0].ord_typ == ro_wp &&
572  r->typ[0].data.wp.start == 1 &&
573  r->typ[0].data.wp.end == r->N &&
574  r->typ[0].data.wp.place == r->pOrdIndex &&
575  r->typ[0].data.wp.weights == r->firstwv)
577  }
578  return p_Setm_General;
579 }
void p_Setm_General(poly p, const ring r)
Definition: p_polys.cc:163
Definition: ring.h:61
void p_Setm_WFirstTotalDegree(poly p, const ring r)
Definition: p_polys.cc:553
void p_Setm_TotalDegree(poly p, const ring r)
Definition: p_polys.cc:546
const ring r
Definition: syzextra.cc:208
void p_Setm_Dummy(poly p, const ring r)
Definition: p_polys.cc:540
#define NULL
Definition: omList.c:10
Definition: ring.h:60
unsigned long p_GetShortExpVector ( const poly  a,
const ring  r 
)

Definition at line 4557 of file p_polys.cc.

4558 {
4559  assume(p != NULL);
4560  unsigned long ev = 0; // short exponent vector
4561  unsigned int n = BIT_SIZEOF_LONG / r->N; // number of bits per exp
4562  unsigned int m1; // highest bit which is filled with (n+1)
4563  int i=0,j=1;
4564 
4565  if (n == 0)
4566  {
4567  if (r->N <2*BIT_SIZEOF_LONG)
4568  {
4569  n=1;
4570  m1=0;
4571  }
4572  else
4573  {
4574  for (; j<=r->N; j++)
4575  {
4576  if (p_GetExp(p,j,r) > 0) i++;
4577  if (i == BIT_SIZEOF_LONG) break;
4578  }
4579  if (i>0)
4580  ev = ~(0UL) >> (BIT_SIZEOF_LONG - i);
4581  return ev;
4582  }
4583  }
4584  else
4585  {
4586  m1 = (n+1)*(BIT_SIZEOF_LONG - n*r->N);
4587  }
4588 
4589  n++;
4590  while (i<m1)
4591  {
4592  ev |= GetBitFields(p_GetExp(p, j,r), i, n);
4593  i += n;
4594  j++;
4595  }
4596 
4597  n--;
4598  while (i<BIT_SIZEOF_LONG)
4599  {
4600  ev |= GetBitFields(p_GetExp(p, j,r), i, n);
4601  i += n;
4602  j++;
4603  }
4604  return ev;
4605 }
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
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 assume(x)
Definition: mod2.h:405
int i
Definition: cfEzgcd.cc:123
static unsigned long GetBitFields(const long e, const unsigned int s, const unsigned int n)
Definition: p_polys.cc:4524
#define NULL
Definition: omList.c:10
#define BIT_SIZEOF_LONG
Definition: auxiliary.h:124
unsigned long p_GetShortExpVector ( const poly  p,
const poly  pp,
const ring  r 
)

p_GetShortExpVector of p * pp

Definition at line 4609 of file p_polys.cc.

4610 {
4611  assume(p != NULL);
4612  assume(pp != NULL);
4613 
4614  unsigned long ev = 0; // short exponent vector
4615  unsigned int n = BIT_SIZEOF_LONG / r->N; // number of bits per exp
4616  unsigned int m1; // highest bit which is filled with (n+1)
4617  int j=1;
4618  unsigned long i = 0L;
4619 
4620  if (n == 0)
4621  {
4622  if (r->N <2*BIT_SIZEOF_LONG)
4623  {
4624  n=1;
4625  m1=0;
4626  }
4627  else
4628  {
4629  for (; j<=r->N; j++)
4630  {
4631  if (p_GetExp(p,j,r) > 0 || p_GetExp(pp,j,r) > 0) i++;
4632  if (i == BIT_SIZEOF_LONG) break;
4633  }
4634  if (i>0)
4635  ev = ~(0UL) >> (BIT_SIZEOF_LONG - i);
4636  return ev;
4637  }
4638  }
4639  else
4640  {
4641  m1 = (n+1)*(BIT_SIZEOF_LONG - n*r->N);
4642  }
4643 
4644  n++;
4645  while (i<m1)
4646  {
4647  ev |= GetBitFields(p_GetExp(p, j,r) + p_GetExp(pp, j,r), i, n);
4648  i += n;
4649  j++;
4650  }
4651 
4652  n--;
4653  while (i<BIT_SIZEOF_LONG)
4654  {
4655  ev |= GetBitFields(p_GetExp(p, j,r) + p_GetExp(pp, j,r), i, n);
4656  i += n;
4657  j++;
4658  }
4659  return ev;
4660 }
return P p
Definition: myNF.cc:203
poly pp
Definition: myNF.cc:296
const ring r
Definition: syzextra.cc:208
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 assume(x)
Definition: mod2.h:405
int i
Definition: cfEzgcd.cc:123
static unsigned long GetBitFields(const long e, const unsigned int s, const unsigned int n)
Definition: p_polys.cc:4524
#define NULL
Definition: omList.c:10
#define BIT_SIZEOF_LONG
Definition: auxiliary.h:124
static unsigned long p_GetTotalDegree ( const unsigned long  l,
const ring  r,
const int  number_of_exps 
)
inlinestatic

Definition at line 772 of file p_polys.h.

773 {
774  const unsigned long bitmask = r->bitmask;
775  unsigned long sum = (l & bitmask);
776  unsigned long j = number_of_exps - 1;
777 
778  if (j > 0)
779  {
780  unsigned long i = r->BitsPerExp;
781  loop
782  {
783  sum += ((l >> i) & bitmask);
784  j--;
785  if (j==0) break;
786  i += r->BitsPerExp;
787  }
788  }
789  return sum;
790 }
loop
Definition: myNF.cc:98
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
int l
Definition: cfEzgcd.cc:94
static unsigned long p_GetTotalDegree ( const unsigned long  l,
const ring  r 
)
inlinestatic

Definition at line 793 of file p_polys.h.

794 {
795  return p_GetTotalDegree(l, r, r->ExpPerLong);
796 }
static unsigned long p_GetTotalDegree(const unsigned long l, const ring r, const int number_of_exps)
Definition: p_polys.h:772
const ring r
Definition: syzextra.cc:208
int l
Definition: cfEzgcd.cc:94
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)

Definition at line 1272 of file p_polys.cc.

1273 {
1274  int i;
1275  int n=0;
1276  while(p!=NULL)
1277  {
1278  n=0;
1279  for(i=r->N; i>0; i--)
1280  {
1281  if(e[i]==0)
1282  {
1283  if (p_GetExp(p,i,r)>0)
1284  {
1285  e[i]=1;
1286  n++;
1287  }
1288  }
1289  else
1290  n++;
1291  }
1292  if (n==r->N) break;
1293  pIter(p);
1294  }
1295  return n;
1296 }
return P p
Definition: myNF.cc:203
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
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 i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
BOOLEAN p_HasNotCF ( poly  p1,
poly  p2,
const ring  r 
)

Definition at line 1334 of file p_polys.cc.

1335 {
1336 
1337  if (p_GetComp(p1,r) > 0 || p_GetComp(p2,r) > 0)
1338  return FALSE;
1339  int i = rVar(r);
1340  loop
1341  {
1342  if ((p_GetExp(p1, i, r) > 0) && (p_GetExp(p2, i, r) > 0))
1343  return FALSE;
1344  i--;
1345  if (i == 0)
1346  return TRUE;
1347  }
1348 }
loop
Definition: myNF.cc:98
#define FALSE
Definition: auxiliary.h:140
#define p_GetComp(p, r)
Definition: monomials.h:72
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
#define TRUE
Definition: auxiliary.h:144
const ring r
Definition: syzextra.cc:208
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 i
Definition: cfEzgcd.cc:123
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
static poly p_Head ( poly  p,
const ring  r 
)
inlinestatic

Definition at line 819 of file p_polys.h.

820 {
821  if (p == NULL) return NULL;
823  poly np;
824  omTypeAllocBin(poly, np, r->PolyBin);
825  p_SetRingOfLm(np, r);
826  memcpy(np->exp, p->exp, r->ExpL_Size*sizeof(long));
827  pNext(np) = NULL;
828  pSetCoeff0(np, n_Copy(pGetCoeff(p), r->cf));
829  return np;
830 }
return P p
Definition: myNF.cc:203
#define omTypeAllocBin(type, addr, bin)
Definition: omAllocDecl.h:203
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
const ring r
Definition: syzextra.cc:208
#define p_SetRingOfLm(p, r)
Definition: monomials.h:152
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of &#39;n&#39;
Definition: coeffs.h:452
#define pNext(p)
Definition: monomials.h:43
#define pSetCoeff0(p, n)
Definition: monomials.h:67
polyrec * poly
Definition: hilb.h:10
poly p_Homogen ( poly  p,
int  varnum,
const ring  r 
)

Definition at line 3138 of file p_polys.cc.

3139 {
3140  pFDegProc deg;
3141  if (r->pLexOrder && (r->order[0]==ringorder_lp))
3142  deg=p_Totaldegree;
3143  else
3144  deg=r->pFDeg;
3145 
3146  poly q=NULL, qn;
3147  int o,ii;
3148  sBucket_pt bp;
3149 
3150  if (p!=NULL)
3151  {
3152  if ((varnum < 1) || (varnum > rVar(r)))
3153  {
3154  return NULL;
3155  }
3156  o=deg(p,r);
3157  q=pNext(p);
3158  while (q != NULL)
3159  {
3160  ii=deg(q,r);
3161  if (ii>o) o=ii;
3162  pIter(q);
3163  }
3164  q = p_Copy(p,r);
3165  bp = sBucketCreate(r);
3166  while (q != NULL)
3167  {
3168  ii = o-deg(q,r);
3169  if (ii!=0)
3170  {
3171  p_AddExp(q,varnum, (long)ii,r);
3172  p_Setm(q,r);
3173  }
3174  qn = pNext(q);
3175  pNext(q) = NULL;
3176  sBucket_Add_p(bp, q, 1);
3177  q = qn;
3178  }
3179  sBucketDestroyAdd(bp, &q, &ii);
3180  }
3181  return q;
3182 }
return P p
Definition: myNF.cc:203
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
void sBucketDestroyAdd(sBucket_pt bucket, poly *p, int *length)
Definition: sbuckets.h:72
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1435
void sBucket_Add_p(sBucket_pt bucket, poly p, int length)
adds poly p to bucket destroys p!
Definition: sbuckets.cc:206
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:811
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
sBucket_pt sBucketCreate(ring r)
Definition: sbuckets.cc:125
#define NULL
Definition: omList.c:10
long(* pFDegProc)(poly p, ring r)
Definition: ring.h:46
#define pNext(p)
Definition: monomials.h:43
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:436
static long p_AddExp(poly p, int v, long ee, ring r)
Definition: p_polys.h:602
polyrec * poly
Definition: hilb.h:10
static long p_IncrExp ( poly  p,
int  v,
ring  r 
)
inlinestatic

Definition at line 587 of file p_polys.h.

588 {
590  int e = p_GetExp(p,v,r);
591  e++;
592  return p_SetExp(p,v,e,r);
593 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
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
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:484
static poly p_Init ( const ring  r,
omBin  bin 
)
inlinestatic

Definition at line 1248 of file p_polys.h.

1249 {
1250  p_CheckRing1(r);
1251  pAssume1(bin != NULL && omSizeWOfBin(r->PolyBin) == omSizeWOfBin(bin));
1252  poly p;
1253  omTypeAlloc0Bin(poly, p, bin);
1255  p_SetRingOfLm(p, r);
1256  return p;
1257 }
return P p
Definition: myNF.cc:203
#define p_CheckRing1(r)
Definition: monomials.h:186
const ring r
Definition: syzextra.cc:208
#define p_SetRingOfLm(p, r)
Definition: monomials.h:152
static void p_MemAdd_NegWeightAdjust(poly p, const ring r)
Definition: p_polys.h:1220
#define omTypeAlloc0Bin(type, addr, bin)
Definition: omAllocDecl.h:204
#define NULL
Definition: omList.c:10
#define omSizeWOfBin(bin_ptr)
polyrec * poly
Definition: hilb.h:10
#define pAssume1(cond)
Definition: monomials.h:179
static poly p_Init ( const ring  r)
inlinestatic

Definition at line 1258 of file p_polys.h.

1259 {
1260  return p_Init(r, r->PolyBin);
1261 }
const ring r
Definition: syzextra.cc:208
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1248
poly p_Invers ( int  n,
poly  u,
intvec w,
const ring  R 
)

Definition at line 4261 of file p_polys.cc.

4262 {
4263  if(n<0)
4264  return NULL;
4265  number u0=n_Invers(pGetCoeff(u),R->cf);
4266  poly v=p_NSet(u0,R);
4267  if(n==0)
4268  return v;
4269  short *ww=iv2array(w,R);
4270  poly u1=p_JetW(p_Sub(p_One(R),p_Mult_nn(u,u0,R),R),n,ww,R);
4271  if(u1==NULL)
4272  {
4273  omFreeSize((ADDRESS)ww,(rVar(R)+1)*sizeof(short));
4274  return v;
4275  }
4276  poly v1=p_Mult_nn(p_Copy(u1,R),u0,R);
4277  v=p_Add_q(v,p_Copy(v1,R),R);
4278  for(int i=n/p_MinDeg(u1,w,R);i>1;i--)
4279  {
4280  v1=p_JetW(p_Mult_q(v1,p_Copy(u1,R),R),n,ww,R);
4281  v=p_Add_q(v,p_Copy(v1,R),R);
4282  }
4283  p_Delete(&u1,R);
4284  p_Delete(&v1,R);
4285  omFreeSize((ADDRESS)ww,(rVar(R)+1)*sizeof(short));
4286  return v;
4287 }
short * iv2array(intvec *iv, const ring R)
Definition: weight.cc:208
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
Definition: p_polys.cc:1448
int p_MinDeg(poly p, intvec *w, const ring R)
Definition: p_polys.cc:4225
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
void * ADDRESS
Definition: auxiliary.h:161
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
poly p_Sub(poly p1, poly p2, const ring r)
Definition: p_polys.cc:1901
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:811
poly p_One(const ring r)
Definition: p_polys.cc:1318
const ring R
Definition: DebugPrint.cc:36
static FORCE_INLINE number n_Invers(number a, const coeffs r)
return the multiplicative inverse of &#39;a&#39;; raise an error if &#39;a&#39; is not invertible ...
Definition: coeffs.h:565
int i
Definition: cfEzgcd.cc:123
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:902
poly p_JetW(poly p, int m, short *w, const ring R)
Definition: p_polys.cc:4207
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1025
static BOOLEAN p_IsConstant ( const poly  p,
const ring  r 
)
inlinestatic

Definition at line 1784 of file p_polys.h.

1785 {
1786  if (p == NULL) return TRUE;
1787  p_Test(p, r);
1788  return (pNext(p)==NULL) && p_LmIsConstant(p, r);
1789 }
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:144
static BOOLEAN p_LmIsConstant(const poly p, const ring r)
Definition: p_polys.h:954
const ring r
Definition: syzextra.cc:208
#define p_Test(p, r)
Definition: p_polys.h:160
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static BOOLEAN p_IsConstantComp ( const poly  p,
const ring  r 
)
inlinestatic

Definition at line 1778 of file p_polys.h.

1779 {
1780  if (p == NULL) return TRUE;
1781  return (pNext(p)==NULL) && p_LmIsConstantComp(p, r);
1782 }
static BOOLEAN p_LmIsConstantComp(const poly p, const ring r)
Definition: p_polys.h:937
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:144
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static BOOLEAN p_IsConstantPoly ( const poly  p,
const ring  r 
)
inlinestatic

Definition at line 1798 of file p_polys.h.

1799 {
1800  p_Test(p, r);
1801  poly pp=p;
1802  while(pp!=NULL)
1803  {
1804  if (! p_LmIsConstantComp(pp, r))
1805  return FALSE;
1806  pIter(pp);
1807  }
1808  return TRUE;
1809 }
static BOOLEAN p_LmIsConstantComp(const poly p, const ring r)
Definition: p_polys.h:937
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:144
poly pp
Definition: myNF.cc:296
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
#define p_Test(p, r)
Definition: p_polys.h:160
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
poly p_ISet ( long  i,
const ring  r 
)

returns the poly representing the integer i

Definition at line 1302 of file p_polys.cc.

1303 {
1304  poly rc = NULL;
1305  if (i!=0)
1306  {
1307  rc = p_Init(r);
1308  pSetCoeff0(rc,n_Init(i,r->cf));
1309  if (n_IsZero(pGetCoeff(rc),r->cf))
1310  p_LmDelete(&rc,r);
1311  }
1312  return rc;
1313 }
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:539
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the zero element.
Definition: coeffs.h:465
#define NULL
Definition: omList.c:10
#define pSetCoeff0(p, n)
Definition: monomials.h:67
static void p_LmDelete(poly p, const ring r)
Definition: p_polys.h:707
polyrec * poly
Definition: hilb.h:10
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1248
BOOLEAN p_IsHomogeneous ( poly  p,
const ring  r 
)

Definition at line 3187 of file p_polys.cc.

3188 {
3189  poly qp=p;
3190  int o;
3191 
3192  if ((p == NULL) || (pNext(p) == NULL)) return TRUE;
3193  pFDegProc d;
3194  if (r->pLexOrder && (r->order[0]==ringorder_lp))
3195  d=p_Totaldegree;
3196  else
3197  d=r->pFDeg;
3198  o = d(p,r);
3199  do
3200  {
3201  if (d(qp,r) != o) return FALSE;
3202  pIter(qp);
3203  }
3204  while (qp != NULL);
3205  return TRUE;
3206 }
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:144
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1435
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
long(* pFDegProc)(poly p, ring r)
Definition: ring.h:46
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
static BOOLEAN p_IsOne ( const poly  p,
const ring  R 
)
inlinestatic

either poly(1) or gen(k)?!

Definition at line 1792 of file p_polys.h.

1793 {
1794  p_Test(p, R);
1795  return (p_IsConstant(p, R) && n_IsOne(p_GetCoeff(p, R), R->cf));
1796 }
return P p
Definition: myNF.cc:203
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the one element.
Definition: coeffs.h:469
static BOOLEAN p_IsConstant(const poly p, const ring r)
Definition: p_polys.h:1784
const ring R
Definition: DebugPrint.cc:36
#define p_Test(p, r)
Definition: p_polys.h:160
#define p_GetCoeff(p, r)
Definition: monomials.h:57
int p_IsPurePower ( const poly  p,
const ring  r 
)

return i, if head depends only on var(i)

Definition at line 1224 of file p_polys.cc.

1225 {
1226 #ifdef HAVE_RINGS
1227  if (rField_is_Ring(r))
1228  {
1229  if (p == NULL) return 0;
1230  if (!n_IsUnit(pGetCoeff(p), r->cf)) return 0;
1231  }
1232 #endif
1233  int i,k=0;
1234 
1235  for (i=r->N;i;i--)
1236  {
1237  if (p_GetExp(p,i, r)!=0)
1238  {
1239  if(k!=0) return 0;
1240  k=i;
1241  }
1242  }
1243  return k;
1244 }
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.
Definition: coeffs.h:516
return P p
Definition: myNF.cc:203
int k
Definition: cfEzgcd.cc:93
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
const ring r
Definition: syzextra.cc:208
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 i
Definition: cfEzgcd.cc:123
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:437
#define NULL
Definition: omList.c:10
static BOOLEAN p_IsUnit ( const poly  p,
const ring  r 
)
inlinestatic

Definition at line 1811 of file p_polys.h.

1812 {
1813  if (p == NULL) return FALSE;
1814 #ifdef HAVE_RINGS
1815  if (rField_is_Ring(r))
1816  return (p_LmIsConstant(p, r) && n_IsUnit(pGetCoeff(p),r->cf));
1817 #endif
1818  return p_LmIsConstant(p, r);
1819 }
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.
Definition: coeffs.h:516
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static BOOLEAN p_LmIsConstant(const poly p, const ring r)
Definition: p_polys.h:954
const ring r
Definition: syzextra.cc:208
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:437
#define NULL
Definition: omList.c:10
int p_IsUnivariate ( poly  p,
const ring  r 
)

return i, if poly depends only on var(i)

Definition at line 1252 of file p_polys.cc.

1253 {
1254  int i,k=-1;
1255 
1256  while (p!=NULL)
1257  {
1258  for (i=r->N;i;i--)
1259  {
1260  if (p_GetExp(p,i, r)!=0)
1261  {
1262  if((k!=-1)&&(k!=i)) return 0;
1263  k=i;
1264  }
1265  }
1266  pIter(p);
1267  }
1268  return k;
1269 }
return P p
Definition: myNF.cc:203
int k
Definition: cfEzgcd.cc:93
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
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 i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
poly p_Jet ( poly  p,
int  m,
const ring  R 
)

Definition at line 4163 of file p_polys.cc.

4164 {
4165  while((p!=NULL) && (p_Totaldegree(p,R)>m)) p_LmDelete(&p,R);
4166  if (p==NULL) return NULL;
4167  poly r=p;
4168  while (pNext(p)!=NULL)
4169  {
4170  if (p_Totaldegree(pNext(p),R)>m)
4171  {
4172  p_LmDelete(&pNext(p),R);
4173  }
4174  else
4175  pIter(p);
4176  }
4177  return r;
4178 }
return P p
Definition: myNF.cc:203
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1435
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
const ring R
Definition: DebugPrint.cc:36
int m
Definition: cfEzgcd.cc:119
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static void p_LmDelete(poly p, const ring r)
Definition: p_polys.h:707
polyrec * poly
Definition: hilb.h:10
poly p_JetW ( poly  p,
int  m,
short *  w,
const ring  R 
)

Definition at line 4207 of file p_polys.cc.

4208 {
4209  while((p!=NULL) && (totaldegreeWecart_IV(p,R,w)>m)) p_LmDelete(&p,R);
4210  if (p==NULL) return NULL;
4211  poly r=p;
4212  while (pNext(p)!=NULL)
4213  {
4214  if (totaldegreeWecart_IV(pNext(p),R,w)>m)
4215  {
4216  p_LmDelete(&pNext(p),R);
4217  }
4218  else
4219  pIter(p);
4220  }
4221  return r;
4222 }
return P p
Definition: myNF.cc:203
long totaldegreeWecart_IV(poly p, ring r, const short *w)
Definition: weight.cc:239
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
const ring R
Definition: DebugPrint.cc:36
int m
Definition: cfEzgcd.cc:119
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
#define pNext(p)
Definition: monomials.h:43
static void p_LmDelete(poly p, const ring r)
Definition: p_polys.h:707
polyrec * poly
Definition: hilb.h:10
poly p_Last ( const poly  a,
int &  l,
const ring  r 
)

Definition at line 4398 of file p_polys.cc.

4399 {
4400  if (p == NULL)
4401  {
4402  l = 0;
4403  return NULL;
4404  }
4405  l = 1;
4406  poly a = p;
4407  if (! rIsSyzIndexRing(r))
4408  {
4409  poly next = pNext(a);
4410  while (next!=NULL)
4411  {
4412  a = next;
4413  next = pNext(a);
4414  l++;
4415  }
4416  }
4417  else
4418  {
4419  int curr_limit = rGetCurrSyzLimit(r);
4420  poly pp = a;
4421  while ((a=pNext(a))!=NULL)
4422  {
4423  if (p_GetComp(a,r)<=curr_limit/*syzComp*/)
4424  l++;
4425  else break;
4426  pp = a;
4427  }
4428  a=pp;
4429  }
4430  return a;
4431 }
const poly a
Definition: syzextra.cc:212
return P p
Definition: myNF.cc:203
static BOOLEAN rIsSyzIndexRing(const ring r)
Definition: ring.h:714
#define p_GetComp(p, r)
Definition: monomials.h:72
static int rGetCurrSyzLimit(const ring r)
Definition: ring.h:717
poly pp
Definition: myNF.cc:296
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
int l
Definition: cfEzgcd.cc:94
ListNode * next
Definition: janet.h:31
void p_Lcm ( const poly  a,
const poly  b,
poly  m,
const ring  r 
)

Definition at line 1572 of file p_polys.cc.

1573 {
1574  for (int i=rVar(r); i; --i)
1575  p_SetExp(m,i, si_max( p_GetExp(a,i,r), p_GetExp(b,i,r)),r);
1576 
1578  /* Don't do a pSetm here, otherwise hres/lres chockes */
1579 }
const poly a
Definition: syzextra.cc:212
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:236
#define p_GetComp(p, r)
Definition: monomials.h:72
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
const ring r
Definition: syzextra.cc:208
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 m
Definition: cfEzgcd.cc:119
static int si_max(const int a, const int b)
Definition: auxiliary.h:166
int i
Definition: cfEzgcd.cc:123
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:484
const poly b
Definition: syzextra.cc:213
poly p_LcmRat ( const poly  a,
const poly  b,
const long  lCompM,
const ring  r 
)

Definition at line 1588 of file p_polys.cc.

1589 {
1590  poly m = // p_One( r);
1591  p_Init(r);
1592 
1593 // const int (currRing->N) = r->N;
1594 
1595  // for (int i = (currRing->N); i>=r->real_var_start; i--)
1596  for (int i = r->real_var_end; i>=r->real_var_start; i--)
1597  {
1598  const int lExpA = p_GetExp (a, i, r);
1599  const int lExpB = p_GetExp (b, i, r);
1600 
1601  p_SetExp (m, i, si_max(lExpA, lExpB), r);
1602  }
1603 
1604  p_SetComp (m, lCompM, r);
1605  p_Setm(m,r);
1606  n_New(&(p_GetCoeff(m, r)), r);
1607 
1608  return(m);
1609 };
#define n_New(n, r)
Definition: coeffs.h:441
const poly a
Definition: syzextra.cc:212
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:236
const ring r
Definition: syzextra.cc:208
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 m
Definition: cfEzgcd.cc:119
static int si_max(const int a, const int b)
Definition: auxiliary.h:166
int i
Definition: cfEzgcd.cc:123
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:484
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:436
#define p_GetCoeff(p, r)
Definition: monomials.h:57
polyrec * poly
Definition: hilb.h:10
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1248
const poly b
Definition: syzextra.cc:213
static long p_LDeg ( const poly  p,
int *  l,
const ring  r 
)
inlinestatic

Definition at line 370 of file p_polys.h.

370 { return r->pLDeg(p,l,r); }
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
int l
Definition: cfEzgcd.cc:94
BOOLEAN p_LmCheckIsFromRing ( poly  p,
ring  r 
)

Definition at line 71 of file pDebug.cc.

72 {
73  if (p != NULL)
74  {
75  #if (OM_TRACK > 0) && defined(OM_TRACK_CUSTOM)
76  void* custom = omGetCustomOfAddr(p);
77  if (custom != NULL)
78  {
79  pPolyAssumeReturnMsg(custom == r ||
80  // be more sloppy for qrings
81  (r->qideal != NULL &&
82  omIsBinPageAddr(p) &&
83  omSizeWOfAddr(p)==omSizeWOfBin(r->PolyBin)) ||
84  rSamePolyRep((ring) custom, r),
85  "monomial not from specified ring",p,r);
86  return TRUE;
87  }
88  else
89  #endif
90  #ifndef X_OMALLOC
91  {
93  return TRUE;
94  }
95  return FALSE;
96  #endif
97  }
98  return TRUE;
99 }
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:144
size_t omSizeWOfAddr(void *addr)
#define _pPolyAssumeReturn(cond, p, r)
Definition: monomials.h:109
const ring r
Definition: syzextra.cc:208
BOOLEAN rSamePolyRep(ring r1, ring r2)
returns TRUE, if r1 and r2 represents the monomials in the same way FALSE, otherwise this is an analo...
Definition: ring.cc:1681
#define NULL
Definition: omList.c:10
#define omIsBinPageAddr(addr)
Definition: omBinPage.h:71
#define omSizeWOfBin(bin_ptr)
#define pPolyAssumeReturnMsg(cond, msg)
Definition: monomials.h:145
BOOLEAN p_LmCheckPolyRing ( poly  p,
ring  r 
)

Definition at line 119 of file pDebug.cc.

120 {
121  #ifndef X_OMALLOC
122  pAssumeReturn(r != NULL && r->PolyBin != NULL);
123  #endif
124  pAssumeReturn(p != NULL);
125  return p_LmCheckIsFromRing(p, r);
126 }
return P p
Definition: myNF.cc:203
#define pAssumeReturn(cond)
Definition: monomials.h:86
BOOLEAN p_LmCheckIsFromRing(poly p, ring r)
Definition: pDebug.cc:71
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
static int p_LmCmp ( poly  p,
poly  q,
const ring  r 
)
inlinestatic

Definition at line 1472 of file p_polys.h.

1473 {
1475  p_LmCheckPolyRing1(q, r);
1476 
1477  const unsigned long* _s1 = ((unsigned long*) p->exp);
1478  const unsigned long* _s2 = ((unsigned long*) q->exp);
1479  register unsigned long _v1;
1480  register unsigned long _v2;
1481  const unsigned long _l = r->CmpL_Size;
1482 
1483  register unsigned long _i=0;
1484 
1485  LengthGeneral_OrdGeneral_LoopTop:
1486  _v1 = _s1[_i];
1487  _v2 = _s2[_i];
1488  if (_v1 == _v2)
1489  {
1490  _i++;
1491  if (_i == _l) return 0;
1492  goto LengthGeneral_OrdGeneral_LoopTop;
1493  }
1494  const long* _ordsgn = (long*) r->ordsgn;
1495  if (_v1 > _v2)
1496  {
1497  if (_ordsgn[_i] == 1) return 1;
1498  return -1;
1499  }
1500  if (_ordsgn[_i] == 1) return -1;
1501  return 1;
1502 
1503 }
if(0 > strat->sl)
Definition: myNF.cc:73
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
static void p_LmDelete ( poly  p,
const ring  r 
)
inlinestatic

Definition at line 707 of file p_polys.h.

708 {
710  n_Delete(&pGetCoeff(p), r->cf);
711  omFreeBinAddr(p);
712 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
return P p
Definition: myNF.cc:203
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
const ring r
Definition: syzextra.cc:208
#define omFreeBinAddr(addr)
Definition: omAllocDecl.h:258
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
static void p_LmDelete ( poly p,
const ring  r 
)
inlinestatic

Definition at line 713 of file p_polys.h.

714 {
716  poly h = *p;
717  *p = pNext(h);
718  n_Delete(&pGetCoeff(h), r->cf);
719  omFreeBinAddr(h);
720 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
return P p
Definition: myNF.cc:203
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
const ring r
Definition: syzextra.cc:208
#define omFreeBinAddr(addr)
Definition: omAllocDecl.h:258
#define pNext(p)
Definition: monomials.h:43
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
static poly p_LmDeleteAndNext ( poly  p,
const ring  r 
)
inlinestatic

Definition at line 721 of file p_polys.h.

722 {
724  poly pnext = pNext(p);
725  n_Delete(&pGetCoeff(p), r->cf);
726  omFreeBinAddr(p);
727  return pnext;
728 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
return P p
Definition: myNF.cc:203
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
const ring r
Definition: syzextra.cc:208
#define omFreeBinAddr(addr)
Definition: omAllocDecl.h:258
#define pNext(p)
Definition: monomials.h:43
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
polyrec * poly
Definition: hilb.h:10
void p_LmDeleteAndNextRat ( poly p,
int  ishift,
ring  r 
)

Definition at line 1611 of file p_polys.cc.

1612 {
1613  /* modifies p*/
1614  // Print("start: "); Print(" "); p_wrp(*p,r);
1615  p_LmCheckPolyRing2(*p, r);
1616  poly q = p_Head(*p,r);
1617  const long cmp = p_GetComp(*p, r);
1618  while ( ( (*p)!=NULL ) && ( p_Comp_k_n(*p, q, ishift+1, r) ) && (p_GetComp(*p, r) == cmp) )
1619  {
1620  p_LmDelete(p,r);
1621  // Print("while: ");p_wrp(*p,r);Print(" ");
1622  }
1623  // p_wrp(*p,r);Print(" ");
1624  // PrintS("end\n");
1625  p_LmDelete(&q,r);
1626 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
static poly p_Head(poly p, const ring r)
Definition: p_polys.h:819
const ring r
Definition: syzextra.cc:208
static int p_Comp_k_n(poly a, poly b, int k, ring r)
Definition: p_polys.h:636
#define NULL
Definition: omList.c:10
static void p_LmDelete(poly p, const ring r)
Definition: p_polys.h:707
polyrec * poly
Definition: hilb.h:10
static BOOLEAN p_LmDivisibleBy ( poly  a,
poly  b,
const ring  r 
)
inlinestatic

Definition at line 1676 of file p_polys.h.

1677 {
1680  if (p_GetComp(a, r) == 0 || p_GetComp(a,r) == p_GetComp(b,r))
1681  return _p_LmDivisibleByNoComp(a, b, r);
1682  return FALSE;
1683 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
#define p_GetComp(p, r)
Definition: monomials.h:72
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...
Definition: p_polys.h:1546
const ring r
Definition: syzextra.cc:208
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
#define pIfThen1(cond, check)
Definition: monomials.h:187
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
static BOOLEAN p_LmDivisibleBy ( poly  a,
const ring  r_a,
poly  b,
const ring  r_b 
)
inlinestatic

Definition at line 1703 of file p_polys.h.

1704 {
1705  p_LmCheckPolyRing(a, r_a);
1706  p_LmCheckPolyRing(b, r_b);
1707  return _p_LmDivisibleBy(a, r_a, b, r_b);
1708 }
const poly a
Definition: syzextra.cc:212
static BOOLEAN _p_LmDivisibleBy(poly a, poly b, const ring r)
Definition: p_polys.h:1650
BOOLEAN p_LmCheckPolyRing(poly p, ring r)
Definition: pDebug.cc:119
const poly b
Definition: syzextra.cc:213
static BOOLEAN p_LmDivisibleByNoComp ( poly  a,
poly  b,
const ring  r 
)
inlinestatic

Definition at line 1662 of file p_polys.h.

1663 {
1666  return _p_LmDivisibleByNoComp(a, b, r);
1667 }
const poly a
Definition: syzextra.cc:212
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...
Definition: p_polys.h:1546
const ring r
Definition: syzextra.cc:208
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
const poly b
Definition: syzextra.cc:213
static BOOLEAN p_LmDivisibleByNoComp ( poly  a,
const ring  ra,
poly  b,
const ring  rb 
)
inlinestatic

Definition at line 1669 of file p_polys.h.

1670 {
1671  p_LmCheckPolyRing1(a, ra);
1672  p_LmCheckPolyRing1(b, rb);
1673  return _p_LmDivisibleByNoComp(a, ra, b, rb);
1674 }
const poly a
Definition: syzextra.cc:212
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...
Definition: p_polys.h:1546
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
const poly b
Definition: syzextra.cc:213
static BOOLEAN p_LmDivisibleByPart ( poly  a,
poly  b,
const ring  r,
const int  start,
const int  end 
)
inlinestatic

Definition at line 1641 of file p_polys.h.

1642 {
1645  if (p_GetComp(a, r) == 0 || p_GetComp(a,r) == p_GetComp(b,r))
1646  return _p_LmDivisibleByNoCompPart(a, r, b, r,start, end);
1647  return FALSE;
1648 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
#define p_GetComp(p, r)
Definition: monomials.h:72
const ring r
Definition: syzextra.cc:208
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
#define pIfThen1(cond, check)
Definition: monomials.h:187
#define NULL
Definition: omList.c:10
static BOOLEAN _p_LmDivisibleByNoCompPart(poly a, const ring r_a, poly b, const ring r_b, const int start, const int end)
Definition: p_polys.h:1616
const poly b
Definition: syzextra.cc:213
static BOOLEAN p_LmExpVectorAddIsOk ( const poly  p1,
const poly  p2,
const ring  r 
)
inlinestatic

Definition at line 1821 of file p_polys.h.

1823 {
1824  p_LmCheckPolyRing(p1, r);
1826  unsigned long l1, l2, divmask = r->divmask;
1827  int i;
1828 
1829  for (i=0; i<r->VarL_Size; i++)
1830  {
1831  l1 = p1->exp[r->VarL_Offset[i]];
1832  l2 = p2->exp[r->VarL_Offset[i]];
1833  // do the divisiblity trick
1834  if ( (l1 > ULONG_MAX - l2) ||
1835  (((l1 & divmask) ^ (l2 & divmask)) != ((l1 + l2) & divmask)))
1836  return FALSE;
1837  }
1838  return TRUE;
1839 }
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
BOOLEAN p_LmCheckPolyRing(poly p, ring r)
Definition: pDebug.cc:119
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
static void p_LmFree ( poly  p,
ring   
)
inlinestatic

Definition at line 679 of file p_polys.h.

681 {
683  omFreeBinAddr(p);
684 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
#define omFreeBinAddr(addr)
Definition: omAllocDecl.h:258
static void p_LmFree ( poly p,
ring   
)
inlinestatic

Definition at line 688 of file p_polys.h.

690 {
692  poly h = *p;
693  *p = pNext(h);
694  omFreeBinAddr(h);
695 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
#define omFreeBinAddr(addr)
Definition: omAllocDecl.h:258
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
static poly p_LmFreeAndNext ( poly  p,
ring   
)
inlinestatic

Definition at line 699 of file p_polys.h.

701 {
703  poly pnext = pNext(p);
704  omFreeBinAddr(p);
705  return pnext;
706 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
#define omFreeBinAddr(addr)
Definition: omAllocDecl.h:258
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
static poly p_LmInit ( poly  p,
const ring  r 
)
inlinestatic

Definition at line 1263 of file p_polys.h.

1264 {
1266  poly np;
1267  omTypeAllocBin(poly, np, r->PolyBin);
1268  p_SetRingOfLm(np, r);
1269  memcpy(np->exp, p->exp, r->ExpL_Size*sizeof(long));
1270  pNext(np) = NULL;
1271  pSetCoeff0(np, NULL);
1272  return np;
1273 }
return P p
Definition: myNF.cc:203
#define omTypeAllocBin(type, addr, bin)
Definition: omAllocDecl.h:203
const ring r
Definition: syzextra.cc:208
#define p_SetRingOfLm(p, r)
Definition: monomials.h:152
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
#define pSetCoeff0(p, n)
Definition: monomials.h:67
polyrec * poly
Definition: hilb.h:10
static poly p_LmInit ( poly  s_p,
const ring  s_r,
const ring  d_r,
omBin  d_bin 
)
inlinestatic

Definition at line 1274 of file p_polys.h.

1275 {
1276  p_LmCheckPolyRing1(s_p, s_r);
1277  p_CheckRing(d_r);
1278  pAssume1(d_r->N <= s_r->N);
1279  poly d_p = p_Init(d_r, d_bin);
1280  for (int i=d_r->N; i>0; i--)
1281  {
1282  p_SetExp(d_p, i, p_GetExp(s_p, i,s_r), d_r);
1283  }
1284  if (rRing_has_Comp(d_r))
1285  {
1286  p_SetComp(d_p, p_GetComp(s_p,s_r), d_r);
1287  }
1288  p_Setm(d_p, d_r);
1289  return d_p;
1290 }
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:236
#define p_GetComp(p, r)
Definition: monomials.h:72
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 i
Definition: cfEzgcd.cc:123
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
#define rRing_has_Comp(r)
Definition: monomials.h:274
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:484
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:436
polyrec * poly
Definition: hilb.h:10
BOOLEAN p_CheckRing(ring r)
Definition: pDebug.cc:127
#define pAssume1(cond)
Definition: monomials.h:179
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1248
static poly p_LmInit ( poly  s_p,
const ring  s_r,
const ring  d_r 
)
inlinestatic

Definition at line 1291 of file p_polys.h.

1292 {
1293  pAssume1(d_r != NULL);
1294  return p_LmInit(s_p, s_r, d_r, d_r->PolyBin);
1295 }
#define NULL
Definition: omList.c:10
static poly p_LmInit(poly p, const ring r)
Definition: p_polys.h:1263
#define pAssume1(cond)
Definition: monomials.h:179
static BOOLEAN p_LmIsConstant ( const poly  p,
const ring  r 
)
inlinestatic

Definition at line 954 of file p_polys.h.

955 {
956  if (p_LmIsConstantComp(p, r))
957  return (p_GetComp(p, r) == 0);
958  return FALSE;
959 }
static BOOLEAN p_LmIsConstantComp(const poly p, const ring r)
Definition: p_polys.h:937
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
const ring r
Definition: syzextra.cc:208
static BOOLEAN p_LmIsConstantComp ( const poly  p,
const ring  r 
)
inlinestatic

Definition at line 937 of file p_polys.h.

938 {
939  //p_LmCheckPolyRing(p, r);
940  int i = r->VarL_Size - 1;
941 
942  do
943  {
944  if (p->exp[r->VarL_Offset[i]] != 0)
945  return FALSE;
946  i--;
947  }
948  while (i >= 0);
949  return TRUE;
950 }
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:144
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
static poly p_LmShallowCopyDelete ( poly  p,
const ring  r 
)
inlinestatic

Definition at line 1321 of file p_polys.h.

1322 {
1324  pAssume1(omSizeWOfBin(bin) == omSizeWOfBin(r->PolyBin));
1325  poly new_p = p_New(r);
1326  memcpy(new_p->exp, p->exp, r->ExpL_Size*sizeof(long));
1327  pSetCoeff0(new_p, pGetCoeff(p));
1328  pNext(new_p) = pNext(p);
1329  omFreeBinAddr(p);
1330  return new_p;
1331 }
return P p
Definition: myNF.cc:203
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
const ring r
Definition: syzextra.cc:208
#define omFreeBinAddr(addr)
Definition: omAllocDecl.h:258
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
#define omSizeWOfBin(bin_ptr)
#define pNext(p)
Definition: monomials.h:43
#define pSetCoeff0(p, n)
Definition: monomials.h:67
polyrec * poly
Definition: hilb.h:10
static poly p_New(const ring, omBin bin)
Definition: p_polys.h:660
#define pAssume1(cond)
Definition: monomials.h:179
static BOOLEAN p_LmShortDivisibleBy ( poly  a,
unsigned long  sev_a,
poly  b,
unsigned long  not_sev_b,
const ring  r 
)
inlinestatic

Definition at line 1710 of file p_polys.h.

1712 {
1715 #ifndef PDIV_DEBUG
1716  _pPolyAssume2(p_GetShortExpVector(a, r) == sev_a, a, r);
1717  _pPolyAssume2(p_GetShortExpVector(b, r) == ~ not_sev_b, b, r);
1718 
1719  if (sev_a & not_sev_b)
1720  {
1722  return FALSE;
1723  }
1724  return p_LmDivisibleBy(a, b, r);
1725 #else
1726  return pDebugLmShortDivisibleBy(a, sev_a, r, b, not_sev_b, r);
1727 #endif
1728 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
unsigned long p_GetShortExpVector(const poly a, const ring r)
Definition: p_polys.cc:4557
static BOOLEAN p_LmDivisibleByNoComp(poly a, poly b, const ring r)
Definition: p_polys.h:1662
#define _pPolyAssume2(cond, p, r)
Definition: monomials.h:203
const ring r
Definition: syzextra.cc:208
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
static BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
Definition: p_polys.h:1676
#define pAssume1(cond)
Definition: monomials.h:179
const poly b
Definition: syzextra.cc:213
BOOLEAN pDebugLmShortDivisibleBy(poly p1, unsigned long sev_1, ring r_1, poly p2, unsigned long not_sev_2, ring r_2)
Definition: pDebug.cc:365
static BOOLEAN p_LmShortDivisibleBy ( poly  a,
unsigned long  sev_a,
const ring  r_a,
poly  b,
unsigned long  not_sev_b,
const ring  r_b 
)
inlinestatic

Definition at line 1750 of file p_polys.h.

1752 {
1753  p_LmCheckPolyRing1(a, r_a);
1754  p_LmCheckPolyRing1(b, r_b);
1755 #ifndef PDIV_DEBUG
1756  _pPolyAssume2(p_GetShortExpVector(a, r_a) == sev_a, a, r_a);
1757  _pPolyAssume2(p_GetShortExpVector(b, r_b) == ~ not_sev_b, b, r_b);
1758 
1759  if (sev_a & not_sev_b)
1760  {
1761  pAssume1(_p_LmDivisibleByNoComp(a, r_a, b, r_b) == FALSE);
1762  return FALSE;
1763  }
1764  return _p_LmDivisibleBy(a, r_a, b, r_b);
1765 #else
1766  return pDebugLmShortDivisibleBy(a, sev_a, r_a, b, not_sev_b, r_b);
1767 #endif
1768 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
unsigned long p_GetShortExpVector(const poly a, const ring r)
Definition: p_polys.cc:4557
#define _pPolyAssume2(cond, p, r)
Definition: monomials.h:203
static BOOLEAN _p_LmDivisibleBy(poly a, poly b, const ring r)
Definition: p_polys.h:1650
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...
Definition: p_polys.h:1546
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
#define pAssume1(cond)
Definition: monomials.h:179
const poly b
Definition: syzextra.cc:213
BOOLEAN pDebugLmShortDivisibleBy(poly p1, unsigned long sev_1, ring r_1, poly p2, unsigned long not_sev_2, ring r_2)
Definition: pDebug.cc:365
static BOOLEAN p_LmShortDivisibleByNoComp ( poly  a,
unsigned long  sev_a,
poly  b,
unsigned long  not_sev_b,
const ring  r 
)
inlinestatic

Definition at line 1730 of file p_polys.h.

1732 {
1735 #ifndef PDIV_DEBUG
1736  _pPolyAssume2(p_GetShortExpVector(a, r) == sev_a, a, r);
1737  _pPolyAssume2(p_GetShortExpVector(b, r) == ~ not_sev_b, b, r);
1738 
1739  if (sev_a & not_sev_b)
1740  {
1742  return FALSE;
1743  }
1744  return p_LmDivisibleByNoComp(a, b, r);
1745 #else
1746  return pDebugLmShortDivisibleByNoComp(a, sev_a, r, b, not_sev_b, r);
1747 #endif
1748 }
const poly a
Definition: syzextra.cc:212
BOOLEAN pDebugLmShortDivisibleByNoComp(poly p1, unsigned long sev_1, ring r_1, poly p2, unsigned long not_sev_2, ring r_2)
Definition: pDebug.cc:388
#define FALSE
Definition: auxiliary.h:140
unsigned long p_GetShortExpVector(const poly a, const ring r)
Definition: p_polys.cc:4557
static BOOLEAN p_LmDivisibleByNoComp(poly a, poly b, const ring r)
Definition: p_polys.h:1662
#define _pPolyAssume2(cond, p, r)
Definition: monomials.h:203
const ring r
Definition: syzextra.cc:208
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
#define pAssume1(cond)
Definition: monomials.h:179
const poly b
Definition: syzextra.cc:213
int p_LowVar ( poly  p,
const ring  r 
)

the minimal index of used variables - 1

Definition at line 4457 of file p_polys.cc.

4458 {
4459  int k,l,lex;
4460 
4461  if (p == NULL) return -1;
4462 
4463  k = 32000;/*a very large dummy value*/
4464  while (p != NULL)
4465  {
4466  l = 1;
4467  lex = p_GetExp(p,l,r);
4468  while ((l < (rVar(r))) && (lex == 0))
4469  {
4470  l++;
4471  lex = p_GetExp(p,l,r);
4472  }
4473  l--;
4474  if (l < k) k = l;
4475  pIter(p);
4476  }
4477  return k;
4478 }
return P p
Definition: myNF.cc:203
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
int k
Definition: cfEzgcd.cc:93
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
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
#define NULL
Definition: omList.c:10
int l
Definition: cfEzgcd.cc:94
static long p_MaxComp ( poly  p,
ring  lmRing,
ring  tailRing 
)
inlinestatic

Definition at line 281 of file p_polys.h.

282 {
283  long result,i;
284 
285  if(p==NULL) return 0;
286  result = p_GetComp(p, lmRing);
287  if (result != 0)
288  {
289  loop
290  {
291  pIter(p);
292  if(p==NULL) break;
293  i = p_GetComp(p, tailRing);
294  if (i>result) result = i;
295  }
296  }
297  return result;
298 }
BEGIN_NAMESPACE_SINGULARXX const ring lmRing
Definition: DebugPrint.h:30
loop
Definition: myNF.cc:98
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
Definition: DebugPrint.h:30
#define pIter(p)
Definition: monomials.h:44
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
return result
Definition: facAbsBiFact.cc:76
static long p_MaxComp ( poly  p,
ring  lmRing 
)
inlinestatic

Definition at line 300 of file p_polys.h.

300 {return p_MaxComp(p,lmRing,lmRing);}
BEGIN_NAMESPACE_SINGULARXX const ring lmRing
Definition: DebugPrint.h:30
return P p
Definition: myNF.cc:203
static long p_MaxComp(poly p, ring lmRing, ring tailRing)
Definition: p_polys.h:281
static void p_MemAdd_NegWeightAdjust ( poly  p,
const ring  r 
)
inlinestatic

Definition at line 1220 of file p_polys.h.

1221 {
1222  if (r->NegWeightL_Offset != NULL)
1223  {
1224  for (int i=r->NegWeightL_Size-1; i>=0; i--)
1225  {
1226  p->exp[r->NegWeightL_Offset[i]] -= POLY_NEGWEIGHT_OFFSET;
1227  }
1228  }
1229 }
#define POLY_NEGWEIGHT_OFFSET
Definition: monomials.h:244
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
static void p_MemSub_NegWeightAdjust ( poly  p,
const ring  r 
)
inlinestatic

Definition at line 1230 of file p_polys.h.

1231 {
1232  if (r->NegWeightL_Offset != NULL)
1233  {
1234  for (int i=r->NegWeightL_Size-1; i>=0; i--)
1235  {
1236  p->exp[r->NegWeightL_Offset[i]] += POLY_NEGWEIGHT_OFFSET;
1237  }
1238  }
1239 }
#define POLY_NEGWEIGHT_OFFSET
Definition: monomials.h:244
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
static poly p_Merge_q ( poly  p,
poly  q,
const ring  r 
)
inlinestatic

Definition at line 1140 of file p_polys.h.

1141 {
1142  assume( (p != q) || (p == NULL && q == NULL) );
1143  return r->p_Procs->p_Merge_q(p, q, r);
1144 }
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static long p_MinComp ( poly  p,
ring  lmRing,
ring  tailRing 
)
inlinestatic

Definition at line 302 of file p_polys.h.

303 {
304  long result,i;
305 
306  if(p==NULL) return 0;
307  result = p_GetComp(p,lmRing);
308  if (result != 0)
309  {
310  loop
311  {
312  pIter(p);
313  if(p==NULL) break;
314  i = p_GetComp(p,tailRing);
315  if (i<result) result = i;
316  }
317  }
318  return result;
319 }
BEGIN_NAMESPACE_SINGULARXX const ring lmRing
Definition: DebugPrint.h:30
loop
Definition: myNF.cc:98
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
Definition: DebugPrint.h:30
#define pIter(p)
Definition: monomials.h:44
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
return result
Definition: facAbsBiFact.cc:76
static long p_MinComp ( poly  p,
ring  lmRing 
)
inlinestatic

Definition at line 321 of file p_polys.h.

321 {return p_MinComp(p,lmRing,lmRing);}
BEGIN_NAMESPACE_SINGULARXX const ring lmRing
Definition: DebugPrint.h:30
return P p
Definition: myNF.cc:203
static long p_MinComp(poly p, ring lmRing, ring tailRing)
Definition: p_polys.h:302
int p_MinDeg ( poly  p,
intvec w,
const ring  R 
)

Definition at line 4225 of file p_polys.cc.

4226 {
4227  if(p==NULL)
4228  return -1;
4229  int d=-1;
4230  while(p!=NULL)
4231  {
4232  int d0=0;
4233  for(int j=0;j<rVar(R);j++)
4234  if(w==NULL||j>=w->length())
4235  d0+=p_GetExp(p,j+1,R);
4236  else
4237  d0+=(*w)[j]*p_GetExp(p,j+1,R);
4238  if(d0<d||d==-1)
4239  d=d0;
4240  pIter(p);
4241  }
4242  return d;
4243 }
return P p
Definition: myNF.cc:203
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
int length() const
Definition: intvec.h:86
#define pIter(p)
Definition: monomials.h:44
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
const ring R
Definition: DebugPrint.cc:36
#define NULL
Definition: omList.c:10
poly p_mInit ( const char *  s,
BOOLEAN ok,
const ring  r 
)

Definition at line 1425 of file p_polys.cc.

1426 {
1427  poly p;
1428  const char *s=p_Read(st,p,r);
1429  if (*s!='\0')
1430  {
1431  if ((s!=st)&&isdigit(st[0]))
1432  {
1434  }
1435  ok=FALSE;
1436  p_Delete(&p,r);
1437  return NULL;
1438  }
1439  p_Test(p,r);
1440  ok=!errorreported;
1441  return p;
1442 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:144
const char * p_Read(const char *st, poly &rc, const ring r)
Definition: p_polys.cc:1353
const ring r
Definition: syzextra.cc:208
#define p_Test(p, r)
Definition: p_polys.h:160
short errorreported
Definition: feFopen.cc:23
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
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 
)
inlinestatic

Definition at line 981 of file p_polys.h.

983 {
984  int shorter;
985  const poly res = r->p_Procs->p_Minus_mm_Mult_qq(p, m, q, shorter, spNoether, r);
986  lp += lq - shorter;
987 // assume( lp == pLength(res) );
988  return res;
989 }
return P p
Definition: myNF.cc:203
poly res
Definition: myNF.cc:322
const ring r
Definition: syzextra.cc:208
int m
Definition: cfEzgcd.cc:119
polyrec * poly
Definition: hilb.h:10
static poly p_Minus_mm_Mult_qq ( poly  p,
const poly  m,
const poly  q,
const ring  r 
)
inlinestatic

Definition at line 992 of file p_polys.h.

993 {
994  int shorter;
995 
996  return r->p_Procs->p_Minus_mm_Mult_qq(p, m, q, shorter, NULL, r);
997 }
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
int m
Definition: cfEzgcd.cc:119
#define NULL
Definition: omList.c:10
static poly p_Mult_mm ( poly  p,
poly  m,
const ring  r 
)
inlinestatic

Definition at line 973 of file p_polys.h.

974 {
975  if (p_LmIsConstant(m, r))
976  return p_Mult_nn(p, pGetCoeff(m), r);
977  else
978  return r->p_Procs->p_Mult_mm(p, m, r);
979 }
return P p
Definition: myNF.cc:203
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static BOOLEAN p_LmIsConstant(const poly p, const ring r)
Definition: p_polys.h:954
const ring r
Definition: syzextra.cc:208
int m
Definition: cfEzgcd.cc:119
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:902
static poly p_Mult_nn ( poly  p,
number  n,
const ring  r 
)
inlinestatic

Definition at line 902 of file p_polys.h.

903 {
904  if (n_IsOne(n, r->cf))
905  return p;
906  else if (n_IsZero(n, r->cf))
907  return NULL;
908  else
909  return r->p_Procs->p_Mult_nn(p, n, r);
910 }
return P p
Definition: myNF.cc:203
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the one element.
Definition: coeffs.h:469
const ring r
Definition: syzextra.cc:208
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the zero element.
Definition: coeffs.h:465
#define NULL
Definition: omList.c:10
static poly p_Mult_nn ( poly  p,
number  n,
const ring  lmRing,
const ring  tailRing 
)
inlinestatic

Definition at line 912 of file p_polys.h.

914 {
915 #ifndef PDEBUG
916  if (lmRing == tailRing)
917  return p_Mult_nn(p, n, tailRing);
918 #endif
919  poly pnext = pNext(p);
920  pNext(p) = NULL;
921  p = lmRing->p_Procs->p_Mult_nn(p, n, lmRing);
922  pNext(p) = tailRing->p_Procs->p_Mult_nn(pnext, n, tailRing);
923  return p;
924 }
BEGIN_NAMESPACE_SINGULARXX const ring lmRing
Definition: DebugPrint.h:30
return P p
Definition: myNF.cc:203
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
Definition: DebugPrint.h:30
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:902
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
static poly p_Mult_q ( poly  p,
poly  q,
const ring  r 
)
inlinestatic

Definition at line 1025 of file p_polys.h.

1026 {
1027  assume( (p != q) || (p == NULL && q == NULL) );
1028 
1029  if (p == NULL)
1030  {
1031  r->p_Procs->p_Delete(&q, r);
1032  return NULL;
1033  }
1034  if (q == NULL)
1035  {
1036  r->p_Procs->p_Delete(&p, r);
1037  return NULL;
1038  }
1039 
1040  if (pNext(p) == NULL)
1041  {
1042 #ifdef HAVE_PLURAL
1043  if (rIsPluralRing(r))
1044  q = nc_mm_Mult_p(p, q, r);
1045  else
1046 #endif /* HAVE_PLURAL */
1047  q = r->p_Procs->p_Mult_mm(q, p, r);
1048 
1049  r->p_Procs->p_Delete(&p, r);
1050  return q;
1051  }
1052 
1053  if (pNext(q) == NULL)
1054  {
1055  // NEEDED
1056 #ifdef HAVE_PLURAL
1057 /* if (rIsPluralRing(r))
1058  p = gnc_p_Mult_mm(p, q, r); // ???
1059  else*/
1060 #endif /* HAVE_PLURAL */
1061  p = r->p_Procs->p_Mult_mm(p, q, r);
1062 
1063  r->p_Procs->p_Delete(&q, r);
1064  return p;
1065  }
1066 #ifdef HAVE_PLURAL
1067  if (rIsPluralRing(r))
1068  return _nc_p_Mult_q(p, q, r);
1069  else
1070 #endif
1071  return _p_Mult_q(p, q, 0, r);
1072 }
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.
Definition: p_Mult_q.cc:273
return P p
Definition: myNF.cc:203
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
static poly nc_mm_Mult_p(const poly m, poly p, const ring r)
Definition: nc.h:250
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
poly _nc_p_Mult_q(poly p, poly q, const ring r)
general NC-multiplication with destruction
Definition: old.gring.cc:274
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static long p_MultExp ( poly  p,
int  v,
long  ee,
ring  r 
)
inlinestatic

Definition at line 617 of file p_polys.h.

618 {
620  long e = p_GetExp(p,v,r);
621  e *= ee;
622  return p_SetExp(p,v,e,r);
623 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
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
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:484
static poly p_Neg ( poly  p,
const ring  r 
)
inlinestatic

Definition at line 1018 of file p_polys.h.

1019 {
1020  return r->p_Procs->p_Neg(p, r);
1021 }
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
static poly p_New ( const ring  ,
omBin  bin 
)
inlinestatic

Definition at line 660 of file p_polys.h.

662 {
663  p_CheckRing2(r);
664  pAssume2(bin != NULL && omSizeWOfBin(r->PolyBin) == omSizeWOfBin(bin));
665  poly p;
666  omTypeAllocBin(poly, p, bin);
667  p_SetRingOfLm(p, r);
668  return p;
669 }
return P p
Definition: myNF.cc:203
#define p_CheckRing2(r)
Definition: monomials.h:208
#define omTypeAllocBin(type, addr, bin)
Definition: omAllocDecl.h:203
#define pAssume2(cond)
Definition: monomials.h:201
const ring r
Definition: syzextra.cc:208
#define p_SetRingOfLm(p, r)
Definition: monomials.h:152
#define NULL
Definition: omList.c:10
#define omSizeWOfBin(bin_ptr)
polyrec * poly
Definition: hilb.h:10
static poly p_New ( ring  r)
inlinestatic

Definition at line 671 of file p_polys.h.

672 {
673  return p_New(r, r->PolyBin);
674 }
const ring r
Definition: syzextra.cc:208
static poly p_New(const ring, omBin bin)
Definition: p_polys.h:660
void p_Norm ( poly  p1,
const ring  r 
)

Definition at line 3565 of file p_polys.cc.

3566 {
3567 #ifdef HAVE_RINGS
3568  if (rField_is_Ring(r))
3569  {
3570  if (!n_IsUnit(pGetCoeff(p1), r->cf)) return;
3571  // Werror("p_Norm not possible in the case of coefficient rings.");
3572  }
3573  else
3574 #endif
3575  if (p1!=NULL)
3576  {
3577  if (pNext(p1)==NULL)
3578  {
3579  p_SetCoeff(p1,n_Init(1,r->cf),r);
3580  return;
3581  }
3582  poly h;
3583  if (!n_IsOne(pGetCoeff(p1),r->cf))
3584  {
3585  number k, c;
3586  n_Normalize(pGetCoeff(p1),r->cf);
3587  k = pGetCoeff(p1);
3588  c = n_Init(1,r->cf);
3589  pSetCoeff0(p1,c);
3590  h = pNext(p1);
3591  while (h!=NULL)
3592  {
3593  c=n_Div(pGetCoeff(h),k,r->cf);
3594  // no need to normalize: Z/p, R
3595  // normalize already in nDiv: Q_a, Z/p_a
3596  // remains: Q
3597  if (rField_is_Q(r) && (!n_IsOne(c,r->cf))) n_Normalize(c,r->cf);
3598  p_SetCoeff(h,c,r);
3599  pIter(h);
3600  }
3601  n_Delete(&k,r->cf);
3602  }
3603  else
3604  {
3605  //if (r->cf->cfNormalize != nDummy2) //TODO: OPTIMIZE
3606  {
3607  h = pNext(p1);
3608  while (h!=NULL)
3609  {
3610  n_Normalize(pGetCoeff(h),r->cf);
3611  pIter(h);
3612  }
3613  }
3614  }
3615  }
3616 }
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.
Definition: coeffs.h:516
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the one element.
Definition: coeffs.h:469
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:539
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition: coeffs.h:579
int k
Definition: cfEzgcd.cc:93
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:401
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:461
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:437
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of &#39;a&#39; and &#39;b&#39;, i.e., a/b; raises an error if &#39;b&#39; is not invertible in r exceptio...
Definition: coeffs.h:615
#define pNext(p)
Definition: monomials.h:43
#define pSetCoeff0(p, n)
Definition: monomials.h:67
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
void p_Normalize ( poly  p,
const ring  r 
)

Definition at line 3621 of file p_polys.cc.

3622 {
3623  if (rField_has_simple_inverse(r)) return; /* Z/p, GF(p,n), R, long R/C */
3624  while (p!=NULL)
3625  {
3626  // no test befor n_Normalize: n_Normalize should fix problems
3627  n_Normalize(pGetCoeff(p),r->cf);
3628  pIter(p);
3629  }
3630 }
return P p
Definition: myNF.cc:203
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition: coeffs.h:579
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static BOOLEAN rField_has_simple_inverse(const ring r)
Definition: ring.h:497
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
poly p_NSet ( number  n,
const ring  r 
)

returns the poly representing the number n, destroys n

Definition at line 1448 of file p_polys.cc.

1449 {
1450  if (n_IsZero(n,r->cf))
1451  {
1452  n_Delete(&n, r->cf);
1453  return NULL;
1454  }
1455  else
1456  {
1457  poly rc = p_Init(r);
1458  pSetCoeff0(rc,n);
1459  return rc;
1460  }
1461 }
const ring r
Definition: syzextra.cc:208
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the zero element.
Definition: coeffs.h:465
#define NULL
Definition: omList.c:10
#define pSetCoeff0(p, n)
Definition: monomials.h:67
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
polyrec * poly
Definition: hilb.h:10
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1248
poly p_One ( const ring  r)

Definition at line 1318 of file p_polys.cc.

1319 {
1320  poly rc = p_Init(r);
1321  pSetCoeff0(rc,n_Init(1,r->cf));
1322  return rc;
1323 }
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:539
const ring r
Definition: syzextra.cc:208
#define pSetCoeff0(p, n)
Definition: monomials.h:67
polyrec * poly
Definition: hilb.h:10
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1248
BOOLEAN p_OneComp ( poly  p,
const ring  r 
)

return TRUE if all monoms have the same component

Definition at line 1207 of file p_polys.cc.

1208 {
1209  if(p!=NULL)
1210  {
1211  long i = p_GetComp(p, r);
1212  while (pNext(p)!=NULL)
1213  {
1214  pIter(p);
1215  if(i != p_GetComp(p, r)) return FALSE;
1216  }
1217  }
1218  return TRUE;
1219 }
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
#define TRUE
Definition: auxiliary.h:144
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
poly p_PermPoly ( poly  p,
const int *  perm,
const ring  OldRing,
const ring  dst,
nMapFunc  nMap,
const int *  par_perm = NULL,
int  OldPar = 0 
)

Definition at line 3926 of file p_polys.cc.

3928 {
3929 #if 0
3930  p_Test(p, oldRing);
3931  PrintS("\np_PermPoly::p: "); p_Write(p, oldRing, oldRing); PrintLn();
3932 #endif
3933  const int OldpVariables = rVar(oldRing);
3934  poly result = NULL;
3935  poly result_last = NULL;
3936  poly aq = NULL; /* the map coefficient */
3937  poly qq; /* the mapped monomial */
3938  assume(dst != NULL);
3939  assume(dst->cf != NULL);
3940  while (p != NULL)
3941  {
3942  // map the coefficient
3943  if ( ((OldPar == 0) || (par_perm == NULL) || rField_is_GF(oldRing)) && (nMap != NULL) )
3944  {
3945  qq = p_Init(dst);
3946  assume( nMap != NULL );
3947  number n = nMap(p_GetCoeff(p, oldRing), oldRing->cf, dst->cf);
3948  n_Test (n,dst->cf);
3949  if ( nCoeff_is_algExt(dst->cf) )
3950  n_Normalize(n, dst->cf);
3951  p_GetCoeff(qq, dst) = n;// Note: n can be a ZERO!!!
3952  }
3953  else
3954  {
3955  qq = p_One(dst);
3956 // aq = naPermNumber(p_GetCoeff(p, oldRing), par_perm, OldPar, oldRing); // no dst???
3957 // poly n_PermNumber(const number z, const int *par_perm, const int P, const ring src, const ring dst)
3958  aq = n_PermNumber(p_GetCoeff(p, oldRing), par_perm, OldPar, oldRing, dst);
3959  p_Test(aq, dst);
3960  if ( nCoeff_is_algExt(dst->cf) )
3961  p_Normalize(aq,dst);
3962  if (aq == NULL)
3963  p_SetCoeff(qq, n_Init(0, dst->cf),dst); // Very dirty trick!!!
3964  p_Test(aq, dst);
3965  }
3966  if (rRing_has_Comp(dst))
3967  p_SetComp(qq, p_GetComp(p, oldRing), dst);
3968  if ( n_IsZero(pGetCoeff(qq), dst->cf) )
3969  {
3970  p_LmDelete(&qq,dst);
3971  qq = NULL;
3972  }
3973  else
3974  {
3975  // map pars:
3976  int mapped_to_par = 0;
3977  for(int i = 1; i <= OldpVariables; i++)
3978  {
3979  int e = p_GetExp(p, i, oldRing);
3980  if (e != 0)
3981  {
3982  if (perm==NULL)
3983  p_SetExp(qq, i, e, dst);
3984  else if (perm[i]>0)
3985  p_AddExp(qq,perm[i], e/*p_GetExp( p,i,oldRing)*/, dst);
3986  else if (perm[i]<0)
3987  {
3988  number c = p_GetCoeff(qq, dst);
3989  if (rField_is_GF(dst))
3990  {
3991  assume( dst->cf->extRing == NULL );
3992  number ee = n_Param(1, dst);
3993  number eee;
3994  n_Power(ee, e, &eee, dst->cf); //nfDelete(ee,dst);
3995  ee = n_Mult(c, eee, dst->cf);
3996  //nfDelete(c,dst);nfDelete(eee,dst);
3997  pSetCoeff0(qq,ee);
3998  }
3999  else if (nCoeff_is_Extension(dst->cf))
4000  {
4001  const int par = -perm[i];
4002  assume( par > 0 );
4003 // WarnS("longalg missing 3");
4004 #if 1
4005  const coeffs C = dst->cf;
4006  assume( C != NULL );
4007  const ring R = C->extRing;
4008  assume( R != NULL );
4009  assume( par <= rVar(R) );
4010  poly pcn; // = (number)c
4011  assume( !n_IsZero(c, C) );
4012  if( nCoeff_is_algExt(C) )
4013  pcn = (poly) c;
4014  else // nCoeff_is_transExt(C)
4015  pcn = NUM((fraction)c);
4016  if (pNext(pcn) == NULL) // c->z
4017  p_AddExp(pcn, -perm[i], e, R);
4018  else /* more difficult: we have really to multiply: */
4019  {
4020  poly mmc = p_ISet(1, R);
4021  p_SetExp(mmc, -perm[i], e, R);
4022  p_Setm(mmc, R);
4023  number nnc;
4024  // convert back to a number: number nnc = mmc;
4025  if( nCoeff_is_algExt(C) )
4026  nnc = (number) mmc;
4027  else // nCoeff_is_transExt(C)
4028  nnc = ntInit(mmc, C);
4029  p_GetCoeff(qq, dst) = n_Mult((number)c, nnc, C);
4030  n_Delete((number *)&c, C);
4031  n_Delete((number *)&nnc, C);
4032  }
4033  mapped_to_par=1;
4034 #endif
4035  }
4036  }
4037  else
4038  {
4039  /* this variable maps to 0 !*/
4040  p_LmDelete(&qq, dst);
4041  break;
4042  }
4043  }
4044  }
4045  if ( mapped_to_par && qq!= NULL && nCoeff_is_algExt(dst->cf) )
4046  {
4047  number n = p_GetCoeff(qq, dst);
4048  n_Normalize(n, dst->cf);
4049  p_GetCoeff(qq, dst) = n;
4050  }
4051  }
4052  pIter(p);
4053 
4054 #if 0
4055  p_Test(aq,dst);
4056  PrintS("\naq: "); p_Write(aq, dst, dst); PrintLn();
4057 #endif
4058 
4059 
4060 #if 1
4061  if (qq!=NULL)
4062  {
4063  p_Setm(qq,dst);
4064 
4065  p_Test(aq,dst);
4066  p_Test(qq,dst);
4067 
4068 #if 0
4069  p_Test(qq,dst);
4070  PrintS("\nqq: "); p_Write(qq, dst, dst); PrintLn();
4071 #endif
4072 
4073  if (aq!=NULL)
4074  qq=p_Mult_q(aq,qq,dst);
4075  aq = qq;
4076  while (pNext(aq) != NULL) pIter(aq);
4077  if (result_last==NULL)
4078  {
4079  result=qq;
4080  }
4081  else
4082  {
4083  pNext(result_last)=qq;
4084  }
4085  result_last=aq;
4086  aq = NULL;
4087  }
4088  else if (aq!=NULL)
4089  {
4090  p_Delete(&aq,dst);
4091  }
4092  }
4093  result=p_SortAdd(result,dst);
4094 #else
4095  // if (qq!=NULL)
4096  // {
4097  // pSetm(qq);
4098  // pTest(qq);
4099  // pTest(aq);
4100  // if (aq!=NULL) qq=pMult(aq,qq);
4101  // aq = qq;
4102  // while (pNext(aq) != NULL) pIter(aq);
4103  // pNext(aq) = result;
4104  // aq = NULL;
4105  // result = qq;
4106  // }
4107  // else if (aq!=NULL)
4108  // {
4109  // pDelete(&aq);
4110  // }
4111  //}
4112  //p = result;
4113  //result = NULL;
4114  //while (p != NULL)
4115  //{
4116  // qq = p;
4117  // pIter(p);
4118  // qq->next = NULL;
4119  // result = pAdd(result, qq);
4120  //}
4121 #endif
4122  p_Test(result,dst);
4123 #if 0
4124  p_Test(result,dst);
4125  PrintS("\nresult: "); p_Write(result,dst,dst); PrintLn();
4126 #endif
4127  return result;
4128 }
void PrintLn()
Definition: reporter.cc:327
return P p
Definition: myNF.cc:203
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:236
#define p_GetComp(p, r)
Definition: monomials.h:72
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:539
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition: coeffs.h:579
static BOOLEAN rField_is_GF(const ring r)
Definition: ring.h:470
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:401
static FORCE_INLINE number n_Param(const int iParameter, const coeffs r)
return the (iParameter^th) parameter as a NEW number NOTE: parameter numbering: 1..n_NumberOfParameters(...)
Definition: coeffs.h:801
#define pIter(p)
Definition: monomials.h:44
static poly p_SortAdd(poly p, const ring r, BOOLEAN revert=FALSE)
Definition: p_polys.h:1147
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of &#39;a&#39; and &#39;b&#39;, i.e., a*b
Definition: coeffs.h:635
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
Definition: coeffs.h:911
poly p_One(const ring r)
Definition: p_polys.cc:1318
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
number ntInit(long i, const coeffs cf)
Definition: transext.cc:616
#define assume(x)
Definition: mod2.h:405
The main handler for Singular numbers which are suitable for Singular polynomials.
const ring R
Definition: DebugPrint.cc:36
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:923
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:294
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the zero element.
Definition: coeffs.h:465
#define p_Test(p, r)
Definition: p_polys.h:160
void p_Normalize(poly p, const ring r)
Definition: p_polys.cc:3621
#define rRing_has_Comp(r)
Definition: monomials.h:274
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:484
static FORCE_INLINE void n_Power(number a, int b, number *res, const coeffs r)
fill res with the power a^b
Definition: coeffs.h:631
#define NULL
Definition: omList.c:10
poly n_PermNumber(const number z, const int *par_perm, const int, const ring src, const ring dst)
Definition: p_polys.cc:3822
#define pNext(p)
Definition: monomials.h:43
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:436
#define pSetCoeff0(p, n)
Definition: monomials.h:67
static long p_AddExp(poly p, int v, long ee, ring r)
Definition: p_polys.h:602
#define p_GetCoeff(p, r)
Definition: monomials.h:57
static FORCE_INLINE BOOLEAN nCoeff_is_Extension(const coeffs r)
Definition: coeffs.h:844
static void p_LmDelete(poly p, const ring r)
Definition: p_polys.h:707
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
void p_Write(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:206
polyrec * poly
Definition: hilb.h:10
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1248
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
Definition: p_polys.cc:1302
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1025
return result
Definition: facAbsBiFact.cc:76
static poly p_Plus_mm_Mult_qq ( poly  p,
poly  m,
poly  q,
int &  lp,
int  lq,
const ring  r 
)
inlinestatic

Definition at line 1111 of file p_polys.h.

1113 {
1114 #ifdef HAVE_PLURAL
1115  if (rIsPluralRing(r))
1116  return nc_p_Plus_mm_Mult_qq(p, m, q, lp, lq, r);
1117 #endif
1118 
1119 // this should be implemented more efficiently
1120  poly res;
1121  int shorter;
1122  number n_old = pGetCoeff(m);
1123  number n_neg = n_Copy(n_old, r->cf);
1124  n_neg = n_InpNeg(n_neg, r->cf);
1125  pSetCoeff0(m, n_neg);
1126  res = r->p_Procs->p_Minus_mm_Mult_qq(p, m, q, shorter, NULL, r);
1127  lp = (lp + lq) - shorter;
1128  pSetCoeff0(m, n_old);
1129  n_Delete(&n_neg, r->cf);
1130  return res;
1131 }
return P p
Definition: myNF.cc:203
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
poly nc_p_Plus_mm_Mult_qq(poly p, const poly m, const poly q, int &lp, const int, const ring r)
Definition: old.gring.cc:227
poly res
Definition: myNF.cc:322
const ring r
Definition: syzextra.cc:208
int m
Definition: cfEzgcd.cc:119
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)
Definition: coeffs.h:558
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of &#39;n&#39;
Definition: coeffs.h:452
#define pSetCoeff0(p, n)
Definition: monomials.h:67
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
polyrec * poly
Definition: hilb.h:10
static poly p_Plus_mm_Mult_qq ( poly  p,
poly  m,
poly  q,
const ring  r 
)
inlinestatic

Definition at line 1133 of file p_polys.h.

1134 {
1135  int lp = 0, lq = 0;
1136  return p_Plus_mm_Mult_qq(p, m, q, lp, lq, r);
1137 }
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
int m
Definition: cfEzgcd.cc:119
static poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, int &lp, int lq, const ring r)
Definition: p_polys.h:1111
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 divisor != NULL; p may be NULL; assumes a global monomial ordering in r; performs polynomial division of p by divisor:

  • afterwards p contains the remainder of the division, i.e., p_before = result * divisor + p_afterwards;
  • if needResult == TRUE, then the method computes and returns 'result', otherwise NULL is returned (This parametrization can be used when one is only interested in the remainder of the division. In this case, the method will be slightly faster.) leaves divisor unmodified

Definition at line 1781 of file p_polys.cc.

1782 {
1783  assume(divisor != NULL);
1784  if (p == NULL) return NULL;
1785 
1786  poly result = NULL;
1787  number divisorLC = p_GetCoeff(divisor, r);
1788  int divisorLE = p_GetExp(divisor, 1, r);
1789  while ((p != NULL) && (p_Deg(p, r) >= p_Deg(divisor, r)))
1790  {
1791  /* determine t = LT(p) / LT(divisor) */
1792  poly t = p_ISet(1, r);
1793  number c = n_Div(p_GetCoeff(p, r), divisorLC, r->cf);
1794  n_Normalize(c,r->cf);
1795  p_SetCoeff(t, c, r);
1796  int e = p_GetExp(p, 1, r) - divisorLE;
1797  p_SetExp(t, 1, e, r);
1798  p_Setm(t, r);
1799  if (needResult) result = p_Add_q(result, p_Copy(t, r), r);
1800  p = p_Add_q(p, p_Neg(p_Mult_q(t, p_Copy(divisor, r), r), r), r);
1801  }
1802  return result;
1803 }
return P p
Definition: myNF.cc:203
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition: coeffs.h:579
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:401
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:811
long p_Deg(poly a, const ring r)
Definition: p_polys.cc:586
const ring r
Definition: syzextra.cc:208
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
#define assume(x)
Definition: mod2.h:405
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:484
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of &#39;a&#39; and &#39;b&#39;, i.e., a/b; raises an error if &#39;b&#39; is not invertible in r exceptio...
Definition: coeffs.h:615
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:436
#define p_GetCoeff(p, r)
Definition: monomials.h:57
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1018
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
Definition: p_polys.cc:1302
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1025
return result
Definition: facAbsBiFact.cc:76
poly p_Power ( poly  p,
int  i,
const ring  r 
)

Definition at line 2100 of file p_polys.cc.

2101 {
2102  poly rc=NULL;
2103 
2104  if (i==0)
2105  {
2106  p_Delete(&p,r);
2107  return p_One(r);
2108  }
2109 
2110  if(p!=NULL)
2111  {
2112  if ( (i > 0) && ((unsigned long ) i > (r->bitmask)))
2113  {
2114  Werror("exponent %d is too large, max. is %ld",i,r->bitmask);
2115  return NULL;
2116  }
2117  switch (i)
2118  {
2119 // cannot happen, see above
2120 // case 0:
2121 // {
2122 // rc=pOne();
2123 // pDelete(&p);
2124 // break;
2125 // }
2126  case 1:
2127  rc=p;
2128  break;
2129  case 2:
2130  rc=p_Mult_q(p_Copy(p,r),p,r);
2131  break;
2132  default:
2133  if (i < 0)
2134  {
2135  p_Delete(&p,r);
2136  return NULL;
2137  }
2138  else
2139  {
2140 #ifdef HAVE_PLURAL
2141  if (rIsPluralRing(r)) /* in the NC case nothing helps :-( */
2142  {
2143  int j=i;
2144  rc = p_Copy(p,r);
2145  while (j>1)
2146  {
2147  rc = p_Mult_q(p_Copy(p,r),rc,r);
2148  j--;
2149  }
2150  p_Delete(&p,r);
2151  return rc;
2152  }
2153 #endif
2154  rc = pNext(p);
2155  if (rc == NULL)
2156  return p_MonPower(p,i,r);
2157  /* else: binom ?*/
2158  int char_p=rChar(r);
2159  if ((pNext(rc) != NULL)
2160 #ifdef HAVE_RINGS
2161  || rField_is_Ring(r)
2162 #endif
2163  )
2164  return p_Pow(p,i,r);
2165  if ((char_p==0) || (i<=char_p))
2166  return p_TwoMonPower(p,i,r);
2167  return p_Pow(p,i,r);
2168  }
2169  /*end default:*/
2170  }
2171  }
2172  return rc;
2173 }
static poly p_MonPower(poly p, int exp, const ring r)
Definition: p_polys.cc:1911
return P p
Definition: myNF.cc:203
int rChar(ring r)
Definition: ring.cc:684
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
static poly p_TwoMonPower(poly p, int exp, const ring r)
Definition: p_polys.cc:2017
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:811
const ring r
Definition: syzextra.cc:208
poly p_One(const ring r)
Definition: p_polys.cc:1318
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
static poly p_Pow(poly p, int i, const ring r)
Definition: p_polys.cc:2082
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:437
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1025
void Werror(const char *fmt,...)
Definition: reporter.cc:199
void p_ProjectiveUnique ( poly  p,
const ring  r 
)

Definition at line 3008 of file p_polys.cc.

3009 {
3010  if( ph == NULL )
3011  return;
3012 
3013  assume( r != NULL ); assume( r->cf != NULL ); const coeffs C = r->cf;
3014 
3015  number h;
3016  poly p;
3017 
3018 #ifdef HAVE_RINGS
3019  if (rField_is_Ring(r))
3020  {
3021  p_Content(ph,r);
3022  if(!n_GreaterZero(pGetCoeff(ph),C)) ph = p_Neg(ph,r);
3023  assume( n_GreaterZero(pGetCoeff(ph),C) );
3024  return;
3025  }
3026 #endif
3027 
3029  {
3030  assume( n_GreaterZero(pGetCoeff(ph),C) );
3031  if(!n_GreaterZero(pGetCoeff(ph),C)) ph = p_Neg(ph,r);
3032  return;
3033  }
3034  p = ph;
3035 
3036  assume(p != NULL);
3037 
3038  if(pNext(p)==NULL) // a monomial
3039  {
3040  p_SetCoeff(p, n_Init(1, C), r);
3041  return;
3042  }
3043 
3044  assume(pNext(p)!=NULL);
3045 
3046  if(!rField_is_Q(r) && !nCoeff_is_transExt(C))
3047  {
3048  h = p_GetCoeff(p, C);
3049  number hInv = n_Invers(h, C);
3050  pIter(p);
3051  while (p!=NULL)
3052  {
3053  p_SetCoeff(p, n_Mult(p_GetCoeff(p, C), hInv, C), r);
3054  pIter(p);
3055  }
3056  n_Delete(&hInv, C);
3057  p = ph;
3058  p_SetCoeff(p, n_Init(1, C), r);
3059  }
3060 
3061  p_Cleardenom(ph, r); //performs also a p_Content
3062 
3063 
3064  /* normalize ph over a transcendental extension s.t.
3065  lead (ph) is > 0 if extRing->cf == Q
3066  or lead (ph) is monic if extRing->cf == Zp*/
3067  if (nCoeff_is_transExt(C))
3068  {
3069  p= ph;
3070  h= p_GetCoeff (p, C);
3071  fraction f = (fraction) h;
3072  number n=p_GetCoeff (NUM (f),C->extRing->cf);
3073  if (rField_is_Q (C->extRing))
3074  {
3075  if (!n_GreaterZero(n,C->extRing->cf))
3076  {
3077  p=p_Neg (p,r);
3078  }
3079  }
3080  else if (rField_is_Zp(C->extRing))
3081  {
3082  if (!n_IsOne (n, C->extRing->cf))
3083  {
3084  n=n_Invers (n,C->extRing->cf);
3085  nMapFunc nMap;
3086  nMap= n_SetMap (C->extRing->cf, C);
3087  number ninv= nMap (n,C->extRing->cf, C);
3088  p=p_Mult_nn (p, ninv, r);
3089  n_Delete (&ninv, C);
3090  n_Delete (&n, C->extRing->cf);
3091  }
3092  }
3093  p= ph;
3094  }
3095 
3096  return;
3097 }
return P p
Definition: myNF.cc:203
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the one element.
Definition: coeffs.h:469
f
Definition: cfModGcd.cc:4022
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:539
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:401
#define pIter(p)
Definition: monomials.h:44
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of &#39;a&#39; and &#39;b&#39;, i.e., a*b
Definition: coeffs.h:635
const ring r
Definition: syzextra.cc:208
#define TEST_OPT_INTSTRATEGY
Definition: options.h:105
#define assume(x)
Definition: mod2.h:405
The main handler for Singular numbers which are suitable for Singular polynomials.
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:72
static FORCE_INLINE number n_Invers(number a, const coeffs r)
return the multiplicative inverse of &#39;a&#39;; raise an error if &#39;a&#39; is not invertible ...
Definition: coeffs.h:565
static FORCE_INLINE BOOLEAN nCoeff_is_transExt(const coeffs r)
TRUE iff r represents a transcendental extension field.
Definition: coeffs.h:919
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:902
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:461
void p_Content(poly ph, const ring r)
Definition: p_polys.cc:2182
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:720
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:455
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:437
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
#define p_GetCoeff(p, r)
Definition: monomials.h:57
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1018
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff &#39;n&#39; is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2), where m is the long representing n in C: TRUE iff (Im(n) != 0 and Im(n) >= 0) or (Im(n) == 0 and Re(n) >= 0) in K(a)/<p(a)>: TRUE iff (n != 0 and (LC(n) > 0 or deg(n) > 0)) in K(t_1, ..., t_n): TRUE iff (LC(numerator(n) is a constant and > 0) or (LC(numerator(n) is not a constant) in Z/2^kZ: TRUE iff 0 < n <= 2^(k-1) in Z/mZ: TRUE iff the internal mpz is greater than zero in Z: TRUE iff n > 0
Definition: coeffs.h:495
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2682
const char* p_Read ( const char *  s,
poly p,
const ring  r 
)

Definition at line 1353 of file p_polys.cc.

1354 {
1355  if (r==NULL) { rc=NULL;return st;}
1356  int i,j;
1357  rc = p_Init(r);
1358  const char *s = n_Read(st,&(p_GetCoeff(rc, r)),r->cf);
1359  if (s==st)
1360  /* i.e. it does not start with a coeff: test if it is a ringvar*/
1361  {
1362  j = r_IsRingVar(s,r->names,r->N);
1363  if (j >= 0)
1364  {
1365  p_IncrExp(rc,1+j,r);
1366  while (*s!='\0') s++;
1367  goto done;
1368  }
1369  }
1370  while (*s!='\0')
1371  {
1372  char ss[2];
1373  ss[0] = *s++;
1374  ss[1] = '\0';
1375  j = r_IsRingVar(ss,r->names,r->N);
1376  if (j >= 0)
1377  {
1378  const char *s_save=s;
1379  s = eati(s,&i);
1380  if (((unsigned long)i) > r->bitmask)
1381  {
1382  // exponent to large: it is not a monomial
1383  p_LmDelete(&rc,r);
1384  return s_save;
1385  }
1386  p_AddExp(rc,1+j, (long)i, r);
1387  }
1388  else
1389  {
1390  // 1st char of is not a varname
1391  // We return the parsed polynomial nevertheless. This is needed when
1392  // we are parsing coefficients in a rational function field.
1393  s--;
1394  break;
1395  }
1396  }
1397 done:
1398  if (n_IsZero(pGetCoeff(rc),r->cf)) p_LmDelete(&rc,r);
1399  else
1400  {
1401 #ifdef HAVE_PLURAL
1402  // in super-commutative ring
1403  // squares of anti-commutative variables are zeroes!
1404  if(rIsSCA(r))
1405  {
1406  const unsigned int iFirstAltVar = scaFirstAltVar(r);
1407  const unsigned int iLastAltVar = scaLastAltVar(r);
1408 
1409  assume(rc != NULL);
1410 
1411  for(unsigned int k = iFirstAltVar; k <= iLastAltVar; k++)
1412  if( p_GetExp(rc, k, r) > 1 )
1413  {
1414  p_LmDelete(&rc, r);
1415  goto finish;
1416  }
1417  }
1418 #endif
1419 
1420  p_Setm(rc,r);
1421  }
1422 finish:
1423  return s;
1424 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
const char * eati(const char *s, int *i)
Definition: reporter.cc:390
static FORCE_INLINE const char * n_Read(const char *s, number *a, const coeffs r)
!!! Recommendation: This method is too cryptic to be part of the user- !!! interface. As defined here, it is merely a helper !!! method for parsing number input strings.
Definition: coeffs.h:599
static long p_IncrExp(poly p, int v, ring r)
Definition: p_polys.h:587
int k
Definition: cfEzgcd.cc:93
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
int r_IsRingVar(const char *n, char **names, int N)
Definition: ring.cc:222
const ring r
Definition: syzextra.cc:208
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 assume(x)
Definition: mod2.h:405
int i
Definition: cfEzgcd.cc:123
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the zero element.
Definition: coeffs.h:465
static short scaFirstAltVar(ring r)
Definition: sca.h:18
#define NULL
Definition: omList.c:10
static short scaLastAltVar(ring r)
Definition: sca.h:25
static bool rIsSCA(const ring r)
Definition: nc.h:206
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:436
static long p_AddExp(poly p, int v, long ee, ring r)
Definition: p_polys.h:602
#define p_GetCoeff(p, r)
Definition: monomials.h:57
static void p_LmDelete(poly p, const ring r)
Definition: p_polys.h:707
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1248
poly p_Series ( int  n,
poly  p,
poly  u,
intvec w,
const ring  R 
)

Definition at line 4247 of file p_polys.cc.

4248 {
4249  short *ww=iv2array(w,R);
4250  if(p!=NULL)
4251  {
4252  if(u==NULL)
4253  p=p_JetW(p,n,ww,R);
4254  else
4255  p=p_JetW(p_Mult_q(p,p_Invers(n-p_MinDeg(p,w,R),u,w,R),R),n,ww,R);
4256  }
4257  omFreeSize((ADDRESS)ww,(rVar(R)+1)*sizeof(short));
4258  return p;
4259 }
return P p
Definition: myNF.cc:203
short * iv2array(intvec *iv, const ring R)
Definition: weight.cc:208
int p_MinDeg(poly p, intvec *w, const ring R)
Definition: p_polys.cc:4225
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
void * ADDRESS
Definition: auxiliary.h:161
poly p_Invers(int n, poly u, intvec *w, const ring R)
Definition: p_polys.cc:4261
const ring R
Definition: DebugPrint.cc:36
poly p_JetW(poly p, int m, short *w, const ring R)
Definition: p_polys.cc:4207
#define NULL
Definition: omList.c:10
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1025
static number p_SetCoeff ( poly  p,
number  n,
ring  r 
)
inlinestatic

Definition at line 401 of file p_polys.h.

402 {
404  n_Delete(&(p->coef), r->cf);
405  (p)->coef=n;
406  return n;
407 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
static unsigned long p_SetComp ( poly  p,
unsigned long  c,
ring  r 
)
inlinestatic

Definition at line 236 of file p_polys.h.

237 {
239  if (r->pCompIndex>=0) __p_GetComp(p,r) = c;
240  return c;
241 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
#define __p_GetComp(p, r)
Definition: monomials.h:71
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
static void p_SetCompP ( poly  p,
int  i,
ring  r 
)
inlinestatic

Definition at line 243 of file p_polys.h.

244 {
245  if (p != NULL)
246  {
247  p_Test(p, r);
249  {
250  do
251  {
252  p_SetComp(p, i, r);
253  p_SetmComp(p, r);
254  pIter(p);
255  }
256  while (p != NULL);
257  }
258  else
259  {
260  do
261  {
262  p_SetComp(p, i, r);
263  pIter(p);
264  }
265  while(p != NULL);
266  }
267  }
268 }
return P p
Definition: myNF.cc:203
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:236
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
BOOLEAN rOrd_SetCompRequiresSetm(const ring r)
return TRUE if p_SetComp requires p_Setm
Definition: ring.cc:1875
#define p_Test(p, r)
Definition: p_polys.h:160
#define p_SetmComp
Definition: p_polys.h:233
#define NULL
Definition: omList.c:10
static void p_SetCompP ( poly  p,
int  i,
ring  lmRing,
ring  tailRing 
)
inlinestatic

Definition at line 270 of file p_polys.h.

271 {
272  if (p != NULL)
273  {
274  p_SetComp(p, i, lmRing);
275  p_SetmComp(p, lmRing);
277  }
278 }
BEGIN_NAMESPACE_SINGULARXX const ring lmRing
Definition: DebugPrint.h:30
return P p
Definition: myNF.cc:203
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:236
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
Definition: DebugPrint.h:30
static void p_SetCompP(poly p, int i, ring r)
Definition: p_polys.h:243
int i
Definition: cfEzgcd.cc:123
#define p_SetmComp
Definition: p_polys.h:233
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static unsigned long p_SetExp ( poly  p,
const unsigned long  e,
const unsigned long  iBitmask,
const int  VarOffset 
)
inlinestatic

set a single variable exponent : VarOffset encodes the position in p->exp

See also
p_GetExp

Definition at line 484 of file p_polys.h.

485 {
486  pAssume2(e>=0);
487  pAssume2(e<=iBitmask);
488  pAssume2((VarOffset >> (24 + 6)) == 0);
489 
490  // shift e to the left:
491  register int shift = VarOffset >> 24;
492  unsigned long ee = e << shift /*(VarOffset >> 24)*/;
493  // find the bits in the exponent vector
494  register int offset = (VarOffset & 0xffffff);
495  // clear the bits in the exponent vector:
496  p->exp[offset] &= ~( iBitmask << shift );
497  // insert e with |
498  p->exp[ offset ] |= ee;
499  return e;
500 }
return P p
Definition: myNF.cc:203
#define pAssume2(cond)
Definition: monomials.h:201
int offset
Definition: libparse.cc:1091
static long p_SetExp ( poly  p,
const long  e,
const ring  r,
const int  VarOffset 
)
inlinestatic

Definition at line 558 of file p_polys.h.

559 {
561  pAssume2(VarOffset != -1);
562  return p_SetExp(p, e, r->bitmask, VarOffset);
563 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
return P p
Definition: myNF.cc:203
#define pAssume2(cond)
Definition: monomials.h:201
const ring r
Definition: syzextra.cc:208
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:484
static long p_SetExp ( poly  p,
const int  v,
const long  e,
const ring  r 
)
inlinestatic

set v^th exponent for a monomial

Definition at line 578 of file p_polys.h.

579 {
581  pAssume2(v>0 && v <= r->N);
582  pAssume2(r->VarOffset[v] != -1);
583  return p_SetExp(p, e, r->bitmask, r->VarOffset[v]);
584 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
return P p
Definition: myNF.cc:203
#define pAssume2(cond)
Definition: monomials.h:201
const ring r
Definition: syzextra.cc:208
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:49
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:484
static void p_SetExpV ( poly  p,
int *  ev,
const ring  r 
)
inlinestatic

Definition at line 1456 of file p_polys.h.

1457 {
1459  for (int j = r->N; j; j--)
1460  p_SetExp(p, j, ev[j], r);
1461 
1462  p_SetComp(p, ev[0],r);
1463  p_Setm(p, r);
1464 }
return P p
Definition: myNF.cc:203
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:236
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:484
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:436
static void p_Setm ( poly  p,
const ring  r 
)
inlinestatic

Definition at line 436 of file p_polys.h.

437 {
438  p_CheckRing2(r);
439  r->p_Setm(p, r);
440 }
return P p
Definition: myNF.cc:203
#define p_CheckRing2(r)
Definition: monomials.h:208
const ring r
Definition: syzextra.cc:208
void p_SetModDeg ( intvec w,
ring  r 
)

Definition at line 3517 of file p_polys.cc.

3518 {
3519  if (w!=NULL)
3520  {
3521  r->pModW = w;
3522  pOldFDeg = r->pFDeg;
3523  pOldLDeg = r->pLDeg;
3524  pOldLexOrder = r->pLexOrder;
3526  r->pLexOrder = TRUE;
3527  }
3528  else
3529  {
3530  r->pModW = NULL;
3532  r->pLexOrder = pOldLexOrder;
3533  }
3534 }
static BOOLEAN pOldLexOrder
Definition: p_polys.cc:3506
static long pModDeg(poly p, ring r)
Definition: p_polys.cc:3508
#define TRUE
Definition: auxiliary.h:144
const ring r
Definition: syzextra.cc:208
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
Definition: p_polys.cc:3481
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
Definition: p_polys.cc:3493
static pLDegProc pOldLDeg
Definition: p_polys.cc:3505
#define NULL
Definition: omList.c:10
static pFDegProc pOldFDeg
Definition: p_polys.cc:3504
const CanonicalForm & w
Definition: facAbsFact.cc:55
static poly p_ShallowCopyDelete ( poly  p,
const ring  r,
omBin  bin 
)
inlinestatic

Definition at line 876 of file p_polys.h.

877 {
879  pAssume2(omSizeWOfBin(r->PolyBin) == omSizeWOfBin(bin));
880  return r->p_Procs->p_ShallowCopyDelete(p, r, bin);
881 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
return P p
Definition: myNF.cc:203
#define pAssume2(cond)
Definition: monomials.h:201
const ring r
Definition: syzextra.cc:208
#define omSizeWOfBin(bin_ptr)
void p_ShallowDelete ( poly p,
const ring  r 
)
void p_Shift ( poly p,
int  i,
const ring  r 
)

shifts components of the vector p by i

Definition at line 4483 of file p_polys.cc.

4484 {
4485  poly qp1 = *p,qp2 = *p;/*working pointers*/
4486  int j = p_MaxComp(*p,r),k = p_MinComp(*p,r);
4487 
4488  if (j+i < 0) return ;
4489  while (qp1 != NULL)
4490  {
4491  if ((p_GetComp(qp1,r)+i > 0) || ((j == -i) && (j == k)))
4492  {
4493  p_AddComp(qp1,i,r);
4494  p_SetmComp(qp1,r);
4495  qp2 = qp1;
4496  pIter(qp1);
4497  }
4498  else
4499  {
4500  if (qp2 == *p)
4501  {
4502  pIter(*p);
4503  p_LmDelete(&qp2,r);
4504  qp2 = *p;
4505  qp1 = *p;
4506  }
4507  else
4508  {
4509  qp2->next = qp1->next;
4510  if (qp1!=NULL) p_LmDelete(&qp1,r);
4511  qp1 = qp2->next;
4512  }
4513  }
4514  }
4515 }
static unsigned long p_AddComp(poly p, unsigned long v, ring r)
Definition: p_polys.h:443
return
Definition: syzextra.cc:280
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
int k
Definition: cfEzgcd.cc:93
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
static long p_MinComp(poly p, ring lmRing, ring tailRing)
Definition: p_polys.h:302
#define p_SetmComp
Definition: p_polys.h:233
#define NULL
Definition: omList.c:10
static void p_LmDelete(poly p, const ring r)
Definition: p_polys.h:707
polyrec * poly
Definition: hilb.h:10
static long p_MaxComp(poly p, ring lmRing, ring tailRing)
Definition: p_polys.h:281
void p_SimpleContent ( poly  p,
int  s,
const ring  r 
)

Definition at line 2391 of file p_polys.cc.

2392 {
2393  if(TEST_OPT_CONTENTSB) return;
2394  if (ph==NULL) return;
2395  if (pNext(ph)==NULL)
2396  {
2397  p_SetCoeff(ph,n_Init(1,r->cf),r);
2398  return;
2399  }
2400  if ((pNext(pNext(ph))==NULL)||(!rField_is_Q(r)))
2401  {
2402  return;
2403  }
2404  number d=p_InitContent(ph,r);
2405  if (n_Size(d,r->cf)<=smax)
2406  {
2407  //if (TEST_OPT_PROT) PrintS("G");
2408  return;
2409  }
2410 
2411 
2412  poly p=ph;
2413  number h=d;
2414  if (smax==1) smax=2;
2415  while (p!=NULL)
2416  {
2417 #if 0
2418  d=n_Gcd(h,pGetCoeff(p),r->cf);
2419  n_Delete(&h,r->cf);
2420  h = d;
2421 #else
2422  STATISTIC(n_Gcd); nlInpGcd(h,pGetCoeff(p),r->cf); // FIXME? TODO? // extern void nlInpGcd(number &a, number b, const coeffs r);
2423 #endif
2424  if(n_Size(h,r->cf)<smax)
2425  {
2426  //if (TEST_OPT_PROT) PrintS("g");
2427  return;
2428  }
2429  pIter(p);
2430  }
2431  p = ph;
2432  if (!n_GreaterZero(pGetCoeff(p),r->cf)) h=n_InpNeg(h,r->cf);
2433  if(n_IsOne(h,r->cf)) return;
2434  //if (TEST_OPT_PROT) PrintS("c");
2435  while (p!=NULL)
2436  {
2437 #if 1
2438  d = n_ExactDiv(pGetCoeff(p),h,r->cf);
2439  p_SetCoeff(p,d,r);
2440 #else
2441  STATISTIC(n_ExactDiv); nlInpExactDiv(pGetCoeff(p),h,r->cf); // no such function... ?
2442 #endif
2443  pIter(p);
2444  }
2445  n_Delete(&h,r->cf);
2446 }
#define STATISTIC(f)
Definition: numstats.h:16
static FORCE_INLINE number n_Gcd(number a, number b, const coeffs r)
in Z: return the gcd of &#39;a&#39; and &#39;b&#39; in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ...
Definition: coeffs.h:685
return P p
Definition: myNF.cc:203
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the one element.
Definition: coeffs.h:469
#define TEST_OPT_CONTENTSB
Definition: options.h:121
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:539
void nlInpGcd(number &a, number b, const coeffs r)
Definition: longrat.cc:2588
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:401
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
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)
Definition: coeffs.h:558
static number p_InitContent(poly ph, const ring r)
Definition: p_polys.cc:2449
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:461
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static FORCE_INLINE number n_ExactDiv(number a, number b, const coeffs r)
assume that there is a canonical subring in cf and we know that division is possible for these a and ...
Definition: coeffs.h:622
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff &#39;n&#39; is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2), where m is the long representing n in C: TRUE iff (Im(n) != 0 and Im(n) >= 0) or (Im(n) == 0 and Re(n) >= 0) in K(a)/<p(a)>: TRUE iff (n != 0 and (LC(n) > 0 or deg(n) > 0)) in K(t_1, ..., t_n): TRUE iff (LC(numerator(n) is a constant and > 0) or (LC(numerator(n) is not a constant) in Z/2^kZ: TRUE iff 0 < n <= 2^(k-1) in Z/mZ: TRUE iff the internal mpz is greater than zero in Z: TRUE iff n > 0
Definition: coeffs.h:495
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
static FORCE_INLINE int n_Size(number n, const coeffs r)
return a non-negative measure for the complexity of n; return 0 only when n represents zero; (used fo...
Definition: coeffs.h:571
int p_Size ( poly  p,
const ring  r 
)

Definition at line 3121 of file p_polys.cc.

3122 {
3123  int count = 0;
3124  if (r->cf->has_simple_Alloc)
3125  return pLength(p);
3126  while ( p != NULL )
3127  {
3128  count+= n_Size( pGetCoeff( p ), r->cf );
3129  pIter( p );
3130  }
3131  return count;
3132 }
int status int void size_t count
Definition: si_signals.h:59
return P p
Definition: myNF.cc:203
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static int pLength(poly a)
Definition: p_polys.h:189
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
static FORCE_INLINE int n_Size(number n, const coeffs r)
return a non-negative measure for the complexity of n; return 0 only when n represents zero; (used fo...
Definition: coeffs.h:571
static poly p_SortAdd ( poly  p,
const ring  r,
BOOLEAN  revert = FALSE 
)
inlinestatic

Definition at line 1147 of file p_polys.h.

1148 {
1149  if (revert) p = pReverse(p);
1150  return sBucketSortAdd(p, r);
1151 }
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
poly sBucketSortAdd(poly p, ring r)
Sorts p with bucketSort: p may have equal monomials.
Definition: sbuckets.cc:369
static poly pReverse(poly p)
Definition: p_polys.h:324
static poly p_SortMerge ( poly  p,
const ring  r,
BOOLEAN  revert = FALSE 
)
inlinestatic

Definition at line 1157 of file p_polys.h.

1158 {
1159  if (revert) p = pReverse(p);
1160  return sBucketSortMerge(p, r);
1161 }
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
static poly pReverse(poly p)
Definition: p_polys.h:324
poly sBucketSortMerge(poly p, ring r)
Sorts p with bucketSort: assumes all monomials of p are different.
Definition: sbuckets.cc:332
void p_Split ( poly  p,
poly r 
)

Definition at line 1325 of file p_polys.cc.

1326 {
1327  *h=pNext(p);
1328  pNext(p)=NULL;
1329 }
return P p
Definition: myNF.cc:203
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static Poly * h
Definition: janet.cc:978
char* p_String ( poly  p,
ring  lmRing,
ring  tailRing 
)

Definition at line 186 of file polys0.cc.

187 {
188  StringSetS("");
190  return StringEndS();
191 }
BEGIN_NAMESPACE_SINGULARXX const ring lmRing
Definition: DebugPrint.h:30
return P p
Definition: myNF.cc:203
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
Definition: DebugPrint.h:30
char * StringEndS()
Definition: reporter.cc:151
void StringSetS(const char *st)
Definition: reporter.cc:128
void p_String0(poly p, ring lmRing, ring tailRing)
print p according to ShortOut in lmRing & tailRing
Definition: polys0.cc:136
static char* p_String ( poly  p,
ring  p_ring 
)
inlinestatic

Definition at line 1168 of file p_polys.h.

1169 {
1170  return p_String(p, p_ring, p_ring);
1171 }
char * p_String(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:186
return P p
Definition: myNF.cc:203
void p_String0 ( poly  p,
ring  lmRing,
ring  tailRing 
)

print p according to ShortOut in lmRing & tailRing

Definition at line 136 of file polys0.cc.

137 {
138  if (p == NULL)
139  {
140  StringAppendS("0");
141  return;
142  }
144  if ((n_GetChar(lmRing->cf) == 0)
145  && (nCoeff_is_transExt(lmRing->cf)))
146  p_Normalize(p,lmRing); /* Manual/absfact.tst */
147  if ((p_GetComp(p, lmRing) == 0) || (!lmRing->VectorOut))
148  {
149  writemon(p,0, lmRing);
150  p = pNext(p);
151  while (p!=NULL)
152  {
153  assume((p->coef==NULL)||(!n_IsZero(p->coef,tailRing->cf)));
154  if ((p->coef==NULL)||n_GreaterZero(p->coef,tailRing->cf))
155  StringAppendS("+");
156  writemon(p,0, tailRing);
157  p = pNext(p);
158  }
159  return;
160  }
161 
162  long k = 1;
163  StringAppendS("[");
164  loop
165  {
166  while (k < p_GetComp(p,lmRing))
167  {
168  StringAppendS("0,");
169  k++;
170  }
171  writemon(p,k,lmRing);
172  pIter(p);
173  while ((p!=NULL) && (k == p_GetComp(p, tailRing)))
174  {
175  if (n_GreaterZero(p->coef,tailRing->cf)) StringAppendS("+");
176  writemon(p,k,tailRing);
177  pIter(p);
178  }
179  if (p == NULL) break;
180  StringAppendS(",");
181  k++;
182  }
183  StringAppendS("]");
184 }
BEGIN_NAMESPACE_SINGULARXX const ring lmRing
Definition: DebugPrint.h:30
loop
Definition: myNF.cc:98
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
Definition: DebugPrint.h:30
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
Definition: coeffs.h:445
int k
Definition: cfEzgcd.cc:93
#define pIter(p)
Definition: monomials.h:44
#define assume(x)
Definition: mod2.h:405
void StringAppendS(const char *st)
Definition: reporter.cc:107
static FORCE_INLINE BOOLEAN nCoeff_is_transExt(const coeffs r)
TRUE iff r represents a transcendental extension field.
Definition: coeffs.h:919
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the zero element.
Definition: coeffs.h:465
void p_Normalize(poly p, const ring r)
Definition: p_polys.cc:3621
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff &#39;n&#39; is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2), where m is the long representing n in C: TRUE iff (Im(n) != 0 and Im(n) >= 0) or (Im(n) == 0 and Re(n) >= 0) in K(a)/<p(a)>: TRUE iff (n != 0 and (LC(n) > 0 or deg(n) > 0)) in K(t_1, ..., t_n): TRUE iff (LC(numerator(n) is a constant and > 0) or (LC(numerator(n) is not a constant) in Z/2^kZ: TRUE iff 0 < n <= 2^(k-1) in Z/mZ: TRUE iff the internal mpz is greater than zero in Z: TRUE iff n > 0
Definition: coeffs.h:495
static void writemon(poly p, int ko, const ring r)
Definition: polys0.cc:23
static void p_String0 ( poly  p,
ring  p_ring 
)
inlinestatic

Definition at line 1172 of file p_polys.h.

1173 {
1174  p_String0(p, p_ring, p_ring);
1175 }
return P p
Definition: myNF.cc:203
void p_String0(poly p, ring lmRing, ring tailRing)
print p according to ShortOut in lmRing & tailRing
Definition: polys0.cc:136
void p_String0Long ( const poly  p,
ring  lmRing,
ring  tailRing 
)

print p in a long way

print p in a long way

Definition at line 116 of file polys0.cc.

117 {
118  // NOTE: the following (non-thread-safe!) UGLYNESS
119  // (changing naRing->ShortOut for a while) is due to Hans!
120  // Just think of other ring using the VERY SAME naRing and possible
121  // side-effects...
122  // but this is not a problem: i/o is not thread-safe anyway.
123  const BOOLEAN bLMShortOut = rShortOut(lmRing);
124  const BOOLEAN bTAILShortOut = rShortOut(tailRing);
125 
126  lmRing->ShortOut = FALSE;
127  tailRing->ShortOut = FALSE;
128 
130 
131  lmRing->ShortOut = bLMShortOut;
132  tailRing->ShortOut = bTAILShortOut;
133 }
BEGIN_NAMESPACE_SINGULARXX const ring lmRing
Definition: DebugPrint.h:30
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
Definition: DebugPrint.h:30
static BOOLEAN rShortOut(const ring r)
Definition: ring.h:529
void p_String0(poly p, ring lmRing, ring tailRing)
print p according to ShortOut in lmRing & tailRing
Definition: polys0.cc:136
int BOOLEAN
Definition: auxiliary.h:131
void p_String0Short ( const poly  p,
ring  lmRing,
ring  tailRing 
)

print p in a short way, if possible

print p in a short way, if possible

Definition at line 97 of file polys0.cc.

98 {
99  // NOTE: the following (non-thread-safe!) UGLYNESS
100  // (changing naRing->ShortOut for a while) is due to Hans!
101  // Just think of other ring using the VERY SAME naRing and possible
102  // side-effects...
103  const BOOLEAN bLMShortOut = rShortOut(lmRing);
104  const BOOLEAN bTAILShortOut = rShortOut(tailRing);
105 
106  lmRing->ShortOut = rCanShortOut(lmRing);
107  tailRing->ShortOut = rCanShortOut(tailRing);
108 
110 
111  lmRing->ShortOut = bLMShortOut;
112  tailRing->ShortOut = bTAILShortOut;
113 }
BEGIN_NAMESPACE_SINGULARXX const ring lmRing
Definition: DebugPrint.h:30
return P p
Definition: myNF.cc:203
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
Definition: DebugPrint.h:30
static BOOLEAN rShortOut(const ring r)
Definition: ring.h:529
static BOOLEAN rCanShortOut(const ring r)
Definition: ring.h:534
void p_String0(poly p, ring lmRing, ring tailRing)
print p according to ShortOut in lmRing & tailRing
Definition: polys0.cc:136
int BOOLEAN
Definition: auxiliary.h:131
poly p_Sub ( poly  a,
poly  b,
const ring  r 
)

Definition at line 1901 of file p_polys.cc.

1902 {
1903  return p_Add_q(p1, p_Neg(p2,r),r);
1904 }
const ring r
Definition: syzextra.cc:208
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1018
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
static unsigned long p_SubComp ( poly  p,
unsigned long  v,
ring  r 
)
inlinestatic

Definition at line 449 of file p_polys.h.

450 {
454  return __p_GetComp(p,r) -= v;
455 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
#define __p_GetComp(p, r)
Definition: monomials.h:71
return P p
Definition: myNF.cc:203
#define _pPolyAssume2(cond, p, r)
Definition: monomials.h:203
#define pAssume2(cond)
Definition: monomials.h:201
const ring r
Definition: syzextra.cc:208
#define rRing_has_Comp(r)
Definition: monomials.h:274
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
static long p_SubExp ( poly  p,
int  v,
long  ee,
ring  r 
)
inlinestatic

Definition at line 609 of file p_polys.h.

610 {
612  long e = p_GetExp(p,v,r);
613  pAssume2(e >= ee);
614  e -= ee;
615  return p_SetExp(p,v,e,r);
616 }
#define p_LmCheckPolyRing2(p, r)
Definition: monomials.h:207
return P p
Definition: myNF.cc:203
#define pAssume2(cond)
Definition: monomials.h:201
const ring r
Definition: syzextra.cc:208
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
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:484
poly p_Subst ( poly  p,
int  n,
poly  e,
const ring  r 
)

Definition at line 3763 of file p_polys.cc.

3764 {
3765  if (e == NULL) return p_Subst0(p, n,r);
3766 
3767  if (p_IsConstant(e,r))
3768  {
3769  if (n_IsOne(pGetCoeff(e),r->cf)) return p_Subst1(p,n,r);
3770  else return p_Subst2(p, n, pGetCoeff(e),r);
3771  }
3772 
3773 #ifdef HAVE_PLURAL
3774  if (rIsPluralRing(r))
3775  {
3776  return nc_pSubst(p,n,e,r);
3777  }
3778 #endif
3779 
3780  int exponent,i;
3781  poly h, res, m;
3782  int *me,*ee;
3783  number nu,nu1;
3784 
3785  me=(int *)omAlloc((rVar(r)+1)*sizeof(int));
3786  ee=(int *)omAlloc((rVar(r)+1)*sizeof(int));
3787  if (e!=NULL) p_GetExpV(e,ee,r);
3788  res=NULL;
3789  h=p;
3790  while (h!=NULL)
3791  {
3792  if ((e!=NULL) || (p_GetExp(h,n,r)==0))
3793  {
3794  m=p_Head(h,r);
3795  p_GetExpV(m,me,r);
3796  exponent=me[n];
3797  me[n]=0;
3798  for(i=rVar(r);i>0;i--)
3799  me[i]+=exponent*ee[i];
3800  p_SetExpV(m,me,r);
3801  if (e!=NULL)
3802  {
3803  n_Power(pGetCoeff(e),exponent,&nu,r->cf);
3804  nu1=n_Mult(pGetCoeff(m),nu,r->cf);
3805  n_Delete(&nu,r->cf);
3806  p_SetCoeff(m,nu1,r);
3807  }
3808  res=p_Add_q(res,m,r);
3809  }
3810  p_LmDelete(&h,r);
3811  }
3812  omFreeSize((ADDRESS)me,(rVar(r)+1)*sizeof(int));
3813  omFreeSize((ADDRESS)ee,(rVar(r)+1)*sizeof(int));
3814  return res;
3815 }
return P p
Definition: myNF.cc:203
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the one element.
Definition: coeffs.h:469
static void p_GetExpV(poly p, int *ev, const ring r)
Definition: p_polys.h:1448
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
static poly p_Subst1(poly p, int n, const ring r)
Definition: p_polys.cc:3670
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
void * ADDRESS
Definition: auxiliary.h:161
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
#define omAlloc(size)
Definition: omAllocDecl.h:210
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:401
static void p_SetExpV(poly p, int *ev, const ring r)
Definition: p_polys.h:1456
poly res
Definition: myNF.cc:322
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of &#39;a&#39; and &#39;b&#39;, i.e., a*b
Definition: coeffs.h:635
static poly p_Head(poly p, const ring r)
Definition: p_polys.h:819
const ring r
Definition: syzextra.cc:208
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
static BOOLEAN p_IsConstant(const poly p, const ring r)
Definition: p_polys.h:1784
static poly p_Subst0(poly p, int n, const ring r)
Definition: p_polys.cc:3738
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
static FORCE_INLINE void n_Power(number a, int b, number *res, const coeffs r)
fill res with the power a^b
Definition: coeffs.h:631
#define NULL
Definition: omList.c:10
static void p_LmDelete(poly p, const ring r)
Definition: p_polys.h:707
int exponent(const CanonicalForm &f, int q)
int exponent ( const CanonicalForm & f, int q )
static poly p_Subst2(poly p, int n, number e, const ring r)
Definition: p_polys.cc:3697
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
poly nc_pSubst(poly p, int n, poly e, const ring r)
substitute the n-th variable by e in p destroy p e is not a constant
Definition: old.gring.cc:3288
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
static Poly * h
Definition: janet.cc:978
void p_TakeOutComp ( poly p,
long  comp,
poly q,
int *  lq,
const ring  r 
)

Definition at line 3378 of file p_polys.cc.

3379 {
3380  spolyrec pp, qq;
3381  poly p, q, p_prev;
3382  int l = 0;
3383 
3384 #ifdef HAVE_ASSUME
3385  int lp = pLength(*r_p);
3386 #endif
3387 
3388  pNext(&pp) = *r_p;
3389  p = *r_p;
3390  p_prev = &pp;
3391  q = &qq;
3392 
3393  while(p != NULL)
3394  {
3395  while (p_GetComp(p,r) == comp)
3396  {
3397  pNext(q) = p;
3398  pIter(q);
3399  p_SetComp(p, 0,r);
3400  p_SetmComp(p,r);
3401  pIter(p);
3402  l++;
3403  if (p == NULL)
3404  {
3405  pNext(p_prev) = NULL;
3406  goto Finish;
3407  }
3408  }
3409  pNext(p_prev) = p;
3410  p_prev = p;
3411  pIter(p);
3412  }
3413 
3414  Finish:
3415  pNext(q) = NULL;
3416  *r_p = pNext(&pp);
3417  *r_q = pNext(&qq);
3418  *lq = l;
3419 #ifdef HAVE_ASSUME
3420  assume(pLength(*r_p) + pLength(*r_q) == lp);
3421 #endif
3422  p_Test(*r_p,r);
3423  p_Test(*r_q,r);
3424 }
return P p
Definition: myNF.cc:203
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:236
#define p_GetComp(p, r)
Definition: monomials.h:72
static int pLength(poly a)
Definition: p_polys.h:189
poly pp
Definition: myNF.cc:296
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
#define p_Test(p, r)
Definition: p_polys.h:160
#define p_SetmComp
Definition: p_polys.h:233
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
int l
Definition: cfEzgcd.cc:94
poly p_TakeOutComp ( poly p,
int  k,
const ring  r 
)

Definition at line 3317 of file p_polys.cc.

3318 {
3319  poly q = *p,qq=NULL,result = NULL;
3320 
3321  if (q==NULL) return NULL;
3322  BOOLEAN use_setmcomp=rOrd_SetCompRequiresSetm(r);
3323  if (p_GetComp(q,r)==k)
3324  {
3325  result = q;
3326  do
3327  {
3328  p_SetComp(q,0,r);
3329  if (use_setmcomp) p_SetmComp(q,r);
3330  qq = q;
3331  pIter(q);
3332  }
3333  while ((q!=NULL) && (p_GetComp(q,r)==k));
3334  *p = q;
3335  pNext(qq) = NULL;
3336  }
3337  if (q==NULL) return result;
3338  if (p_GetComp(q,r) > k)
3339  {
3340  p_SubComp(q,1,r);
3341  if (use_setmcomp) p_SetmComp(q,r);
3342  }
3343  poly pNext_q;
3344  while ((pNext_q=pNext(q))!=NULL)
3345  {
3346  if (p_GetComp(pNext_q,r)==k)
3347  {
3348  if (result==NULL)
3349  {
3350  result = pNext_q;
3351  qq = result;
3352  }
3353  else
3354  {
3355  pNext(qq) = pNext_q;
3356  pIter(qq);
3357  }
3358  pNext(q) = pNext(pNext_q);
3359  pNext(qq) =NULL;
3360  p_SetComp(qq,0,r);
3361  if (use_setmcomp) p_SetmComp(qq,r);
3362  }
3363  else
3364  {
3365  /*pIter(q);*/ q=pNext_q;
3366  if (p_GetComp(q,r) > k)
3367  {
3368  p_SubComp(q,1,r);
3369  if (use_setmcomp) p_SetmComp(q,r);
3370  }
3371  }
3372  }
3373  return result;
3374 }
return P p
Definition: myNF.cc:203
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:236
#define p_GetComp(p, r)
Definition: monomials.h:72
int k
Definition: cfEzgcd.cc:93
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
BOOLEAN rOrd_SetCompRequiresSetm(const ring r)
return TRUE if p_SetComp requires p_Setm
Definition: ring.cc:1875
static unsigned long p_SubComp(poly p, unsigned long v, ring r)
Definition: p_polys.h:449
#define p_SetmComp
Definition: p_polys.h:233
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:131
return result
Definition: facAbsBiFact.cc:76
poly p_TakeOutComp1 ( poly p,
int  k,
const ring  r 
)

Definition at line 3266 of file p_polys.cc.

3267 {
3268  poly q = *p;
3269 
3270  if (q==NULL) return NULL;
3271 
3272  poly qq=NULL,result = NULL;
3273 
3274  if (p_GetComp(q,r)==k)
3275  {
3276  result = q; /* *p */
3277  while ((q!=NULL) && (p_GetComp(q,r)==k))
3278  {
3279  p_SetComp(q,0,r);
3280  p_SetmComp(q,r);
3281  qq = q;
3282  pIter(q);
3283  }
3284  *p = q;
3285  pNext(qq) = NULL;
3286  }
3287  if (q==NULL) return result;
3288 // if (pGetComp(q) > k) pGetComp(q)--;
3289  while (pNext(q)!=NULL)
3290  {
3291  if (p_GetComp(pNext(q),r)==k)
3292  {
3293  if (result==NULL)
3294  {
3295  result = pNext(q);
3296  qq = result;
3297  }
3298  else
3299  {
3300  pNext(qq) = pNext(q);
3301  pIter(qq);
3302  }
3303  pNext(q) = pNext(pNext(q));
3304  pNext(qq) =NULL;
3305  p_SetComp(qq,0,r);
3306  p_SetmComp(qq,r);
3307  }
3308  else
3309  {
3310  pIter(q);
3311 // if (pGetComp(q) > k) pGetComp(q)--;
3312  }
3313  }
3314  return result;
3315 }
return P p
Definition: myNF.cc:203
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:236
#define p_GetComp(p, r)
Definition: monomials.h:72
int k
Definition: cfEzgcd.cc:93
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
#define p_SetmComp
Definition: p_polys.h:233
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
return result
Definition: facAbsBiFact.cc:76
static long p_Totaldegree ( poly  p,
const ring  r 
)
inlinestatic

Definition at line 1435 of file p_polys.h.

1436 {
1438  unsigned long s = p_GetTotalDegree(p->exp[r->VarL_Offset[0]],
1439  r,
1440  r->MinExpPerLong);
1441  for (int i=r->VarL_Size-1; i>0; i--)
1442  {
1443  s += p_GetTotalDegree(p->exp[r->VarL_Offset[i]], r);
1444  }
1445  return (long)s;
1446 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
return P p
Definition: myNF.cc:203
static unsigned long p_GetTotalDegree(const unsigned long l, const ring r, const int number_of_exps)
Definition: p_polys.h:772
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
int p_Var ( poly  mi,
const ring  r 
)

Definition at line 4433 of file p_polys.cc.

4434 {
4435  if (m==NULL) return 0;
4436  if (pNext(m)!=NULL) return 0;
4437  int i,e=0;
4438  for (i=rVar(r); i>0; i--)
4439  {
4440  int exp=p_GetExp(m,i,r);
4441  if (exp==1)
4442  {
4443  if (e==0) e=i;
4444  else return 0;
4445  }
4446  else if (exp!=0)
4447  {
4448  return 0;
4449  }
4450  }
4451  return e;
4452 }
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
const ring r
Definition: syzextra.cc:208
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 m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
p exp[i]
Definition: DebugPrint.cc:39
void p_Vec2Polys ( poly  v,
poly **  p,
int *  len,
const ring  r 
)

Definition at line 3459 of file p_polys.cc.

3460 {
3461  poly h;
3462  int k;
3463 
3464  *len=p_MaxComp(v,r);
3465  if (*len==0) *len=1;
3466  *p=(poly*)omAlloc0((*len)*sizeof(poly));
3467  while (v!=NULL)
3468  {
3469  h=p_Head(v,r);
3470  k=p_GetComp(h,r);
3471  p_SetComp(h,0,r);
3472  (*p)[k-1]=p_Add_q((*p)[k-1],h,r);
3473  pIter(v);
3474  }
3475 }
return P p
Definition: myNF.cc:203
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:236
#define p_GetComp(p, r)
Definition: monomials.h:72
int k
Definition: cfEzgcd.cc:93
#define pIter(p)
Definition: monomials.h:44
static poly p_Head(poly p, const ring r)
Definition: p_polys.h:819
const ring r
Definition: syzextra.cc:208
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
static Poly * h
Definition: janet.cc:978
#define omAlloc0(size)
Definition: omAllocDecl.h:211
static long p_MaxComp(poly p, ring lmRing, ring tailRing)
Definition: p_polys.h:281
void p_VectorHasUnit ( poly  p,
int *  k,
int *  len,
const ring  r 
)

Definition at line 3234 of file p_polys.cc.

3235 {
3236  poly q=p,qq;
3237  int i,j=0;
3238 
3239  *len = 0;
3240  while (q!=NULL)
3241  {
3242  if (p_LmIsConstantComp(q,r))
3243  {
3244  i = p_GetComp(q,r);
3245  qq = p;
3246  while ((qq != q) && (p_GetComp(qq,r) != i)) pIter(qq);
3247  if (qq == q)
3248  {
3249  j = 0;
3250  while (qq!=NULL)
3251  {
3252  if (p_GetComp(qq,r)==i) j++;
3253  pIter(qq);
3254  }
3255  if ((*len == 0) || (j<*len))
3256  {
3257  *len = j;
3258  *k = i;
3259  }
3260  }
3261  }
3262  pIter(q);
3263  }
3264 }
static BOOLEAN p_LmIsConstantComp(const poly p, const ring r)
Definition: p_polys.h:937
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
int k
Definition: cfEzgcd.cc:93
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
BOOLEAN p_VectorHasUnitB ( poly  p,
int *  k,
const ring  r 
)

Definition at line 3209 of file p_polys.cc.

3210 {
3211  poly q=p,qq;
3212  int i;
3213 
3214  while (q!=NULL)
3215  {
3216  if (p_LmIsConstantComp(q,r))
3217  {
3218  i = p_GetComp(q,r);
3219  qq = p;
3220  while ((qq != q) && (p_GetComp(qq,r) != i)) pIter(qq);
3221  if (qq == q)
3222  {
3223  *k = i;
3224  return TRUE;
3225  }
3226  else
3227  pIter(q);
3228  }
3229  else pIter(q);
3230  }
3231  return FALSE;
3232 }
static BOOLEAN p_LmIsConstantComp(const poly p, const ring r)
Definition: p_polys.h:937
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
#define TRUE
Definition: auxiliary.h:144
int k
Definition: cfEzgcd.cc:93
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
long p_WDegree ( poly  p,
const ring  r 
)

Definition at line 713 of file p_polys.cc.

714 {
715  if (r->firstwv==NULL) return p_Totaldegree(p, r);
717  int i;
718  long j =0;
719 
720  for(i=1;i<=r->firstBlockEnds;i++)
721  j+=p_GetExp(p, i, r)*r->firstwv[i-1];
722 
723  for (;i<=rVar(r);i++)
724  j+=p_GetExp(p,i, r)*p_Weight(i, r);
725 
726  return j;
727 }
return P p
Definition: myNF.cc:203
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1435
int p_Weight(int i, const ring r)
Definition: p_polys.cc:704
const ring r
Definition: syzextra.cc:208
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
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
BOOLEAN p_LmCheckPolyRing(poly p, ring r)
Definition: pDebug.cc:119
int p_Weight ( int  c,
const ring  r 
)

Definition at line 704 of file p_polys.cc.

705 {
706  if ((r->firstwv==NULL) || (i>r->firstBlockEnds))
707  {
708  return 1;
709  }
710  return r->firstwv[i-1];
711 }
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
long p_WFirstTotalDegree ( poly  p,
ring  r 
)

Definition at line 595 of file p_polys.cc.

596 {
597  int i;
598  long sum = 0;
599 
600  for (i=1; i<= r->firstBlockEnds; i++)
601  {
602  sum += p_GetExp(p, i, r)*r->firstwv[i-1];
603  }
604  return sum;
605 }
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
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 i
Definition: cfEzgcd.cc:123
void p_Write ( poly  p,
ring  lmRing,
ring  tailRing 
)

Definition at line 206 of file polys0.cc.

207 {
209  PrintLn();
210 }
void PrintLn()
Definition: reporter.cc:327
BEGIN_NAMESPACE_SINGULARXX const ring lmRing
Definition: DebugPrint.h:30
return P p
Definition: myNF.cc:203
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
Definition: DebugPrint.h:30
void p_Write0(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:196
static void p_Write ( poly  p,
ring  p_ring 
)
inlinestatic

Definition at line 1176 of file p_polys.h.

1177 {
1178  p_Write(p, p_ring, p_ring);
1179 }
return P p
Definition: myNF.cc:203
void p_Write(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:206
void p_Write0 ( poly  p,
ring  lmRing,
ring  tailRing 
)

Definition at line 196 of file polys0.cc.

197 {
198  char *s=p_String(p, lmRing, tailRing);
199  PrintS(s);
200  omFree(s);
201 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
char * p_String(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:186
BEGIN_NAMESPACE_SINGULARXX const ring lmRing
Definition: DebugPrint.h:30
return P p
Definition: myNF.cc:203
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
Definition: DebugPrint.h:30
#define omFree(addr)
Definition: omAllocDecl.h:261
void PrintS(const char *s)
Definition: reporter.cc:294
static void p_Write0 ( poly  p,
ring  p_ring 
)
inlinestatic

Definition at line 1180 of file p_polys.h.

1181 {
1182  p_Write0(p, p_ring, p_ring);
1183 }
return P p
Definition: myNF.cc:203
void p_Write0(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:196
void p_wrp ( poly  p,
ring  lmRing,
ring  tailRing 
)

Definition at line 237 of file polys0.cc.

238 {
239  poly r;
240 
241  if (p==NULL) PrintS("NULL");
242  else if (pNext(p)==NULL) p_Write0(p, lmRing);
243  else
244  {
245  r = pNext(pNext(p));
246  pNext(pNext(p)) = NULL;
247  p_Write0(p, tailRing);
248  if (r!=NULL)
249  {
250  PrintS("+...");
251  pNext(pNext(p)) = r;
252  }
253  }
254 }
BEGIN_NAMESPACE_SINGULARXX const ring lmRing
Definition: DebugPrint.h:30
return P p
Definition: myNF.cc:203
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
Definition: DebugPrint.h:30
const ring r
Definition: syzextra.cc:208
void p_Write0(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:196
void PrintS(const char *s)
Definition: reporter.cc:294
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
static void p_wrp ( poly  p,
ring  p_ring 
)
inlinestatic

Definition at line 1184 of file p_polys.h.

1185 {
1186  p_wrp(p, p_ring, p_ring);
1187 }
return P p
Definition: myNF.cc:203
void p_wrp(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:237
long p_WTotaldegree ( poly  p,
const ring  r 
)

Definition at line 612 of file p_polys.cc.

613 {
615  int i, k;
616  long j =0;
617 
618  // iterate through each block:
619  for (i=0;r->order[i]!=0;i++)
620  {
621  int b0=r->block0[i];
622  int b1=r->block1[i];
623  switch(r->order[i])
624  {
625  case ringorder_M:
626  for (k=b0 /*r->block0[i]*/;k<=b1 /*r->block1[i]*/;k++)
627  { // in jedem block:
628  j+= p_GetExp(p,k,r)*r->wvhdl[i][k - b0 /*r->block0[i]*/]*r->OrdSgn;
629  }
630  break;
631  case ringorder_wp:
632  case ringorder_ws:
633  case ringorder_Wp:
634  case ringorder_Ws:
635  for (k=b0 /*r->block0[i]*/;k<=b1 /*r->block1[i]*/;k++)
636  { // in jedem block:
637  j+= p_GetExp(p,k,r)*r->wvhdl[i][k - b0 /*r->block0[i]*/];
638  }
639  break;
640  case ringorder_lp:
641  case ringorder_ls:
642  case ringorder_rs:
643  case ringorder_dp:
644  case ringorder_ds:
645  case ringorder_Dp:
646  case ringorder_Ds:
647  case ringorder_rp:
648  for (k=b0 /*r->block0[i]*/;k<=b1 /*r->block1[i]*/;k++)
649  {
650  j+= p_GetExp(p,k,r);
651  }
652  break;
653  case ringorder_a64:
654  {
655  int64* w=(int64*)r->wvhdl[i];
656  for (k=0;k<=(b1 /*r->block1[i]*/ - b0 /*r->block0[i]*/);k++)
657  {
658  //there should be added a line which checks if w[k]>2^31
659  j+= p_GetExp(p,k+1, r)*(long)w[k];
660  }
661  //break;
662  return j;
663  }
664  case ringorder_c:
665  case ringorder_C:
666  case ringorder_S:
667  case ringorder_s:
668  case ringorder_aa:
669  case ringorder_IS:
670  break;
671  case ringorder_a:
672  for (k=b0 /*r->block0[i]*/;k<=b1 /*r->block1[i]*/;k++)
673  { // only one line
674  j+= p_GetExp(p,k, r)*r->wvhdl[i][ k- b0 /*r->block0[i]*/];
675  }
676  //break;
677  return j;
678 
679 #ifndef SING_NDEBUG
680  default:
681  Print("missing order %d in p_WTotaldegree\n",r->order[i]);
682  break;
683 #endif
684  }
685  }
686  return j;
687 }
for idElimination, like a, except pFDeg, pWeigths ignore it
Definition: ring.h:693
for int64 weights
Definition: ring.h:673
#define Print
Definition: emacs.cc:83
return P p
Definition: myNF.cc:203
opposite of ls
Definition: ring.h:694
long int64
Definition: auxiliary.h:112
int k
Definition: cfEzgcd.cc:93
const ring r
Definition: syzextra.cc:208
for(int i=0;i< R->ExpL_Size;i++) Print("%09lx "
Definition: cfEzgcd.cc:66
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
int i
Definition: cfEzgcd.cc:123
Induced (Schreyer) ordering.
Definition: ring.h:695
S?
Definition: ring.h:677
BOOLEAN p_LmCheckPolyRing(poly p, ring r)
Definition: pDebug.cc:119
const CanonicalForm & w
Definition: facAbsFact.cc:55
s?
Definition: ring.h:678
void pEnlargeSet ( poly **  p,
int  length,
int  increment 
)

Definition at line 3540 of file p_polys.cc.

3541 {
3542  poly* h;
3543 
3544  if (*p==NULL)
3545  {
3546  if (increment==0) return;
3547  h=(poly*)omAlloc0(increment*sizeof(poly));
3548  }
3549  else
3550  {
3551  h=(poly*)omReallocSize((poly*)*p,l*sizeof(poly),(l+increment)*sizeof(poly));
3552  if (increment>0)
3553  {
3554  //for (i=l; i<l+increment; i++)
3555  // h[i]=NULL;
3556  memset(&(h[l]),0,increment*sizeof(poly));
3557  }
3558  }
3559  *p=h;
3560 }
return P p
Definition: myNF.cc:203
#define omReallocSize(addr, o_size, size)
Definition: omAllocDecl.h:220
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int l
Definition: cfEzgcd.cc:94
BOOLEAN pHaveCommonMonoms ( poly  p,
poly  q 
)

Definition at line 174 of file pDebug.cc.

175 {
176  while (p != NULL)
177  {
178  if (pIsMonomOf(q, p))
179  {
180  return TRUE;
181  }
182  pIter(p);
183  }
184  return FALSE;
185 }
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:144
#define pIter(p)
Definition: monomials.h:44
BOOLEAN pIsMonomOf(poly p, poly m)
Definition: pDebug.cc:164
#define NULL
Definition: omList.c:10
BOOLEAN pIsMonomOf ( poly  p,
poly  m 
)

Definition at line 164 of file pDebug.cc.

165 {
166  if (m == NULL) return TRUE;
167  while (p != NULL)
168  {
169  if (p == m) return TRUE;
170  pIter(p);
171  }
172  return FALSE;
173 }
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:144
#define pIter(p)
Definition: monomials.h:44
int m
Definition: cfEzgcd.cc:119
#define NULL
Definition: omList.c:10
long pLDeg0 ( poly  p,
int *  l,
ring  r 
)

Definition at line 738 of file p_polys.cc.

739 {
740  p_CheckPolyRing(p, r);
741  long k= p_GetComp(p, r);
742  int ll=1;
743 
744  if (k > 0)
745  {
746  while ((pNext(p)!=NULL) && (p_GetComp(pNext(p), r)==k))
747  {
748  pIter(p);
749  ll++;
750  }
751  }
752  else
753  {
754  while (pNext(p)!=NULL)
755  {
756  pIter(p);
757  ll++;
758  }
759  }
760  *l=ll;
761  return r->pFDeg(p, r);
762 }
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
int k
Definition: cfEzgcd.cc:93
#define pIter(p)
Definition: monomials.h:44
BOOLEAN p_CheckPolyRing(poly p, ring r)
Definition: pDebug.cc:111
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
int l
Definition: cfEzgcd.cc:94
long pLDeg0c ( poly  p,
int *  l,
ring  r 
)

Definition at line 769 of file p_polys.cc.

770 {
771  assume(p!=NULL);
772  p_Test(p,r);
773  p_CheckPolyRing(p, r);
774  long o;
775  int ll=1;
776 
777  if (! rIsSyzIndexRing(r))
778  {
779  while (pNext(p) != NULL)
780  {
781  pIter(p);
782  ll++;
783  }
784  o = r->pFDeg(p, r);
785  }
786  else
787  {
788  int curr_limit = rGetCurrSyzLimit(r);
789  poly pp = p;
790  while ((p=pNext(p))!=NULL)
791  {
792  if (p_GetComp(p, r)<=curr_limit/*syzComp*/)
793  ll++;
794  else break;
795  pp = p;
796  }
797  p_Test(pp,r);
798  o = r->pFDeg(pp, r);
799  }
800  *l=ll;
801  return o;
802 }
return P p
Definition: myNF.cc:203
static BOOLEAN rIsSyzIndexRing(const ring r)
Definition: ring.h:714
#define p_GetComp(p, r)
Definition: monomials.h:72
static int rGetCurrSyzLimit(const ring r)
Definition: ring.h:717
poly pp
Definition: myNF.cc:296
#define pIter(p)
Definition: monomials.h:44
BOOLEAN p_CheckPolyRing(poly p, ring r)
Definition: pDebug.cc:111
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
#define p_Test(p, r)
Definition: p_polys.h:160
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
int l
Definition: cfEzgcd.cc:94
long pLDeg1 ( poly  p,
int *  l,
ring  r 
)

Definition at line 840 of file p_polys.cc.

841 {
842  p_CheckPolyRing(p, r);
843  long k= p_GetComp(p, r);
844  int ll=1;
845  long t,max;
846 
847  max=r->pFDeg(p, r);
848  if (k > 0)
849  {
850  while (((p=pNext(p))!=NULL) && (p_GetComp(p, r)==k))
851  {
852  t=r->pFDeg(p, r);
853  if (t>max) max=t;
854  ll++;
855  }
856  }
857  else
858  {
859  while ((p=pNext(p))!=NULL)
860  {
861  t=r->pFDeg(p, r);
862  if (t>max) max=t;
863  ll++;
864  }
865  }
866  *l=ll;
867  return max;
868 }
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
int k
Definition: cfEzgcd.cc:93
BOOLEAN p_CheckPolyRing(poly p, ring r)
Definition: pDebug.cc:111
const ring r
Definition: syzextra.cc:208
static int max(int a, int b)
Definition: fast_mult.cc:264
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
int l
Definition: cfEzgcd.cc:94
long pLDeg1_Deg ( poly  p,
int *  l,
ring  r 
)

Definition at line 909 of file p_polys.cc.

910 {
911  assume(r->pFDeg == p_Deg);
912  p_CheckPolyRing(p, r);
913  long k= p_GetComp(p, r);
914  int ll=1;
915  long t,max;
916 
917  max=p_GetOrder(p, r);
918  if (k > 0)
919  {
920  while (((p=pNext(p))!=NULL) && (p_GetComp(p, r)==k))
921  {
922  t=p_GetOrder(p, r);
923  if (t>max) max=t;
924  ll++;
925  }
926  }
927  else
928  {
929  while ((p=pNext(p))!=NULL)
930  {
931  t=p_GetOrder(p, r);
932  if (t>max) max=t;
933  ll++;
934  }
935  }
936  *l=ll;
937  return max;
938 }
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
int k
Definition: cfEzgcd.cc:93
BOOLEAN p_CheckPolyRing(poly p, ring r)
Definition: pDebug.cc:111
long p_Deg(poly a, const ring r)
Definition: p_polys.cc:586
const ring r
Definition: syzextra.cc:208
static int max(int a, int b)
Definition: fast_mult.cc:264
#define assume(x)
Definition: mod2.h:405
static long p_GetOrder(poly p, ring r)
Definition: p_polys.h:410
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
int l
Definition: cfEzgcd.cc:94
long pLDeg1_Totaldegree ( poly  p,
int *  l,
ring  r 
)

Definition at line 974 of file p_polys.cc.

975 {
976  p_CheckPolyRing(p, r);
977  long k= p_GetComp(p, r);
978  int ll=1;
979  long t,max;
980 
981  max=p_Totaldegree(p, r);
982  if (k > 0)
983  {
984  while (((p=pNext(p))!=NULL) && (p_GetComp(p, r)==k))
985  {
986  t=p_Totaldegree(p, r);
987  if (t>max) max=t;
988  ll++;
989  }
990  }
991  else
992  {
993  while ((p=pNext(p))!=NULL)
994  {
995  t=p_Totaldegree(p, r);
996  if (t>max) max=t;
997  ll++;
998  }
999  }
1000  *l=ll;
1001  return max;
1002 }
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1435
int k
Definition: cfEzgcd.cc:93
BOOLEAN p_CheckPolyRing(poly p, ring r)
Definition: pDebug.cc:111
const ring r
Definition: syzextra.cc:208
static int max(int a, int b)
Definition: fast_mult.cc:264
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
int l
Definition: cfEzgcd.cc:94
long pLDeg1_WFirstTotalDegree ( poly  p,
int *  l,
ring  r 
)

Definition at line 1037 of file p_polys.cc.

1038 {
1039  p_CheckPolyRing(p, r);
1040  long k= p_GetComp(p, r);
1041  int ll=1;
1042  long t,max;
1043 
1044  max=p_WFirstTotalDegree(p, r);
1045  if (k > 0)
1046  {
1047  while (((p=pNext(p))!=NULL) && (p_GetComp(p, r)==k))
1048  {
1049  t=p_WFirstTotalDegree(p, r);
1050  if (t>max) max=t;
1051  ll++;
1052  }
1053  }
1054  else
1055  {
1056  while ((p=pNext(p))!=NULL)
1057  {
1058  t=p_WFirstTotalDegree(p, r);
1059  if (t>max) max=t;
1060  ll++;
1061  }
1062  }
1063  *l=ll;
1064  return max;
1065 }
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
int k
Definition: cfEzgcd.cc:93
BOOLEAN p_CheckPolyRing(poly p, ring r)
Definition: pDebug.cc:111
const ring r
Definition: syzextra.cc:208
static int max(int a, int b)
Definition: fast_mult.cc:264
long p_WFirstTotalDegree(poly p, const ring r)
Definition: p_polys.cc:595
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
int l
Definition: cfEzgcd.cc:94
long pLDeg1c ( poly  p,
int *  l,
ring  r 
)

Definition at line 876 of file p_polys.cc.

877 {
878  p_CheckPolyRing(p, r);
879  int ll=1;
880  long t,max;
881 
882  max=r->pFDeg(p, r);
883  if (rIsSyzIndexRing(r))
884  {
885  long limit = rGetCurrSyzLimit(r);
886  while ((p=pNext(p))!=NULL)
887  {
888  if (p_GetComp(p, r)<=limit)
889  {
890  if ((t=r->pFDeg(p, r))>max) max=t;
891  ll++;
892  }
893  else break;
894  }
895  }
896  else
897  {
898  while ((p=pNext(p))!=NULL)
899  {
900  if ((t=r->pFDeg(p, r))>max) max=t;
901  ll++;
902  }
903  }
904  *l=ll;
905  return max;
906 }
return P p
Definition: myNF.cc:203
static BOOLEAN rIsSyzIndexRing(const ring r)
Definition: ring.h:714
#define p_GetComp(p, r)
Definition: monomials.h:72
static int rGetCurrSyzLimit(const ring r)
Definition: ring.h:717
BOOLEAN p_CheckPolyRing(poly p, ring r)
Definition: pDebug.cc:111
const ring r
Definition: syzextra.cc:208
static int max(int a, int b)
Definition: fast_mult.cc:264
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
int l
Definition: cfEzgcd.cc:94
long pLDeg1c_Deg ( poly  p,
int *  l,
ring  r 
)

Definition at line 940 of file p_polys.cc.

941 {
942  assume(r->pFDeg == p_Deg);
943  p_CheckPolyRing(p, r);
944  int ll=1;
945  long t,max;
946 
947  max=p_GetOrder(p, r);
948  if (rIsSyzIndexRing(r))
949  {
950  long limit = rGetCurrSyzLimit(r);
951  while ((p=pNext(p))!=NULL)
952  {
953  if (p_GetComp(p, r)<=limit)
954  {
955  if ((t=p_GetOrder(p, r))>max) max=t;
956  ll++;
957  }
958  else break;
959  }
960  }
961  else
962  {
963  while ((p=pNext(p))!=NULL)
964  {
965  if ((t=p_GetOrder(p, r))>max) max=t;
966  ll++;
967  }
968  }
969  *l=ll;
970  return max;
971 }
return P p
Definition: myNF.cc:203
static BOOLEAN rIsSyzIndexRing(const ring r)
Definition: ring.h:714
#define p_GetComp(p, r)
Definition: monomials.h:72
static int rGetCurrSyzLimit(const ring r)
Definition: ring.h:717
BOOLEAN p_CheckPolyRing(poly p, ring r)
Definition: pDebug.cc:111
long p_Deg(poly a, const ring r)
Definition: p_polys.cc:586
const ring r
Definition: syzextra.cc:208
static int max(int a, int b)
Definition: fast_mult.cc:264
#define assume(x)
Definition: mod2.h:405
static long p_GetOrder(poly p, ring r)
Definition: p_polys.h:410
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
int l
Definition: cfEzgcd.cc:94
long pLDeg1c_Totaldegree ( poly  p,
int *  l,
ring  r 
)

Definition at line 1004 of file p_polys.cc.

1005 {
1006  p_CheckPolyRing(p, r);
1007  int ll=1;
1008  long t,max;
1009 
1010  max=p_Totaldegree(p, r);
1011  if (rIsSyzIndexRing(r))
1012  {
1013  long limit = rGetCurrSyzLimit(r);
1014  while ((p=pNext(p))!=NULL)
1015  {
1016  if (p_GetComp(p, r)<=limit)
1017  {
1018  if ((t=p_Totaldegree(p, r))>max) max=t;
1019  ll++;
1020  }
1021  else break;
1022  }
1023  }
1024  else
1025  {
1026  while ((p=pNext(p))!=NULL)
1027  {
1028  if ((t=p_Totaldegree(p, r))>max) max=t;
1029  ll++;
1030  }
1031  }
1032  *l=ll;
1033  return max;
1034 }
return P p
Definition: myNF.cc:203
static BOOLEAN rIsSyzIndexRing(const ring r)
Definition: ring.h:714
#define p_GetComp(p, r)
Definition: monomials.h:72
static int rGetCurrSyzLimit(const ring r)
Definition: ring.h:717
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1435
BOOLEAN p_CheckPolyRing(poly p, ring r)
Definition: pDebug.cc:111
const ring r
Definition: syzextra.cc:208
static int max(int a, int b)
Definition: fast_mult.cc:264
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
int l
Definition: cfEzgcd.cc:94
long pLDeg1c_WFirstTotalDegree ( poly  p,
int *  l,
ring  r 
)

Definition at line 1067 of file p_polys.cc.

1068 {
1069  p_CheckPolyRing(p, r);
1070  int ll=1;
1071  long t,max;
1072 
1073  max=p_WFirstTotalDegree(p, r);
1074  if (rIsSyzIndexRing(r))
1075  {
1076  long limit = rGetCurrSyzLimit(r);
1077  while ((p=pNext(p))!=NULL)
1078  {
1079  if (p_GetComp(p, r)<=limit)
1080  {
1081  if ((t=p_Totaldegree(p, r))>max) max=t;
1082  ll++;
1083  }
1084  else break;
1085  }
1086  }
1087  else
1088  {
1089  while ((p=pNext(p))!=NULL)
1090  {
1091  if ((t=p_Totaldegree(p, r))>max) max=t;
1092  ll++;
1093  }
1094  }
1095  *l=ll;
1096  return max;
1097 }
return P p
Definition: myNF.cc:203
static BOOLEAN rIsSyzIndexRing(const ring r)
Definition: ring.h:714
#define p_GetComp(p, r)
Definition: monomials.h:72
static int rGetCurrSyzLimit(const ring r)
Definition: ring.h:717
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1435
BOOLEAN p_CheckPolyRing(poly p, ring r)
Definition: pDebug.cc:111
const ring r
Definition: syzextra.cc:208
static int max(int a, int b)
Definition: fast_mult.cc:264
long p_WFirstTotalDegree(poly p, const ring r)
Definition: p_polys.cc:595
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
int l
Definition: cfEzgcd.cc:94
long pLDegb ( poly  p,
int *  l,
ring  r 
)

Definition at line 810 of file p_polys.cc.

811 {
812  p_CheckPolyRing(p, r);
813  long k= p_GetComp(p, r);
814  long o = r->pFDeg(p, r);
815  int ll=1;
816 
817  if (k != 0)
818  {
819  while (((p=pNext(p))!=NULL) && (p_GetComp(p, r)==k))
820  {
821  ll++;
822  }
823  }
824  else
825  {
826  while ((p=pNext(p)) !=NULL)
827  {
828  ll++;
829  }
830  }
831  *l=ll;
832  return o;
833 }
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
int k
Definition: cfEzgcd.cc:93
BOOLEAN p_CheckPolyRing(poly p, ring r)
Definition: pDebug.cc:111
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
int l
Definition: cfEzgcd.cc:94
static int pLength ( poly  a)
inlinestatic

Definition at line 189 of file p_polys.h.

190 {
191  int l = 0;
192  while (a!=NULL)
193  {
194  pIter(a);
195  l++;
196  }
197  return l;
198 }
const poly a
Definition: syzextra.cc:212
#define pIter(p)
Definition: monomials.h:44
#define NULL
Definition: omList.c:10
int l
Definition: cfEzgcd.cc:94
poly pp_Jet ( poly  p,
int  m,
const ring  R 
)

Definition at line 4135 of file p_polys.cc.

4136 {
4137  poly r=NULL;
4138  poly t=NULL;
4139 
4140  while (p!=NULL)
4141  {
4142  if (p_Totaldegree(p,R)<=m)
4143  {
4144  if (r==NULL)
4145  r=p_Head(p,R);
4146  else
4147  if (t==NULL)
4148  {
4149  pNext(r)=p_Head(p,R);
4150  t=pNext(r);
4151  }
4152  else
4153  {
4154  pNext(t)=p_Head(p,R);
4155  pIter(t);
4156  }
4157  }
4158  pIter(p);
4159  }
4160  return r;
4161 }
return P p
Definition: myNF.cc:203
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1435
#define pIter(p)
Definition: monomials.h:44
static poly p_Head(poly p, const ring r)
Definition: p_polys.h:819
const ring r
Definition: syzextra.cc:208
const ring R
Definition: DebugPrint.cc:36
int m
Definition: cfEzgcd.cc:119
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
poly pp_JetW ( poly  p,
int  m,
short *  w,
const ring  R 
)

Definition at line 4180 of file p_polys.cc.

4181 {
4182  poly r=NULL;
4183  poly t=NULL;
4184  while (p!=NULL)
4185  {
4186  if (totaldegreeWecart_IV(p,R,w)<=m)
4187  {
4188  if (r==NULL)
4189  r=p_Head(p,R);
4190  else
4191  if (t==NULL)
4192  {
4193  pNext(r)=p_Head(p,R);
4194  t=pNext(r);
4195  }
4196  else
4197  {
4198  pNext(t)=p_Head(p,R);
4199  pIter(t);
4200  }
4201  }
4202  pIter(p);
4203  }
4204  return r;
4205 }
return P p
Definition: myNF.cc:203
long totaldegreeWecart_IV(poly p, ring r, const short *w)
Definition: weight.cc:239
#define pIter(p)
Definition: monomials.h:44
static poly p_Head(poly p, const ring r)
Definition: p_polys.h:819
const ring r
Definition: syzextra.cc:208
const ring R
Definition: DebugPrint.cc:36
int m
Definition: cfEzgcd.cc:119
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
static poly pp_Mult_Coeff_mm_DivSelect ( poly  p,
const poly  m,
const ring  r 
)
inlinestatic

Definition at line 1001 of file p_polys.h.

1002 {
1003  int shorter;
1004  return r->p_Procs->pp_Mult_Coeff_mm_DivSelect(p, m, shorter, r);
1005 }
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
int m
Definition: cfEzgcd.cc:119
static poly pp_Mult_Coeff_mm_DivSelect ( poly  p,
int &  lp,
const poly  m,
const ring  r 
)
inlinestatic

Definition at line 1009 of file p_polys.h.

1010 {
1011  int shorter;
1012  poly pp = r->p_Procs->pp_Mult_Coeff_mm_DivSelect(p, m, shorter, r);
1013  lp -= shorter;
1014  return pp;
1015 }
return P p
Definition: myNF.cc:203
poly pp
Definition: myNF.cc:296
const ring r
Definition: syzextra.cc:208
int m
Definition: cfEzgcd.cc:119
polyrec * poly
Definition: hilb.h:10
static poly pp_Mult_mm ( poly  p,
poly  m,
const ring  r 
)
inlinestatic

Definition at line 962 of file p_polys.h.

963 {
964  if (p_LmIsConstant(m, r))
965  return pp_Mult_nn(p, pGetCoeff(m), r);
966  else
967  {
968  return r->p_Procs->pp_Mult_mm(p, m, r);
969  }
970 }
return P p
Definition: myNF.cc:203
static poly pp_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:927
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static BOOLEAN p_LmIsConstant(const poly p, const ring r)
Definition: p_polys.h:954
const ring r
Definition: syzextra.cc:208
int m
Definition: cfEzgcd.cc:119
static poly pp_Mult_nn ( poly  p,
number  n,
const ring  r 
)
inlinestatic

Definition at line 927 of file p_polys.h.

928 {
929  if (n_IsOne(n, r->cf))
930  return p_Copy(p, r);
931  else
932  return r->p_Procs->pp_Mult_nn(p, n, r);
933 }
return P p
Definition: myNF.cc:203
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the one element.
Definition: coeffs.h:469
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:811
const ring r
Definition: syzextra.cc:208
static poly pp_Mult_qq ( poly  p,
poly  q,
const ring  r 
)
inlinestatic

Definition at line 1075 of file p_polys.h.

1076 {
1077  if (p == NULL || q == NULL) return NULL;
1078 
1079  if (pNext(p) == NULL)
1080  {
1081 #ifdef HAVE_PLURAL
1082  if (rIsPluralRing(r))
1083  return nc_mm_Mult_pp(p, q, r);
1084 #endif
1085  return r->p_Procs->pp_Mult_mm(q, p, r);
1086  }
1087 
1088  if (pNext(q) == NULL)
1089  {
1090  return r->p_Procs->pp_Mult_mm(p, q, r);
1091  }
1092 
1093  poly qq = q;
1094  if (p == q)
1095  qq = p_Copy(q, r);
1096 
1097  poly res;
1098 #ifdef HAVE_PLURAL
1099  if (rIsPluralRing(r))
1100  res = _nc_pp_Mult_qq(p, qq, r);
1101  else
1102 #endif
1103  res = _p_Mult_q(p, qq, 1, r);
1104 
1105  if (qq != q)
1106  p_Delete(&qq, r);
1107  return res;
1108 }
poly _nc_pp_Mult_qq(const poly p, const poly q, const ring r)
general NC-multiplication without destruction
Definition: old.gring.cc:313
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.
Definition: p_Mult_q.cc:273
return P p
Definition: myNF.cc:203
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:811
poly res
Definition: myNF.cc:322
const ring r
Definition: syzextra.cc:208
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static poly nc_mm_Mult_pp(const poly m, const poly p, const ring r)
Definition: nc.h:240
polyrec * poly
Definition: hilb.h:10
void pRestoreDegProcs ( ring  r,
pFDegProc  old_FDeg,
pLDegProc  old_lDeg 
)

Definition at line 3493 of file p_polys.cc.

3494 {
3495  assume(old_FDeg != NULL && old_lDeg != NULL);
3496  r->pFDeg = old_FDeg;
3497  r->pLDeg = old_lDeg;
3498 }
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static poly pReverse ( poly  p)
inlinestatic

Definition at line 324 of file p_polys.h.

325 {
326  if (p == NULL || pNext(p) == NULL) return p;
327 
328  poly q = pNext(p), // == pNext(p)
329  qn;
330  pNext(p) = NULL;
331  do
332  {
333  qn = pNext(q);
334  pNext(q) = p;
335  p = q;
336  q = qn;
337  }
338  while (qn != NULL);
339  return p;
340 }
return P p
Definition: myNF.cc:203
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
void pSetDegProcs ( ring  r,
pFDegProc  new_FDeg,
pLDegProc  new_lDeg = NULL 
)

Definition at line 3481 of file p_polys.cc.

3482 {
3483  assume(new_FDeg != NULL);
3484  r->pFDeg = new_FDeg;
3485 
3486  if (new_lDeg == NULL)
3487  new_lDeg = r->pLDegOrig;
3488 
3489  r->pLDeg = new_lDeg;
3490 }
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10