Changeset 8fcfae in git for kernel/kstd2.cc


Ignore:
Timestamp:
Dec 2, 2013, 11:58:00 AM (10 years ago)
Author:
Christian Eder
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
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
File:
1 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)
Note: See TracChangeset for help on using the changeset viewer.