Changeset c760e25 in git


Ignore:
Timestamp:
May 27, 2013, 6:11:44 PM (10 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
8152f755b696b292d052dc7d9fa5e013e399f6c9
Parents:
7edaddb6072298fa487927f45cea2dca47b8e485
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2013-05-27 18:11:44+02:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-05-07 04:41:49+02:00
Message:
Added TREEOUTPUT to testSimple (e.g. called by make check)
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/schreyer.lib

    r7edaddb rc760e25  
    4545";
    4646
     47
    4748static proc prepareSyz( module I, list # )
    4849{
     
    579580  }
    580581
    581   int @KERCHECK = @DEBUG;
     582  int @KERCHECK = 1; // @DEBUG;
    582583
    583584  if( typeof( attrib(SSinit, "KERCHECK") ) == "int" )
     
    591592  {
    592593    @IGNORETAILS = attrib(SSinit, "IGNORETAILS");
     594  }
     595
     596  int @TREEOUTPUT = 0;
     597
     598  if( typeof( attrib(SSinit, "TREEOUTPUT") ) == "int" )
     599  {
     600    @TREEOUTPUT = attrib(SSinit, "TREEOUTPUT");
    593601  }
    594602
     
    783791  attrib(S, "KERCHECK", @KERCHECK);
    784792  attrib(S, "IGNORETAILS", @IGNORETAILS);
    785 
     793  attrib(S, "TREEOUTPUT", @TREEOUTPUT);
    786794  attrib(S, "SYZNUMBER", 0);
     795 
     796  "attrib(S,'TREEOUTPUT'): ", attrib(S, "TREEOUTPUT");
    787797 
    788798  if( @DEBUG )
     
    13731383  if( @KERCHECK )
    13741384  {
     1385    int @TREEOUTPUT  = attrib(basering, "TREEOUTPUT");
     1386 
    13751387    vector s = 0;
    13761388
     
    13861398
    13871399        def @c = leadcomp(s); int k = int(@c);
     1400
     1401        if( @TREEOUTPUT ){ "\CHILD{", (s), "}{", ( @b*L[k]), "}"; }
    13881402
    13891403        s = s + SSTraverseTail(@b, T[k], L, T, #); // !!!   
     
    15341548  if( @KERCHECK )
    15351549  {
     1550    int @TREEOUTPUT  = attrib(basering, "TREEOUTPUT");
     1551   
    15361552    def spoly = leadmonomial(syz_lead) * T[int(leadcomp(syz_lead))]
    15371553              + leadmonomial(syz_2)    * T[int(leadcomp(syz_2))];
    15381554
    15391555    vector @tail = syz_2;
     1556   
     1557    poly @b; int k;
    15401558
    15411559    while (size(spoly) > 0)
     
    15451563      if( size(syz_2) != 0)
    15461564      {         
    1547         spoly = spoly + leadmonomial(syz_2) * T[int(leadcomp(syz_2))];
     1565        @b = leadmonomial(syz_2);
     1566        k =  int(leadcomp(syz_2));
     1567       
     1568        if( @TREEOUTPUT ){ "\CHILD{", (syz_2), "}{", ( lead(spoly)), "}"; }
     1569       
     1570        spoly = spoly + @b * T[k];
    15481571        @tail = @tail + syz_2;
     1572       
    15491573      }
    15501574    }
     
    16051629  if( @KERCHECK )
    16061630  {
    1607     int @SYZCHECK = attrib(basering, "SYZCHECK");
    1608     int @LEAD2SYZ = attrib(basering, "LEAD2SYZ");
    1609     int @TAILREDSYZ = attrib(basering, "TAILREDSYZ");
    1610     int @HYBRIDNF = attrib(basering, "HYBRIDNF");
     1631    int @SYZCHECK    = attrib(basering, "SYZCHECK");
     1632    int @LEAD2SYZ    = attrib(basering, "LEAD2SYZ");
     1633    int @TAILREDSYZ  = attrib(basering, "TAILREDSYZ");
     1634    int @HYBRIDNF    = attrib(basering, "HYBRIDNF");
    16111635    int @IGNORETAILS = attrib(basering, "IGNORETAILS");
    1612 
    1613     int @SYZNUMBER = attrib(basering,"SYZNUMBER");
     1636    int @TREEOUTPUT  = attrib(basering, "TREEOUTPUT");
     1637
     1638    int @SYZNUMBER   = attrib(basering,"SYZNUMBER");
     1639   
    16141640    if( @HYBRIDNF == 2 )
    16151641    {
     
    16481674        // leading syz. term:
    16491675        a = LL[k];
    1650 
     1676       
    16511677        if( !@IGNORETAILS )
    16521678        {
    16531679          c = leadcomp(a); r = int(c); aa = leadmonomial(a);
     1680         
     1681          if( @TREEOUTPUT ){ "\ROOT{", (lead(a)), "}"; }
    16541682         
    16551683          // NF reduction:
    16561684          if( @HYBRIDNF == 0 ) // Traverse approach:
    1657           {       
     1685          {
    16581686            @tail = SSTraverseTail(aa, T[r], L, T, LS);
    16591687
     
    16621690            {     
    16631691              a2 = LL2[k]; c = leadcomp(a2); r = int(c); aa = leadmonomial(a2);
    1664 
     1692             
     1693              if( @TREEOUTPUT ){ "\CHILD{", (lead(a2)), "}{", ( aa*L[r]), "}"; }
     1694             
    16651695              @tail = a2 + @tail + SSTraverseTail(aa, T[r], L, T, LS);
    16661696            } else
     
    16891719              }
    16901720            }
     1721           
     1722            if( @TREEOUTPUT ){ "\CHILD{", (a2), "}{", ( aa*L[r]), "}"; }
    16911723
    16921724            @tail = SSSchreyerSyzygyNF(a, a2, L, T, LS);
     
    25602592//  attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 0); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M);
    25612593
    2562   attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 2); TestSSSres(M);
    2563   attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 1); TestSSSres(M);
     2594  attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 2); TestSSSres(M);
     2595  attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 1); TestSSSres(M);
     2596  attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 0); TestSSSres(M);
    25642597
    25652598
     
    26112644  attrib(SSinit, "DEBUG", (DEBUG > 0));
    26122645  attrib(SSinit, "SYZCHECK", (DEBUG > 0));
    2613   attrib(SSinit, "KERCHECK", 1);
     2646  attrib(SSinit, "KERCHECK", 0);
     2647  attrib(SSinit, "TREEOUTPUT", 1);
    26142648  attrib(SSinit, "PROFILE", 0);
    26152649
     
    26592693  attrib(SSinit, "SYZCHECK", (DEBUG > 0));
    26602694  attrib(SSinit, "KERCHECK", 0);
    2661   attrib(SSinit, "PROFILE", 1);
     2695  attrib(SSinit, "TREEOUTPUT", 0);
     2696  attrib(SSinit, "PROFILE", 0);
    26622697 
    26632698//  option(prot);
     
    28512886  attrib(SSinit, "SYZCHECK", (DEBUG > 0));
    28522887  attrib(SSinit, "KERCHECK", 0);
     2888  attrib(SSinit, "TREEOUTPUT", 0);
    28532889  attrib(SSinit, "PROFILE", 1);
    28542890 
  • dyn_modules/syzextra/syzextra.cc

    r7edaddb rc760e25  
    461461#ifndef NDEBUG
    462462  if( TEST_OPT_PROT | 1)
    463     Print("      **!!**      SchreyerSyzygyComputation::SetUpTailTerms()::PreProcessing(): X: {c: %lu, C: %lu, P: %lu} + %lu\n", pp[1], pp[2], pp[3], pp[0]);
     463    Print("%%      **!!**      SchreyerSyzygyComputation::SetUpTailTerms()::PreProcessing(): X: {c: %lu, C: %lu, P: %lu} + %lu\n", pp[1], pp[2], pp[3], pp[0]);
    464464#endif
    465465   
     
    779779  poly aa = leadmonom(a, R); assume( aa != NULL); // :(
    780780
    781  
     781  if( __TREEOUTPUT__ )
     782  {
     783     PrintS("%%%% BEGIN LIFTPART DIAGRAMM\n");
     784     PrintS("\\begin{ROOTTREE}{"); dPrint(a, R, R, 0);PrintS("}");
     785//    PrintS("\\ROOTRESULT{"); dPrint(t, R, R, 0); PrintS("}");
     786//     PrintS("\\end{ROOTTREE}\n");
     787  }
     788   
    782789  poly t = TraverseTail(aa, r);
    783790
     
    786793    assume( __LEAD2SYZ__ );
    787794
     795    // replace the following... ?
    788796    const int r2 = p_GetComp(a2, R) - 1; poly aa2 = leadmonom(a2, R); // :(
    789797
    790798    assume( r2 >= 0 && r2 < IDELEMS(T) );
    791799
     800    if( __TREEOUTPUT__ )
     801    {
     802//       PrintS("\\CONSIDERTERM{"); dPrint(spoly, r, r, 0); PrintS("}\n");
     803       PrintS("\\CHILDNODE{"); dPrint(a2, R, R, 0); PrintS("}\n");
     804    }
     805     
    792806    t = p_Add_q(a2, p_Add_q(t, TraverseTail(aa2, r2), R), R);
    793807
     
    797811
    798812  p_Delete(&aa, R);
    799 
     813   
     814  if( __TREEOUTPUT__ )
     815  {   
     816    PrintS("\\ROOTRESULT{"); dPrint(t, R, R, 0); PrintS("}");   
     817    PrintS("\\end{ROOTTREE}\n");
     818  }
     819   
     820     
     821   
    800822  return t;
    801823}
     
    831853    {
    832854      t = getTimer(); r = getRTimer();
    833       Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: t: %d, r: %d\n", r, t, r);
     855      Print("%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: t: %d, r: %d\n", r, t, r);
    834856    }
    835857#endif     
     
    839861    {
    840862      t = getTimer() - t; r = getRTimer() - r;
    841       Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: dt: %d, dr: %d\n", getRTimer(), t, r);
     863      Print("%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: dt: %d, dr: %d\n", getRTimer(), t, r);
    842864    }
    843865#endif
     
    865887      {
    866888        t = getTimer(); r = getRTimer();
    867         Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): t: %d, r: %d\n", r, t, r);
     889        Print("%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): t: %d, r: %d\n", r, t, r);
    868890      }
    869891#endif
     
    874896      {
    875897        t = getTimer() - t; r = getRTimer() - r;
    876         Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): dt: %d, dr: %d\n", getRTimer(), t, r);
     898        Print("%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): dt: %d, dr: %d\n", getRTimer(), t, r);
    877899      }
    878900#endif
     
    884906  {
    885907    t = getTimer(); r = getRTimer();
    886     Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: t: %d, r: %d\n", r, t, r);
     908    Print("%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: t: %d, r: %d\n", r, t, r);
    887909  }
    888910#endif
     
    897919    if( a2 != NULL )
    898920      pNext(a) = NULL;
    899 
     921     
    900922    if( __IGNORETAILS__ )
    901923    {
     
    922944  {
    923945    t = getTimer() - t; r = getRTimer() - r;
    924     Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: dt: %d, dr: %d\n", getRTimer(), t, r);
     946    Print("%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: dt: %d, dr: %d\n", getRTimer(), t, r);
    925947  }
    926948#endif   
     
    9871009  assume( syz_lead != NULL );
    9881010
     1011  if( __TREEOUTPUT__ )
     1012  {
     1013     PrintS("%%%% BEGIN LIFTHYBRID DIAGRAMM\n");
     1014     PrintS("\\begin{ROOTTREE}{"); dPrint(syz_lead, r, r, 0); PrintS("}");
     1015  }
     1016   
    9891017  if( syz_2 == NULL )
    9901018  {
     
    9931021    assume( rr >= 0 && rr < IDELEMS(T) );
    9941022    assume( rr >= 0 && rr < IDELEMS(L) );
    995 
    9961023
    9971024#if NOPRODUCT
     
    10011028    aa = p_Mult_mm(aa, L->m[rr], r);
    10021029
     1030    if( __TREEOUTPUT__ )
     1031    {
     1032      PrintS("\\CONSIDERTERM{"); dPrint(aa, r, r, 0); PrintS("}\n");
     1033    }
     1034     
    10031035    syz_2 = m_div.FindReducer(aa, syz_lead, m_checker);
    10041036
     
    10061038#endif
    10071039   
    1008     assume( syz_2 != NULL ); // by construction of S-Polynomial   
    1009   }
    1010 
    1011 
     1040  }
     1041   
     1042  assume( syz_2 != NULL ); // by construction of S-Polynomial   
     1043
     1044  if( __TREEOUTPUT__ )
     1045  {
     1046    PrintS("\\CHILDNODE{"); dPrint(syz_2, r, r, 0); PrintS("}\n");
     1047  }
    10121048 
    10131049  assume( syz_2 != NULL );
     
    10671103
    10681104      assume( c >= 0 && c < IDELEMS(T) );
     1105       
     1106      if( __TREEOUTPUT__ )
     1107      {
     1108         PrintS("\\CONSIDERTERM{"); dPrint(spoly, r, r, 0); PrintS("}\n");
     1109         PrintS("\\CHILDNODE{"); dPrint(t, r, r, 0); PrintS("}\n");
     1110      }
    10691111
    10701112      kBucket_Plus_mm_Mult_pp(bucket, p, T->m[c], 0); // pLength(T->m[c])?
     
    10861128  assume( pLength(result) == len );
    10871129     
     1130  if( __TREEOUTPUT__ )
     1131  {   
     1132    PrintS("\\ROOTRESULT{"); dPrint(result, r, r, 0); PrintS("}");     
     1133    PrintS("\\end{ROOTTREE}\n");
     1134  }
     1135   
     1136
    10881137  return result;
    10891138}
     
    11081157  // TODO: store (multiplier, tail) -.-^-.-^-.--> !
    11091158  TCache::iterator top_itr = m_cache.find(tail);
     1159   
     1160  if( __TREEOUTPUT__ )
     1161  {
     1162     PrintS("\\begin{ROOTTREE}{"); dPrint(multiplier, r, r, 0);Print("*gen(%d)}", tail);
     1163//    PrintS("\\ROOTRESULT{"); dPrint(t, R, R, 0); PrintS("}");
     1164//     PrintS("\\end{ROOTTREE}\n");
     1165  }
    11101166   
    11111167  if ( top_itr != m_cache.end() )
     
    11271183         n_Delete(&n, r);
    11281184       }
     1185
     1186       if( __TREEOUTPUT__ )
     1187       {
     1188         PrintS("\\REUSEROOTRESULT{"); dPrint(p, r, r, 0); PrintS("}\n");
     1189         PrintS("\\end{ROOTTREE}\n");
     1190       }
    11291191       
    11301192       return p;
     
    11351197//     T[ multiplier ] = p;
    11361198     
     1199     if( __TREEOUTPUT__ )
     1200     {
     1201       PrintS("\\STOREROOTRESULT{"); dPrint(p, r, r, 0); PrintS("}");   
     1202       PrintS("\\end{ROOTTREE}\n");
     1203     }
    11371204     return p_Copy(p, r);
    11381205  }
     
    11401207
    11411208  const poly p = ComputeImage(multiplier, tail);
    1142    
     1209
    11431210  T.insert( TP2PCache::value_type(p_Copy(multiplier, r), p) );
    11441211   
    11451212  m_cache.insert( TCache::value_type(tail, T) );
    11461213
     1214  if( __TREEOUTPUT__ )
     1215  {
     1216    PrintS("\\STOREROOTRESULT{"); dPrint(p, r, r, 0); PrintS("}");     
     1217    PrintS("\\end{ROOTTREE}\n");
     1218  }
    11471219  return p_Copy(p, r);
    11481220}
     
    12371309    poly product = pp_Mult_mm(multiplier, term4reduction, r);
    12381310    s = m_div.FindReducer(product, syztermCheck, m_checker);
     1311     
     1312    if( __TREEOUTPUT__ && (s != NULL) )
     1313    {
     1314      PrintS("\\CONSIDERTERM{"); dPrint(product, r, r, 0); PrintS("}\n");
     1315    }
     1316     
    12391317    p_Delete(&product, r);
    12401318#endif
     
    12441322    return s;
    12451323
     1324  if( __TREEOUTPUT__ )
     1325  {
     1326    PrintS("\\CHILDNODE{"); dPrint(s, r, r, 0); PrintS("}\n");
     1327  }
     1328
    12461329  poly b = leadmonom(s, r);
    12471330
     
    12491332  assume( c >= 0 && c < IDELEMS(T) );
    12501333
     1334  if( __TREEOUTPUT__ )
     1335  {
     1336     PrintS("\\begin{ROOTTREE}{"); dPrint(s, r, r, 0); PrintS("}");
     1337  }
     1338   
    12511339  const poly t = TraverseTail(b, c); // T->m[c];
    12521340
     1341  if( __TREEOUTPUT__ )
     1342  {
     1343    PrintS("\\ROOTRESULT{"); dPrint(t, r, r, 0); PrintS("}");   
     1344    PrintS("\\end{ROOTTREE}\n");
     1345  }
     1346   
    12531347  if( t != NULL )
    12541348    s = p_Add_q(s, t, r);
     
    12821376    __IGNORETAILS__( atGetInt(rootRingHdl, "IGNORETAILS", 0) ),
    12831377    __SYZNUMBER__( atGetInt(rootRingHdl, "SYZNUMBER", 0) ),
     1378    __TREEOUTPUT__( atGetInt(rootRingHdl, "TREEOUTPUT", 0) ),
    12841379    m_rBaseRing( rootRingHdl->data.uring )
    12851380{   
     
    12931388    Print("   TAILREDSYZ: \t%d\n", __TAILREDSYZ__);
    12941389    Print("  IGNORETAILS: \t%d\n", __IGNORETAILS__);
     1390    Print("   TREEOUTPUT: \t%d\n", __TREEOUTPUT__);
     1391
    12951392  }
    12961393#endif
  • dyn_modules/syzextra/syzextra.h

    r7edaddb rc760e25  
    6666        __LEAD2SYZ__(attr.__LEAD2SYZ__),  __TAILREDSYZ__(attr.__TAILREDSYZ__),
    6767        __HYBRIDNF__(attr.__HYBRIDNF__), __IGNORETAILS__(attr.__IGNORETAILS__),
    68         __SYZNUMBER__(attr.__SYZNUMBER__), m_rBaseRing(attr.m_rBaseRing)
     68        __SYZNUMBER__(attr.__SYZNUMBER__), __TREEOUTPUT__(attr.__TREEOUTPUT__),
     69        m_rBaseRing(attr.m_rBaseRing)
    6970    {}   
    7071
     
    9091  /// Syzygy level (within a resolution)
    9192  const int __SYZNUMBER__;
    92  
     93
     94  /// output lifting tree
     95  const int __TREEOUTPUT__;
     96
    9397  /// global base ring
    9498  const ring m_rBaseRing;
Note: See TracChangeset for help on using the changeset viewer.