Changeset c760e25 in git
- Timestamp:
- May 27, 2013, 6:11:44 PM (10 years ago)
- 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
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/schreyer.lib
r7edaddb rc760e25 45 45 "; 46 46 47 47 48 static proc prepareSyz( module I, list # ) 48 49 { … … 579 580 } 580 581 581 int @KERCHECK = @DEBUG;582 int @KERCHECK = 1; // @DEBUG; 582 583 583 584 if( typeof( attrib(SSinit, "KERCHECK") ) == "int" ) … … 591 592 { 592 593 @IGNORETAILS = attrib(SSinit, "IGNORETAILS"); 594 } 595 596 int @TREEOUTPUT = 0; 597 598 if( typeof( attrib(SSinit, "TREEOUTPUT") ) == "int" ) 599 { 600 @TREEOUTPUT = attrib(SSinit, "TREEOUTPUT"); 593 601 } 594 602 … … 783 791 attrib(S, "KERCHECK", @KERCHECK); 784 792 attrib(S, "IGNORETAILS", @IGNORETAILS); 785 793 attrib(S, "TREEOUTPUT", @TREEOUTPUT); 786 794 attrib(S, "SYZNUMBER", 0); 795 796 "attrib(S,'TREEOUTPUT'): ", attrib(S, "TREEOUTPUT"); 787 797 788 798 if( @DEBUG ) … … 1373 1383 if( @KERCHECK ) 1374 1384 { 1385 int @TREEOUTPUT = attrib(basering, "TREEOUTPUT"); 1386 1375 1387 vector s = 0; 1376 1388 … … 1386 1398 1387 1399 def @c = leadcomp(s); int k = int(@c); 1400 1401 if( @TREEOUTPUT ){ "\CHILD{", (s), "}{", ( @b*L[k]), "}"; } 1388 1402 1389 1403 s = s + SSTraverseTail(@b, T[k], L, T, #); // !!! … … 1534 1548 if( @KERCHECK ) 1535 1549 { 1550 int @TREEOUTPUT = attrib(basering, "TREEOUTPUT"); 1551 1536 1552 def spoly = leadmonomial(syz_lead) * T[int(leadcomp(syz_lead))] 1537 1553 + leadmonomial(syz_2) * T[int(leadcomp(syz_2))]; 1538 1554 1539 1555 vector @tail = syz_2; 1556 1557 poly @b; int k; 1540 1558 1541 1559 while (size(spoly) > 0) … … 1545 1563 if( size(syz_2) != 0) 1546 1564 { 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]; 1548 1571 @tail = @tail + syz_2; 1572 1549 1573 } 1550 1574 } … … 1605 1629 if( @KERCHECK ) 1606 1630 { 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"); 1611 1635 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 1614 1640 if( @HYBRIDNF == 2 ) 1615 1641 { … … 1648 1674 // leading syz. term: 1649 1675 a = LL[k]; 1650 1676 1651 1677 if( !@IGNORETAILS ) 1652 1678 { 1653 1679 c = leadcomp(a); r = int(c); aa = leadmonomial(a); 1680 1681 if( @TREEOUTPUT ){ "\ROOT{", (lead(a)), "}"; } 1654 1682 1655 1683 // NF reduction: 1656 1684 if( @HYBRIDNF == 0 ) // Traverse approach: 1657 { 1685 { 1658 1686 @tail = SSTraverseTail(aa, T[r], L, T, LS); 1659 1687 … … 1662 1690 { 1663 1691 a2 = LL2[k]; c = leadcomp(a2); r = int(c); aa = leadmonomial(a2); 1664 1692 1693 if( @TREEOUTPUT ){ "\CHILD{", (lead(a2)), "}{", ( aa*L[r]), "}"; } 1694 1665 1695 @tail = a2 + @tail + SSTraverseTail(aa, T[r], L, T, LS); 1666 1696 } else … … 1689 1719 } 1690 1720 } 1721 1722 if( @TREEOUTPUT ){ "\CHILD{", (a2), "}{", ( aa*L[r]), "}"; } 1691 1723 1692 1724 @tail = SSSchreyerSyzygyNF(a, a2, L, T, LS); … … 2560 2592 // attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 0); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M); 2561 2593 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); 2564 2597 2565 2598 … … 2611 2644 attrib(SSinit, "DEBUG", (DEBUG > 0)); 2612 2645 attrib(SSinit, "SYZCHECK", (DEBUG > 0)); 2613 attrib(SSinit, "KERCHECK", 1); 2646 attrib(SSinit, "KERCHECK", 0); 2647 attrib(SSinit, "TREEOUTPUT", 1); 2614 2648 attrib(SSinit, "PROFILE", 0); 2615 2649 … … 2659 2693 attrib(SSinit, "SYZCHECK", (DEBUG > 0)); 2660 2694 attrib(SSinit, "KERCHECK", 0); 2661 attrib(SSinit, "PROFILE", 1); 2695 attrib(SSinit, "TREEOUTPUT", 0); 2696 attrib(SSinit, "PROFILE", 0); 2662 2697 2663 2698 // option(prot); … … 2851 2886 attrib(SSinit, "SYZCHECK", (DEBUG > 0)); 2852 2887 attrib(SSinit, "KERCHECK", 0); 2888 attrib(SSinit, "TREEOUTPUT", 0); 2853 2889 attrib(SSinit, "PROFILE", 1); 2854 2890 -
dyn_modules/syzextra/syzextra.cc
r7edaddb rc760e25 461 461 #ifndef NDEBUG 462 462 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]); 464 464 #endif 465 465 … … 779 779 poly aa = leadmonom(a, R); assume( aa != NULL); // :( 780 780 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 782 789 poly t = TraverseTail(aa, r); 783 790 … … 786 793 assume( __LEAD2SYZ__ ); 787 794 795 // replace the following... ? 788 796 const int r2 = p_GetComp(a2, R) - 1; poly aa2 = leadmonom(a2, R); // :( 789 797 790 798 assume( r2 >= 0 && r2 < IDELEMS(T) ); 791 799 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 792 806 t = p_Add_q(a2, p_Add_q(t, TraverseTail(aa2, r2), R), R); 793 807 … … 797 811 798 812 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 800 822 return t; 801 823 } … … 831 853 { 832 854 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); 834 856 } 835 857 #endif … … 839 861 { 840 862 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); 842 864 } 843 865 #endif … … 865 887 { 866 888 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); 868 890 } 869 891 #endif … … 874 896 { 875 897 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); 877 899 } 878 900 #endif … … 884 906 { 885 907 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); 887 909 } 888 910 #endif … … 897 919 if( a2 != NULL ) 898 920 pNext(a) = NULL; 899 921 900 922 if( __IGNORETAILS__ ) 901 923 { … … 922 944 { 923 945 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); 925 947 } 926 948 #endif … … 987 1009 assume( syz_lead != NULL ); 988 1010 1011 if( __TREEOUTPUT__ ) 1012 { 1013 PrintS("%%%% BEGIN LIFTHYBRID DIAGRAMM\n"); 1014 PrintS("\\begin{ROOTTREE}{"); dPrint(syz_lead, r, r, 0); PrintS("}"); 1015 } 1016 989 1017 if( syz_2 == NULL ) 990 1018 { … … 993 1021 assume( rr >= 0 && rr < IDELEMS(T) ); 994 1022 assume( rr >= 0 && rr < IDELEMS(L) ); 995 996 1023 997 1024 #if NOPRODUCT … … 1001 1028 aa = p_Mult_mm(aa, L->m[rr], r); 1002 1029 1030 if( __TREEOUTPUT__ ) 1031 { 1032 PrintS("\\CONSIDERTERM{"); dPrint(aa, r, r, 0); PrintS("}\n"); 1033 } 1034 1003 1035 syz_2 = m_div.FindReducer(aa, syz_lead, m_checker); 1004 1036 … … 1006 1038 #endif 1007 1039 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 } 1012 1048 1013 1049 assume( syz_2 != NULL ); … … 1067 1103 1068 1104 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 } 1069 1111 1070 1112 kBucket_Plus_mm_Mult_pp(bucket, p, T->m[c], 0); // pLength(T->m[c])? … … 1086 1128 assume( pLength(result) == len ); 1087 1129 1130 if( __TREEOUTPUT__ ) 1131 { 1132 PrintS("\\ROOTRESULT{"); dPrint(result, r, r, 0); PrintS("}"); 1133 PrintS("\\end{ROOTTREE}\n"); 1134 } 1135 1136 1088 1137 return result; 1089 1138 } … … 1108 1157 // TODO: store (multiplier, tail) -.-^-.-^-.--> ! 1109 1158 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 } 1110 1166 1111 1167 if ( top_itr != m_cache.end() ) … … 1127 1183 n_Delete(&n, r); 1128 1184 } 1185 1186 if( __TREEOUTPUT__ ) 1187 { 1188 PrintS("\\REUSEROOTRESULT{"); dPrint(p, r, r, 0); PrintS("}\n"); 1189 PrintS("\\end{ROOTTREE}\n"); 1190 } 1129 1191 1130 1192 return p; … … 1135 1197 // T[ multiplier ] = p; 1136 1198 1199 if( __TREEOUTPUT__ ) 1200 { 1201 PrintS("\\STOREROOTRESULT{"); dPrint(p, r, r, 0); PrintS("}"); 1202 PrintS("\\end{ROOTTREE}\n"); 1203 } 1137 1204 return p_Copy(p, r); 1138 1205 } … … 1140 1207 1141 1208 const poly p = ComputeImage(multiplier, tail); 1142 1209 1143 1210 T.insert( TP2PCache::value_type(p_Copy(multiplier, r), p) ); 1144 1211 1145 1212 m_cache.insert( TCache::value_type(tail, T) ); 1146 1213 1214 if( __TREEOUTPUT__ ) 1215 { 1216 PrintS("\\STOREROOTRESULT{"); dPrint(p, r, r, 0); PrintS("}"); 1217 PrintS("\\end{ROOTTREE}\n"); 1218 } 1147 1219 return p_Copy(p, r); 1148 1220 } … … 1237 1309 poly product = pp_Mult_mm(multiplier, term4reduction, r); 1238 1310 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 1239 1317 p_Delete(&product, r); 1240 1318 #endif … … 1244 1322 return s; 1245 1323 1324 if( __TREEOUTPUT__ ) 1325 { 1326 PrintS("\\CHILDNODE{"); dPrint(s, r, r, 0); PrintS("}\n"); 1327 } 1328 1246 1329 poly b = leadmonom(s, r); 1247 1330 … … 1249 1332 assume( c >= 0 && c < IDELEMS(T) ); 1250 1333 1334 if( __TREEOUTPUT__ ) 1335 { 1336 PrintS("\\begin{ROOTTREE}{"); dPrint(s, r, r, 0); PrintS("}"); 1337 } 1338 1251 1339 const poly t = TraverseTail(b, c); // T->m[c]; 1252 1340 1341 if( __TREEOUTPUT__ ) 1342 { 1343 PrintS("\\ROOTRESULT{"); dPrint(t, r, r, 0); PrintS("}"); 1344 PrintS("\\end{ROOTTREE}\n"); 1345 } 1346 1253 1347 if( t != NULL ) 1254 1348 s = p_Add_q(s, t, r); … … 1282 1376 __IGNORETAILS__( atGetInt(rootRingHdl, "IGNORETAILS", 0) ), 1283 1377 __SYZNUMBER__( atGetInt(rootRingHdl, "SYZNUMBER", 0) ), 1378 __TREEOUTPUT__( atGetInt(rootRingHdl, "TREEOUTPUT", 0) ), 1284 1379 m_rBaseRing( rootRingHdl->data.uring ) 1285 1380 { … … 1293 1388 Print(" TAILREDSYZ: \t%d\n", __TAILREDSYZ__); 1294 1389 Print(" IGNORETAILS: \t%d\n", __IGNORETAILS__); 1390 Print(" TREEOUTPUT: \t%d\n", __TREEOUTPUT__); 1391 1295 1392 } 1296 1393 #endif -
dyn_modules/syzextra/syzextra.h
r7edaddb rc760e25 66 66 __LEAD2SYZ__(attr.__LEAD2SYZ__), __TAILREDSYZ__(attr.__TAILREDSYZ__), 67 67 __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) 69 70 {} 70 71 … … 90 91 /// Syzygy level (within a resolution) 91 92 const int __SYZNUMBER__; 92 93 94 /// output lifting tree 95 const int __TREEOUTPUT__; 96 93 97 /// global base ring 94 98 const ring m_rBaseRing;
Note: See TracChangeset
for help on using the changeset viewer.