Changeset 0b356b in git


Ignore:
Timestamp:
Jul 25, 2011, 1:24:34 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '0bc2210f8055033868008a3836878db65ec6f89e')
Children:
fdbaeb8802b87e60d2e0b1ef40e8c2c8682637c2
Parents:
f78059cd3fcf97dca7e3c89d6090636c59cf10d1
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-07-25 13:24:34+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:53:31+01:00
Message:
fix kstd1.cc
Location:
kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/ideals.h

    rf78059 r0b356b  
    1515//typedef struct sip_smap *          map;
    1616typedef ideal *            resolvente;
     17
     18extern ideal currQuotient;
    1719
    1820
  • kernel/kstd1.cc

    rf78059 r0b356b  
    928928    kTest_TS(strat);
    929929    strat->update = (strat->tl == -1);
    930     if (TEST_OPT_WEIGHTM)
    931     {
    932       pRestoreDegProcs(pFDegOld, pLDegOld);
    933       if (strat->tailRing != currRing)
    934       {
    935         strat->tailRing->pFDeg = strat->pOrigFDeg_TailRing;
    936         strat->tailRing->pLDeg = strat->pOrigLDeg_TailRing;
    937       }
    938       int i;
    939       for (i=strat->Ll; i>=0; i--)
    940       {
    941         strat->L[i].SetpFDeg();
    942       }
    943       for (i=strat->tl; i>=0; i--)
    944       {
    945         strat->T[i].SetpFDeg();
    946       }
    947       if (ecartWeights)
    948       {
    949         omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short));
    950         ecartWeights=NULL;
    951       }
    952     }
     930    //if (TEST_OPT_WEIGHTM)
     931    //{
     932    //  pRestoreDegProcs(currRing,pFDegOld, pLDegOld);
     933    //  if (strat->tailRing != currRing)
     934    //  {
     935    //    strat->tailRing->pFDeg = strat->pOrigFDeg_TailRing;
     936    //    strat->tailRing->pLDeg = strat->pOrigLDeg_TailRing;
     937    //  }
     938    //  int i;
     939    //  for (i=strat->Ll; i>=0; i--)
     940    //  {
     941    //    strat->L[i].SetpFDeg();
     942    //  }
     943    //  for (i=strat->tl; i>=0; i--)
     944    //  {
     945    //    strat->T[i].SetpFDeg();
     946    //  }
     947    //  if (ecartWeights)
     948    //  {
     949    //    omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short));
     950    //    ecartWeights=NULL;
     951    //  }
     952    //}
    953953    if (TEST_OPT_FASTHC)
    954954    {
     
    10811081  //else              strat->kIdeal->rtyp=MODUL_CMD;
    10821082  //strat->kIdeal->data=(void *)strat->Shdl;
    1083   if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
    1084   {
    1085     //interred  machen   Aenderung
    1086     pFDegOld=pFDeg;
    1087     pLDegOld=pLDeg;
    1088     //h=ggetid("ecart");
    1089     //if ((h!=NULL) /*&& (IDTYP(h)==INTVEC_CMD)*/)
    1090     //{
    1091     //  ecartWeights=iv2array(IDINTVEC(h));
    1092     //}
    1093     //else
    1094     {
    1095       ecartWeights=(short *)omAlloc(((currRing->N)+1)*sizeof(short));
    1096       /*uses automatic computation of the ecartWeights to set them*/
    1097       kEcartWeights(F->m,IDELEMS(F)-1,ecartWeights);
    1098     }
    1099     pRestoreDegProcs(totaldegreeWecart, maxdegreeWecart);
    1100     if (TEST_OPT_PROT)
    1101     {
    1102       for(i=1; i<=(currRing->N); i++)
    1103         Print(" %d",ecartWeights[i]);
    1104       PrintLn();
    1105       mflush();
    1106     }
    1107   }
     1083//  if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
     1084//  {
     1085//    //interred  machen   Aenderung
     1086//    pFDegOld=pFDeg;
     1087//    pLDegOld=pLDeg;
     1088//    //h=ggetid("ecart");
     1089//    //if ((h!=NULL) /*&& (IDTYP(h)==INTVEC_CMD)*/)
     1090//    //{
     1091//    //  ecartWeights=iv2array(IDINTVEC(h));
     1092//    //}
     1093//    //else
     1094//    {
     1095//      ecartWeights=(short *)omAlloc(((currRing->N)+1)*sizeof(short));
     1096//      /*uses automatic computation of the ecartWeights to set them*/
     1097//      kEcartWeights(F->m,IDELEMS(F)-1,ecartWeights);
     1098//    }
     1099//    pRestoreDegProcs(currRing,totaldegreeWecart, maxdegreeWecart);
     1100//    if (TEST_OPT_PROT)
     1101//    {
     1102//      for(i=1; i<=(currRing->N); i++)
     1103//        Print(" %d",ecartWeights[i]);
     1104//      PrintLn();
     1105//      mflush();
     1106//    }
     1107//  }
    11081108}
    11091109
     
    11291129  if (strat->kHEdgeFound)
    11301130  {
    1131     strat->HCord = pFDeg(ppNoether,currRing)+1;
     1131    strat->HCord = currRing->pFDeg(ppNoether,currRing)+1;
    11321132    strat->posInT = posInT2;
    11331133  }
     
    11391139   *intvec ecart and set ecartWeights
    11401140   */
    1141   if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
    1142   {
    1143     //interred  machen   Aenderung
    1144     pFDegOld=pFDeg;
    1145     pLDegOld=pLDeg;
    1146     //h=ggetid("ecart");
    1147     //if ((h!=NULL) /*&& (IDTYP(h)==INTVEC_CMD)*/)
    1148     //{
    1149     //  ecartWeights=iv2array(IDINTVEC(h));
    1150     //}
    1151     //else
    1152     {
    1153       ecartWeights=(short *)omAlloc(((currRing->N)+1)*sizeof(short));
    1154       /*uses automatic computation of the ecartWeights to set them*/
    1155       kEcartWeights(F->m,IDELEMS(F)-1,ecartWeights);
    1156     }
    1157 
    1158     pSetDegProcs(totaldegreeWecart, maxdegreeWecart);
    1159     if (TEST_OPT_PROT)
    1160     {
    1161       for(i=1; i<=(currRing->N); i++)
    1162         Print(" %d",ecartWeights[i]);
    1163       PrintLn();
    1164       mflush();
    1165     }
    1166   }
     1141//  if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
     1142//  {
     1143//    //interred  machen   Aenderung
     1144//    pFDegOld=pFDeg;
     1145//    pLDegOld=pLDeg;
     1146//    //h=ggetid("ecart");
     1147//    //if ((h!=NULL) /*&& (IDTYP(h)==INTVEC_CMD)*/)
     1148//    //{
     1149//    //  ecartWeights=iv2array(IDINTVEC(h));
     1150//    //}
     1151//    //else
     1152//    {
     1153//      ecartWeights=(short *)omAlloc(((currRing->N)+1)*sizeof(short));
     1154//      /*uses automatic computation of the ecartWeights to set them*/
     1155//      kEcartWeights(F->m,IDELEMS(F)-1,ecartWeights);
     1156//    }
     1157//
     1158//    pSetDegProcs(currRing,totaldegreeWecart, maxdegreeWecart);
     1159//    if (TEST_OPT_PROT)
     1160//    {
     1161//      for(i=1; i<=(currRing->N); i++)
     1162//        Print(" %d",ecartWeights[i]);
     1163//      PrintLn();
     1164//      mflush();
     1165//    }
     1166//  }
    11671167  kOptimizeLDeg(pLDeg, strat);
    11681168}
     
    13971397  {
    13981398    if (strat->kHEdge!=NULL)
    1399       Kstd1_mu=pFDeg(strat->kHEdge,currRing);
     1399      Kstd1_mu=currRing->pFDeg(strat->kHEdge,currRing);
    14001400    else
    14011401      Kstd1_mu=-1;
     
    14071407  omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
    14081408  if (TEST_OPT_PROT) messageStat(srmax,lrmax,hilbcount,strat);
    1409   if (TEST_OPT_WEIGHTM)
    1410   {
    1411     pRestoreDegProcs(pFDegOld, pLDegOld);
    1412     if (ecartWeights)
    1413     {
    1414       omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short));
    1415       ecartWeights=NULL;
    1416     }
    1417   }
     1409//  if (TEST_OPT_WEIGHTM)
     1410//  {
     1411//    pRestoreDegProcs(currRing,pFDegOld, pLDegOld);
     1412//    if (ecartWeights)
     1413//    {
     1414//      omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short));
     1415//      ecartWeights=NULL;
     1416//    }
     1417//  }
    14181418  if (Q!=NULL) updateResult(strat->Shdl,Q,strat);
    14191419  test=save_test;
     
    15351535  pDelete(&strat->kHEdge);
    15361536  pDelete(&strat->kNoether);
    1537   if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
    1538   {
    1539     pRestoreDegProcs(pFDegOld, pLDegOld);
    1540     if (ecartWeights)
    1541     {
    1542       omFreeSize((ADDRESS *)&ecartWeights,((currRing->N)+1)*sizeof(short));
    1543       ecartWeights=NULL;
    1544     }
    1545   }
     1537//  if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
     1538//  {
     1539//    pRestoreDegProcs(currRing,pFDegOld, pLDegOld);
     1540//    if (ecartWeights)
     1541//    {
     1542//      omFreeSize((ADDRESS *)&ecartWeights,((currRing->N)+1)*sizeof(short));
     1543//      ecartWeights=NULL;
     1544//    }
     1545//  }
    15461546  idDelete(&strat->Shdl);
    15471547  test=save_test;
     
    16731673  pDelete(&strat->kHEdge);
    16741674  pDelete(&strat->kNoether);
    1675   if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
    1676   {
    1677     pFDeg=pFDegOld;
    1678     pLDeg=pLDegOld;
    1679     if (ecartWeights)
    1680     {
    1681       omFreeSize((ADDRESS *)&ecartWeights,((currRing->N)+1)*sizeof(short));
    1682       ecartWeights=NULL;
    1683     }
    1684   }
     1675//  if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
     1676//  {
     1677//    pFDeg=pFDegOld;
     1678//    pLDeg=pLDegOld;
     1679//    if (ecartWeights)
     1680//    {
     1681//      omFreeSize((ADDRESS *)&ecartWeights,((currRing->N)+1)*sizeof(short));
     1682//      ecartWeights=NULL;
     1683//    }
     1684//  }
    16851685  idDelete(&strat->Shdl);
    16861686  test=save_test;
     
    17311731  if (TEST_OPT_SB_1)
    17321732    strat->newIdeal = newIdeal;
    1733   if (rField_has_simple_inverse())
     1733  if (rField_has_simple_inverse(currRing))
    17341734    strat->LazyPass=20;
    17351735  else
     
    17381738  strat->enterOnePair=enterOnePairNormal;
    17391739  strat->chainCrit=chainCritNormal;
    1740   strat->ak = idRankFreeModule(F);
     1740  strat->ak = id_RankFreeModule(F,currRing);
    17411741  strat->kModW=kModW=NULL;
    17421742  strat->kHomW=kHomW=NULL;
     
    17451745    pLexOrder=FALSE;
    17461746    strat->kHomW=kHomW=vw;
    1747     pFDegOld = pFDeg;
     1747    pFDegOld = currRing->pFDeg;
    17481748    pLDegOld = pLDeg;
    1749     pSetDegProcs(kHomModDeg);
     1749    pSetDegProcs(currRing,kHomModDeg);
    17501750    toReset = TRUE;
    17511751  }
     
    17701770      if (vw == NULL)
    17711771      {
    1772         pFDegOld = pFDeg;
     1772        pFDegOld = currRing->pFDeg;
    17731773        pLDegOld = pLDeg;
    1774         pSetDegProcs(kModDeg);
     1774        pSetDegProcs(currRing,kModDeg);
    17751775        toReset = TRUE;
    17761776      }
     
    17991799    strat->no_prod_crit   = ! bIsSCA;
    18001800    if (w!=NULL)
    1801       r = nc_GB(F, Q, *w, hilb, strat);
     1801      r = nc_GB(F, Q, *w, hilb, strat, currRing);
    18021802    else
    1803       r = nc_GB(F, Q, NULL, hilb, strat);
     1803      r = nc_GB(F, Q, NULL, hilb, strat, currRing);
    18041804  }
    18051805  else
     
    18321832  {
    18331833    kModW = NULL;
    1834     pRestoreDegProcs(pFDegOld, pLDegOld);
     1834    pRestoreDegProcs(currRing,pFDegOld, pLDegOld);
    18351835  }
    18361836  pLexOrder = b;
     
    18551855  if (TEST_OPT_SB_1)
    18561856    strat->newIdeal = newIdeal;
    1857   if (rField_has_simple_inverse())
     1857  if (rField_has_simple_inverse(currRing))
    18581858    strat->LazyPass=20;
    18591859  else
    18601860    strat->LazyPass=2;
    18611861  strat->LazyDegree = 1;
    1862   strat->ak = idRankFreeModule(F);
     1862  strat->ak = id_RankFreeModule(F,currRing);
    18631863  strat->kModW=kModW=NULL;
    18641864  strat->kHomW=kHomW=NULL;
     
    18671867    pLexOrder=FALSE;
    18681868    strat->kHomW=kHomW=vw;
    1869     pFDegOld = pFDeg;
     1869    pFDegOld = currRing->pFDeg;
    18701870    pLDegOld = pLDeg;
    1871     pSetDegProcs(kHomModDeg);
     1871    pSetDegProcs(currRing,kHomModDeg);
    18721872    toReset = TRUE;
    18731873  }
     
    18921892      if (vw == NULL)
    18931893      {
    1894         pFDegOld = pFDeg;
     1894        pFDegOld = currRing->pFDeg;
    18951895        pLDegOld = pLDeg;
    1896         pSetDegProcs(kModDeg);
     1896        pSetDegProcs(currRing,kModDeg);
    18971897        toReset = TRUE;
    18981898      }
     
    19251925  {
    19261926    kModW = NULL;
    1927     pRestoreDegProcs(pFDegOld, pLDegOld);
     1927    pRestoreDegProcs(currRing,pFDegOld, pLDegOld);
    19281928  }
    19291929  pLexOrder = b;
     
    19611961  if(!TEST_OPT_RETURN_SB)
    19621962     strat->syzComp = syzComp;
    1963   if (rField_has_simple_inverse())
     1963  if (rField_has_simple_inverse(currRing))
    19641964    strat->LazyPass=20;
    19651965  else
     
    19671967  strat->LazyDegree = 1;
    19681968  strat->minim=(reduced % 2)+1;
    1969   strat->ak = idRankFreeModule(F);
     1969  strat->ak = id_RankFreeModule(F,currRing);
    19701970  if (delete_w)
    19711971  {
     
    19931993      strat->kModW = *w;
    19941994      assume(pFDeg != NULL && pLDeg != NULL);
    1995       pFDegOld = pFDeg;
     1995      pFDegOld = currRing->pFDeg;
    19961996      pLDegOld = pLDeg;
    1997       pSetDegProcs(kModDeg);
     1997      pSetDegProcs(currRing,kModDeg);
    19981998
    19991999      toReset = TRUE;
     
    20042004        for (i=IDELEMS(F)-1;i>=0;i--)
    20052005        {
    2006           if ((F->m[i]!=NULL) && (pFDeg(F->m[i],currRing)>=Kstd1_deg))
    2007             Kstd1_deg = pFDeg(F->m[i],currRing)+1;
     2006          if ((F->m[i]!=NULL) && (currRing->pFDeg(F->m[i],currRing)>=Kstd1_deg))
     2007            Kstd1_deg = currRing->pFDeg(F->m[i],currRing)+1;
    20082008        }
    20092009      }
     
    20362036  if (toReset)
    20372037  {
    2038     pRestoreDegProcs(pFDegOld, pLDegOld);
     2038    pRestoreDegProcs(currRing,pFDegOld, pLDegOld);
    20392039    kModW = NULL;
    20402040  }
     
    21032103  kStrategy strat=new skStrategy;
    21042104  strat->syzComp = syzComp;
    2105   strat->ak = si_max(idRankFreeModule(F),pMaxComp(p));
     2105  strat->ak = si_max(id_RankFreeModule(F,currRing),pMaxComp(p));
    21062106  poly res;
    21072107
     
    21532153  kStrategy strat=new skStrategy;
    21542154  strat->syzComp = syzComp;
    2155   strat->ak = si_max(idRankFreeModule(F),idRankFreeModule(p));
     2155  strat->ak = si_max(id_RankFreeModule(F,currRing),id_RankFreeModule(p,currRing));
    21562156  if (strat->ak>0) // only for module case, see Tst/Short/bug_reduce.tst
    21572157  {
     
    22082208  strat->kHEdgeFound = ppNoether != NULL;
    22092209  strat->kNoether=pCopy(ppNoether);
    2210   strat->ak = idRankFreeModule(tempF);
     2210  strat->ak = id_RankFreeModule(tempF,currRing);
    22112211  initBuchMoraCrit(strat);
    22122212  strat->NotUsedAxis = (BOOLEAN *)omAlloc(((currRing->N)+1)*sizeof(BOOLEAN));
     
    22792279  intvec * w=NULL;
    22802280
    2281   if (rField_has_simple_inverse())
     2281  if (rField_has_simple_inverse(currRing))
    22822282    strat->LazyPass=20;
    22832283  else
    22842284    strat->LazyPass=2;
    22852285  strat->LazyDegree = 1;
    2286   strat->ak = idRankFreeModule(F);
     2286  strat->ak = id_RankFreeModule(F,currRing);
    22872287  strat->syzComp = strat->ak;
    22882288  strat->kModW=kModW=NULL;
     
    23022302    {
    23032303      strat->kModW = kModW = w;
    2304       pFDegOld = pFDeg;
     2304      pFDegOld = currRing->pFDeg;
    23052305      pLDegOld = pLDeg;
    2306       pSetDegProcs(kModDeg);
     2306      pSetDegProcs(currRing,kModDeg);
    23072307      toReset = TRUE;
    23082308    }
     
    25072507  /* release temp data-------------------------------- */
    25082508  exitBuchMora(strat);
    2509   if (TEST_OPT_WEIGHTM)
    2510   {
    2511     pRestoreDegProcs(pFDegOld, pLDegOld);
    2512     if (ecartWeights)
    2513     {
    2514       omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short));
    2515       ecartWeights=NULL;
    2516     }
    2517   }
     2509//  if (TEST_OPT_WEIGHTM)
     2510//  {
     2511//    pRestoreDegProcs(currRing,pFDegOld, pLDegOld);
     2512//    if (ecartWeights)
     2513//    {
     2514//      omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short));
     2515//      ecartWeights=NULL;
     2516//    }
     2517//  }
    25182518  //if (TEST_OPT_PROT) messageStat(srmax,lrmax,0/*hilbcount*/,strat);
    25192519  if (Q!=NULL) updateResult(strat->Shdl,Q,strat);
Note: See TracChangeset for help on using the changeset viewer.