Ignore:
Timestamp:
Nov 22, 2012, 8:29:57 PM (11 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
7eaf722febee351de63ee153106d9bb44f37c045
Parents:
daa4e53f3b95f4242ea851541c7e3e0470446fa4
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-11-22 20:29:57+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-05-07 04:41:48+02:00
Message:
Cleanup time-stamping and debug output from Release build

add: save description of resolution test to a global string variable
chg: shorter test descriptions (to be used as parts of profiler output file names later on)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • dyn_modules/syzextra/syzextra.cc

    rdaa4e5 rda9d52  
    294294        if( (p_GetExp(p, var, r) != 0) && (p_GetExp(t, var, r) != 0) )
    295295        {       
     296#ifndef NDEBUG
    296297          if( __DEBUG__ || 0)
    297298          {         
     
    299300            dPrint(p, r, r, 1);
    300301          }
     302#endif     
    301303          coprime = false; // t not coprime with p!
    302304          break;
     
    312314        coprime = ( syzChecker.IsDivisible(ss) );
    313315
     316#ifndef NDEBUG
    314317        if( __DEBUG__ && !coprime)
    315318        {         
     
    317320          dPrint(ss, r, r, 1);
    318321        }
    319 
     322#endif
     323         
    320324        p_LmDelete(&ss, r); // deletes coeff as well???
    321325      }
     
    323327    }
    324328
     329#ifndef NDEBUG
    325330    if( __DEBUG__ && coprime )
    326331      PrintS("CReducerFinder::PreProcessTerm, the following 't' is 'co-prime' with all of leading terms! \n");
    327 
     332#endif
     333     
    328334    return coprime? 3: 0; // t was coprime with all of leading terms!!!
    329335
     
    342348  const ring r = m_rBaseRing;
    343349
     350#ifndef NDEBUG
    344351  if( __DEBUG__ || 0)
    345352  {
     
    349356
    350357  unsigned long pp[4] = {0,0,0,0}; // count preprocessed terms...
     358#endif
    351359
    352360  for( int p = IDELEMS(idTails) - 1; p >= 0; --p )
     
    356364      const int k = m_div.PreProcessTerm(t, m_checker); // 0..3
    357365      assume( 0 <= k && k <= 3 );
     366
     367#ifndef NDEBUG
    358368      pp[k]++;
     369#endif
     370       
    359371      if( k )
    360372      {
     373#ifndef NDEBUG
    361374        if( __DEBUG__)
    362375        {         
     
    364377          dPrint(t, r, r, 1);
    365378        }
     379#endif
    366380
    367381        (*tt) = p_LmDeleteAndNext(t, r); // delete the lead and next...
     
    372386    }
    373387
     388#ifndef NDEBUG
    374389  if( TEST_OPT_PROT || 1)
    375390    Print("      **!!**      SchreyerSyzygyComputation::SetUpTailTerms()::PreProcessing(): X: {c: %lu, C: %lu, P: %lu} + %lu\n", pp[1], pp[2], pp[3], pp[0]);
    376 
     391#endif
     392   
     393#ifndef NDEBUG
    377394  if( __DEBUG__ || 0)
    378395  {
     
    380397    dPrint(idTails, r, r, 0);
    381398  }
     399#endif
     400   
    382401}
    383402/* 
     
    722741
    723742  assume( IDELEMS(L) == IDELEMS(T) );
     743#ifndef NDEBUG
    724744  int t, r;
    725 
     745#endif
     746   
    726747  if( m_syzLeads == NULL )
    727748  {   
     749#ifndef NDEBUG
    728750    if( TEST_OPT_PROT || 1)
    729751    {
     
    731753      Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: t: %d, r: %d\n", r, t, r);
    732754    }
     755#endif     
    733756    ComputeLeadingSyzygyTerms( __LEAD2SYZ__ && !__IGNORETAILS__ ); // 2 terms OR 1 term!
     757#ifndef NDEBUG
    734758    if( TEST_OPT_PROT || 1)
    735759    {
     
    737761      Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: dt: %d, dr: %d\n", getRTimer(), t, r);
    738762    }
    739 
     763#endif
     764     
    740765  }
    741766
     
    756781    if( T != NULL )
    757782    {
     783#ifndef NDEBUG
    758784      if( TEST_OPT_PROT || 1 )
    759785      {
     
    761787        Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): t: %d, r: %d\n", r, t, r);
    762788      }
    763 
     789#endif
     790       
    764791      SetUpTailTerms();
    765 
     792#ifndef NDEBUG
    766793      if( TEST_OPT_PROT || 1)
    767794      {
     
    769796        Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): dt: %d, dr: %d\n", getRTimer(), t, r);
    770797      }
     798#endif
    771799    }     
    772800  }
    773801
     802#ifndef NDEBUG
    774803  if( TEST_OPT_PROT || 1)
    775804  {
     
    777806    Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: t: %d, r: %d\n", r, t, r);
    778807  }
    779 
     808#endif
     809   
    780810  for( int k = size - 1; k >= 0; k-- )
    781811  {
     
    808838  }
    809839
     840#ifndef NDEBUG
    810841  if( TEST_OPT_PROT || 1)
    811842  {
     
    813844    Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: dt: %d, dr: %d\n", getRTimer(), t, r);
    814845  }
     846#endif   
    815847
    816848  TT->rank = id_RankFreeModule(TT, R); 
     
    10841116    m_rBaseRing( rootRingHdl->data.uring )
    10851117{   
     1118#ifndef NDEBUG
    10861119  if( __DEBUG__ )
    10871120  {
     
    10921125    Print("   TAILREDSYZ: \t%d\n", __TAILREDSYZ__);
    10931126    Print("  IGNORETAILS: \t%d\n", __IGNORETAILS__);
    1094    
    1095   }
    1096 
     1127  }
     1128#endif
     1129   
    10971130  // TODO: just current setting!
    10981131  assume( rootRingHdl == currRingHdl );
     
    13171350        if( Current().DivisibilityCheck(m_product, m_not_sev, m_rBaseRing) )
    13181351        {
     1352#ifndef NDEBUG
    13191353          if( __DEBUG__ )
    13201354          {
     
    13221356            dPrint(Current().m_lt, m_rBaseRing, m_rBaseRing, 1);
    13231357          }
    1324 
     1358#endif
    13251359//          m_active = true;
    13261360          return true;
     
    14081442      assume( p_sev == p_GetShortExpVector(p, r) );
    14091443
    1410       Print("L[%d]: ", k); dPrint(p, r, r, 0); Print("SEV: %dl\n", p_sev);     
     1444      Print("L[%d]: ", k); dPrint(p, r, r, 0); Print("SEV: %dl\n", p_sev);
    14111445    }
    14121446  }
     
    14901524        if( Current().DivisibilityCheck(m_multiplier, m_term, m_not_sev, m_rBaseRing) )
    14911525        {
     1526#ifndef NDEBUG
    14921527          if( __DEBUG__ )
    14931528          {
     
    14951530            dPrint(Current().m_lt, m_rBaseRing, m_rBaseRing, 1);
    14961531          }
    1497 
     1532#endif
    14981533//          m_active = true;
    14991534          return true;
     
    15651600     
    15661601    p_ExpVectorSum(q, multiplier, t, r); // q == product == multiplier * t // TODO: do it once?
     1602    p_ExpVectorDiff(q, q, p, r); // (LM(product) / LM(L[k]))
     1603   
     1604    p_SetComp(q, k + 1, r);
     1605    p_Setm(q, r);
     1606
     1607    // cannot allow something like: a*gen(i) - a*gen(i)
     1608    if (syzterm != NULL && (k == c))
     1609      if (p_ExpVectorEqual(syzterm, q, r))
     1610      {
     1611#ifndef NDEBUG
     1612        if( __DEBUG__ )
     1613        {
     1614          Print("_FindReducer::Test SYZTERM: q == syzterm !:((, syzterm is: ");
     1615          dPrint(syzterm, r, r, 1);
     1616        }   
     1617#endif
     1618        continue;
     1619      }
     1620
     1621    // while the complement (the fraction) is not reducible by leading syzygies
     1622    if( to_check && syz_checker.IsDivisible(q) )
     1623    {
     1624#ifndef NDEBUG
     1625      if( __DEBUG__ )
     1626      {
     1627        PrintS("_FindReducer::Test LS: q is divisible by LS[?] !:((: ");
     1628      }
     1629#endif
     1630      continue;
     1631    }
     1632
     1633    number n = n_Mult( p_GetCoeff(multiplier, r), p_GetCoeff(t, r), r);
     1634    p_SetCoeff0(q, n_Neg( n_Div(n, p_GetCoeff(p, r), r), r), r);
     1635    n_Delete(&n, r);
     1636   
     1637    return q;
     1638  }
     1639   
     1640/*
     1641  const long comp = p_GetComp(t, r); assume( comp >= 0 );
     1642  const unsigned long not_sev = ~p_GetShortExpVector(multiplier, t, r); // !
     1643
     1644//   for( int k = IDELEMS(L)-1; k>= 0; k-- )
     1645//   {
     1646//     const poly p = L->m[k];
     1647//
     1648//     if ( p_GetComp(p, r) != comp )
     1649//       continue;
     1650//
     1651//     const unsigned long p_sev = p_GetShortExpVector(p, r); // to be stored in m_hash!!!
     1652
     1653   // looking for an appropriate diviser p = L[k]...
     1654  CReducersHash::const_iterator it = m_hash.find(comp); // same module component
     1655
     1656  if( it == m_hash.end() )
     1657    return NULL;
     1658
     1659  assume( m_L != NULL );
     1660
     1661  const TReducers& reducers = it->second;
     1662
     1663  for(TReducers::const_iterator vit = reducers.begin(); vit != reducers.end(); vit++ )
     1664  {
     1665
     1666    const poly p = (*vit)->m_lt;
     1667    const int k = (*vit)->m_label;
     1668
     1669    assume( L->m[k] == p );
     1670
     1671//    const unsigned long p_sev = (*vit)->m_sev;
     1672//    assume( p_sev == p_GetShortExpVector(p, r) );     
     1673
     1674//    if( !p_LmShortDivisibleByNoComp(p, p_sev, product, not_sev, r) )
     1675//      continue;     
     1676
     1677    if( !(*vit)->DivisibilityCheck(multiplier, t, not_sev, r) )
     1678      continue;
     1679   
     1680   
     1681//    if (p_sev & not_sev) continue;
     1682//    if( !_p_LmDivisibleByNoComp(p, multiplier, t, r) ) continue;     
     1683
     1684
     1685    p_ExpVectorSum(q, multiplier, t, r); // q == product == multiplier * t       
    15671686    p_ExpVectorDiff(q, q, p, r); // (LM(product) / LM(L[k]))
    15681687   
     
    16001719    return q;
    16011720  }
    1602    
    1603 /*
    1604   const long comp = p_GetComp(t, r); assume( comp >= 0 );
    1605   const unsigned long not_sev = ~p_GetShortExpVector(multiplier, t, r); // !
    1606 
    1607 //   for( int k = IDELEMS(L)-1; k>= 0; k-- )
    1608 //   {
    1609 //     const poly p = L->m[k];
    1610 //
    1611 //     if ( p_GetComp(p, r) != comp )
    1612 //       continue;
    1613 //
    1614 //     const unsigned long p_sev = p_GetShortExpVector(p, r); // to be stored in m_hash!!!
    1615 
    1616    // looking for an appropriate diviser p = L[k]...
    1617   CReducersHash::const_iterator it = m_hash.find(comp); // same module component
    1618 
    1619   if( it == m_hash.end() )
    1620     return NULL;
    1621 
    1622   assume( m_L != NULL );
    1623 
    1624   const TReducers& reducers = it->second;
    1625 
    1626   for(TReducers::const_iterator vit = reducers.begin(); vit != reducers.end(); vit++ )
    1627   {
    1628 
    1629     const poly p = (*vit)->m_lt;
    1630     const int k = (*vit)->m_label;
    1631 
    1632     assume( L->m[k] == p );
    1633 
    1634 //    const unsigned long p_sev = (*vit)->m_sev;
    1635 //    assume( p_sev == p_GetShortExpVector(p, r) );     
    1636 
    1637 //    if( !p_LmShortDivisibleByNoComp(p, p_sev, product, not_sev, r) )
    1638 //      continue;     
    1639 
    1640     if( !(*vit)->DivisibilityCheck(multiplier, t, not_sev, r) )
    1641       continue;
    1642    
    1643    
    1644 //    if (p_sev & not_sev) continue;
    1645 //    if( !_p_LmDivisibleByNoComp(p, multiplier, t, r) ) continue;     
    1646 
    1647 
    1648     p_ExpVectorSum(q, multiplier, t, r); // q == product == multiplier * t       
    1649     p_ExpVectorDiff(q, q, p, r); // (LM(product) / LM(L[k]))
    1650    
    1651     p_SetComp(q, k + 1, r);
    1652     p_Setm(q, r);
    1653 
    1654     // cannot allow something like: a*gen(i) - a*gen(i)
    1655     if (syzterm != NULL && (k == c))
    1656       if (p_ExpVectorEqual(syzterm, q, r))
    1657       {
    1658         if( __DEBUG__ )
    1659         {
    1660           Print("_FindReducer::Test SYZTERM: q == syzterm !:((, syzterm is: ");
    1661           dPrint(syzterm, r, r, 1);
    1662         }   
    1663 
    1664         continue;
    1665       }
    1666 
    1667     // while the complement (the fraction) is not reducible by leading syzygies
    1668     if( to_check && syz_checker.IsDivisible(q) )
    1669     {
    1670       if( __DEBUG__ )
    1671       {
    1672         PrintS("_FindReducer::Test LS: q is divisible by LS[?] !:((: ");
    1673       }
    1674 
    1675       continue;
    1676     }
    1677 
    1678     number n = n_Mult( p_GetCoeff(multiplier, r), p_GetCoeff(t, r), r);
    1679     p_SetCoeff0(q, n_Neg( n_Div(n, p_GetCoeff(p, r), r), r), r);
    1680     n_Delete(&n, r);
    1681    
    1682     return q;
    1683   }
    16841721*/
    16851722
     
    17471784      if (p_ExpVectorEqual(syzterm, q, r))
    17481785      {
     1786#ifndef NDEBUG
    17491787        if( __DEBUG__ )
    17501788        {
     
    17521790          dPrint(syzterm, r, r, 1);
    17531791        }   
    1754 
     1792#endif
    17551793        continue;
    17561794      }
     
    17591797    if( to_check && syz_checker.IsDivisible(q) )
    17601798    {
     1799#ifndef NDEBUG
    17611800      if( __DEBUG__ )
    17621801      {
    17631802        PrintS("_FindReducer::Test LS: q is divisible by LS[?] !:((: ");
    17641803      }
    1765 
     1804#endif
    17661805      continue;
    17671806    }
Note: See TracChangeset for help on using the changeset viewer.