Changeset 3e5610 in git


Ignore:
Timestamp:
Jul 12, 2018, 1:39:04 PM (5 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
6c8f2bd7d8f3d28a5621da4bfc39a75f6d4ce055
Parents:
ce5acd0310801fae5f6a56e78258c3ac612fe6ce
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2018-07-12 13:39:04+02:00
git-committer:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2018-07-12 13:47:55+02:00
Message:
simplify delete lcm to kDeleteLcm (GBEngine)
Location:
kernel/GBEngine
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/gr_kstd2.cc

    rce5acd0 r3e5610  
    102102      if ((*h).p == NULL)
    103103      {
    104         if (h->lcm!=NULL) p_LmFree((*h).lcm, currRing);
     104        kDeleteLcm(h);
    105105        return 0;
    106106      }
     
    286286        if ((*h).p == NULL)
    287287        {
    288           if (h->lcm!=NULL) p_LmFree((*h).lcm, currRing);
     288          kDeleteLcm(h);
    289289          return 0;
    290290        }
     
    399399      {
    400400        if (TEST_OPT_DEBUG) PrintS(" to 0\n");
    401         if (h->lcm!=NULL) pLmFree((*h).lcm);
    402         (*h).lcm=NULL;
     401        kDeleteLcm(h);
    403402        return 0;
    404403      }
     
    466465      {
    467466        if (TEST_OPT_DEBUG) PrintS(" to 0\n");
    468         if (h->lcm!=NULL) pLmFree((*h).lcm);
    469         (*h).lcm=NULL;
     467        kDeleteLcm(h);
    470468        return 0;
    471469      }
     
    548546      {
    549547        if (TEST_OPT_DEBUG) PrintS(" to 0\n");
    550         if (h->lcm!=NULL) pLmFree((*h).lcm);
    551         (*h).lcm=NULL;
     548        kDeleteLcm(h);
    552549        return 0;
    553550      }
     
    725722      if ((*h).p == NULL)
    726723      {
    727         if (h->lcm!=NULL) pLmFree((*h).lcm);
    728         (*h).lcm=NULL;
     724        kDeleteLcm(h);
    729725        return 0;
    730726      }
     
    870866                pLmFree(p);
    871867                pDelete(&((*h).p));
    872                 if (h->lcm!=NULL)
    873                 {
    874                   pLmFree((*h).lcm);
    875                   (*h).lcm=NULL;
    876                 }
     868                kDeleteLcm(h);
    877869                return 0;
    878870              }
     
    895887      else
    896888      {
    897         if (h->lcm!=NULL)
    898         {
    899           pLmFree((*h).lcm);
    900           (*h).lcm=NULL;
    901         }
    902         (*h).p = NULL;
     889        kDeleteLcm(h);
    903890        return 0;
    904891      }
     
    12451232//      if (hilb!=NULL) khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
    12461233      }
    1247       if (strat->P.lcm!=NULL) pLmFree(strat->P.lcm);
    1248     }
    1249 #ifdef KDEBUG
    1250     strat->P.lcm=NULL;
    1251 #endif
     1234      kDeleteLcm(&strat->P);
     1235    }
    12521236    //kTest(strat);
    12531237  }
  • kernel/GBEngine/kstd1.cc

    rce5acd0 r3e5610  
    258258    {
    259259      assume(!rField_is_Ring(currRing));
    260       if (h->lcm!=NULL) pLmFree(h->lcm);
     260      kDeleteLcm(h);
    261261      h->Clear();
    262262      return 0;
     
    361361      if(h->p == NULL)
    362362      {
    363         if (h->lcm!=NULL) pLmDelete(h->lcm);
     363        kDeleteLcm(h);
    364364        h->Clear();
    365365        return 0;
     
    372372      if (h->GetLmTailRing() == NULL)
    373373      {
    374         if (h->lcm!=NULL) pLmDelete(h->lcm);
     374        kDeleteLcm(h);
    375375        h->Clear();
    376376        return 0;
     
    454454    if (h->IsNull())
    455455    {
    456       if (h->lcm!=NULL) pLmDelete(h->lcm);
     456      kDeleteLcm(h);
    457457      h->Clear();
    458458      return 0;
     
    575575    {
    576576      assume(!rField_is_Ring(currRing));
    577       if (h->lcm!=NULL) pLmFree(h->lcm);
     577      kDeleteLcm(h);
    578578      h->Clear();
    579579      return 0;
     
    17031703
    17041704      // clear strat->P
    1705       if (strat->P.lcm!=NULL)
    1706       {
    1707         if (rField_is_Ring(currRing))
    1708           pLmDelete(strat->P.lcm);
    1709         else
    1710           pLmFree(strat->P.lcm);
    1711         strat->P.lcm=NULL;
    1712       }
     1705      kDeleteLcm(&strat->P);
    17131706
    17141707#ifdef KDEBUG
     
    33213314        // clean P
    33223315      }
    3323       if (strat->P.lcm!=NULL)
    3324 #ifdef HAVE_RINGS
    3325         pLmDelete(strat->P.lcm);
    3326 #else
    3327         pLmFree(strat->P.lcm);
    3328 #endif
     3316      kDeleteLcm(&strat->P);
    33293317    }
    33303318
  • kernel/GBEngine/kstd2.cc

    rce5acd0 r3e5610  
    462462      if(h->p == NULL)
    463463      {
    464         if (h->lcm!=NULL) pLmDelete(h->lcm);
     464        kDeleteLcm(h);
    465465        h->Clear();
    466466        return 0;
     
    476476        if (h->GetLmTailRing() == NULL)
    477477        {
    478           if (h->lcm!=NULL) pLmDelete(h->lcm);
     478          kDeleteLcm(h);
    479479          h->Clear();
    480480          return 0;
     
    489489    if (h->GetLmTailRing() == NULL)
    490490    {
    491       if (h->lcm!=NULL) pLmDelete(h->lcm);
    492 #ifdef KDEBUG
    493       h->lcm=NULL;
    494 #endif
     491      kDeleteLcm(h);
    495492      h->Clear();
    496493      return 0;
     
    635632    if (h_p == NULL)
    636633    {
    637       if (h->lcm!=NULL) pLmFree(h->lcm);
    638 #ifdef KDEBUG
    639       h->lcm=NULL;
    640 #endif
     634      kDeleteLcm(h);
    641635      return 0;
    642636    }
     
    839833      if (h_p == NULL)
    840834      {
    841         if (h->lcm!=NULL) pLmFree(h->lcm);
    842 #ifdef KDEBUG
    843         h->lcm=NULL;
    844 #endif
     835        kDeleteLcm(h);
    845836        return 0;
    846837      }
     
    947938        if (h->GetLmTailRing() == NULL)
    948939        {
    949           if (h->lcm!=NULL) pLmDelete(h->lcm);
     940          kDeleteLcm(h);
    950941          h->Clear();
    951942          return 0;
     
    10911082      if (h_p == NULL)
    10921083      {
    1093         if (h->lcm!=NULL) pLmFree(h->lcm);
    1094 #ifdef KDEBUG
    1095         h->lcm=NULL;
    1096 #endif
     1084        kDeleteLcm(h);
    10971085        return 0;
    10981086      }
     
    13411329    if (h_p == NULL)
    13421330    {
    1343       if (h->lcm!=NULL) pLmFree(h->lcm);
    1344 #ifdef KDEBUG
    1345       h->lcm=NULL;
    1346 #endif
     1331      kDeleteLcm(h);
    13471332      return 0;
    13481333    }
     
    15141499    if(h->IsNull())
    15151500    {
     1501      kDeleteLcm(h);
    15161502      h->Clear();
    1517       if (h->lcm!=NULL) pLmFree(h->lcm);
    1518       #ifdef KDEBUG
    1519       h->lcm=NULL;
    1520       #endif
    15211503      return 0;
    15221504    }
     
    21442126      if (hilb!=NULL) khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
    21452127//      Print("[%d]",hilbeledeg);
    2146       if (strat->P.lcm!=NULL)
    2147       {
    2148         if (rField_is_Ring(currRing)) pLmDelete(strat->P.lcm);
    2149         else                          pLmFree(strat->P.lcm);
    2150         strat->P.lcm=NULL;
    2151       }
     2128      kDeleteLcm(&strat->P);
    21522129      if (strat->s_poly!=NULL)
    21532130      {
     
    25892566          int pos = posInSyz(strat, strat->P.sig);
    25902567          enterSyz(strat->P, strat, pos);
    2591           if (strat->P.lcm!=NULL)
    2592             pLmFree(strat->P.lcm);
     2568          kDeleteLcm(&strat->P);
    25932569          red_result = 2;
    25942570        }
     
    29872963      if (hilb!=NULL) khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
    29882964//      Print("[%d]",hilbeledeg);
    2989       if (strat->P.lcm!=NULL)
    2990 #ifdef HAVE_RINGS
    2991         pLmDelete(strat->P.lcm);
    2992 #else
    2993         pLmFree(strat->P.lcm);
    2994 #endif
     2965      kDeleteLcm(&strat->P);
    29952966      if (strat->sl>srmax) srmax = strat->sl;
    29962967    }
     
    37643735      }
    37653736      //      Print("[%d]",hilbeledeg);
    3766       if (strat->P.lcm!=NULL)
    3767 #ifdef HAVE_RINGS
    3768         pLmDelete(strat->P.lcm);
    3769 #else
    3770       pLmFree(strat->P.lcm);
    3771 #endif
     3737      kDeleteLcm(&strat->P);
    37723738      if (strat->sl>srmax) srmax = strat->sl;
    37733739    }
     
    41364102      if (hilb!=NULL) khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
    41374103//      Print("[%d]",hilbeledeg);
    4138       if (strat->P.lcm!=NULL) pLmFree(strat->P.lcm);
     4104      kDeleteLcm(&strat->P);
    41394105    }
    41404106    else
     
    43184284    if (h->IsNull())
    43194285    {
    4320       if (h->lcm!=NULL) pLmFree(h->lcm);
     4286      kDeleteLcm(h);
    43214287      h->Clear();
    43224288      return 0;
  • kernel/GBEngine/kstdfac.cc

    rce5acd0 r3e5610  
    575575        }
    576576      }
    577       if (strat->P.lcm!=NULL) pLmFree(strat->P.lcm);
     577      kDeleteLcm(&strat->P);
    578578      int i;
    579579
  • kernel/GBEngine/kutil.cc

    rce5acd0 r3e5610  
    11541154  if (set[j].lcm!=NULL)
    11551155  {
    1156 #ifdef HAVE_RINGS
    1157     if (rField_is_Ring(currRing)
    1158     && (pGetCoeff(set[j].lcm) != NULL))
    1159       pLmDelete(set[j].lcm);
    1160     else
    1161 #endif
    1162       pLmFree(set[j].lcm);
     1156    kDeleteLcm(&set[j]);
    11631157  }
    11641158  if (set[j].sig!=NULL)
  • kernel/GBEngine/kutil.h

    rce5acd0 r3e5610  
    841841extern  int (*test_PosInL)(const LSet set, const int length,
    842842                LObject* L,const kStrategy strat);
    843 #endif
     843
     844static inline void kDeleteLcm(LObject *P)
     845{
     846 if (P->lcm!=NULL)
     847 {
     848 #ifdef HAVE_RINGS
     849   if (rField_is_Ring(currRing))
     850     pLmDelete(P->lcm);
     851   else
     852 #endif
     853     pLmFree(P->lcm);
     854   P->lcm=NULL;
     855 }
     856}
     857#endif
  • kernel/GBEngine/sca.cc

    rce5acd0 r3e5610  
    8686//    enterT(h, strat); // ?!
    8787
    88     if (h.lcm!=NULL) pLmFree(h.lcm);
     88    kDeleteLcm(&h);
    8989  }
    9090
     
    681681
    682682//      Print("[%d]",hilbeledeg);
    683       if (strat->P.lcm!=NULL) pLmFree(strat->P.lcm);
     683      kDeleteLcm(&strat->P);
    684684
    685685      // //////////////////////////////////////////////////////////
     
    11091109
    11101110      // clear strat->P
    1111       if (strat->P.lcm!=NULL) pLmFree(strat->P.lcm);
    1112       strat->P.lcm=NULL;
     1111      kDeleteLcm(&strat->P);
    11131112
    11141113      // //////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.