39 #define freeT(A,v) omFreeSize((ADDRESS)A,(v+1)*sizeof(int))
50 if (p==
NULL)
return(p);
57 if (sh == 0)
return(p);
81 if (p==
NULL)
return(p);
82 if (sh == 0)
return(p);
98 if (sh == 0)
return(p);
103 PrintS(
"pmLPshift: negative shift requested\n");
109 if (L+sh-1 > uptodeg)
112 PrintS(
"p_mLPshift: too big shift requested\n");
116 int *e=(
int *)
omAlloc0((r->N+1)*
sizeof(int));
117 int *
s=(
int *)
omAlloc0((r->N+1)*
sizeof(int));
123 for (j=1; j<= L*lV ; j++)
127 s[j + (sh*lV)] = e[j];
163 if (sh == 0)
return(p);
183 if (sh == 0)
return(p);
188 PrintS(
"pmLPshift: negative shift requested\n");
194 if (L+sh-1 > uptodeg)
197 PrintS(
"pmLPshift: too big shift requested\n");
210 s[j + (sh*lV)] = e[j];
253 while ( (!e[j]) && (j>=1) ) j--;
258 PrintS(
"pmLastVblock: unexpected zero exponent vector\n");
315 int *e=(
int *)
omAlloc0((r->N+1)*
sizeof(int));
319 while ( (!e[j]) && (j>=1) ) j--;
323 PrintS(
"pmLastVblock: unexpected zero exponent vector\n");
327 b = (int)((j+lV-1)/lV);
362 while ( (!e[j]) && (j<=currRing->
N-1) ) j++;
366 PrintS(
"pmFirstVblock: unexpected zero exponent vector\n");
382 if (lV <= 0)
return(0);
389 int *
B = (
int *)
omAlloc0((b+1)*
sizeof(int));
396 for (i=(j-1)*lV + 1; i<= j*lV; i++)
398 if (e[i]) B[
j] = B[
j]+1;
410 if (j==0)
goto ret_true;
450 for(i = 0; i <=
s; i++)
491 if (p==
NULL)
return(p);
517 if (p==
NULL)
return(p);
538 int *e = (
int *)
omAlloc0((r->N+1)*
sizeof(int));
539 int b = (int)((r->N +lV-1)/lV);
541 int *S = (
int *)
omAlloc0((r->N+1)*
sizeof(int));
543 int i,
j;
int cnt = 1;
548 for (i=(j-1)*lV + 1; i<= j*lV; i++)
553 S[(cnt-1)*lV + (i - (j-1)*lV)] = e[i];
int p_mLastVblock(poly p, int lV, const ring r)
const CanonicalForm int s
int itoInsert(poly p, int uptodeg, int lV, const ring r)
BOOLEAN p_LmCheckIsFromRing(poly p, ring r)
static int si_min(const int a, const int b)
poly pmLPshift(poly p, int sh, int uptodeg, int lV)
Compatiblity layer for legacy polynomial operations (over currRing)
poly p_ShrinkT(poly p, int lV, kStrategy strat, const ring r)
int poly_isInV(poly p, int lV)
int ideal_isInV(ideal I, int lV)
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
static void p_GetExpV(poly p, int *ev, const ring r)
poly p_mShrink(poly p, int lV, const ring r)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
static number p_SetCoeff(poly p, number n, ring r)
static void p_SetExpV(poly p, int *ev, const ring r)
static BOOLEAN p_LmIsConstant(const poly p, const ring r)
poly p_LPshift(poly p, int sh, int uptodeg, int lV, const ring r)
poly p_Shrink(poly p, int lV, const ring r)
int p_LastVblockT(poly p, int lV, kStrategy strat, const ring r)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
const CanonicalForm CFMap CFMap & N
poly pLPshift(poly p, int sh, int uptodeg, int lV)
#define pIsConstant(p)
like above, except that Comp might be != 0
static int si_max(const int a, const int b)
void PrintS(const char *s)
int isInV(poly p, int lV)
static void p_Delete(poly *p, const ring r)
int pFirstVblock(poly p, int lV)
int pLastVblock(poly p, int lV)
poly p_LPshiftT(poly p, int sh, int uptodeg, int lV, kStrategy strat, const ring r)
BOOLEAN p_CheckIsFromRing(poly p, ring r)
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
#define pGetExpV(p, e)
Gets a copy of (resp. set) the exponent vector, where e is assumed to point to (r->N +1)*sizeof(long)...
poly p_mLPshift(poly p, int sh, int uptodeg, int lV, const ring r)
#define pIsConstantPoly(p)
return TRUE if all monomials of p are constant
#define p_SetCoeff0(p, n, r)
#define omCheckAddr(addr)
int p_LastVblock(poly p, int lV, const ring r)
static poly p_Add_q(poly p, poly q, const ring r)
int pmFirstVblock(poly p, int lV)
int pmLastVblock(poly p, int lV)