31 #define TEST_OPT_DEBUG_RED 53 #ifdef TEST_OPT_DEBUG_RED 68 poly p1 = PR->GetLmTailRing();
69 poly p2 = PW->GetLmTailRing();
91 poly _p = (PR->t_p !=
NULL ? PR->t_p : PR->p);
94 if (PR->t_p!=
NULL) PR->t_p=_p;
else PR->p=_p;
103 PR->LmDeleteAndIter();
120 p1 = PR->GetLmTailRing();
121 p2 = PW->GetLmTailRing();
136 if ((ct == 0) || (ct == 2))
137 PR->Tail_Mult_nn(an);
138 if (coef !=
NULL) *coef = an;
148 PR->Tail_Minus_mm_Mult_qq(lm, t2,
pLength(t2) , spNoether);
150 PR->LmDeleteAndIter();
153 #ifdef HAVE_SHIFTBBA_NONEXISTENT 162 PR->SetShortExpVector();
166 #if defined(KDEBUG) && defined(TEST_OPT_DEBUG_RED) 185 #ifdef TEST_OPT_DEBUG_RED 200 poly p1 = PR->GetLmTailRing();
201 poly p2 = PW->GetLmTailRing();
223 poly _p = (PR->t_p !=
NULL ? PR->t_p : PR->p);
226 if (PR->t_p!=
NULL) PR->t_p=_p;
else PR->p=_p;
235 PR->LmDeleteAndIter();
252 p1 = PR->GetLmTailRing();
253 p2 = PW->GetLmTailRing();
268 if ((ct == 0) || (ct == 2))
269 PR->Tail_Mult_nn(an);
270 if (coef !=
NULL) *coef = an;
280 PR->Tail_Minus_mm_Mult_qq(lm, t2,
pLength(t2) , spNoether);
282 PR->LmDeleteAndIter();
285 #ifdef HAVE_SHIFTBBA_NONEXISTENT 294 PR->SetShortExpVector();
298 #if defined(KDEBUG) && defined(TEST_OPT_DEBUG_RED) 324 #ifdef TEST_OPT_DEBUG_RED 370 printf(
"IN KSREDUCEPOLYSIG: \n");
374 printf(
"--------------\n");
379 printf(
"------------------- IN KSREDUCEPOLYSIG: --------------------\n");
384 printf(
"--------------\n");
391 printf(
"%d -- %d sig\n",sigSafe,PW->is_sigsafe);
400 PR->is_redundant =
TRUE;
405 PR->is_redundant =
FALSE;
406 poly p1 = PR->GetLmTailRing();
407 poly p2 = PW->GetLmTailRing();
429 poly _p = (PR->t_p !=
NULL ? PR->t_p : PR->p);
432 if (PR->t_p!=
NULL) PR->t_p=_p;
else PR->p=_p;
441 PR->LmDeleteAndIter();
458 p1 = PR->GetLmTailRing();
459 p2 = PW->GetLmTailRing();
474 if ((ct == 0) || (ct == 2))
475 PR->Tail_Mult_nn(an);
476 if (coef !=
NULL) *coef = an;
486 PR->Tail_Minus_mm_Mult_qq(lm, t2, PW->GetpLength() - 1, spNoether);
488 PR->LmDeleteAndIter();
491 #ifdef HAVE_SHIFTBBA_NONEXISTENT 500 PR->SetShortExpVector();
504 #if defined(KDEBUG) && defined(TEST_OPT_DEBUG_RED) 521 printf(
"\nksReducePolySig\n");
527 #ifdef TEST_OPT_DEBUG_RED 573 printf(
"IN KSREDUCEPOLYSIG: \n");
577 printf(
"--------------\n");
591 printf(
"------------------- IN KSREDUCEPOLYSIG: --------------------\n");
596 printf(
"--------------\n");
605 printf(
"%d -- %d sig\n",sigSafe,PW->is_sigsafe);
619 printf(
"\nPossible sigdrop in ksreducepolysig (lost signature)\n");
625 if(
pLtCmp(PR->sig,origsig) == 1)
629 PR->is_redundant =
TRUE;
635 if(
pLtCmp(PR->sig,origsig) == -1)
638 printf(
"\nSigdrop in ksreducepolysig from * to *\n");
pWrite(origsig);
pWrite(PR->sig);
650 PR->is_redundant =
TRUE;
655 PR->is_redundant =
FALSE;
656 poly p1 = PR->GetLmTailRing();
657 poly p2 = PW->GetLmTailRing();
679 poly _p = (PR->t_p !=
NULL ? PR->t_p : PR->p);
682 if (PR->t_p!=
NULL) PR->t_p=_p;
else PR->p=_p;
691 PR->LmDeleteAndIter();
708 p1 = PR->GetLmTailRing();
709 p2 = PW->GetLmTailRing();
730 if (((ct == 0) || (ct == 2)))
731 PR->Tail_Mult_nn(an);
732 if (coef !=
NULL) *coef = an;
742 PR->Tail_Minus_mm_Mult_qq(lm, t2, PW->GetpLength() - 1, spNoether);
744 PR->LmDeleteAndIter();
747 #ifdef HAVE_SHIFTBBA_NONEXISTENT 756 PR->SetShortExpVector();
759 #if defined(KDEBUG) && defined(TEST_OPT_DEBUG_RED) 821 if (Pair->i_r1 == -1)
827 l1 = (
R[Pair->i_r1])->GetpLength() - 1;
829 if ((Pair->i_r2 == -1)||(
R[Pair->i_r2]==
NULL))
835 l2 = (
R[Pair->i_r2])->GetpLength() - 1;
840 if (spNoether !=
NULL)
843 a2 =
tailRing->p_Procs->pp_Mult_mm_Noether(a2, m2, spNoether, l2,
tailRing);
852 Pair->SetLmTail(m2, a2, l2, use_buckets,
tailRing);
855 Pair->Tail_Minus_mm_Mult_qq(m1, a1, l1, spNoether);
858 Pair->LmDeleteAndIter();
874 #ifdef HAVE_SHIFTBBA_NONEXISTENT 883 Pair->SetShortExpVector();
893 poly Lp = PR->GetLmCurrRing();
894 poly Save = PW->GetLmCurrRing();
914 if (Current == PR->p && PR->t_p !=
NULL)
920 pNext(Current) = Red.GetLmTailRing();
921 if (Current == PR->p && PR->t_p !=
NULL)
929 #ifdef HAVE_SHIFTBBA_NONEXISTENT 938 PR->SetShortExpVector();
949 poly Lp = PR->GetLmCurrRing();
950 poly Save = PW->GetLmCurrRing();
970 if (Current == PR->p && PR->t_p !=
NULL)
976 pNext(Current) = Red.GetLmTailRing();
977 if (Current == PR->p && PR->t_p !=
NULL)
985 #ifdef HAVE_SHIFTBBA_NONEXISTENT 994 PR->SetShortExpVector();
1068 if ((c1==c2)||(c2!=0))
1120 if ((c1==c2)||(c1!=0))
KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r, poly &m1, poly &m2, const ring m_r)
static void nc_kBucketPolyRed(kBucket_pt b, poly p, number *c)
static CanonicalForm bound(const CFMatrix &M)
void nc_PolyPolyRed(poly &b, poly p, number *c, const ring r)
Compatiblity layer for legacy polynomial operations (over currRing)
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
static BOOLEAN p_LmExpVectorAddIsOk(const poly p1, const poly p2, const ring r)
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
int ksCheckCoeff(number *a, number *b)
int ksReducePolyTailBound(LObject *PR, TObject *PW, int bound, poly Current, poly spNoether)
int ksReducePoly(LObject *PR, TObject *PW, poly spNoether, number *coef, kStrategy strat)
static BOOLEAN rField_is_Domain(const ring r)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing)
BOOLEAN pHaveCommonMonoms(poly p, poly q)
static number p_SetCoeff(poly p, number n, ring r)
static void p_LmFree(poly p, ring)
BOOLEAN pIsMonomOf(poly p, poly m)
int ksReducePolySig(LObject *PR, TObject *PW, long, poly spNoether, number *coef, kStrategy strat)
poly p_Shrink(poly p, int lV, const ring r)
BOOLEAN p_CheckPolyRing(poly p, ring r)
static long p_GetExpDiff(poly p1, poly p2, int i, ring r)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
static void p_SetCompP(poly p, int i, 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 BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
void ksCreateSpoly(LObject *Pair, poly spNoether, int use_buckets, ring tailRing, poly m1, poly m2, TObject **R)
static BOOLEAN p_DivisibleBy(poly a, poly b, const ring r)
static int p_LmCmp(poly p, poly q, const ring r)
BOOLEAN kStratChangeTailRing(kStrategy strat, LObject *L, TObject *T, unsigned long expbound)
static void p_ExpVectorSub(poly p1, poly p2, const ring r)
static void p_ExpVectorAdd(poly p1, poly p2, const ring r)
static unsigned pLength(poly a)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
int ksReducePolyBound(LObject *PR, TObject *PW, int bound, poly spNoether, number *coef, kStrategy strat)
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 BOOLEAN rField_is_Ring(const ring r)
static void p_Setm(poly p, const ring r)
static void p_LmDelete(poly p, const ring r)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
static void p_ExpVectorAddSub(poly p1, poly p2, poly p3, const ring r)
int ksReducePolyTail(LObject *PR, TObject *PW, poly Current, poly spNoether)
static poly p_Init(const ring r, omBin bin)
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
static long p_MaxComp(poly p, ring lmRing, ring tailRing)
#define pCopy(p)
return a copy of the poly
int ksReducePolySigRing(LObject *PR, TObject *PW, long, poly spNoether, number *coef, kStrategy strat)