655 SObject tso = resPairs[itso];
657 ideal old_generators=syzstr->
res[
index];
659 int og_idel=
IDELEMS(old_generators),ng_place=
IDELEMS(new_generators);
669 int syz_place=
IDELEMS(syzygies);
671 while ((syz_place>0) && (syzygies->m[syz_place-1]==
NULL)) syz_place--;
672 while ((ng_place>0) && (new_generators->m[ng_place-1]==
NULL)) ng_place--;
673 while ((og_idel>0) && (old_generators->m[og_idel-1]==
NULL)) og_idel--;
674 assume (tso.ind1<og_idel);
675 assume (tso.ind2<og_idel);
676 assume (tso.ind1!=tso.ind2);
677 assume (tso.p1 == old_generators->m[tso.ind1]);
678 assume (tso.p2 == old_generators->m[tso.ind2]);
679 tso.p1 = old_generators->m[tso.ind1];
680 tso.p2 = old_generators->m[tso.ind2];
681 if ((tso.p1!=
NULL) && (tso.p2!=
NULL))
689 toReplace = tso.ind1+1;
691 toReplace = tso.ind2+1;
695 if ((
index==0) && (old_generators->rank==1) &&
707 pp =
pCopy(old_repr->m[tso.ind2]);
717 pp =
pCopy(old_repr->m[tso.ind1]);
727 tso.syz =
pMult(p,
pCopy(old_repr->m[tso.ind2]));
740 tso.syz =
pCopy(old_repr->m[tso.ind1]);
749 p =
pCopy(old_repr->m[tso.ind2]);
756 tso.syz =
pAdd(p,tso.syz);
768 Print(
"reduziere Paar im Module %d mit: \n",
index);
776 if ((tso.p!=
NULL) && (!deleteP))
787 while ((j<ng_place) && (!
pDivisibleBy(new_generators->m[j],p))) j++;
788 if (j>=ng_place)
break;
844 PrintS(
"Shit happens!\n");
847 Print(
"erhalte Paar im Module %d mit: \n",
index);
855 pDelete(&old_generators->m[toReplace-1]);
856 pDelete(&old_repr->m[toReplace-1]);
857 for (i=toReplace-1;i<og_idel-1;i++)
859 old_generators->m[
i] = old_generators->m[i+1];
860 old_repr->m[
i] = old_repr->m[i+1];
862 old_generators->m[og_idel-1] =
NULL;
863 old_repr->m[og_idel-1] =
NULL;
864 for (i=itso+1;i<
l;i++)
868 if ((resPairs[i].ind1==toReplace-1)||(resPairs[i].
ind2==toReplace-1))
872 if (resPairs[i].ind1>=toReplace)
873 (resPairs[
i].ind1)--;
874 if (resPairs[i].
ind2>=toReplace)
875 (resPairs[
i].ind2)--;
885 if (ng_place>=
IDELEMS(new_generators))
899 new_generators->m[ng_place] = tso.p;
901 new_repr->m[ng_place] = tso.syz;
915 else if (
pGetComp(tso.syz)<=crit_comp)
921 if (syz_place>=
IDELEMS(syzygies))
926 syzygies->m[syz_place] = tso.syz;
928 pNorm(syzygies->m[syz_place]);
931 resPairs[itso] = tso;
#define pSetmComp(p)
TODO:
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
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...
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
void kBucketInit(kBucket_pt bucket, poly lm, int length)
number kBucketPolyRed(kBucket_pt bucket, poly p1, int l1, poly spNoether)
void syCompactifyPairSet(SSet sPairs, int sPlength, int first)
const poly kBucketGetLm(kBucket_pt bucket)
KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether, ring r)
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
#define pGetComp(p)
Component.
static long p_FDeg(const poly p, const ring r)
void PrintS(const char *s)
static unsigned pLength(poly a)
void kBucket_Minus_m_Mult_p(kBucket_pt bucket, poly m, poly p, int *l, poly spNoether)
Bpoly == Bpoly - m*p; where m is a monom Does not destroy p and m assume (*l <= 0 || pLength(p) == *l...
static int index(p_Length length, p_Ord ord)
void sySPRedSyz_Kosz(syStrategy syzstr, poly redWith, poly syz, poly q=NULL, int l_syz=-1)
void p_Shift(poly *p, int i, const ring r)
shifts components of the vector p by i
static void syTestPairs(SSet resPairs, int length, ideal old_generators)
#define __p_Mult_nn(p, n, r)
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
void pEnlargeSet(poly **p, int l, int increment)
void pNorm(poly p, const ring R=currRing)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
void syDeletePair(SObject *so)
#define pCopy(p)
return a copy of the poly