Changeset 68fedf in git


Ignore:
Timestamp:
Nov 5, 2012, 5:53:01 PM (10 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
daa4e53f3b95f4242ea851541c7e3e0470446fa4
Parents:
31a08c219875a2199e6c67adcf1eef18ba4a3a4f
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-11-05 17:53:01+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-05-07 04:41:47+02:00
Message:
Mixed hybrid/traverse syzygy computation mathod (2)

add: attribute int SYZNUMBER = level in the resolution)
add: detailed PP statistics
cosmetics: some code reformatting
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/schreyer.lib

    r31a08c2 r68fedf  
    776776  } else
    777777  {
    778     attrib(S, "HYBRIDNF", 0);
     778    attrib(S, "HYBRIDNF", 2);
    779779  }
    780780 
     
    15941594  }
    15951595
    1596   option(prot);
     1596//  option(prot);
    15971597  rtimer, "***TIME for ComputeSyzygy(L,T): on level: [",attrib(basering,"SYZNUMBER"),"] :: t: ", timer, ", r: ", rtimer;
    15981598  list @res=ComputeSyzygy(L,T);
    15991599  rtimer, "***TIME for ComputeSyzygy(L,T): on level: [",attrib(basering,"SYZNUMBER"),"] :: t: ", timer, ", r: ", rtimer;
    1600   option(noprot); // TODO: restore!
     1600//  option(noprot); // TODO: restore!
    16011601
    16021602
     
    16051605  if( @KERCHECK )
    16061606  {
    1607     if( typeof( attrib(basering, "SYZCHECK") ) == "int" )
    1608     {
    1609       int @SYZCHECK = attrib(basering, "SYZCHECK");
    1610     } else
    1611     {
    1612       int @SYZCHECK = @DEBUG;
    1613     }
    1614 
    1615     int @LEAD2SYZ = 1;
    1616     if( typeof( attrib(basering, "LEAD2SYZ") ) == "int" )
    1617     {
    1618       @LEAD2SYZ = attrib(basering, "LEAD2SYZ");
    1619     }
    1620 
    1621     int @TAILREDSYZ = 1;
    1622     if( typeof( attrib(basering, "TAILREDSYZ") ) == "int" )
    1623     {
    1624       @TAILREDSYZ = attrib(basering, "TAILREDSYZ");
    1625     }
    1626 
    1627     int @HYBRIDNF = 0;
    1628     if( typeof( attrib(basering, "HYBRIDNF") ) == "int" )
    1629     {
    1630       @HYBRIDNF = attrib(basering, "HYBRIDNF");
    1631     }
    1632 
    1633     if( typeof( attrib(basering, "IGNORETAILS") ) == "int" )
    1634     {
    1635       int @IGNORETAILS = attrib(basering, "IGNORETAILS");
    1636     } else
    1637     {
    1638       int @IGNORETAILS = 0;
     1607    int @SYZCHECK = attrib(basering, "SYZCHECK");
     1608    int @LEAD2SYZ = attrib(basering, "LEAD2SYZ");
     1609    int @TAILREDSYZ = attrib(basering, "TAILREDSYZ");
     1610    int @HYBRIDNF = attrib(basering, "HYBRIDNF");
     1611    int @IGNORETAILS = attrib(basering, "IGNORETAILS");
     1612
     1613    int @SYZNUMBER = attrib(basering,"SYZNUMBER");
     1614    if( @HYBRIDNF == 2 )
     1615    {
     1616      if( @SYZNUMBER < 3 ){ @HYBRIDNF = 1; } else { @HYBRIDNF = 0; }
    16391617    }
    16401618   
     
    16761654         
    16771655          // NF reduction:
    1678           if( !@HYBRIDNF ) // Traverse approach:
     1656          if( @HYBRIDNF == 0 ) // Traverse approach:
    16791657          {       
    16801658            @tail = SSTraverseTail(aa, T[r], L, T, LS);
     
    20422020    ERROR("Sorry: need an ideal or a module for input");
    20432021  }
     2022
    20442023  "KERCHECK: ", attrib(SSinit, "KERCHECK");
    20452024  "SYZCHECK: ", attrib(SSinit, "SYZCHECK");
     
    24402419  );
    24412420  option(redSB); option(redTail); 
    2442   rtimer=0;def R=SSres(I,0);@m=rtimer;setring R;module M;list @l=list();@l[size(RES)-1]=list();r=nrows(RES[1]);for(i=2;i<=size(RES);i++){M=RES[i];rr=nrows(M);if((r>0)&&(size(M)>0)&&(r<rr)){M=transpose(M);M=M[(r+1)..ncols(M)];M=transpose(M);RES[i]=M;};r=rr;@l[i-1] = M;};resolution RR=@l;RR=minres(RR);def S=betti(RR,1);@t=rtimer;
     2421  timer=0;rtimer=0;def R=SSres(I,0);@m=rtimer;setring R;module M;list @l=list();@l[size(RES)-1]=list();r=nrows(RES[1]);for(i=2;i<=size(RES);i++){M=RES[i];rr=nrows(M);if((r>0)&&(size(M)>0)&&(r<rr)){M=transpose(M);M=M[(r+1)..ncols(M)];M=transpose(M);RES[i]=M;};r=rr;@l[i-1] = M;};resolution RR=@l;RR=minres(RR);def S=betti(RR,1);@t=rtimer;
    24432422  SCheck(R);
    24442423  StopAddResTest(RR, S, @t,@m);
     
    24562435  );
    24572436  option(redSB); option(redTail);
    2458   rtimer=0;def R=Sres(I,0);@m=rtimer;setring R;module M;list @l=list();@l[size(RES)-1]=list();r=nrows(RES[1]);for(i=2;i<=size(RES);i++){M=RES[i];rr=nrows(M);if((r>0)&&(size(M)>0)&&(r<rr)){M=transpose(M);M=M[(r+1)..ncols(M)];M=transpose(M);RES[i]=M;};r=rr;@l[i-1] = M;};resolution RR=@l;RR=minres(RR);def S=betti(RR,1);@t=rtimer;
     2437  timer=0;rtimer=0;def R=Sres(I,0);@m=rtimer;setring R;module M;list @l=list();@l[size(RES)-1]=list();r=nrows(RES[1]);for(i=2;i<=size(RES);i++){M=RES[i];rr=nrows(M);if((r>0)&&(size(M)>0)&&(r<rr)){M=transpose(M);M=M[(r+1)..ncols(M)];M=transpose(M);RES[i]=M;};r=rr;@l[i-1] = M;};resolution RR=@l;RR=minres(RR);def S=betti(RR,1);@t=rtimer;
    24592438  SCheck(R);
    24602439  StopAddResTest(RR, S, @t,@m); 
     
    24682447  StartAddResTest("sres", "no minres + betti(,1)");
    24692448  option(redSB);option(redTail);
    2470   rtimer=0;def RR=sres(groebner(M),0);@m=rtimer;def S=betti(RR,1);@t=rtimer;
     2449  timer=0;rtimer=0;def RR=sres(groebner(M),0);@m=rtimer;def S=betti(RR,1);@t=rtimer;
    24712450  StopAddResTest(RR, S, @t,@m); kill S, RR;
    24722451}
     
    24772456  StartAddResTest("lres", "no minres + betti(,1)");
    24782457  option(redSB);option(redTail);
    2479   rtimer=0;def RR=lres(M,0);@m=rtimer;def S=betti(RR,1);@t=rtimer;
     2458  timer=0;rtimer=0;def RR=lres(M,0);@m=rtimer;def S=betti(RR,1);@t=rtimer;
    24802459  StopAddResTest(RR, S, @t,@m); kill S, RR;
    24812460
    24822461  StartAddResTest("lres", "minres + betti()");
    24832462  option(redSB);option(redTail);
    2484   rtimer=0;def RR=lres(M,0);@m=rtimer;def S=betti(minres(RR));@t=rtimer;
     2463  timer=0;rtimer=0;def RR=lres(M,0);@m=rtimer;def S=betti(minres(RR));@t=rtimer;
    24852464  StopAddResTest(RR, S, @t,@m);
    24862465  kill S, RR;
     
    24942473 
    24952474  option(redSB); option(redTail);
    2496   rtimer=0;def RR=nres(M,0);@m=rtimer;def S=betti(RR,1);@t=rtimer;
     2475  timer=0;rtimer=0;def RR=nres(M,0);@m=rtimer;def S=betti(RR,1);@t=rtimer;
    24972476 
    24982477  StopAddResTest(RR, S, @t,@m); kill S, RR;
     
    25172496//  attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 0); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M);
    25182497
     2498  attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 2); TestSSres(M);
     2499 
    25192500  attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M);
    2520   attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M);
     2501//  attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M);
    25212502 
    25222503
     
    25362517  attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M);
    25372518  attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M);
     2519  attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 2); TestSSres(M);
    25382520
    25392521  attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M);
    25402522  attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M);
     2523  attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 2); TestSSres(M);
    25412524
    25422525 
  • dyn_modules/syzextra/syzextra.cc

    r31a08c2 r68fedf  
    246246
    247247
    248 bool CReducerFinder::PreProcessTerm(const poly t, CReducerFinder& syzChecker) const
    249 {
    250    assume( t != NULL );
    251    
    252    if( __DEBUG__ && __TAILREDSYZ__ )
    253      assume( !IsDivisible(t) ); // each input term should NOT be in <L>
    254    
    255    const ring r = m_rBaseRing;
    256 
    257    
    258    if( __TAILREDSYZ__ )
    259      if( p_LmIsConstant(t, r) ) // most basic case of baing coprime with L, whatever that is...
    260        return true; // TODO: prove this...?
    261    
    262 //   return false; // appears to be fine
    263 
    264    const long comp = p_GetComp(t, r);
    265    
    266    CReducersHash::const_iterator itr = m_hash.find(comp);
    267    
    268    if ( itr == m_hash.end() )
    269      return true; // no such leading component!!!
    270    
    271   const bool bIdealCase = (comp == 0);  
     248int CReducerFinder::PreProcessTerm(const poly t, CReducerFinder& syzChecker) const
     249{
     250  assume( t != NULL );
     251
     252  if( __DEBUG__ && __TAILREDSYZ__ )
     253    assume( !IsDivisible(t) ); // each input term should NOT be in <L>
     254
     255  const ring r = m_rBaseRing;
     256
     257
     258  if( __TAILREDSYZ__ )
     259    if( p_LmIsConstant(t, r) ) // most basic case of baing coprime with L, whatever that is...
     260      return 1; // TODO: prove this...?
     261
     262  //   return false; // appears to be fine
     263
     264  const long comp = p_GetComp(t, r);
     265
     266  CReducersHash::const_iterator itr = m_hash.find(comp);
     267
     268  if ( itr == m_hash.end() )
     269    return 2; // no such leading component!!!
     270
     271  const bool bIdealCase = (comp == 0);  
    272272  const bool bSyzCheck = syzChecker.IsNonempty(); // need to check even in ideal case????? proof?  "&& !bIdealCase"
    273    
    274 //   return false;
    275    if( __TAILREDSYZ__ && (bIdealCase || bSyzCheck) )
    276    {
    277    const TReducers& v = itr->second;
    278    const int N = rVar(r);
    279    // TODO: extract exps of t beforehand?!
    280    bool coprime = true;
    281    for(TReducers::const_iterator vit = v.begin(); (vit != v.end()) && coprime; ++vit )
    282    {
    283      assume( m_L->m[(*vit)->m_label] == (*vit)->m_lt );
    284      
    285      const poly p = (*vit)->m_lt;
    286      
    287      assume( p_GetComp(p, r) == comp );
    288      
     273
     274  if( __TAILREDSYZ__ && (bIdealCase || bSyzCheck) )
     275  {
     276    const TReducers& v = itr->second;
     277    const int N = rVar(r);
     278    // TODO: extract exps of t beforehand?!
     279    bool coprime = true;
     280    for(TReducers::const_iterator vit = v.begin(); (vit != v.end()) && coprime; ++vit )
     281    {
     282      assume( m_L->m[(*vit)->m_label] == (*vit)->m_lt );
     283
     284      const poly p = (*vit)->m_lt;
     285
     286      assume( p_GetComp(p, r) == comp );
     287
    289288      // TODO: check if coprime with Leads... if __TAILREDSYZ__ !
    290      for( int var = N; var > 0; --var )
    291        if( (p_GetExp(p, var, r) != 0) && (p_GetExp(t, var, r) != 0) )
    292        {             
    293                if( __DEBUG__ || 0)
    294                  {             
    295                     PrintS("CReducerFinder::PreProcessTerm, 't' is NOT co-prime with the following leading term: \n");
    296                     dPrint(p, r, r, 1);
    297                 }
    298                coprime = false; // t not coprime with p!
    299                break;
    300        }
    301      
    302      if( bSyzCheck && coprime )
    303      {
    304         poly ss = p_LmInit(t, r);
     289      for( int var = N; var > 0; --var )
     290        if( (p_GetExp(p, var, r) != 0) && (p_GetExp(t, var, r) != 0) )
     291        {       
     292          if( __DEBUG__ || 0)
     293          {         
     294            PrintS("CReducerFinder::PreProcessTerm, 't' is NOT co-prime with the following leading term: \n");
     295            dPrint(p, r, r, 1);
     296          }
     297          coprime = false; // t not coprime with p!
     298          break;
     299        }
     300
     301      if( bSyzCheck && coprime )
     302      {
     303        poly ss = p_LmInit(t, r);
    305304        p_SetCoeff0(ss, n_Init(1, r), r); // for delete & printout only!...
    306305        p_SetComp(ss, (*vit)->m_label + 1, r); // coeff?
    307         p_Setm(ss, r);
    308        
    309         coprime = ( syzChecker.IsDivisible(ss) );
    310 
    311         if( __DEBUG__ && !coprime)
    312           {           
    313              PrintS("CReducerFinder::PreProcessTerm, 't' is co-prime with p but may lead to NOT divisible syz.term: \n");
    314              dPrint(ss, r, r, 1);
    315           }
    316        
    317         p_LmDelete(&ss, r); // deletes coeff as well???
    318      }
    319      
    320    }
    321      
    322    if( __DEBUG__ && coprime )
    323      PrintS("CReducerFinder::PreProcessTerm, the following 't' is 'co-prime' with all of leading terms! \n");
    324      
    325    return coprime; // t was coprime with all of leading terms!!!
    326      
    327    }
    328 //   return true; // delete the term
    329    
    330    return false;
    331 
    332 
     306        p_Setm(ss, r);
     307
     308        coprime = ( syzChecker.IsDivisible(ss) );
     309
     310        if( __DEBUG__ && !coprime)
     311        {         
     312          PrintS("CReducerFinder::PreProcessTerm, 't' is co-prime with p but may lead to NOT divisible syz.term: \n");
     313          dPrint(ss, r, r, 1);
     314        }
     315
     316        p_LmDelete(&ss, r); // deletes coeff as well???
     317      }
     318
     319    }
     320
     321    if( __DEBUG__ && coprime )
     322      PrintS("CReducerFinder::PreProcessTerm, the following 't' is 'co-prime' with all of leading terms! \n");
     323
     324    return coprime? 3: 0; // t was coprime with all of leading terms!!!
     325
     326  }
     327  //   return true; // delete the term
     328
     329  return 0;
    333330}
    334331 
     
    341338  const ring r = m_rBaseRing;
    342339
    343    if( __DEBUG__ || 0)
    344    {
    345      PrintS("SchreyerSyzygyComputation::SetUpTailTerms(): Tails: \n");
    346      dPrint(idTails, r, r, 0);
    347    }
    348    
    349   unsigned long pp = 0; // count preprocessed terms...
     340  if( __DEBUG__ || 0)
     341  {
     342    PrintS("SchreyerSyzygyComputation::SetUpTailTerms(): Tails: \n");
     343    dPrint(idTails, r, r, 0);
     344  }
     345
     346  unsigned long pp[4] = {0,0,0,0}; // count preprocessed terms...
    350347
    351348  for( int p = IDELEMS(idTails) - 1; p >= 0; --p )
    352349    for( poly* tt = &(idTails->m[p]); (*tt) != NULL;  )
    353        {   
    354           const poly t = *tt;
    355        if( m_div.PreProcessTerm(t, m_checker) )
    356        {
    357           if( __DEBUG__ || 0)
    358           {           
    359             PrintS("SchreyerSyzygyComputation::SetUpTailTerms(): PP the following TT: \n");
    360             dPrint(t, r, r, 1);
    361           }
    362           ++pp;
    363            
    364          (*tt) = p_LmDeleteAndNext(t, r); // delete the lead and next...
    365        }   
    366        else
    367          tt = &pNext(t); // go next?
    368  
    369        }
    370 
    371    if( TEST_OPT_PROT || 1)
    372      Print("**!!** SchreyerSyzygyComputation::SetUpTailTerms()::PreProcessing has eliminated %u terms!\n", pp);
    373    
    374 
    375    if( __DEBUG__ || 0)
    376    {
    377      PrintS("SchreyerSyzygyComputation::SetUpTailTerms(): Preprocessed Tails: \n");
    378      dPrint(idTails, r, r, 0);
    379    }
     350    {   
     351      const poly t = *tt;
     352      const int k = m_div.PreProcessTerm(t, m_checker); // 0..3
     353      assume( 0 <= k && k <= 3 );
     354      pp[k]++;
     355      if( k )
     356      {
     357        if( __DEBUG__)
     358        {         
     359          Print("SchreyerSyzygyComputation::SetUpTailTerms(): PP (%d) the following TT: \n", k);
     360          dPrint(t, r, r, 1);
     361        }
     362
     363        (*tt) = p_LmDeleteAndNext(t, r); // delete the lead and next...
     364      }   
     365      else
     366        tt = &pNext(t); // go next?
     367
     368    }
     369
     370  if( TEST_OPT_PROT || 1)
     371    Print("      **!!**      SchreyerSyzygyComputation::SetUpTailTerms()::PreProcessing(): X: {c: %lu, C: %lu, P: %lu} + %lu\n", pp[1], pp[2], pp[3], pp[0]);
     372
     373  if( __DEBUG__ || 0)
     374  {
     375    PrintS("SchreyerSyzygyComputation::SetUpTailTerms(): Preprocessed Tails: \n");
     376    dPrint(idTails, r, r, 0);
     377  }
    380378}
    381379/* 
     
    710708  assume( m_idLeads != NULL );
    711709  assume( m_idTails != NULL );
    712  
     710
    713711  const ideal& L = m_idLeads;
    714712  const ideal& T = m_idTails;
     
    722720  if( m_syzLeads == NULL )
    723721  {   
    724     if( TEST_OPT_PROT && 1)
    725     {
    726 /*       initTimer();
    727        initRTimer();
    728        startTimer();
    729        startRTimer();*/
    730    
    731       t = getTimer();
    732       r = getRTimer();
    733       Print("%d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: t: %d, r: %d\n", getRTimer(), t, r);
    734     }
    735      
     722    if( TEST_OPT_PROT || 1)
     723    {
     724      t = getTimer(); r = getRTimer();
     725      Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: t: %d, r: %d\n", r, t, r);
     726    }
    736727    ComputeLeadingSyzygyTerms( __LEAD2SYZ__ && !__IGNORETAILS__ ); // 2 terms OR 1 term!
    737     if( TEST_OPT_PROT && 1)
    738     {
    739       t = getTimer() - t;
    740       r = getRTimer() - r;
    741          
    742       Print("%d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: t: %d, r: %d\n", getRTimer(), t, r);
    743     }
    744      
    745   }
    746      
     728    if( TEST_OPT_PROT || 1)
     729    {
     730      t = getTimer() - t; r = getRTimer() - r;
     731      Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: dt: %d, dr: %d\n", getRTimer(), t, r);
     732    }
     733
     734  }
    747735
    748736  assume( m_syzLeads != NULL );
    749 
    750737  ideal& LL = m_syzLeads;
    751 
    752  
    753738  const int size = IDELEMS(LL);
    754739
     
    757742  if( size == 1 && LL->m[0] == NULL )
    758743    return;
    759    
     744
     745  // use hybrid method?
     746  const bool method = (__HYBRIDNF__ == 1) || (__HYBRIDNF__ == 2 && __SYZNUMBER__ < 3);
     747
    760748  if(  !__IGNORETAILS__)
    761749  {
    762750    if( T != NULL )
    763751    {
    764 
    765        if( TEST_OPT_PROT && 1 )
    766          {
    767 //       initTimer();
    768 //       initRTimer();
    769 //       startTimer();
    770 //       startRTimer(); 
    771    
    772             t = getTimer();
    773             r = getRTimer();
    774           Print("%d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): t: %d, r: %d\n", getRTimer(), t, r);
    775          }
    776 
    777        SetUpTailTerms();
    778        
    779        if( TEST_OPT_PROT && 1)
    780        {
    781           t = getTimer() - t;
    782           r = getRTimer()  - r;
    783          
    784           Print("%d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): t: %d, r: %d\n", getRTimer(), t, r);
    785        }
    786        
    787  
    788 
     752      if( TEST_OPT_PROT || 1 )
     753      {
     754        t = getTimer(); r = getRTimer();
     755        Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): t: %d, r: %d\n", r, t, r);
     756      }
     757
     758      SetUpTailTerms();
     759
     760      if( TEST_OPT_PROT || 1)
     761      {
     762        t = getTimer() - t; r = getRTimer() - r;
     763        Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): dt: %d, dr: %d\n", getRTimer(), t, r);
     764      }
    789765    }     
    790766  }
    791767
    792        if( TEST_OPT_PROT && 1)
    793          {
    794 //       initTimer();
    795 //       initRTimer();
    796 //       startTimer();
    797 //       startRTimer(); 
    798    
    799             t = getTimer();
    800             r = getRTimer();
    801           Print("%d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: t: %d, r: %d\n", getRTimer(), t, r);
    802          }
     768  if( TEST_OPT_PROT || 1)
     769  {
     770    t = getTimer(); r = getRTimer();
     771    Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: t: %d, r: %d\n", r, t, r);
     772  }
    803773
    804774  for( int k = size - 1; k >= 0; k-- )
     
    823793      continue;
    824794    }
    825    
    826 //    TT->m[k] = a2;
    827 
    828     if( ! __HYBRIDNF__ )
    829     {
     795
     796    //    TT->m[k] = a2;
     797
     798    if( method )
     799      TT->m[k] = SchreyerSyzygyNF(a, a2);
     800    else
    830801      TT->m[k] = TraverseNF(a, a2);
    831     } else
    832     {
    833       TT->m[k] = SchreyerSyzygyNF(a, a2);
    834     }
    835 
    836   }
    837    
    838        if( TEST_OPT_PROT && 1)
    839        {
    840           t = getTimer() - t;
    841           r = getRTimer();  - r;
    842          
    843           Print("%d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: t: %d, r: %d\n", getRTimer(), t, r);
    844        }
    845 
    846    
     802  }
     803
     804  if( TEST_OPT_PROT || 1)
     805  {
     806    t = getTimer() - t; r = getRTimer() - r;
     807    Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: dt: %d, dr: %d\n", getRTimer(), t, r);
     808  }
    847809
    848810  TT->rank = id_RankFreeModule(TT, R); 
     
    10811043SchreyerSyzygyComputationFlags::SchreyerSyzygyComputationFlags(idhdl rootRingHdl):
    10821044#ifndef NDEBUG
    1083      __DEBUG__( (BOOLEAN)atGetInt(rootRingHdl,"DEBUG", FALSE) ),
     1045     __DEBUG__( atGetInt(rootRingHdl,"DEBUG", 0) ),
    10841046#else
    1085     __DEBUG__( (BOOLEAN)atGetInt(rootRingHdl,"DEBUG", FALSE) ),
     1047    __DEBUG__( atGetInt(rootRingHdl,"DEBUG", 0) ),
    10861048#endif
    10871049//    __SYZCHECK__( (BOOLEAN)atGetInt(rootRingHdl, "SYZCHECK", __DEBUG__) ),
    1088     __LEAD2SYZ__( (BOOLEAN)atGetInt(rootRingHdl, "LEAD2SYZ", 1) ),
    1089     __TAILREDSYZ__( (BOOLEAN)atGetInt(rootRingHdl, "TAILREDSYZ", 1) ),
    1090     __HYBRIDNF__( (BOOLEAN)atGetInt(rootRingHdl, "HYBRIDNF", 0) ),
    1091     __IGNORETAILS__( (BOOLEAN)atGetInt(rootRingHdl, "IGNORETAILS", 0) ),
     1050    __LEAD2SYZ__( atGetInt(rootRingHdl, "LEAD2SYZ", 1) ),
     1051    __TAILREDSYZ__( atGetInt(rootRingHdl, "TAILREDSYZ", 1) ),
     1052    __HYBRIDNF__( atGetInt(rootRingHdl, "HYBRIDNF", 2) ),
     1053    __IGNORETAILS__( atGetInt(rootRingHdl, "IGNORETAILS", 0) ),
     1054    __SYZNUMBER__( atGetInt(rootRingHdl, "SYZNUMBER", 0) ),
    10921055    m_rBaseRing( rootRingHdl->data.uring )
    10931056{   
     
    14891452      else
    14901453        m_active = true;
    1491        
     1454 
    14921455     
    14931456      // looking for the next good entry
  • dyn_modules/syzextra/syzextra.h

    r31a08c2 r68fedf  
    6969        __LEAD2SYZ__(attr.__LEAD2SYZ__),  __TAILREDSYZ__(attr.__TAILREDSYZ__),
    7070        __HYBRIDNF__(attr.__HYBRIDNF__), __IGNORETAILS__(attr.__IGNORETAILS__),
    71         m_rBaseRing(attr.m_rBaseRing)
     71        __SYZNUMBER__(attr.__SYZNUMBER__), m_rBaseRing(attr.m_rBaseRing)
    7272    {}   
    7373
    7474  /// output all the intermediate states
    75   const bool __DEBUG__; // DebugOutput;
     75  const int __DEBUG__; // DebugOutput;
    7676
    7777  //  const bool __SYZCHECK__; // CheckSyzygyProperty: never tested here...
    7878
    7979  /// ?
    80   const bool __LEAD2SYZ__; // TwoLeadingSyzygyTerms;
     80  const int __LEAD2SYZ__; // TwoLeadingSyzygyTerms;
    8181
    8282  /// Reduce syzygy tails wrt the leading syzygy terms
    83   const bool __TAILREDSYZ__; // TailReducedSyzygies;
     83  const int __TAILREDSYZ__; // TailReducedSyzygies;
    8484
    8585  /// Use the usual NF's S-poly reduction while dropping lower order terms
    86   const bool __HYBRIDNF__; // UseHybridNF
     86  /// 2 means - smart selection!
     87  const int __HYBRIDNF__; // UseHybridNF
    8788
    8889
    8990  /// ignore tails and compute the pure Schreyer frame
    90   const bool __IGNORETAILS__; // @IGNORETAILS
     91  const int __IGNORETAILS__; // @IGNORETAILS
     92
     93  /// Syzygy level (within a resolution)
     94  const int __SYZNUMBER__;
    9195 
    9296  /// global base ring
     
    161165
    162166    /// is the term to be "preprocessed" as lower order term or lead to only reducible syzygies...
    163     bool PreProcessTerm(const poly t, CReducerFinder& syzChecker) const;
     167    int PreProcessTerm(const poly t, CReducerFinder& syzChecker) const;
    164168
    165169    poly FindReducer(const poly multiplier, const poly monom, const poly syzterm, const CReducerFinder& checker) const;
Note: See TracChangeset for help on using the changeset viewer.