Changeset 8fcfae in git


Ignore:
Timestamp:
Dec 2, 2013, 11:58:00 AM (9 years ago)
Author:
Christian Eder
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '48f1dd268d0ff74ef2f7dccbf02545425002ddcc')
Children:
11f9394e2a7861a265d30f1e798feea66f2d3973
Parents:
a7b37d65dd6d473a1bf5d915d9853076679013b0
git-author:
Christian Eder <ederc@mathematik.uni-kl.de>2013-12-02 11:58:00+01:00
git-committer:
Christian Eder <ederc@mathematik.uni-kl.de>2013-12-12 13:51:28+01:00
Message:
rewrites rewrite criteria in sba
Location:
kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/kstd2.cc

    ra7b37d r8fcfae  
    5555#define SBA_TAIL_RED                        1
    5656#define SBA_PRODUCT_CRITERION               0
    57 #define SBA_PRINT_ZERO_REDUCTIONS           1
    58 #define SBA_PRINT_REDUCTION_STEPS           1
    59 #define SBA_PRINT_OPERATIONS                1
    60 #define SBA_PRINT_SIZE_G                    1
    61 #define SBA_PRINT_SIZE_SYZ                  1
     57#define SBA_PRINT_ZERO_REDUCTIONS           0
     58#define SBA_PRINT_REDUCTION_STEPS           0
     59#define SBA_PRINT_OPERATIONS                0
     60#define SBA_PRINT_SIZE_G                    0
     61#define SBA_PRINT_SIZE_SYZ                  0
    6262#define SBA_PRINT_PRODUCT_CRITERION         0
    6363
     
    480480    sba_interreduction_steps++;
    481481#endif
    482 #if SBA_PRINT_REDUCTION_OPERATIONS
     482#if SBA_PRINT_OPERATIONS
    483483    sba_interreduction_operations  +=  pLength(strat->T[ii].p);
    484484#endif
     
    18161816      // 2. generation of new principal syzygy rules for syzCriterion
    18171817      f5c ( strat, olddeg, minimcnt, hilbeledeg, hilbcount, srmax,
    1818             lrmax, reduc, Q, w, hilb );
     1818          lrmax, reduc, Q, w, hilb );
    18191819#endif
    18201820      // initialize new syzygy rules for the next iteration step
     
    18221822    }
    18231823    /*********************************************************************
    1824      * interrreduction step is done, we can go on with the next iteration
    1825      * step of the signature-based algorithm
    1826      ********************************************************************/
     1824      * interrreduction step is done, we can go on with the next iteration
     1825      * step of the signature-based algorithm
     1826      ********************************************************************/
    18271827    /* picks the last element from the lazyset L */
    18281828    strat->P = strat->L[strat->Ll];
    18291829    strat->Ll--;
    1830 //#if 1
     1830    /* reduction of the element choosen from L */
     1831    if (!strat->rewCrit2(strat->P.sig, ~strat->P.sevSig, strat, strat->P.checked+1)) {
     1832      //#if 1
    18311833#ifdef DEBUGF5
    1832     Print("SIG OF NEXT PAIR TO HANDLE IN SIG-BASED ALGORITHM\n");
    1833     Print("-------------------------------------------------\n");
    1834     pWrite(strat->P.sig);
    1835     pWrite(pHead(strat->P.p));
    1836     pWrite(pHead(strat->P.p1));
    1837     pWrite(pHead(strat->P.p2));
    1838     Print("-------------------------------------------------\n");
    1839 #endif
    1840     if (pNext(strat->P.p) == strat->tail)
    1841     {
    1842       // deletes the short spoly
     1834      Print("SIG OF NEXT PAIR TO HANDLE IN SIG-BASED ALGORITHM\n");
     1835      Print("-------------------------------------------------\n");
     1836      pWrite(strat->P.sig);
     1837      pWrite(pHead(strat->P.p));
     1838      pWrite(pHead(strat->P.p1));
     1839      pWrite(pHead(strat->P.p2));
     1840      Print("-------------------------------------------------\n");
     1841#endif
     1842      if (pNext(strat->P.p) == strat->tail)
     1843      {
     1844        // deletes the short spoly
    18431845#ifdef HAVE_RINGS
    1844       if (rField_is_Ring(currRing))
    1845         pLmDelete(strat->P.p);
     1846        if (rField_is_Ring(currRing))
     1847          pLmDelete(strat->P.p);
     1848        else
     1849#endif
     1850          pLmFree(strat->P.p);
     1851
     1852        // TODO: needs some masking
     1853        // TODO: masking needs to vanish once the signature
     1854        //       sutff is completely implemented
     1855        strat->P.p = NULL;
     1856        poly m1 = NULL, m2 = NULL;
     1857
     1858        // check that spoly creation is ok
     1859        while (strat->tailRing != currRing &&
     1860            !kCheckSpolyCreation(&(strat->P), strat, m1, m2))
     1861        {
     1862          assume(m1 == NULL && m2 == NULL);
     1863          // if not, change to a ring where exponents are at least
     1864          // large enough
     1865          if (!kStratChangeTailRing(strat))
     1866          {
     1867            WerrorS("OVERFLOW...");
     1868            break;
     1869          }
     1870        }
     1871        // create the real one
     1872        ksCreateSpoly(&(strat->P), NULL, strat->use_buckets,
     1873            strat->tailRing, m1, m2, strat->R);
     1874
     1875      }
     1876      else if (strat->P.p1 == NULL)
     1877      {
     1878        if (strat->minim > 0)
     1879          strat->P.p2=p_Copy(strat->P.p, currRing, strat->tailRing);
     1880        // for input polys, prepare reduction
     1881        strat->P.PrepareRed(strat->use_buckets);
     1882      }
     1883
     1884      if (strat->P.p == NULL && strat->P.t_p == NULL)
     1885      {
     1886        red_result = 0;
     1887      }
    18461888      else
    1847 #endif
    1848         pLmFree(strat->P.p);
    1849 
    1850       // TODO: needs some masking
    1851       // TODO: masking needs to vanish once the signature
    1852       //       sutff is completely implemented
    1853       strat->P.p = NULL;
    1854       poly m1 = NULL, m2 = NULL;
    1855 
    1856       // check that spoly creation is ok
    1857       while (strat->tailRing != currRing &&
    1858              !kCheckSpolyCreation(&(strat->P), strat, m1, m2))
    1859       {
    1860         assume(m1 == NULL && m2 == NULL);
    1861         // if not, change to a ring where exponents are at least
    1862         // large enough
    1863         if (!kStratChangeTailRing(strat))
    1864         {
    1865           WerrorS("OVERFLOW...");
    1866           break;
    1867         }
    1868       }
    1869       // create the real one
    1870       ksCreateSpoly(&(strat->P), NULL, strat->use_buckets,
    1871                     strat->tailRing, m1, m2, strat->R);
    1872 
    1873     }
    1874     else if (strat->P.p1 == NULL)
    1875     {
    1876       if (strat->minim > 0)
    1877         strat->P.p2=p_Copy(strat->P.p, currRing, strat->tailRing);
    1878       // for input polys, prepare reduction
    1879       strat->P.PrepareRed(strat->use_buckets);
    1880     }
    1881 
    1882     if (strat->P.p == NULL && strat->P.t_p == NULL)
    1883     {
    1884       red_result = 0;
    1885     }
    1886     else
    1887     {
    1888       if (TEST_OPT_PROT)
    1889         message((strat->honey ? strat->P.ecart : 0) + strat->P.pFDeg(),
    1890                 &olddeg,&reduc,strat, red_result);
    1891 
    1892 //#if 1
     1889      {
     1890
     1891        //#if 1
    18931892#ifdef DEBUGF5
    1894       Print("Poly before red: ");
    1895       pWrite(pHead(strat->P.p));
    1896       pWrite(strat->P.sig);
    1897 #endif
    1898       /* reduction of the element choosen from L */
    1899       if (!strat->rewCrit2(strat->P.sig, ~strat->P.sevSig, strat, strat->P.checked+1)) {
     1893        Print("Poly before red: ");
     1894        pWrite(pHead(strat->P.p));
     1895        pWrite(strat->P.sig);
     1896#endif
    19001897#if SBA_PRODUCT_CRITERION
    19011898        if (strat->P.prd_crit) {
     
    19091906        }
    19101907#else
    1911       red_result = strat->red(&strat->P,strat);
    1912 #endif
    1913       } else {
     1908        red_result = strat->red(&strat->P,strat);
     1909#endif
     1910      }
     1911    } else {
    19141912        pDelete(&strat->P.sig);
    19151913        if (strat->P.lcm!=NULL)
     
    19181916      }
    19191917      if (errorreported)  break;
    1920     }
    19211918
    19221919    if (strat->overflow)
  • kernel/kutil.cc

    ra7b37d r8fcfae  
    51895189  while (strat->Ll > 0 && pLmEqual(strat->L[strat->Ll].sig,strat->P.sig))
    51905190  {
    5191     // deletes the short spoly
    5192 #ifdef HAVE_RINGS
    5193     if (rField_is_Ring(currRing))
    5194       pLmDelete(strat->L[strat->Ll].p);
    5195     else
    5196 #endif
    5197       pLmFree(strat->L[strat->Ll].p);
    5198 
    5199     // TODO: needs some masking
    5200     // TODO: masking needs to vanish once the signature
    5201     //       sutff is completely implemented
    5202     strat->L[strat->Ll].p = NULL;
    5203     poly m1 = NULL, m2 = NULL;
    5204 
    5205     // check that spoly creation is ok
    5206     while (strat->tailRing != currRing &&
    5207           !kCheckSpolyCreation(&(strat->L[strat->Ll]), strat, m1, m2))
    5208     {
    5209       assume(m1 == NULL && m2 == NULL);
    5210       // if not, change to a ring where exponents are at least
    5211       // large enough
    5212       if (!kStratChangeTailRing(strat))
    5213       {
    5214         WerrorS("OVERFLOW...");
    5215         break;
    5216       }
    5217     }
    5218     // create the real one
    5219     ksCreateSpoly(&(strat->L[strat->Ll]), NULL, strat->use_buckets,
    5220                   strat->tailRing, m1, m2, strat->R);
    52215191    if (strat->P.GetLmCurrRing() == NULL)
    52225192    {
     
    52415211      {
    52425212        pDelete(&strat->P.sig);
    5243         strat->P.Delete();
    52445213        strat->P = strat->L[strat->Ll];
    52455214        strat->Ll--;
     
    52475216    }
    52485217  }
     5218  poly p1 = pOne();
     5219  poly p2 = pOne();
    52495220  for (int ii=strat->sl; ii>-1; ii--)
    52505221  {
    52515222    if (p_LmShortDivisibleBy(strat->sig[ii], strat->sevSig[ii], strat->P.sig, ~strat->P.sevSig, currRing))
    52525223    {
    5253       if (!(pLmCmp(ppMult_mm(strat->P.sig,pHead(strat->S[ii])),ppMult_mm(strat->sig[ii],strat->P.GetLmCurrRing())) == 1))
    5254       {
    5255         strat->P.Delete();
     5224      p_ExpVectorSum(p1,strat->P.sig,strat->S[ii],currRing);
     5225      p_ExpVectorSum(p2,strat->sig[ii],strat->P.p,currRing);
     5226      if (!(pLmCmp(p1,p2) == 1))
     5227      {
     5228        pDelete(&strat->P.sig);
     5229        pDelete(&p1);
     5230        pDelete(&p2);
    52565231        return TRUE;
    52575232      }
    52585233    }
    52595234  }
     5235  pDelete(&p1);
     5236  pDelete(&p2);
    52605237  return FALSE;
    52615238}
Note: See TracChangeset for help on using the changeset viewer.