33 commonGcd = commonGcdCache;
43 number newCoeff =
n_Div(oldCoeff,commonGcd,
r->cf);
72 for (gCache =
g; gCache;
pIter(gCache))
91 number coeff0 =
n_Div(coeff,
p,
r->cf);
97 WerrorS(
"pReduce: overflow in exponent");
111 pNext(gEnd)=toBeChecked;
150 for (gCache =
g; gCache;
pIter(gCache))
169 number coeff0 =
n_Div(coeff,
p,
r->cf);
175 WerrorS(
"pReduce: overflow in exponent");
189 pNext(gEnd)=toBeChecked;
263 ideal I = (ideal) u->
CopyD();
264 number
p = (number)
v->CopyD();
268 res->data = (
char*) I;
279 for (
int i=0;
i<
k;
i++)
305 for (hCache=
h; hCache;
pIter(hCache))
313 for (
int i=2;
i<=
r->N;
i++)
343 for (
int i=1;
i<n;
i++)
355 for (
int i=0;
i<
m;
i++)
361 for (
int i=0;
i<
m-1;
i++)
362 for (
int j=
i+1;
j<
m;
j++)
369 for (
int i=0;
i<
m-1;
i++)
370 for (
int j=
i+1;
j<
m;
j++)
395 for (
j=n-1;
j>0;
j--)
399 poly cache = I->m[
j];
411 for (
int i=0;
i<
j;
i++)
414 for (
int k=
j+1;
k<n;
k++)
418 for (
int l=
j+1;
l<
k;
l++)
427 for (
int i=0;
i<
j;
i++)
428 for (
int k=
j;
k<n;
k++)
431 for (
int k=
j;
k<n-1;
k++)
432 for (
int l=
k+1;
l<n;
l++)
448 for (
int i=0;
i<
l;
i++)
458 static void sortMarks(
const ideal
H,
const ring
r, std::vector<mark> &
T)
460 std::pair<int,int> pointerToTerm;
465 for (
int i=1;
i<
k-1;
i++)
467 int generatorA =
T[
i-1].first;
468 int termA =
T[
i-1].second;
469 int generatorB =
T[
i].first;
470 int termB =
T[
i].second;
495 for (
unsigned i=0;
i<
T.size();
i++)
497 if (
T[
i].first>=newEntry)
498 T[
i].first =
T[
i].first+1;
506 for (
unsigned i=0;
i<
T.size();)
509 T.erase(
T.begin()+
i);
542 for (
int i=0;
i<
m;
i++)
548 T.push_back(std::pair<int,int>(
i,1));
572 for (
int j=2;
j<=
r->N;
j++)
580 T[0].second =
T[0].second+1;
588 for (
int i=0;
i<
k;
i++)
592 for (
int j=0;
j<
m;
j++)
620 std::map<long,ideal>
H;
int n =
IDELEMS(I);
621 for (
int i=0;
i<n;
i++)
627 for (
int j=2;
j<=
r->N;
j++)
629 std::map<long,ideal>::iterator it =
H.find(d);
634 std::pair<long,ideal> Hd(d,
idInit(1));
635 Hd.second->m[0] = I->m[
i];
641 std::map<long,ideal>::iterator it=
H.begin();
642 ideal Hi = it->second;
660 for (it++; it!=
H.end(); it++)
670 for (
int i=1;
i<
k;
i++)
683 for (
int i=n-
m-
l;
i<n;
i++)
687 memcpy(&(
G->m[
i]),&(Hi->m[kH]),(n-
i)*
sizeof(
poly));
693 G->m[
i] =
G->m[kG++];
695 G->m[
i] = Hi->m[kH++];
static FORCE_INLINE number n_Gcd(number a, number b, const coeffs r)
in Z: return the gcd of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ...
const CanonicalForm int s
Class used for (list of) interpreter objects.
static FORCE_INLINE BOOLEAN n_IsUnit(number n, const coeffs r)
TRUE iff n has a multiplicative inverse in the given coeff field/ring r.
static poly p_LmDeleteAndNext(poly p, const ring r)
static poly ppNext(poly p, int l)
std::pair< int, int > mark
bool isOrderingLocalInT(const ring r)
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
static void sortMarks(const ideal H, const ring r, std::vector< mark > &T)
bool ppreduceInitially(poly *hStar, const poly g, const ring r)
reduces h initially with respect to g, returns false if h was initially reduced in the first place...
static poly p_Mult_mm(poly p, poly m, const ring r)
static poly getTerm(const ideal H, const mark ab)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
void WerrorS(const char *s)
static void cleanupMarks(const ideal H, std::vector< mark > &T)
static number p_SetCoeff(poly p, number n, ring r)
static poly p_Copy(poly p, const ring r)
returns a copy of p
CanonicalForm subst(const CanonicalForm &f, const CFList &a, const CFList &b, const CanonicalForm &Rstar, bool isFunctionField)
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
static poly p_Head(poly p, const ring r)
bool p_xLeadmonomDivisibleBy(const poly g, const poly f, const 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:
static FORCE_INLINE number n_Add(number a, number b, const coeffs r)
return the sum of 'a' and 'b', i.e., a+b
void pReduce(poly &g, const number p, const ring r)
static FORCE_INLINE BOOLEAN n_DivBy(number a, number b, const coeffs r)
test whether 'a' is divisible 'b'; for r encoding a field: TRUE iff 'b' does not represent zero in Z:...
BOOLEAN idInsertPoly(ideal h1, poly h2)
insert h2 into h1 (if h2 is not the zero polynomial) return TRUE iff h2 was indeed inserted ...
static int p_LmCmp(poly p, poly q, const ring r)
static poly p_Mult_nn(poly p, number n, const ring r)
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
void ptNormalize(poly *gStar, const number p, const ring r)
static void p_Delete(poly *p, const ring r)
static FORCE_INLINE number n_ExtGcd(number a, number b, number *s, number *t, const coeffs r)
beware that ExtGCD is only relevant for a few chosen coeff. domains and may perform something unexpec...
ideal idInit(int idsize, int rank)
initialise an ideal / module
const Variable & v
< [in] a sqrfree bivariate poly
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
static FORCE_INLINE void n_Power(number a, int b, number *res, const coeffs r)
fill res with the power a^b
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
static void idShallowDelete(ideal *h)
id_ShallowDelete deletes the monomials of the polynomials stored inside of it
void divideByCommonGcd(poly &g, const ring r)
static void adjustMarks(std::vector< mark > &T, const int newEntry)
static poly p_LmInit(poly p, const ring r)
static void p_Setm(poly p, const ring r)
static long p_AddExp(poly p, int v, long ee, ring r)
static poly p_Neg(poly p, const ring r)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
static poly p_Add_q(poly p, poly q, const ring r)
#define omFreeBin(addr, bin)
static poly p_Init(const ring r, omBin bin)
poly p_Cleardenom(poly p, const ring r)
static poly p_Mult_q(poly p, poly q, const ring r)
static BOOLEAN p_LeadmonomDivisibleBy(poly a, poly b, const ring r)
p_LmDivisibleBy checks also the divisibility of coefficients
void pReduceInhomogeneous(poly &g, const number p, const ring r)