28#define TEST_OPT_DEBUG_RED
42#ifdef STDZ_EXCHANGE_DURING_REDUCTION
51#ifdef TEST_OPT_DEBUG_RED
62 ring tailRing = PR->tailRing;
68 poly p1 = PR->GetLmTailRing();
69 poly p2 = PW->GetLmTailRing();
70 poly t2 =
pNext(p2), lm = p1;
76 p_DivisibleBy(p2, p1, tailRing));
80 p_MaxComp(
pNext(p2),tailRing) == 0));
88 if (PR->bucket!=
NULL) nc_kBucketPolyRed_Z(PR->bucket, p2,coef,
FALSE);
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;
104 if (! n_IsOne(pGetCoeff(p2), tailRing->cf))
106 number bn = pGetCoeff(lm);
107 number an = pGetCoeff(p2);
109 p_SetCoeff(lm, bn, tailRing);
110 if ((ct == 0) || (ct == 2))
111 PR->Tail_Mult_nn(an);
112 if (coef !=
NULL) *coef = an;
113 else n_Delete(&an, tailRing->cf);
115 PR->LmDeleteAndIter();
116 if (coef !=
NULL) *coef = n_Init(1, tailRing->cf);
120 p_ExpVectorSub(lm, p2, tailRing);
125 while (PW->max_exp !=
NULL && !p_LmExpVectorAddIsOk(lm, PW->max_exp, tailRing))
128 p_ExpVectorAdd(lm, p2, tailRing);
129 if (strat ==
NULL)
return 2;
132 p1 = PR->GetLmTailRing();
133 p2 = PW->GetLmTailRing();
136 p_ExpVectorSub(lm, p2, tailRing);
143 if (tailRing->isLPring)
152 if (! n_IsOne(pGetCoeff(p2), tailRing->cf))
154 number bn = pGetCoeff(lm);
155 number an = pGetCoeff(p2);
157 p_SetCoeff(lm, bn, tailRing);
158 if ((ct == 0) || (ct == 2))
159 PR->Tail_Mult_nn(an);
160 if (coef !=
NULL) *coef = an;
161 else n_Delete(&an, tailRing->cf);
165 if (coef !=
NULL) *coef = n_Init(1, tailRing->cf);
171 if (tailRing->isLPring)
173 PR->Tail_Minus_mm_Mult_qq(lm, tailRing->p_Procs->pp_Mult_mm(t2, lmRight, tailRing), pLength(t2), spNoether);
178 PR->Tail_Minus_mm_Mult_qq(lm, t2, pLength(t2) , spNoether);
180 assume(PW->GetpLength() == pLength(PW->p !=
NULL ? PW->p : PW->t_p));
181 PR->LmDeleteAndIter();
197#ifdef TEST_OPT_DEBUG_RED
208 ring tailRing = PR->tailRing;
215 poly p1 = PR->GetLmTailRing();
216 poly p2 = PW->GetLmTailRing();
217 poly t2 =
pNext(p2), lm = p1;
223 p_DivisibleBy(p2, p1, tailRing));
227 p_MaxComp(
pNext(p2),tailRing) == 0));
235 if (PR->bucket!=
NULL) nc_kBucketPolyRed_Z(PR->bucket, p2,coef,
reduce);
238 poly _p = (PR->t_p !=
NULL ? PR->t_p : PR->p);
241 if (PR->t_p!=
NULL) PR->t_p=_p;
else PR->p=_p;
250 PR->LmDeleteAndIter();
251 if (coef !=
NULL) *coef = n_Init(1, tailRing->cf);
255 p_ExpVectorSub(lm, p2, tailRing);
260 while (PW->max_exp !=
NULL && !p_LmExpVectorAddIsOk(lm, PW->max_exp, tailRing))
263 p_ExpVectorAdd(lm, p2, tailRing);
264 if (strat ==
NULL)
return 2;
267 p1 = PR->GetLmTailRing();
268 p2 = PW->GetLmTailRing();
271 p_ExpVectorSub(lm, p2, tailRing);
278 if (tailRing->isLPring)
287 if (! n_IsOne(pGetCoeff(p2), tailRing->cf))
289 number bn = pGetCoeff(lm);
290 number an = pGetCoeff(p2);
294 if(n_IsMOne(an, tailRing->cf))
296 an=n_InpNeg(an, tailRing->cf);
297 bn=n_InpNeg(bn, tailRing->cf);
301 else if(!n_IsOne(an,tailRing->cf))
303 StringSetS(
"ksReducePoly: ");n_Write(an,tailRing->cf);
310 p_SetCoeff(lm, bn, tailRing);
311 if ((ct == 0) || (ct == 2))
312 PR->Tail_Mult_nn(an);
313 if (coef !=
NULL) *coef = an;
314 else n_Delete(&an, tailRing->cf);
318 if (coef !=
NULL) *coef = n_Init(1, tailRing->cf);
324 if (tailRing->isLPring)
326 poly tmp=tailRing->p_Procs->pp_Mult_mm(t2, lmRight, tailRing);
327 PR->Tail_Minus_mm_Mult_qq(lm, tmp, pLength(t2), spNoether);
328 p_Delete(&tmp,tailRing);
329 p_Delete(&lm,tailRing);
330 p_Delete(&lmRight,tailRing);
335 PR->Tail_Minus_mm_Mult_qq(lm, t2, pLength(t2) , spNoether);
337 assume(PW->GetpLength() == pLength(PW->p !=
NULL ? PW->p : PW->t_p));
338 PR->LmDeleteAndIter();
343#ifdef STDZ_EXCHANGE_DURING_REDUCTION
352#ifdef TEST_OPT_DEBUG_RED
363 ring tailRing = PR->tailRing;
370 poly p1 = PR->GetLmTailRing();
371 poly p2 = PW->GetLmTailRing();
378 p_DivisibleBy(p2, p1, tailRing));
382 p_MaxComp(
pNext(p2),tailRing) == 0));
390 if (PR->bucket!=
NULL) nc_kBucketPolyRed_Z(PR->bucket, p2,coef,
TRUE);
393 poly _p = (PR->t_p !=
NULL ? PR->t_p : PR->p);
396 if (PR->t_p!=
NULL) PR->t_p=_p;
else PR->p=_p;
403 while (PW->max_exp !=
NULL && !p_LmExpVectorAddIsOk(lm, PW->max_exp, tailRing))
406 p_ExpVectorAdd(lm, p2, tailRing);
407 if (strat ==
NULL)
return 2;
410 p1 = PR->GetLmTailRing();
411 p2 = PW->GetLmTailRing();
414 p_ExpVectorSub(lm, p2, tailRing);
420 if (tailRing->isLPring)
430 if (! n_IsOne(pGetCoeff(p2), tailRing->cf))
432 ct = n_ExtGcd(pGetCoeff(p1), pGetCoeff(p2), &an, &bn, tailRing->cf);
433 if (n_IsZero(an, tailRing->cf) || n_IsZero(bn, tailRing->cf))
435 n_Delete(&an, tailRing->cf);
436 n_Delete(&bn, tailRing->cf);
437 n_Delete(&ct, tailRing->cf);
441 bn = n_InpNeg(bn, tailRing->cf);
442 p_SetCoeff(lm, bn, tailRing);
444 PR->Tail_Mult_nn(an);
448 if (coef !=
NULL) *coef = n_Init(1, tailRing->cf);
454 if (tailRing->isLPring)
456 PR->Tail_Minus_mm_Mult_qq(lm, tailRing->p_Procs->pp_Mult_mm(t2, lmRight, tailRing), pLength(t2), spNoether);
461 PR->Tail_Minus_mm_Mult_qq(lm, t2, pLength(t2) , spNoether);
463 assume(PW->GetpLength() == pLength(PW->p !=
NULL ? PW->p : PW->t_p));
485#ifdef TEST_OPT_DEBUG_RED
498 ring tailRing = PR->tailRing;
505 poly p1 = PR->GetLmTailRing();
506 poly p2 = PW->GetLmTailRing();
513 p_DivisibleBy(p2, p1, tailRing));
517 p_MaxComp(
pNext(p2),tailRing) == 0));
525 if (PR->bucket!=
NULL) nc_kBucketPolyRed_Z(PR->bucket, p2,coef,
FALSE);
528 poly _p = (PR->t_p !=
NULL ? PR->t_p : PR->p);
531 if (PR->t_p!=
NULL) PR->t_p=_p;
else PR->p=_p;
538 p_ExpVectorSub(lm, p2, tailRing);
539 p_SetCoeff(lm, n_Init(1, tailRing->cf), tailRing);
540 while (PW->max_exp !=
NULL && !p_LmExpVectorAddIsOk(lm, PW->max_exp, tailRing))
543 p_ExpVectorAdd(lm, p2, tailRing);
544 if (strat ==
NULL)
return 2;
547 p1 = PR->GetLmTailRing();
548 p2 = PW->GetLmTailRing();
550 p_ExpVectorSub(lm, p2, tailRing);
556 if (tailRing->isLPring)
566 if (tailRing->isLPring)
568 PR->Tail_Minus_mm_Mult_qq(lm, tailRing->p_Procs->pp_Mult_mm(p2, lmRight, tailRing), pLength(p2), spNoether);
573 PR->Tail_Minus_mm_Mult_qq(lm, p2, pLength(p2) , spNoether);
575 assume(PW->GetpLength() == pLength(PW->p !=
NULL ? PW->p : PW->t_p));
577 PR->LmDeleteAndIter();
580#if defined(KDEBUG) && defined(TEST_OPT_DEBUG_RED)
599#ifdef TEST_OPT_DEBUG_RED
610 ring tailRing = PR->tailRing;
617 poly p1 = PR->GetLmTailRing();
618 poly p2 = PW->GetLmTailRing();
619 poly t2 =
pNext(p2), lm = p1;
625 p_DivisibleBy(p2, p1, tailRing));
629 p_MaxComp(
pNext(p2),tailRing) == 0));
637 if (PR->bucket!=
NULL) nc_kBucketPolyRed_Z(PR->bucket, p2,coef,
FALSE);
640 poly _p = (PR->t_p !=
NULL ? PR->t_p : PR->p);
643 if (PR->t_p!=
NULL) PR->t_p=_p;
else PR->p=_p;
652 PR->LmDeleteAndIter();
653 if (coef !=
NULL) *coef = n_Init(1, tailRing->cf);
657 p_ExpVectorSub(lm, p2, tailRing);
662 while (PW->max_exp !=
NULL && !p_LmExpVectorAddIsOk(lm, PW->max_exp, tailRing))
665 p_ExpVectorAdd(lm, p2, tailRing);
666 if (strat ==
NULL)
return 2;
669 p1 = PR->GetLmTailRing();
670 p2 = PW->GetLmTailRing();
673 p_ExpVectorSub(lm, p2, tailRing);
680 if (tailRing->isLPring)
689 if (! n_IsOne(pGetCoeff(p2), tailRing->cf))
691 number bn = pGetCoeff(lm);
692 number an = pGetCoeff(p2);
694 p_SetCoeff(lm, bn, tailRing);
695 if ((ct == 0) || (ct == 2))
696 PR->Tail_Mult_nn(an);
697 if (coef !=
NULL) *coef = an;
698 else n_Delete(&an, tailRing->cf);
702 if (coef !=
NULL) *coef = n_Init(1, tailRing->cf);
708 if (tailRing->isLPring)
710 PR->Tail_Minus_mm_Mult_qq(lm, tailRing->p_Procs->pp_Mult_mm(t2, lmRight, tailRing), pLength(t2), spNoether);
715 PR->Tail_Minus_mm_Mult_qq(lm, t2, pLength(t2) , spNoether);
717 assume(PW->GetpLength() == pLength(PW->p !=
NULL ? PW->p : PW->t_p));
718 PR->LmDeleteAndIter();
720#if defined(KDEBUG) && defined(TEST_OPT_DEBUG_RED)
746#ifdef TEST_OPT_DEBUG_RED
755 ring tailRing = PR->tailRing;
792 poly sigMult =
pCopy(PW->sig);
795 printf(
"IN KSREDUCEPOLYSIG: \n");
799 printf(
"--------------\n");
801 p_ExpVectorAddSub(sigMult,PR->GetLmCurrRing(),PW->GetLmCurrRing(),
currRing);
804 printf(
"------------------- IN KSREDUCEPOLYSIG: --------------------\n");
809 printf(
"--------------\n");
811 int sigSafe = p_LmCmp(PR->sig,sigMult,
currRing);
816 printf(
"%d -- %d sig\n",sigSafe,PW->is_sigsafe);
825 PR->is_redundant =
TRUE;
830 PR->is_redundant =
FALSE;
831 poly p1 = PR->GetLmTailRing();
832 poly p2 = PW->GetLmTailRing();
833 poly t2 =
pNext(p2), lm = p1;
839 p_DivisibleBy(p2, p1, tailRing));
843 p_MaxComp(
pNext(p2),tailRing) == 0));
851 if (PR->bucket!=
NULL) nc_kBucketPolyRed_Z(PR->bucket, p2,coef,
FALSE);
854 poly _p = (PR->t_p !=
NULL ? PR->t_p : PR->p);
857 if (PR->t_p!=
NULL) PR->t_p=_p;
else PR->p=_p;
866 PR->LmDeleteAndIter();
867 if (coef !=
NULL) *coef = n_Init(1, tailRing->cf);
871 p_ExpVectorSub(lm, p2, tailRing);
876 while (PW->max_exp !=
NULL && !p_LmExpVectorAddIsOk(lm, PW->max_exp, tailRing))
879 p_ExpVectorAdd(lm, p2, tailRing);
880 if (strat ==
NULL)
return 2;
883 p1 = PR->GetLmTailRing();
884 p2 = PW->GetLmTailRing();
887 p_ExpVectorSub(lm, p2, tailRing);
894 if (tailRing->isLPring)
903 if (! n_IsOne(pGetCoeff(p2), tailRing->cf))
905 number bn = pGetCoeff(lm);
906 number an = pGetCoeff(p2);
908 p_SetCoeff(lm, bn, tailRing);
909 if ((ct == 0) || (ct == 2))
910 PR->Tail_Mult_nn(an);
911 if (coef !=
NULL) *coef = an;
912 else n_Delete(&an, tailRing->cf);
916 if (coef !=
NULL) *coef = n_Init(1, tailRing->cf);
922 if (tailRing->isLPring)
924 PR->Tail_Minus_mm_Mult_qq(lm, tailRing->p_Procs->pp_Mult_mm(t2, lmRight, tailRing), pLength(t2), spNoether);
929 PR->Tail_Minus_mm_Mult_qq(lm, t2, PW->GetpLength() - 1, spNoether);
931 assume(PW->GetpLength() == (
int)pLength(PW->p !=
NULL ? PW->p : PW->t_p));
932 PR->LmDeleteAndIter();
934#if defined(KDEBUG) && defined(TEST_OPT_DEBUG_RED)
952#ifdef TEST_OPT_DEBUG_RED
961 ring tailRing = PR->tailRing;
998 poly sigMult =
pCopy(PW->sig);
1001 printf(
"IN KSREDUCEPOLYSIG: \n");
1005 printf(
"--------------\n");
1007 p_ExpVectorAddSub(sigMult,PR->GetLmCurrRing(),PW->GetLmCurrRing(),
currRing);
1011 pSetCoeff(sigMult,
nMult(
nDiv(pGetCoeff(PR->p),pGetCoeff(PW->p)), pGetCoeff(sigMult)));
1012 if(
nIsZero(pGetCoeff(sigMult)))
1019 printf(
"------------------- IN KSREDUCEPOLYSIG: --------------------\n");
1024 printf(
"--------------\n");
1028 sigSafe = p_LmCmp(PR->sig,sigMult,
currRing);
1033 printf(
"%d -- %d sig\n",sigSafe,PW->is_sigsafe);
1039 poly origsig =
pCopy(PR->sig);
1041 PR->sig =
pHead(
pSub(PR->sig, sigMult));
1050 if(
pLtCmp(PR->sig,origsig) == 1)
1054 PR->is_redundant =
TRUE;
1060 if(
pLtCmp(PR->sig,origsig) == -1)
1072 PR->is_redundant =
TRUE;
1077 PR->is_redundant =
FALSE;
1078 poly p1 = PR->GetLmTailRing();
1079 poly p2 = PW->GetLmTailRing();
1080 poly t2 =
pNext(p2), lm = p1;
1086 p_DivisibleBy(p2, p1, tailRing));
1090 p_MaxComp(
pNext(p2),tailRing) == 0));
1098 if (PR->bucket!=
NULL) nc_kBucketPolyRed_Z(PR->bucket, p2,coef,
FALSE);
1101 poly _p = (PR->t_p !=
NULL ? PR->t_p : PR->p);
1104 if (PR->t_p!=
NULL) PR->t_p=_p;
else PR->p=_p;
1113 PR->LmDeleteAndIter();
1114 if (coef !=
NULL) *coef = n_Init(1, tailRing->cf);
1118 p_ExpVectorSub(lm, p2, tailRing);
1123 while (PW->max_exp !=
NULL && !p_LmExpVectorAddIsOk(lm, PW->max_exp, tailRing))
1126 p_ExpVectorAdd(lm, p2, tailRing);
1127 if (strat ==
NULL)
return 2;
1130 p1 = PR->GetLmTailRing();
1131 p2 = PW->GetLmTailRing();
1134 p_ExpVectorSub(lm, p2, tailRing);
1141 if (tailRing->isLPring)
1152 p_SetCoeff(lm,
nDiv(pGetCoeff(lm),pGetCoeff(p2)), tailRing);
1153 if (coef !=
NULL) *coef = n_Init(1, tailRing->cf);
1157 if (! n_IsOne(pGetCoeff(p2), tailRing->cf))
1159 number bn = pGetCoeff(lm);
1160 number an = pGetCoeff(p2);
1162 p_SetCoeff(lm, bn, tailRing);
1163 if (((ct == 0) || (ct == 2)))
1164 PR->Tail_Mult_nn(an);
1165 if (coef !=
NULL) *coef = an;
1166 else n_Delete(&an, tailRing->cf);
1170 if (coef !=
NULL) *coef = n_Init(1, tailRing->cf);
1176 if (tailRing->isLPring)
1178 PR->Tail_Minus_mm_Mult_qq(lm, tailRing->p_Procs->pp_Mult_mm(t2, lmRight, tailRing), pLength(t2), spNoether);
1183 PR->Tail_Minus_mm_Mult_qq(lm, t2, PW->GetpLength() - 1, spNoether);
1185 assume(PW->GetpLength() == (
int)pLength(PW->p !=
NULL ? PW->p : PW->t_p));
1186 PR->LmDeleteAndIter();
1188#if defined(KDEBUG) && defined(TEST_OPT_DEBUG_RED)
1204 int use_buckets, ring tailRing,
1212 Pair->tailRing = tailRing;
1219 number lc1 = pGetCoeff(p1), lc2 = pGetCoeff(p2);
1249 if (tailRing->isLPring)
1263 if (Pair->i_r1 == -1)
1265 l1 = pLength(p1) - 1;
1269 l1 = (
R[Pair->i_r1])->GetpLength() - 1;
1271 if ((Pair->i_r2 == -1)||(
R[Pair->i_r2]==
NULL))
1273 l2 = pLength(p2) - 1;
1277 l2 = (
R[Pair->i_r2])->GetpLength() - 1;
1283 if (tailRing->isLPring)
1286 poly tmp= tailRing->p_Procs->pp_mm_Mult(a2, m2, tailRing);
1287 a2 = tailRing->p_Procs->pp_Mult_mm(tmp, m22, tailRing);
1288 p_Delete(&tmp,tailRing);
1292 if (spNoether !=
NULL)
1295 a2 = tailRing->p_Procs->pp_Mult_mm_Noether(a2, m2, spNoether, l2, tailRing);
1296 assume(l2 == (
int)pLength(a2));
1300 a2 = tailRing->p_Procs->pp_Mult_mm(a2, m2, tailRing);
1302 if (!(rField_is_Domain(
currRing))) l2 = pLength(a2);
1304 Pair->SetLmTail(m2, a2, l2, use_buckets, tailRing);
1307 if (tailRing->isLPring)
1310 poly tmp=tailRing->p_Procs->pp_Mult_mm(a1, m12, tailRing);
1311 Pair->Tail_Minus_mm_Mult_qq(m1, tmp, l1, spNoether);
1312 p_Delete(&tmp,tailRing);
1318 Pair->Tail_Minus_mm_Mult_qq(m1, a1, l1, spNoether);
1322 Pair->LmDeleteAndIter();
1323 p_LmDelete(m1, tailRing);
1325 if (tailRing->isLPring)
1328 assume(Pair->shift == 0);
1331 p_LmDelete(m12, tailRing);
1332 p_LmDelete(m22, tailRing);
1341 p_SetCompP(p1,0,
currRing, tailRing);
1345 p_SetCompP(p2,0,
currRing, tailRing);
1354 poly Lp = PR->GetLmCurrRing();
1355 poly Save = PW->GetLmCurrRing();
1373 if (Current == PR->p && PR->t_p !=
NULL)
1379 pNext(Current) = Red.GetLmTailRing();
1380 if (Current == PR->p && PR->t_p !=
NULL)
1394 poly Lp = PR->GetLmCurrRing();
1395 poly Save = PW->GetLmCurrRing();
1413 if (Current == PR->p && PR->t_p !=
NULL)
1419 pNext(Current) = Red.GetLmTailRing();
1420 if (Current == PR->p && PR->t_p !=
NULL)
1451 if (tailRing->isLPring)
1469 number lc1 = pGetCoeff(p1), lc2 = pGetCoeff(p2);
1473 if (a1 !=
NULL) t2 =
nMult(pGetCoeff(a1),lc2);
1474 if (a2 !=
NULL) t1 =
nMult(pGetCoeff(a2),lc1);
1479 if (a1 !=
NULL) t2 =
nMult(pGetCoeff(a1),lc2);
1485 if (a2 !=
NULL) t1 =
nMult(pGetCoeff(a2),lc1);
1491 if (tailRing->isLPring)
1508 p_SetExp(m2,
i,(c+p_GetExp(a2,
i,tailRing)),
currRing);
1512 p_SetExp(m2,
i,p_GetExp(a2,
i,tailRing),
currRing);
1515 if ((c1==c2)||(c2!=0))
1532 if (tailRing->isLPring && (shift2!=0))
1534 p_LmDelete(a2, tailRing);
1560 p_SetExp(m1,
i,(c+p_GetExp(a1,
i, tailRing)),
currRing);
1564 p_SetExp(m1,
i,p_GetExp(a1,
i, tailRing),
currRing);
1567 if ((c1==c2)||(c1!=0))
1584 if (tailRing->isLPring && (shift1!=0))
1586 p_LmDelete(a1, tailRing);
1600 p_SetExp(m2,
i,(c+p_GetExp(a2,
i,tailRing)),
currRing);
1601 p_SetExp(m1,
i,p_GetExp(a1,
i, tailRing),
currRing);
1605 p_SetExp(m1,
i,(p_GetExp(a1,
i,tailRing)-c),
currRing);
1606 p_SetExp(m2,
i,p_GetExp(a2,
i, tailRing),
currRing);
1643 if (tailRing->isLPring)
1645 if (shift1!=0) p_LmDelete(a1, tailRing);
1646 if (shift2!=0) p_LmDelete(a2, tailRing);
1662 if (tailRing->isLPring)
1664 if (shift1!=0) p_LmDelete(a1, tailRing);
1665 if (shift2!=0) p_LmDelete(a2, tailRing);
1677 t1 =
nMult(pGetCoeff(a2),pGetCoeff(p1));
1678 t2 =
nMult(pGetCoeff(a1),pGetCoeff(p2));
1695 if (tailRing->isLPring)
1697 if (shift1!=0) p_LmDelete(a1, tailRing);
1698 if (shift2!=0) p_LmDelete(a2, tailRing);
1710 t1 =
nMult(pGetCoeff(a2),lc1);
1715 t2 =
nMult(pGetCoeff(a1),lc2);
1723 t2 =
nMult(pGetCoeff(a1),lc2);
1732 t1 =
nMult(pGetCoeff(a2),lc1);
1737 if (tailRing->isLPring)
KINLINE int ksReducePolyTail(LObject *PR, TObject *PW, LObject *Red)
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)
int ksReducePolyLC(LObject *PR, TObject *PW, poly spNoether, number *coef, kStrategy strat)
void ksCreateSpoly(LObject *Pair, poly spNoether, int use_buckets, ring tailRing, poly m1, poly m2, TObject **R)
int ksReducePolyTailBound(LObject *PR, TObject *PW, int bound, poly Current, poly spNoether)
int ksReducePoly(LObject *PR, TObject *PW, poly spNoether, number *coef, poly *mon, kStrategy strat, BOOLEAN reduce)
int ksReducePolySig(LObject *PR, TObject *PW, long, poly spNoether, number *coef, kStrategy strat)
int ksReducePolyBound(LObject *PR, TObject *PW, int, poly spNoether, number *coef, kStrategy strat)
int ksReducePolySigRing(LObject *PR, TObject *PW, long, poly spNoether, number *coef, kStrategy strat)
poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing)
BOOLEAN kStratChangeTailRing(kStrategy strat, LObject *L, TObject *T, unsigned long expbound)
BOOLEAN kTest_L(LObject *L, kStrategy strat, BOOLEAN testp, int lpos, TSet T, int tlength)
BOOLEAN kTest_T(TObject *T, kStrategy strat, int i, char TN)
int ksReducePolyGCD(LObject *PR, TObject *PW, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
int ksReducePolyZ(LObject *PR, TObject *PW, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
void nc_PolyPolyRed(poly &b, poly p, number *c, const ring r)
#define __p_GetComp(p, r)
BOOLEAN pIsMonomOf(poly p, poly m)
BOOLEAN p_CheckPolyRing(poly p, ring r)
BOOLEAN pHaveCommonMonoms(poly p, poly q)
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 pSetCoeff(p, n)
deletes old coeff before setting the new one
#define pCopy(p)
return a copy of the poly
void StringSetS(const char *st)
void StringAppendS(const char *st)
void PrintS(const char *s)
#define rField_is_Ring(R)
poly p_LPCopyAndShiftLM(poly p, int sh, const ring r)
int p_mFirstVblock(poly p, const ring ri)
int p_FirstVblock(poly p, const ring r)
void k_SplitFrame(poly &m1, poly &m2, int at, const ring r)