Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove all shrink calls. Remove uptodeg/lV parameters from almost all…
… methods.
  • Loading branch information
kabouzeid committed Jun 14, 2018
1 parent 8c73fde commit b00f8a3
Show file tree
Hide file tree
Showing 12 changed files with 164 additions and 542 deletions.
8 changes: 2 additions & 6 deletions Singular/LIB/freegb.lib
Expand Up @@ -501,10 +501,8 @@ EXAMPLE: example letplaceGBasis; shows examples
def save = basering;
// assumes of the ring have been checked
// run the computation - it will test assumes on the ideal
int uptodeg = attrib(save,"uptodeg");
int lV = attrib(save,"isLetterplaceRing");
dbprint(ppl,"start computing GB");
def J = system("freegb",I,uptodeg,lV);
def J = system("freegb",I);
dbprint(ppl,"finished computing GB");
dbprint(ppl-1,"the result is:");
dbprint(ppl-1,J);
Expand Down Expand Up @@ -2526,9 +2524,7 @@ EXAMPLE: example shiftPoly; shows examples
{
ERROR("Incomplete Letterplace structure on the basering!");
}
int uptodeg = attrib(basering,"uptodeg");
int lV = attrib(basering,"isLetterplaceRing");
return(system("stest",a,i,uptodeg,lV));
return(system("stest",a,i));
}
example
{
Expand Down
51 changes: 10 additions & 41 deletions Singular/extra.cc
Expand Up @@ -1137,28 +1137,24 @@ BOOLEAN jjSYSTEM(leftv res, leftv args)
#ifdef HAVE_SHIFTBBA
if (strcmp(sys_cmd, "stest") == 0)
{
const short t[]={4,POLY_CMD,INT_CMD,INT_CMD,INT_CMD};
const short t[]={2,POLY_CMD,INT_CMD};
if (iiCheckTypes(h,t,1))
{
poly p=(poly)h->CopyD();
h=h->next;
int sh=(int)((long)(h->Data()));
h=h->next;
int uptodeg=(int)((long)(h->Data()));
h=h->next;
int lVblock=(int)((long)(h->Data()));
if (sh<0)
{
WerrorS("negative shift for pLPshift");
return TRUE;
}
int L = pLastVblock(p,lVblock);
if (L+sh > uptodeg)
int L = pLastVblock(p);
if (L+sh > currRing->N/currRing->isLPring)
{
WerrorS("pLPshift: too big shift requested\n");
return TRUE;
}
res->data = p_LPshift(p,sh,uptodeg,lVblock,currRing);
res->data = p_LPshift(p,sh,currRing);
res->rtyp = POLY_CMD;
return FALSE;
}
Expand All @@ -1170,35 +1166,12 @@ BOOLEAN jjSYSTEM(leftv res, leftv args)
#ifdef HAVE_SHIFTBBA
if (strcmp(sys_cmd, "btest") == 0)
{
const short t[]={2,POLY_CMD,INT_CMD};
const short t[]={1,POLY_CMD};
if (iiCheckTypes(h,t,1))
{
poly p=(poly)h->CopyD();
h=h->next;
int lV=(int)((long)(h->Data()));
res->rtyp = INT_CMD;
res->data = (void*)(long)pLastVblock(p, lV);
return FALSE;
}
else return TRUE;
}
else
#endif
/*==================== shrink-test for freeGB =================*/
#ifdef HAVE_SHIFTBBA
if (strcmp(sys_cmd, "shrinktest") == 0)
{
const short t[]={2,POLY_CMD,INT_CMD};
if (iiCheckTypes(h,t,1))
{
poly p=(poly)h->Data();
h=h->next;
int lV=(int)((long)(h->Data()));
res->rtyp = POLY_CMD;
// res->data = p_mShrink(p, lV, currRing);
// kStrategy strat=new skStrategy;
// strat->tailRing = currRing;
res->data = p_Shrink(p, lV, currRing);
res->data = (void*)(long)pLastVblock(p);
return FALSE;
}
else return TRUE;
Expand Down Expand Up @@ -1477,18 +1450,14 @@ BOOLEAN jjSYSTEM(leftv res, leftv args)
#ifdef HAVE_SHIFTBBA
if (strcmp(sys_cmd, "freegb") == 0)
{
const short t[]={3,IDEAL_CMD,INT_CMD,INT_CMD};
const short tM[]={3,MODUL_CMD,INT_CMD,INT_CMD};
const short t[]={1,IDEAL_CMD};
const short tM[]={1,MODUL_CMD};
if (iiCheckTypes(h,tM,0)
|| (iiCheckTypes(h,t,0)))
{
res->rtyp=h->Typ();
ideal I=(ideal)h->CopyD();
h=h->next;
int uptodeg=(int)((long)(h->Data()));
h=h->next;
int lVblock=(int)((long)(h->Data()));
res->data = freegb(I,uptodeg,lVblock);
res->data = freegb(I);
if (res->data == NULL)
{
/* that is there were input errors */
Expand All @@ -1498,7 +1467,7 @@ BOOLEAN jjSYSTEM(leftv res, leftv args)
}
else
{
WerrorS("system(\"freegb\",`ideal/module`,`int`,`int`) expected");
WerrorS("system(\"freegb\",`ideal/module`) expected");
return TRUE;
}
}
Expand Down
98 changes: 0 additions & 98 deletions kernel/GBEngine/kspoly.cc
Expand Up @@ -155,20 +155,6 @@ int ksReducePoly(LObject* PR,
assume(PW->GetpLength() == pLength(PW->p != NULL ? PW->p : PW->t_p));
PR->LmDeleteAndIter();

// the following is commented out: shrinking
#ifdef HAVE_SHIFTBBA_NONEXISTENT
if ( (currRing->isLPring) && (!strat->homog) )
{
// assume? h->p in currRing
PR->GetP();
poly qq = p_Shrink(PR->p, currRing->isLPring, currRing);
PR->Clear(); // does the right things
PR->p = qq;
PR->t_p = NULL;
PR->SetShortExpVector();
}
#endif

#if defined(KDEBUG) && defined(TEST_OPT_DEBUG_RED)
if (TEST_OPT_DEBUG)
{
Expand Down Expand Up @@ -296,20 +282,6 @@ int ksReducePolyBound(LObject* PR,
assume(PW->GetpLength() == pLength(PW->p != NULL ? PW->p : PW->t_p));
PR->LmDeleteAndIter();

// the following is commented out: shrinking
#ifdef HAVE_SHIFTBBA_NONEXISTENT
if ( (currRing->isLPring) && (!strat->homog) )
{
// assume? h->p in currRing
PR->GetP();
poly qq = p_Shrink(PR->p, currRing->isLPring, currRing);
PR->Clear(); // does the right things
PR->p = qq;
PR->t_p = NULL;
PR->SetShortExpVector();
}
#endif

#if defined(KDEBUG) && defined(TEST_OPT_DEBUG_RED)
if (TEST_OPT_DEBUG)
{
Expand Down Expand Up @@ -511,20 +483,6 @@ int ksReducePolySig(LObject* PR,
assume(PW->GetpLength() == pLength(PW->p != NULL ? PW->p : PW->t_p));
PR->LmDeleteAndIter();

// the following is commented out: shrinking
#ifdef HAVE_SHIFTBBA_NONEXISTENT
if ( (currRing->isLPring) && (!strat->homog) )
{
// assume? h->p in currRing
PR->GetP();
poly qq = p_Shrink(PR->p, currRing->isLPring, currRing);
PR->Clear(); // does the right things
PR->p = qq;
PR->t_p = NULL;
PR->SetShortExpVector();
}
#endif

#if defined(KDEBUG) && defined(TEST_OPT_DEBUG_RED)
if (TEST_OPT_DEBUG)
{
Expand Down Expand Up @@ -766,19 +724,6 @@ int ksReducePolySigRing(LObject* PR,
assume(PW->GetpLength() == pLength(PW->p != NULL ? PW->p : PW->t_p));
PR->LmDeleteAndIter();

// the following is commented out: shrinking
#ifdef HAVE_SHIFTBBA_NONEXISTENT
if ( (currRing->isLPring) && (!strat->homog) )
{
// assume? h->p in currRing
PR->GetP();
poly qq = p_Shrink(PR->p, currRing->isLPring, currRing);
PR->Clear(); // does the right things
PR->p = qq;
PR->t_p = NULL;
PR->SetShortExpVector();
}
#endif
#if defined(KDEBUG) && defined(TEST_OPT_DEBUG_RED)
if (TEST_OPT_DEBUG)
{
Expand Down Expand Up @@ -920,21 +865,6 @@ void ksCreateSpoly(LObject* Pair, poly spNoether,
p_SetCompP(p2,0, currRing, tailRing);
}
}

// the following is commented out: shrinking
#ifdef HAVE_SHIFTBBA_NONEXISTENT
if (currRing->isLPring)
{
// assume? h->p in currRing
Pair->GetP();
poly qq = p_Shrink(Pair->p, currRing->isLPring, currRing);
Pair->Clear(); // does the right things
Pair->p = qq;
Pair->t_p = NULL;
Pair->SetShortExpVector();
}
#endif

}

int ksReducePolyTail(LObject* PR, TObject* PW, poly Current, poly spNoether)
Expand Down Expand Up @@ -976,20 +906,6 @@ int ksReducePolyTail(LObject* PR, TObject* PW, poly Current, poly spNoether)
if (Lp == Save)
With.Delete();

// the following is commented out: shrinking
#ifdef HAVE_SHIFTBBA_NONEXISTENT
if (currRing->isLPring)
{
// assume? h->p in currRing
PR->GetP();
poly qq = p_Shrink(PR->p, currRing->isLPring, currRing);
PR->Clear(); // does the right things
PR->p = qq;
PR->t_p = NULL;
PR->SetShortExpVector();
}
#endif

return ret;
}

Expand Down Expand Up @@ -1032,20 +948,6 @@ int ksReducePolyTailBound(LObject* PR, TObject* PW, int bound, poly Current, pol
if (Lp == Save)
With.Delete();

// the following is commented out: shrinking
#ifdef HAVE_SHIFTBBA_NONEXISTENT
if (currRing->isLPring)
{
// assume? h->p in currRing
PR->GetP();
poly qq = p_Shrink(PR->p, currRing->isLPring, currRing);
PR->Clear(); // does the right things
PR->p = qq;
PR->t_p = NULL;
PR->SetShortExpVector();
}
#endif

return ret;
}

Expand Down
6 changes: 3 additions & 3 deletions kernel/GBEngine/kstd1.cc
Expand Up @@ -2571,7 +2571,7 @@ ideal kSba(ideal F, ideal Q, tHomog h,intvec ** w, int sbaOrder, int arri, intve

#ifdef HAVE_SHIFTBBA
ideal kStdShift(ideal F, ideal Q, tHomog h,intvec ** w, intvec *hilb,int syzComp,
int newIdeal, intvec *vw, int uptodeg, int lV)
int newIdeal, intvec *vw)
{
ideal r;
BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
Expand Down Expand Up @@ -2652,9 +2652,9 @@ ideal kStdShift(ideal F, ideal Q, tHomog h,intvec ** w, intvec *hilb,int syzComp
{
/* global ordering */
if (w!=NULL)
r=bbaShift(F,Q,*w,hilb,strat,uptodeg,lV);
r=bbaShift(F,Q,*w,hilb,strat);
else
r=bbaShift(F,Q,NULL,hilb,strat,uptodeg,lV);
r=bbaShift(F,Q,NULL,hilb,strat);
}
#ifdef KDEBUG
idTest(r);
Expand Down
2 changes: 1 addition & 1 deletion kernel/GBEngine/kstd1.h
Expand Up @@ -39,7 +39,7 @@ ideal kStd(ideal F, ideal Q, tHomog h, intvec ** mw,intvec *hilb=NULL,
int syzComp=0,int newIdeal=0, intvec *vw=NULL, s_poly_proc_t sp=NULL);

ideal kStdShift(ideal F, ideal Q, tHomog h,intvec ** w, intvec *hilb,int syzComp,
int newIdeal, intvec *vw, int uptodeg, int lVblock);
int newIdeal, intvec *vw);

/* the following global data are defined in kutil.cc */
//extern int syzComp;
Expand Down

0 comments on commit b00f8a3

Please sign in to comment.