MCPcopy Create free account
hub / github.com/Singular/Singular / initSyzRules

Function initSyzRules

kernel/GBEngine/kutil.cc:7932–8082  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7930}
7931
7932void initSyzRules (kStrategy strat)
7933{
7934 if( strat->S[0] )
7935 {
7936 if( strat->S[1] && !rField_is_Ring(currRing))
7937 {
7938 omFreeSize(strat->syzIdx,(strat->syzidxmax)*sizeof(int));
7939 omFreeSize(strat->sevSyz,(strat->syzmax)*sizeof(unsigned long));
7940 omFreeSize(strat->syz,(strat->syzmax)*sizeof(poly));
7941 }
7942 int i, j, k, diff, comp, comp_old, ps=0, ctr=0;
7943 /************************************************************
7944 * computing the length of the syzygy array needed
7945 ***********************************************************/
7946 for(i=1; i<=strat->sl; i++)
7947 {
7948 if (pGetComp(strat->sig[i-1]) != pGetComp(strat->sig[i]))
7949 {
7950 ps += i;
7951 }
7952 }
7953 ps += strat->sl+1;
7954 //comp = pGetComp (strat->P.sig);
7955 comp = strat->currIdx;
7956 strat->syzIdx = initec(comp);
7957 strat->sevSyz = initsevS(ps);
7958 strat->syz = (poly *)omAlloc(ps*sizeof(poly));
7959 strat->syzmax = ps;
7960 strat->syzl = 0;
7961 strat->syzidxmax = comp;
7962#if defined(DEBUGF5) || defined(DEBUGF51)
7963 PrintS("------------- GENERATING SYZ RULES NEW ---------------\n");
7964#endif
7965 i = 1;
7966 j = 0;
7967 /************************************************************
7968 * generating the leading terms of the principal syzygies
7969 ***********************************************************/
7970 while (i <= strat->sl)
7971 {
7972 /**********************************************************
7973 * principal syzygies start with component index 2
7974 * the array syzIdx starts with index 0
7975 * => the rules for a signature with component comp start
7976 * at strat->syz[strat->syzIdx[comp-2]] !
7977 *********************************************************/
7978 if (pGetComp(strat->sig[i-1]) != pGetComp(strat->sig[i]))
7979 {
7980 comp = pGetComp(strat->sig[i]);
7981 comp_old = pGetComp(strat->sig[i-1]);
7982 diff = comp - comp_old - 1;
7983 // diff should be zero, but sometimes also the initial generating
7984 // elements of the input ideal reduce to zero. then there is an
7985 // index-gap between the signatures. for these in-between signatures we
7986 // can safely set syzIdx[j] = 0 as no such element will be ever computed
7987 // in the following.
7988 // doing this, we keep the relation "j = comp - 2" alive, which makes
7989 // jumps way easier when checking criteria

Callers 1

sbaFunction · 0.85

Calls 14

PrintSFunction · 0.85
p_SetCoeffFunction · 0.85
p_ExpVectorCopyFunction · 0.85
p_SetCompPFunction · 0.85
p_OneFunction · 0.85
p_NegFunction · 0.85
p_Add_qFunction · 0.85
p_GetShortExpVectorFunction · 0.85
posInSyzFunction · 0.85
enterSyzFunction · 0.85
pWriteFunction · 0.85
initecFunction · 0.70

Tested by

no test coverage detected