57 poly &m1, poly &m2,
const ring m_r)
64 for (
i = p_r->N;
i;
i--)
66 x = p_GetExpDiff(p1, p2,
i, p_r);
69 p_SetExp(m2,
i,
x, m_r);
70 p_SetExp(m1,
i,0, m_r);
74 p_SetExp(m1,
i,-
x, m_r);
75 p_SetExp(m2,
i,0, m_r);
80 long cp1 = (long) pGetCoeff(p1);
81 long cp2 = (long) pGetCoeff(p2);
82 if (cp1 != 0 && cp2 != 0)
84 while (cp1%2 == 0 && cp2%2 == 0)
90 p_SetCoeff(m1, (number) cp2, m_r);
91 p_SetCoeff(m2, (number) cp1, m_r);
110 poly sp =
pSub(p_Mult_mm(
f, m1, r), pp_Mult_mm(
g, m2, r));
125 Print(
"%d-step RedNF - g=", c);
149 if (rside ==
NULL)
return -1;
155 (p_LmDivisibleBy(
G->m[
i], rside, r))
204 while (
h !=
NULL &&
i >= 0) {
230 PrintS(
"Not reduced to zero from I: ");
239 PrintS(
" Yes!\nspoly --> 0?");
270 PrintS(
" Yes!\nzero-spoly --> 0?");
KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r, poly &m1, poly &m2, const ring m_r)
int ksCheckCoeff(number *a, number *b, const coeffs r)
poly kFindZeroPoly(poly input_p, ring leadRing, ring tailRing)
#define __p_Mult_nn(p, n, r)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Compatibility layer for legacy polynomial operations (over currRing).
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
#define pCopy(p)
return a copy of the poly
void PrintS(const char *s)
poly reduce_poly_fct(poly p, ring r)
poly ringNF(poly f, ideal G, ring r)
int findRingSolver(poly rside, ideal G, ring r)
void printPolyMsg(const char *start, poly f, const char *end)
poly plain_spoly(poly f, poly g)
poly spolyRing2toM(poly f, poly g, ring r)
BOOLEAN ring2toM_GetLeadTerms(const poly p1, const poly p2, const ring p_r, poly &m1, poly &m2, const ring m_r)
poly plain_zero_spoly(poly h)
poly ringRedNF(poly f, ideal G, ring r)
int testGB(ideal I, ideal GI)