Changeset 73ba50 in git
- Timestamp:
- Nov 30, 2014, 5:02:25 PM (9 years ago)
- Branches:
- (u'spielwiese', 'e7cc1ebecb61be8b9ca6c18016352af89940b21a')
- Children:
- a7575a10aee0a3dae7dfe5c11fe477c57552464d
- Parents:
- 10478c89d2b549aa165d123e05fd493ee4c8d415
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-11-30 17:02:25+01:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-11-30 18:22:50+01:00
- Location:
- Singular/dyn_modules/syzextra
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/dyn_modules/syzextra/mod_main.cc
r10478c r73ba50 507 507 const SchreyerSyzygyComputationFlags attributes(currRingHdl); 508 508 509 const BOOLEAN __DEBUG__ = attributes.__DEBUG__;510 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__;511 const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__;512 // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__;513 // const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;509 const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG; 510 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK; 511 const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ; 512 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF; 513 // const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ; 514 514 515 515 const ring r = attributes.m_rBaseRing; … … 530 530 assume(id != NULL); 531 531 532 if( UNLIKELY( __DEBUG__) )532 if( UNLIKELY( OPT__DEBUG ) ) 533 533 { 534 534 PrintS("ComputeLeadingSyzygyTerms::Input: \n"); … … 536 536 } 537 537 538 assume( ! __LEAD2SYZ__);538 assume( !OPT__LEAD2SYZ ); 539 539 540 540 h = h->Next(); assume (h == NULL); … … 557 557 const SchreyerSyzygyComputationFlags attributes(currRingHdl); 558 558 559 const BOOLEAN __DEBUG__ = FALSE; // attributes.__DEBUG__;560 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__;561 // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__;562 // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__;563 // const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;559 const BOOLEAN OPT__DEBUG = FALSE; // attributes.OPT__DEBUG; 560 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK; 561 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ; 562 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF; 563 // const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ; 564 564 565 565 NoReturn(res); … … 585 585 assume(id != NULL); 586 586 587 if( UNLIKELY( __DEBUG__) )587 if( UNLIKELY( OPT__DEBUG ) ) 588 588 { 589 589 PrintS("Sort_c_ds::Input: \n"); … … 600 600 // res->rtyp = h->Typ(); 601 601 602 if( UNLIKELY( __DEBUG__) )602 if( UNLIKELY( OPT__DEBUG ) ) 603 603 { 604 604 PrintS("Sort_c_ds::Output: \n"); … … 619 619 const SchreyerSyzygyComputationFlags attributes(currRingHdl); 620 620 621 const BOOLEAN __DEBUG__ = attributes.__DEBUG__;622 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__;623 const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__;624 // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__;625 // const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;621 const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG; 622 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK; 623 const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ; 624 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF; 625 // const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ; 626 626 627 627 const ring r = attributes.m_rBaseRing; … … 636 636 assume( h != NULL ); 637 637 638 assume( __LEAD2SYZ__); // ???638 assume( OPT__LEAD2SYZ ); // ??? 639 639 640 640 if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD) … … 644 644 assume(id != NULL); 645 645 646 if( UNLIKELY( __DEBUG__) )646 if( UNLIKELY( OPT__DEBUG ) ) 647 647 { 648 648 PrintS("Compute2LeadingSyzygyTerms::Input: \n"); … … 669 669 const SchreyerSyzygyComputationFlags attributes(currRingHdl); 670 670 671 const BOOLEAN __DEBUG__ = attributes.__DEBUG__;672 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__;673 // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__;674 // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__;675 const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;671 const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG; 672 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK; 673 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ; 674 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF; 675 const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ; 676 676 677 677 const char* usage = "`FindReducer(<poly/vector>, <vector/0>, <ideal/module>[,<module>])` expected"; … … 724 724 725 725 #ifndef SING_NDEBUG 726 if( LIKELY( __TAILREDSYZ__) )726 if( LIKELY( OPT__TAILREDSYZ) ) 727 727 assume (LS != NULL); 728 728 #endif … … 730 730 assume( h == NULL ); 731 731 732 if( UNLIKELY( __DEBUG__) )732 if( UNLIKELY(OPT__DEBUG) ) 733 733 { 734 734 PrintS("FindReducer(product, syzterm, L, T, #)::Input: \n"); … … 751 751 res->data = FindReducer(product, syzterm, L, LS, attributes); 752 752 753 if( UNLIKELY( __DEBUG__) )753 if( UNLIKELY( OPT__DEBUG ) ) 754 754 { 755 755 PrintS("FindReducer::Output: \n"); … … 766 766 const SchreyerSyzygyComputationFlags attributes(currRingHdl); 767 767 768 const BOOLEAN __DEBUG__ = attributes.__DEBUG__;769 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__;770 // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__;771 const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__;772 const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;768 const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG; 769 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK; 770 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ; 771 const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF; 772 const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ; 773 773 774 774 const char* usage = "`SchreyerSyzygyNF(<vector>, <vector>, <ideal/module>, <ideal/module>[,<module>])` expected"; … … 777 777 NoReturn(res); 778 778 779 assume( __HYBRIDNF__); // ???779 assume( OPT__HYBRIDNF ); // ??? 780 780 781 781 if ((h==NULL) || (h->Typ() != VECTOR_CMD) || (h->Data() == NULL)) … … 828 828 829 829 #ifndef SING_NDEBUG 830 if( LIKELY( __TAILREDSYZ__) )830 if( LIKELY( OPT__TAILREDSYZ) ) 831 831 assume (LS != NULL); 832 832 #endif … … 834 834 assume( h == NULL ); 835 835 836 if( UNLIKELY( __DEBUG__) )836 if( UNLIKELY( OPT__DEBUG ) ) 837 837 { 838 838 PrintS("SchreyerSyzygyNF(syz_lead, syz_2, L, T, #)::Input: \n"); … … 857 857 (syz_2!=NULL)? p_Copy(syz_2, r): syz_2, L, T, LS, attributes); 858 858 859 if( UNLIKELY( __DEBUG__) )859 if( UNLIKELY( OPT__DEBUG ) ) 860 860 { 861 861 PrintS("SchreyerSyzygyNF::Output: "); … … 875 875 const SchreyerSyzygyComputationFlags attributes(currRingHdl); 876 876 877 const BOOLEAN __DEBUG__ = attributes.__DEBUG__;878 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__;879 // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__;880 // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__;881 const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;877 const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG; 878 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK; 879 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ; 880 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF; 881 const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ; 882 882 883 883 const char* usage = "`ReduceTerm(<poly>, <poly/vector>, <vector/0>, <ideal/module>, <ideal/module>[,<module>])` expected"; … … 949 949 950 950 #ifndef SING_NDEBUG 951 if( LIKELY( __TAILREDSYZ__) )951 if( LIKELY( OPT__TAILREDSYZ) ) 952 952 assume (LS != NULL); 953 953 #endif … … 955 955 assume( h == NULL ); 956 956 957 if( UNLIKELY( __DEBUG__) )957 if( UNLIKELY( OPT__DEBUG ) ) 958 958 { 959 959 PrintS("ReduceTerm(m, t, syzterm, L, T, #)::Input: \n"); … … 976 976 977 977 978 if ( UNLIKELY( __DEBUG__&& syztermCheck != NULL) )978 if ( UNLIKELY( OPT__DEBUG && syztermCheck != NULL) ) 979 979 { 980 980 const int c = p_GetComp(syztermCheck, r) - 1; … … 1001 1001 1002 1002 1003 if( UNLIKELY( __DEBUG__) )1003 if( UNLIKELY( OPT__DEBUG ) ) 1004 1004 { 1005 1005 PrintS("ReduceTerm::Output: "); … … 1020 1020 const SchreyerSyzygyComputationFlags attributes(currRingHdl); 1021 1021 1022 const BOOLEAN __DEBUG__ = attributes.__DEBUG__;1023 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__;1024 // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__;1025 // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__;1026 const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;1022 const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG; 1023 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK; 1024 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ; 1025 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF; 1026 const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ; 1027 1027 1028 1028 const char* usage = "`TraverseTail(<poly>, <poly/vector>, <ideal/module>, <ideal/module>[,<module>])` expected"; … … 1082 1082 1083 1083 #ifndef SING_NDEBUG 1084 if( LIKELY( __TAILREDSYZ__) )1084 if( LIKELY( OPT__TAILREDSYZ) ) 1085 1085 assume (LS != NULL); 1086 1086 #endif … … 1088 1088 assume( h == NULL ); 1089 1089 1090 if( UNLIKELY( __DEBUG__) )1090 if( UNLIKELY( OPT__DEBUG ) ) 1091 1091 { 1092 1092 PrintS("TraverseTail(m, t, L, T, #)::Input: \n"); … … 1111 1111 1112 1112 1113 if( UNLIKELY( __DEBUG__) )1113 if( UNLIKELY( OPT__DEBUG ) ) 1114 1114 { 1115 1115 PrintS("TraverseTail::Output: "); … … 1125 1125 const SchreyerSyzygyComputationFlags attributes(currRingHdl); 1126 1126 1127 const BOOLEAN __DEBUG__ = attributes.__DEBUG__;1127 const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG; 1128 1128 1129 1129 const char* usage = "`ComputeResolution(<ideal/module>, <same as before>, <same as before>[,int])` expected"; … … 1183 1183 length = 1 + rVar(r); 1184 1184 1185 if( UNLIKELY( __DEBUG__) )1185 if( UNLIKELY( OPT__DEBUG ) ) 1186 1186 { 1187 1187 PrintS("ComputeResolution(M, length)::Input: \n"); … … 1203 1203 _res->fullres[index++] = M; 1204 1204 1205 // if (UNLIKELY(attributes. __TREEOUTPUT__))1206 // Print("{ \"RESOLUTION: HYBRIDNF:%d, TAILREDSYZ: %d, LEAD2SYZ: %d, IGNORETAILS: %d\": [\n", attributes. __HYBRIDNF__, attributes.__TAILREDSYZ__, attributes.__LEAD2SYZ__, attributes.__IGNORETAILS__);1205 // if (UNLIKELY(attributes.OPT__TREEOUTPUT)) 1206 // Print("{ \"RESOLUTION: HYBRIDNF:%d, TAILREDSYZ: %d, LEAD2SYZ: %d, IGNORETAILS: %d\": [\n", attributes.OPT__HYBRIDNF, attributes.OPT__TAILREDSYZ, attributes.OPT__LEAD2SYZ, attributes.OPT__IGNORETAILS); 1207 1207 1208 1208 while( (!idIs0(L)) && (index < length)) … … 1213 1213 ComputeSyzygy(L, T, LL, TT, attributes); 1214 1214 1215 if( UNLIKELY( __DEBUG__) )1215 if( UNLIKELY( OPT__DEBUG ) ) 1216 1216 { 1217 1217 Print("ComputeResolution()::Separated Syzygy[%d]: \n", index); … … 1235 1235 M->rank = id_RankFreeModule(M, r); 1236 1236 1237 if( UNLIKELY( __DEBUG__) )1237 if( UNLIKELY( OPT__DEBUG ) ) 1238 1238 { 1239 1239 Print("ComputeResolution()::Restored Syzygy[%d]: \n", index); … … 1243 1243 _res->fullres[index++] = M; // ??? 1244 1244 } 1245 // if ( UNLIKELY(attributes. __TREEOUTPUT__) )1245 // if ( UNLIKELY(attributes.OPT__TREEOUTPUT) ) 1246 1246 // PrintS("] }\n"); 1247 1247 … … 1251 1251 res->rtyp = RESOLUTION_CMD; 1252 1252 1253 if( UNLIKELY( __DEBUG__) )1253 if( UNLIKELY(OPT__DEBUG) ) 1254 1254 { 1255 1255 Print("ComputeResolution::Output (index: %d): ", index); … … 1273 1273 const SchreyerSyzygyComputationFlags attributes(currRingHdl); 1274 1274 1275 const BOOLEAN __DEBUG__ = attributes.__DEBUG__;1276 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__;1277 // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__;1278 // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__;1279 // const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;1275 const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG; 1276 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK; 1277 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ; 1278 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF; 1279 // const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ; 1280 1280 1281 1281 const char* usage = "`ComputeSyzygy(<ideal/module>, <ideal/module>)` expected"; … … 1307 1307 h = h->Next(); assume( h == NULL ); 1308 1308 1309 if( UNLIKELY( __DEBUG__) )1309 if( UNLIKELY( OPT__DEBUG ) ) 1310 1310 { 1311 1311 PrintS("ComputeSyzygy(L, T)::Input: \n"); … … 1326 1326 res->data = l; res->rtyp = LIST_CMD; 1327 1327 1328 if( UNLIKELY( __DEBUG__) )1328 if( UNLIKELY( OPT__DEBUG ) ) 1329 1329 { 1330 1330 PrintS("ComputeSyzygy::Output: \nLL: \n"); -
Singular/dyn_modules/syzextra/syzextra.cc
r10478c r73ba50 224 224 225 225 #ifndef SING_NDEBUG 226 const int __DEBUG__= 0;227 if( __DEBUG__)226 const int OPT__DEBUG = 0; 227 if( OPT__DEBUG ) 228 228 { 229 229 PrintS("cmp_c_ds: a, b: \np1: "); dPrint(a, r, r, 0); … … 253 253 254 254 #ifndef SING_NDEBUG 255 if( __DEBUG__)255 if( OPT__DEBUG ) 256 256 { 257 257 PrintS("cmp_c_ds: a & b have the same comp & deg! "); PrintLn(); … … 297 297 298 298 #ifndef SING_NDEBUG 299 const int __DEBUG__= 0;300 if( __DEBUG__)299 const int OPT__DEBUG = 0; 300 if( OPT__DEBUG ) 301 301 { 302 302 PrintS("cmp_lex: a, b: \np1: "); dPrint(a, r, r, 0); … … 588 588 assume( t != NULL ); 589 589 590 if( UNLIKELY( __DEBUG__ & __TAILREDSYZ__) )590 if( UNLIKELY(OPT__DEBUG & OPT__TAILREDSYZ) ) 591 591 assume( !IsDivisible(t) ); // each input term should NOT be in <L> 592 592 … … 594 594 595 595 596 if( LIKELY( __TAILREDSYZ__) )596 if( LIKELY(OPT__TAILREDSYZ) ) 597 597 if( p_LmIsConstant(t, r) ) // most basic case of baing coprime with L, whatever that is... 598 598 return 1; // TODO: prove this...? … … 612 612 const bool bSyzCheck = syzChecker.IsNonempty(); // need to check even in ideal case????? proof? "&& !bIdealCase" 613 613 614 if( LIKELY( __TAILREDSYZ__&& (bIdealCase || bSyzCheck)) )614 if( LIKELY(OPT__TAILREDSYZ && (bIdealCase || bSyzCheck)) ) 615 615 { 616 616 const TReducers& v = itr->second; … … 626 626 assume( p_GetComp(p, r) == comp ); 627 627 628 // TODO: check if coprime with Leads... if __TAILREDSYZ__!628 // TODO: check if coprime with Leads... if OPT__TAILREDSYZ ! 629 629 for( int var = N; var > 0; --var ) 630 630 if( (p_GetExp(p, var, r) != 0) && (p_GetExp(t, var, r) != 0) ) 631 631 { 632 632 #ifndef SING_NDEBUG 633 if( __DEBUG__| 0)633 if( OPT__DEBUG | 0) 634 634 { 635 635 PrintS("CReducerFinder::PreProcessTerm, 't' is NOT co-prime with the following leading term: \n"); … … 651 651 652 652 #ifndef SING_NDEBUG 653 if( __DEBUG__&& !coprime)653 if( OPT__DEBUG && !coprime) 654 654 { 655 655 PrintS("CReducerFinder::PreProcessTerm, 't' is co-prime with p but may lead to NOT divisible syz.term: \n"); … … 666 666 667 667 #ifndef SING_NDEBUG 668 if( __DEBUG__&& coprime )668 if( OPT__DEBUG && coprime ) 669 669 PrintS("CReducerFinder::PreProcessTerm, the following 't' is 'co-prime' with all of leading terms! \n"); 670 670 #endif … … 689 689 690 690 #ifndef SING_NDEBUG 691 if( __DEBUG__| 0)691 if( OPT__DEBUG | 0) 692 692 { 693 693 PrintS("SchreyerSyzygyComputation::SetUpTailTerms(): Tails: \n"); … … 708 708 { 709 709 #ifndef SING_NDEBUG 710 if( __DEBUG__)710 if( OPT__DEBUG) 711 711 { 712 712 Print("SchreyerSyzygyComputation::SetUpTailTerms(): PP (%d) the following TT: \n", k); … … 723 723 724 724 #ifndef SING_NDEBUG 725 if( __DEBUG__| 0)725 if( OPT__DEBUG | 0) 726 726 { 727 727 PrintS("SchreyerSyzygyComputation::SetUpTailTerms(): Preprocessed Tails: \n"); … … 730 730 #endif 731 731 732 if( UNLIKELY( __PROT__) )732 if( UNLIKELY(OPT__PROT) ) 733 733 { 734 734 Print("(PP/ST: {c: %lu, C: %lu, P: %lu} + %lu)", pp[1], pp[2], pp[3], pp[0]); … … 779 779 // const SchreyerSyzygyComputationFlags& attributes = m_atttributes; 780 780 781 assume(! __LEAD2SYZ__);781 assume(!OPT__LEAD2SYZ); 782 782 783 783 // 1. set of components S? … … 850 850 } 851 851 852 // if( __DEBUG__& FALSE )852 // if( OPT__DEBUG & FALSE ) 853 853 // { 854 854 // PrintS("ComputeLeadingSyzygyTerms::Temp0: \n"); … … 862 862 id_DelDiv(newid, r); // #define SIMPL_LMDIV 32 863 863 864 // if( __DEBUG__& FALSE )864 // if( OPT__DEBUG & FALSE ) 865 865 // { 866 866 // PrintS("ComputeLeadingSyzygyTerms::Temp1: \n"); … … 870 870 idSkipZeroes(newid); // #define SIMPL_NULL 2 871 871 872 // if( __DEBUG__)872 // if( OPT__DEBUG ) 873 873 // { 874 874 // PrintS("ComputeLeadingSyzygyTerms::Output: \n"); … … 979 979 } 980 980 981 // if( __DEBUG__& FALSE )981 // if( OPT__DEBUG & FALSE ) 982 982 // { 983 983 // PrintS("Compute2LeadingSyzygyTerms::Temp0: \n"); … … 985 985 // } 986 986 987 if( UNLIKELY(! __TAILREDSYZ__) )987 if( UNLIKELY(!OPT__TAILREDSYZ) ) 988 988 { 989 989 // simplify(newid, 2 + 32)?? … … 991 991 id_DelDiv(newid, r); // #define SIMPL_LMDIV 32 992 992 993 // if( __DEBUG__& FALSE )993 // if( OPT__DEBUG & FALSE ) 994 994 // { 995 995 // PrintS("Compute2LeadingSyzygyTerms::Temp1 (deldiv): \n"); … … 1016 1016 newid = tmp; 1017 1017 1018 // if( __DEBUG__& FALSE )1018 // if( OPT__DEBUG & FALSE ) 1019 1019 // { 1020 1020 // PrintS("Compute2LeadingSyzygyTerms::Temp1 (std): \n"); … … 1034 1034 { 1035 1035 #ifndef SING_NDEBUG 1036 if( __DEBUG__) { m_div.Verify(); m_checker.Verify(); }1036 if( OPT__DEBUG ) { m_div.Verify(); m_checker.Verify(); } 1037 1037 #endif 1038 1038 … … 1050 1050 1051 1051 #ifndef SING_NDEBUG 1052 if( __DEBUG__)1052 if( OPT__DEBUG ) 1053 1053 { 1054 1054 PrintS("SchreyerSyzygyComputation::TraverseNF(syz_lead, poly syz_2), \n"); … … 1061 1061 #endif 1062 1062 1063 if( UNLIKELY( __TREEOUTPUT__) )1063 if( UNLIKELY(OPT__TREEOUTPUT) ) 1064 1064 { 1065 1065 PrintS("{ \"proc\": \"TraverseNF\", \"nodelabel\": \""); … … 1071 1071 1072 1072 #ifndef SING_NDEBUG 1073 if( __DEBUG__) { m_div.Verify(); m_checker.Verify(); }1073 if( OPT__DEBUG ) { m_div.Verify(); m_checker.Verify(); } 1074 1074 #endif 1075 1075 … … 1078 1078 if( a2 != NULL ) 1079 1079 { 1080 assume( __LEAD2SYZ__);1081 1082 if( UNLIKELY( __TREEOUTPUT__) )1080 assume( OPT__LEAD2SYZ ); 1081 1082 if( UNLIKELY(OPT__TREEOUTPUT) ) 1083 1083 { 1084 1084 … … 1098 1098 1099 1099 1100 if( UNLIKELY( __TREEOUTPUT__) )1100 if( UNLIKELY(OPT__TREEOUTPUT) ) 1101 1101 { 1102 1102 PrintS("], \"noderesult\": \""); … … 1108 1108 1109 1109 #ifndef SING_NDEBUG 1110 if( __DEBUG__) { m_div.Verify(); m_checker.Verify(); }1110 if( OPT__DEBUG ) { m_div.Verify(); m_checker.Verify(); } 1111 1111 #endif 1112 1112 … … 1116 1116 p_Delete(&aa, R); 1117 1117 1118 if( UNLIKELY( __TREEOUTPUT__) )1118 if( UNLIKELY(OPT__TREEOUTPUT) ) 1119 1119 { 1120 1120 // poly tt = pp_Add_qq( a, t, R); … … 1125 1125 } 1126 1126 #ifndef SING_NDEBUG 1127 if( __DEBUG__)1127 if( OPT__DEBUG ) 1128 1128 { 1129 1129 PrintS("SchreyerSyzygyComputation::TraverseNF(syz_lead, poly syz_2), ==>>> \n"); … … 1134 1134 1135 1135 #ifndef SING_NDEBUG 1136 if( __DEBUG__) { m_div.Verify(); m_checker.Verify(); }1136 if( OPT__DEBUG ) { m_div.Verify(); m_checker.Verify(); } 1137 1137 #endif 1138 1138 … … 1143 1143 { 1144 1144 #ifndef SING_NDEBUG 1145 if( __DEBUG__) { m_div.Verify(); m_checker.Verify(); }1145 if( OPT__DEBUG ) { m_div.Verify(); m_checker.Verify(); } 1146 1146 #endif 1147 1147 … … 1169 1169 #endif 1170 1170 1171 if( UNLIKELY( __TREEOUTPUT__) )1172 Print("\n{ \"syzygylayer\": \"%d\", \"hybridnf\": \"%d\", \"diagrams\": \n[", __SYZNUMBER__, __HYBRIDNF__);1171 if( UNLIKELY(OPT__TREEOUTPUT) ) 1172 Print("\n{ \"syzygylayer\": \"%d\", \"hybridnf\": \"%d\", \"diagrams\": \n[", OPT__SYZNUMBER, OPT__HYBRIDNF ); 1173 1173 1174 if( UNLIKELY( __PROT__) ) Print("\n[%d]", __SYZNUMBER__);1174 if( UNLIKELY(OPT__PROT) ) Print("\n[%d]", OPT__SYZNUMBER ); 1175 1175 1176 1176 if( m_syzLeads == NULL ) 1177 1177 { 1178 1178 #ifdef SING_NDEBUG 1179 if( UNLIKELY( __PROT__& RTIMER_BENCHMARKING) )1179 if( UNLIKELY(OPT__PROT & RTIMER_BENCHMARKING) ) 1180 1180 { 1181 1181 t = getTimer(); r = getRTimer(); … … 1184 1184 #endif 1185 1185 1186 ComputeLeadingSyzygyTerms( __LEAD2SYZ__ && !__IGNORETAILS__); // 2 terms OR 1 term!1186 ComputeLeadingSyzygyTerms( OPT__LEAD2SYZ && !OPT__IGNORETAILS ); // 2 terms OR 1 term! 1187 1187 1188 1188 #ifdef SING_NDEBUG 1189 if( UNLIKELY( __PROT__& RTIMER_BENCHMARKING) )1189 if( UNLIKELY(OPT__PROT & RTIMER_BENCHMARKING) ) 1190 1190 { 1191 1191 t = getTimer() - t; r = getRTimer() - r; … … 1204 1204 if( size == 1 && LL->m[0] == NULL ) 1205 1205 { 1206 if( UNLIKELY( __TREEOUTPUT__) )1206 if( UNLIKELY(OPT__TREEOUTPUT) ) 1207 1207 PrintS("]},"); 1208 1208 return; … … 1211 1211 1212 1212 // use hybrid (Schreyer NF) method? 1213 const bool method = ( __HYBRIDNF__ == 1); // || (__HYBRIDNF__ == 2 && __SYZNUMBER__< 3);1214 1215 if( UNLIKELY( __PROT__) ) Print("[%s NF|%s]",(method) ? "PR" : "TT", (NOPRODUCT == 1)? "_,_": "^*^" );1213 const bool method = (OPT__HYBRIDNF == 1); // || (OPT__HYBRIDNF == 2 && OPT__SYZNUMBER < 3); 1214 1215 if( UNLIKELY(OPT__PROT) ) Print("[%s NF|%s]",(method) ? "PR" : "TT", (NOPRODUCT == 1)? "_,_": "^*^" ); 1216 1216 1217 1217 1218 if( LIKELY(! __IGNORETAILS__) )1218 if( LIKELY(!OPT__IGNORETAILS) ) 1219 1219 { 1220 1220 if( T != NULL ) 1221 1221 { 1222 1222 #ifdef SING_NDEBUG 1223 if( UNLIKELY( __PROT__& RTIMER_BENCHMARKING) )1223 if( UNLIKELY(OPT__PROT & RTIMER_BENCHMARKING) ) 1224 1224 { 1225 1225 t = getTimer(); r = getRTimer(); … … 1231 1231 1232 1232 #ifdef SING_NDEBUG 1233 if( UNLIKELY( __PROT__& RTIMER_BENCHMARKING) )1233 if( UNLIKELY(OPT__PROT & RTIMER_BENCHMARKING) ) 1234 1234 { 1235 1235 t = getTimer() - t; r = getRTimer() - r; … … 1241 1241 1242 1242 #ifdef SING_NDEBUG 1243 if( UNLIKELY( __PROT__& RTIMER_BENCHMARKING) )1243 if( UNLIKELY(OPT__PROT & RTIMER_BENCHMARKING) ) 1244 1244 { 1245 1245 t = getTimer(); r = getRTimer(); … … 1249 1249 1250 1250 #ifndef SING_NDEBUG 1251 if( __DEBUG__) { m_div.Verify(); m_checker.Verify(); }1251 if( OPT__DEBUG ) { m_div.Verify(); m_checker.Verify(); } 1252 1252 #endif 1253 1253 … … 1263 1263 pNext(a) = NULL; 1264 1264 1265 if( UNLIKELY( __IGNORETAILS__) )1265 if( UNLIKELY(OPT__IGNORETAILS) ) 1266 1266 { 1267 1267 TT->m[k] = NULL; … … 1278 1278 1279 1279 #ifndef SING_NDEBUG 1280 if( __DEBUG__) { m_div.Verify(); m_checker.Verify(); }1280 if( OPT__DEBUG ) { m_div.Verify(); m_checker.Verify(); } 1281 1281 #endif 1282 1282 … … 1289 1289 1290 1290 #ifndef SING_NDEBUG 1291 if( __DEBUG__) { m_div.Verify(); m_checker.Verify(); }1291 if( OPT__DEBUG ) { m_div.Verify(); m_checker.Verify(); } 1292 1292 #endif 1293 1293 1294 1294 TT->m[k] = nf; 1295 1295 1296 if( UNLIKELY( __SYZCHECK__) )1296 if( UNLIKELY(OPT__SYZCHECK) ) 1297 1297 { 1298 1298 // TODO: check the correctness (syzygy property): a + TT->m[k] should be a syzygy!!! … … 1302 1302 poly vp = p_VectorProductLT(s, L, T, R); 1303 1303 1304 if( UNLIKELY( __DEBUG__ && (vp != NULL) && ! __TREEOUTPUT__) )1304 if( UNLIKELY( OPT__DEBUG && (vp != NULL) && ! OPT__TREEOUTPUT ) ) 1305 1305 { 1306 1306 Warn("SchreyerSyzygyComputation::ComputeSyzygy: failed syzygy property for syzygy [%d], non-zero image is as follows: ", k); … … 1334 1334 1335 1335 #ifndef SING_NDEBUG 1336 if( __DEBUG__) { m_div.Verify(); m_checker.Verify(); }1336 if( OPT__DEBUG ) { m_div.Verify(); m_checker.Verify(); } 1337 1337 #endif 1338 1338 … … 1340 1340 assume( vp == NULL ); 1341 1341 1342 if( UNLIKELY( __PROT__&& (vp != NULL) ) ) Warn("ERROR: SyzCheck failed, wrong tail: [%d]\n\n", k); // check k'th syzygy failed1342 if( UNLIKELY( OPT__PROT && (vp != NULL) ) ) Warn("ERROR: SyzCheck failed, wrong tail: [%d]\n\n", k); // check k'th syzygy failed 1343 1343 1344 1344 p_Delete(&vp, R); … … 1346 1346 1347 1347 #ifndef SING_NDEBUG 1348 if( __DEBUG__) { m_div.Verify(); m_checker.Verify(); }1348 if( OPT__DEBUG ) { m_div.Verify(); m_checker.Verify(); } 1349 1349 #endif 1350 1350 } 1351 1351 1352 1352 #ifdef SING_NDEBUG 1353 if( UNLIKELY( __PROT__& RTIMER_BENCHMARKING ) )1353 if( UNLIKELY( OPT__PROT & RTIMER_BENCHMARKING ) ) 1354 1354 { 1355 1355 t = getTimer() - t; r = getRTimer() - r; … … 1360 1360 TT->rank = id_RankFreeModule(TT, R); 1361 1361 1362 if( UNLIKELY( __TREEOUTPUT__) )1362 if( UNLIKELY(OPT__TREEOUTPUT) ) 1363 1363 PrintS("\n]},"); 1364 1364 1365 if( UNLIKELY( __PROT__) ) PrintLn();1365 if( UNLIKELY(OPT__PROT) ) PrintLn(); 1366 1366 } 1367 1367 … … 1370 1370 // const SchreyerSyzygyComputationFlags& attributes = m_atttributes; 1371 1371 1372 // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__;1373 // const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;1372 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ; 1373 // const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ; 1374 1374 1375 1375 assume( m_syzLeads == NULL ); … … 1377 1377 if( UNLIKELY(bComputeSecondTerms) ) 1378 1378 { 1379 assume( __LEAD2SYZ__);1379 assume( OPT__LEAD2SYZ ); 1380 1380 // m_syzLeads = FROM_NAMESPACE(INTERNAL, _Compute2LeadingSyzygyTerms(m_idLeads, m_rBaseRing, m_atttributes)); 1381 1381 m_syzLeads = Compute2LeadingSyzygyTerms(); … … 1383 1383 else 1384 1384 { 1385 assume( ! __LEAD2SYZ__);1385 assume( !OPT__LEAD2SYZ ); 1386 1386 1387 1387 m_syzLeads = Compute1LeadingSyzygyTerms(); … … 1392 1392 assume( m_syzLeads!= NULL ); 1393 1393 1394 if ( LIKELY( __TAILREDSYZ__ && !__IGNORETAILS__&& (IDELEMS(m_syzLeads) > 0) && !((IDELEMS(m_syzLeads) == 1) && (m_syzLeads->m[0] == NULL)) ) )1394 if ( LIKELY( OPT__TAILREDSYZ && !OPT__IGNORETAILS && (IDELEMS(m_syzLeads) > 0) && !((IDELEMS(m_syzLeads) == 1) && (m_syzLeads->m[0] == NULL)) ) ) 1395 1395 { 1396 1396 m_LS = m_syzLeads; 1397 1397 m_checker.Initialize(m_syzLeads); 1398 1398 #ifndef SING_NDEBUG 1399 if( __DEBUG__)1399 if( OPT__DEBUG ) 1400 1400 { 1401 1401 const ring& r = m_rBaseRing; … … 1410 1410 } 1411 1411 1412 if( UNLIKELY( __PROT__) ) Print("(L%dS:%d)", bComputeSecondTerms ? 2 : 1, IDELEMS(m_syzLeads));1412 if( UNLIKELY( OPT__PROT ) ) Print("(L%dS:%d)", bComputeSecondTerms ? 2 : 1, IDELEMS(m_syzLeads)); 1413 1413 1414 1414 } … … 1416 1416 poly SchreyerSyzygyComputation::SchreyerSyzygyNF(const poly syz_lead, poly syz_2) const 1417 1417 { 1418 assume( ! __IGNORETAILS__);1418 assume( !OPT__IGNORETAILS ); 1419 1419 1420 1420 const ideal& L = m_idLeads; … … 1426 1426 1427 1427 #ifndef SING_NDEBUG 1428 if( __DEBUG__)1428 if( OPT__DEBUG ) 1429 1429 { 1430 1430 PrintS("SchreyerSyzygyComputation::SchreyerSyzygyNF(syz_lead, poly syz_2), \n"); … … 1437 1437 #endif 1438 1438 1439 if( UNLIKELY( __TREEOUTPUT__) )1439 if( UNLIKELY( OPT__TREEOUTPUT ) ) 1440 1440 { 1441 1441 PrintS("{ \"nodelabel\": \""); writeLatexTerm(syz_lead, r); … … 1454 1454 p_Test(syz_2, r); 1455 1455 1456 if( UNLIKELY( __TREEOUTPUT__) )1456 if( UNLIKELY( OPT__TREEOUTPUT ) ) 1457 1457 { 1458 1458 PrintS("{ \"nodelabel\": \""); writeLatexTerm(syz_2, r); PrintS("\" },"); … … 1462 1462 aa = p_Mult_mm(aa, L->m[rr], r); 1463 1463 1464 if( UNLIKELY( __TREEOUTPUT__) )1464 if( UNLIKELY( OPT__TREEOUTPUT ) ) 1465 1465 { 1466 1466 PrintS("{ \"nodelabel\": \""); writeLatexTerm(syz_2, r); PrintS("\", \"edgelabel\": \""); writeLatexTerm(aa, r, false); PrintS("\" },"); … … 1530 1530 assume( c >= 0 && c < IDELEMS(T) ); 1531 1531 1532 if(UNLIKELY( __TREEOUTPUT__))1532 if(UNLIKELY( OPT__TREEOUTPUT )) 1533 1533 { 1534 1534 PrintS("{ \"nodelabel\": \""); writeLatexTerm(t, r); PrintS("\", \"edgelabel\": \""); writeLatexTerm(spoly, r, false); PrintS("\" },"); … … 1543 1543 } // otherwise discard that leading term altogether! 1544 1544 else 1545 if( UNLIKELY( __PROT__) ) ++ m_stat[4]; // PrintS("$"); // LOT1545 if( UNLIKELY(OPT__PROT) ) ++ m_stat[4]; // PrintS("$"); // LOT 1546 1546 1547 1547 kbTest(bucket); … … 1562 1562 1563 1563 1564 if( UNLIKELY( __TREEOUTPUT__) )1564 if( UNLIKELY(OPT__TREEOUTPUT) ) 1565 1565 { 1566 1566 PrintS("]},"); … … 1568 1568 1569 1569 #ifndef SING_NDEBUG 1570 if( __DEBUG__)1570 if( OPT__DEBUG ) 1571 1571 { 1572 1572 PrintS("SchreyerSyzygyComputation::SchreyerSyzygyNF(syz_lead, poly syz_2) =>>> \n"); … … 1592 1592 { 1593 1593 #ifndef SING_NDEBUG 1594 if( __DEBUG__) { m_div.Verify(); m_checker.Verify(); }1594 if( OPT__DEBUG ) { m_div.Verify(); m_checker.Verify(); } 1595 1595 #endif 1596 1596 … … 1602 1602 p_Test(multiplier, r); 1603 1603 1604 if( UNLIKELY( __NOCACHING__) )1604 if( UNLIKELY(OPT__NOCACHING) ) 1605 1605 return ComputeImage(multiplier, tail); 1606 1606 … … 1623 1623 return (NULL); 1624 1624 1625 if( UNLIKELY( __TREEOUTPUT__) )1625 if( UNLIKELY( OPT__TREEOUTPUT ) ) 1626 1626 { 1627 1627 // PrintS("{ \"nodelabel\": \""); writeLatexTerm(multiplier, r, false); … … 1641 1641 number n = n_Div( pGetCoeff(multiplier), pGetCoeff(itr->first), r); // new number 1642 1642 1643 if( UNLIKELY( __TREEOUTPUT__) )1643 if( UNLIKELY( OPT__TREEOUTPUT ) ) 1644 1644 { 1645 1645 StringSetS(""); … … 1650 1650 } 1651 1651 1652 if( UNLIKELY( __PROT__) ) ++ m_stat[7]; // PrintS("l*"); // lookup & rescale1652 if( UNLIKELY( OPT__PROT ) ) ++ m_stat[7]; // PrintS("l*"); // lookup & rescale 1653 1653 1654 1654 p = p_Mult_nn(p, n, r); // ! 1655 1655 n_Delete(&n, r); 1656 1656 } else 1657 if( UNLIKELY( __PROT__) ) ++ m_stat[6]; // PrintS("l"); // lookup no rescale1658 1659 if( UNLIKELY( __TREEOUTPUT__) )1657 if( UNLIKELY( OPT__PROT ) ) ++ m_stat[6]; // PrintS("l"); // lookup no rescale 1658 1659 if( UNLIKELY(OPT__TREEOUTPUT) ) 1660 1660 { 1661 1661 PrintS("\"noderesult\": \""); writeLatexTerm(p, r, true, false); PrintS("\" },"); … … 1663 1663 1664 1664 #ifndef SING_NDEBUG 1665 if( __DEBUG__) { m_div.Verify(); m_checker.Verify(); }1665 if( OPT__DEBUG ) { m_div.Verify(); m_checker.Verify(); } 1666 1666 #endif 1667 1667 p_Test(multiplier, r); … … 1671 1671 1672 1672 1673 if( UNLIKELY( __TREEOUTPUT__) )1673 if( UNLIKELY(OPT__TREEOUTPUT) ) 1674 1674 { 1675 1675 Print("{ \"proc\": \"TTStore%d\", \"nodelabel\": \"", tail + 1); writeLatexTerm(multiplier, r, false); Print(" \\\\GEN{%d}\", \"children\": [", tail + 1); … … 1680 1680 const poly p = ComputeImage(multiplier, tail); 1681 1681 1682 if( UNLIKELY( __TREEOUTPUT__) )1682 if( UNLIKELY(OPT__TREEOUTPUT) ) 1683 1683 { 1684 1684 PrintS("], \"noderesult\": \""); writeLatexTerm(p, r, true, false); PrintS("\" },"); 1685 1685 } 1686 1686 1687 if( UNLIKELY( __PROT__) ) ++ m_stat[8]; // PrintS("S"); // store1687 if( UNLIKELY(OPT__PROT) ) ++ m_stat[8]; // PrintS("S"); // store 1688 1688 1689 1689 p_Test(multiplier, r); … … 1697 1697 1698 1698 #ifndef SING_NDEBUG 1699 if( __DEBUG__) { m_div.Verify(); m_checker.Verify(); }1699 if( OPT__DEBUG ) { m_div.Verify(); m_checker.Verify(); } 1700 1700 #endif 1701 1701 … … 1705 1705 CCacheCompare o(r); TP2PCache T(o); 1706 1706 1707 if( UNLIKELY( __TREEOUTPUT__) )1707 if( UNLIKELY(OPT__TREEOUTPUT) ) 1708 1708 { 1709 1709 Print("{ \"proc\": \"TTStore%d\", \"nodelabel\": \"", 0); writeLatexTerm(multiplier, r, false); Print(" \\\\GEN{%d}\", \"children\": [", tail + 1); … … 1712 1712 const poly p = ComputeImage(multiplier, tail); 1713 1713 1714 if( UNLIKELY( __TREEOUTPUT__) )1714 if( UNLIKELY(OPT__TREEOUTPUT) ) 1715 1715 { 1716 1716 PrintS("], \"noderesult\": \""); writeLatexTerm(p, r, true, false); PrintS("\" },"); 1717 1717 } 1718 1718 1719 if( UNLIKELY( __PROT__) ) ++ m_stat[8]; // PrintS("S"); // store // %d", tail + 1);1719 if( UNLIKELY( OPT__PROT ) ) ++ m_stat[8]; // PrintS("S"); // store // %d", tail + 1); 1720 1720 1721 1721 T.insert( TP2PCache::value_type(myp_Head(multiplier, (p==NULL), r), p) ); … … 1727 1727 1728 1728 #ifndef SING_NDEBUG 1729 if( __DEBUG__) { m_div.Verify(); m_checker.Verify(); }1729 if( OPT__DEBUG ) { m_div.Verify(); m_checker.Verify(); } 1730 1730 #endif 1731 1731 … … 1746 1746 if(t != NULL) 1747 1747 { 1748 if( UNLIKELY( __TREEOUTPUT__) )1748 if( UNLIKELY(OPT__TREEOUTPUT) ) 1749 1749 { 1750 1750 PrintS("{ \"proc\": \"ComputeImage\", \"nodelabel\": \""); … … 1759 1759 p_Test(multiplier, r); 1760 1760 1761 if( UNLIKELY( __TREEOUTPUT__) )1761 if( UNLIKELY(OPT__TREEOUTPUT) ) 1762 1762 { 1763 1763 PrintS("], \"noderesult\": \""); writeLatexTerm(p, r, true, false); PrintS("\" },"); … … 1774 1774 poly SchreyerSyzygyComputation::TraverseTail(poly multiplier, poly tail) const 1775 1775 { 1776 assume( ! __IGNORETAILS__);1776 assume( !OPT__IGNORETAILS ); 1777 1777 1778 1778 const ideal& L = m_idLeads; … … 1788 1788 1789 1789 #ifndef SING_NDEBUG 1790 if( __DEBUG__) { m_div.Verify(); m_checker.Verify(); }1791 #endif 1792 1793 if( UNLIKELY( !( (! __TAILREDSYZ__) || m_lcm.Check(multiplier) )) )1794 { 1795 if( UNLIKELY( __TAILREDSYZ__ && __PROT__) ) ++ m_stat[5]; // PrintS("%"); // check LCM !1790 if( OPT__DEBUG ) { m_div.Verify(); m_checker.Verify(); } 1791 #endif 1792 1793 if( UNLIKELY( !( (!OPT__TAILREDSYZ) || m_lcm.Check(multiplier) )) ) 1794 { 1795 if( UNLIKELY(OPT__TAILREDSYZ && OPT__PROT) ) ++ m_stat[5]; // PrintS("%"); // check LCM ! 1796 1796 1797 1797 return NULL; … … 1827 1827 // poly s = NULL; 1828 1828 1829 if( UNLIKELY( __TREEOUTPUT__& 0 ) )1829 if( UNLIKELY( OPT__TREEOUTPUT & 0 ) ) 1830 1830 { 1831 1831 Print("{ \"proc\": \"TTPoly\", \"nodelabel\": \""); writeLatexTerm(multiplier, r, false); Print(" * \\\\ldots \", \"children\": ["); … … 1864 1864 1865 1865 #ifndef SING_NDEBUG 1866 if( __DEBUG__) { m_div.Verify(); m_checker.Verify(); }1867 #endif 1868 1869 if( UNLIKELY( __TREEOUTPUT__& 0 ) )1866 if( OPT__DEBUG ) { m_div.Verify(); m_checker.Verify(); } 1867 #endif 1868 1869 if( UNLIKELY( OPT__TREEOUTPUT & 0 ) ) 1870 1870 { 1871 1871 PrintS("], \"noderesult\": \""); writeLatexTerm(s, r, true, false); PrintS("\" },"); … … 1883 1883 { 1884 1884 #ifndef SING_NDEBUG 1885 if( __DEBUG__) { m_div.Verify(); m_checker.Verify(); }1886 #endif 1887 1888 assume( ! __IGNORETAILS__);1885 if( OPT__DEBUG ) { m_div.Verify(); m_checker.Verify(); } 1886 #endif 1887 1888 assume( !OPT__IGNORETAILS ); 1889 1889 1890 1890 const ideal& L = m_idLeads; … … 1904 1904 poly s = NULL; 1905 1905 1906 if( (! __TAILREDSYZ__) || m_lcm.Check(multiplier) ) // TODO: UNLIKELY / LIKELY ????1906 if( (!OPT__TAILREDSYZ) || m_lcm.Check(multiplier) ) // TODO: UNLIKELY / LIKELY ???? 1907 1907 { 1908 1908 #if NOPRODUCT … … 1914 1914 if( s == NULL ) // No Reducer? 1915 1915 { 1916 if( UNLIKELY( __PROT__) ) ++ m_stat[4]; // PrintS("$"); // LOT1916 if( UNLIKELY(OPT__PROT) ) ++ m_stat[4]; // PrintS("$"); // LOT 1917 1917 return NULL; 1918 1918 } 1919 1919 1920 if( UNLIKELY( __TREEOUTPUT__) )1920 if( UNLIKELY( OPT__TREEOUTPUT ) ) 1921 1921 { 1922 1922 poly product = pp_Mult_mm(multiplier, term4reduction, r); … … 1937 1937 if( s == NULL ) // No Reducer? 1938 1938 { 1939 if( UNLIKELY( __PROT__) ) ++ m_stat[4]; // PrintS("$"); // LOT1939 if( UNLIKELY(OPT__PROT) ) ++ m_stat[4]; // PrintS("$"); // LOT 1940 1940 return NULL; 1941 1941 } 1942 1942 1943 if( UNLIKELY( __TREEOUTPUT__) )1943 if( UNLIKELY(OPT__TREEOUTPUT) ) 1944 1944 { 1945 1945 PrintS("{ \"proc\": \"RdTrmP\", \"nodelabel\": \""); writeLatexTerm(s, r); PrintS("\", \"edgelabel\": \""); writeLatexTerm(product, r, false); … … 1951 1951 1952 1952 #ifndef SING_NDEBUG 1953 if( __DEBUG__) { m_div.Verify(); m_checker.Verify(); }1953 if( OPT__DEBUG ) { m_div.Verify(); m_checker.Verify(); } 1954 1954 #endif 1955 1955 1956 1956 if( s == NULL ) // No Reducer? 1957 1957 { 1958 if( UNLIKELY( __TAILREDSYZ__ && __PROT__) ) ++ m_stat[5]; // PrintS("%"); // check LCM !1958 if( UNLIKELY(OPT__TAILREDSYZ && OPT__PROT) ) ++ m_stat[5]; // PrintS("%"); // check LCM ! 1959 1959 return NULL; 1960 1960 } … … 1971 1971 1972 1972 1973 if( UNLIKELY( __TREEOUTPUT__) )1973 if( UNLIKELY( OPT__TREEOUTPUT ) ) 1974 1974 PrintS("\", \"children\": ["); 1975 1975 1976 1976 const poly t = TraverseTail(b, c); // T->m[c]; 1977 1977 1978 if( UNLIKELY( __TREEOUTPUT__) )1978 if( UNLIKELY( OPT__TREEOUTPUT ) ) 1979 1979 { 1980 1980 … … 1999 1999 2000 2000 #ifndef SING_NDEBUG 2001 if( __DEBUG__) { m_div.Verify(); m_checker.Verify(); }2001 if( OPT__DEBUG ) { m_div.Verify(); m_checker.Verify(); } 2002 2002 #endif 2003 2003 … … 2008 2008 2009 2009 SchreyerSyzygyComputationFlags::SchreyerSyzygyComputationFlags(idhdl rootRingHdl): 2010 __DEBUG__( atGetInt(rootRingHdl,"DEBUG", 0) ),2011 __LEAD2SYZ__( atGetInt(rootRingHdl, "LEAD2SYZ", 0) ),2012 __TAILREDSYZ__( atGetInt(rootRingHdl, "TAILREDSYZ", 1) ),2013 __HYBRIDNF__( atGetInt(rootRingHdl, "HYBRIDNF", 0) ),2014 __IGNORETAILS__( atGetInt(rootRingHdl, "IGNORETAILS", 0) ),2015 __SYZNUMBER__( atGetInt(rootRingHdl, "SYZNUMBER", 0) ),2016 __TREEOUTPUT__( atGetInt(rootRingHdl, "TREEOUTPUT", 0) ),2017 __SYZCHECK__( atGetInt(rootRingHdl, "SYZCHECK", 0) ),2018 __NOCACHING__( atGetInt(rootRingHdl, "NOCACHING", 0) ),2019 __PROT__(TEST_OPT_PROT),2010 OPT__DEBUG( atGetInt(rootRingHdl,"DEBUG", 0) ), 2011 OPT__LEAD2SYZ( atGetInt(rootRingHdl, "LEAD2SYZ", 0) ), 2012 OPT__TAILREDSYZ( atGetInt(rootRingHdl, "TAILREDSYZ", 1) ), 2013 OPT__HYBRIDNF( atGetInt(rootRingHdl, "HYBRIDNF", 0) ), 2014 OPT__IGNORETAILS( atGetInt(rootRingHdl, "IGNORETAILS", 0) ), 2015 OPT__SYZNUMBER( atGetInt(rootRingHdl, "SYZNUMBER", 0) ), 2016 OPT__TREEOUTPUT( atGetInt(rootRingHdl, "TREEOUTPUT", 0) ), 2017 OPT__SYZCHECK( atGetInt(rootRingHdl, "SYZCHECK", 0) ), 2018 OPT__NOCACHING( atGetInt(rootRingHdl, "NOCACHING", 0) ), 2019 OPT__PROT(TEST_OPT_PROT), 2020 2020 m_rBaseRing( rootRingHdl->data.uring ) 2021 2021 { 2022 2022 #ifndef SING_NDEBUG 2023 if( __DEBUG__& 0 )2023 if( OPT__DEBUG & 0 ) 2024 2024 { 2025 2025 PrintS("SchreyerSyzygyComputationFlags: \n"); 2026 Print(" DEBUG: \t%d\n", __DEBUG__);2027 // Print(" SYZCHECK : \t%d\n", __SYZCHECK__);2028 Print(" LEAD2SYZ: \t%d\n", __LEAD2SYZ__);2029 Print(" TAILREDSYZ: \t%d\n", __TAILREDSYZ__);2030 Print(" IGNORETAILS: \t%d\n", __IGNORETAILS__);2031 Print(" TREEOUTPUT: \t%d\n", __TREEOUTPUT__);2032 Print(" SYZCHECK: \t%d\n", __SYZCHECK__);2026 Print(" DEBUG: \t%d\n", OPT__DEBUG); 2027 // Print(" SYZCHECK : \t%d\n", OPT__SYZCHECK); 2028 Print(" LEAD2SYZ: \t%d\n", OPT__LEAD2SYZ); 2029 Print(" TAILREDSYZ: \t%d\n", OPT__TAILREDSYZ); 2030 Print(" IGNORETAILS: \t%d\n", OPT__IGNORETAILS); 2031 Print(" TREEOUTPUT: \t%d\n", OPT__TREEOUTPUT); 2032 Print(" SYZCHECK: \t%d\n", OPT__SYZCHECK); 2033 2033 } 2034 2034 #endif … … 2272 2272 // assume ( !n_IsZero( p_GetCoeff(product, m_rBaseRing), m_rBaseRing ) ); 2273 2273 #ifndef SING_NDEBUG 2274 if( __DEBUG__) m_reds.Verify();2274 if( OPT__DEBUG ) m_reds.Verify(); 2275 2275 #endif 2276 2276 } … … 2322 2322 { 2323 2323 #ifndef SING_NDEBUG 2324 if( __DEBUG__)2324 if( OPT__DEBUG ) 2325 2325 { 2326 2326 Print("CDivisorEnumerator::MoveNext::est LS: q is divisible by LS[%d] !:((, diviser is: ", 1 + Current().label()); … … 2348 2348 { 2349 2349 #ifndef SING_NDEBUG 2350 if( __DEBUG__) Verify();2350 if( OPT__DEBUG ) Verify(); 2351 2351 #endif 2352 2352 … … 2385 2385 if( (*vit)->DivisibilityCheck(product, not_sev, r) ) 2386 2386 { 2387 if( __DEBUG__)2387 if( OPT__DEBUG ) 2388 2388 { 2389 2389 Print("_FindReducer::Test LS: q is divisible by LS[%d] !:((, diviser is: ", 1 + (*vit)->label()); … … 2503 2503 // assume( p_GetComp(m_multiplier, m_rBaseRing) == 0 ); 2504 2504 #ifndef SING_NDEBUG 2505 if( __DEBUG__) m_reds.Verify();2505 if( OPT__DEBUG ) m_reds.Verify(); 2506 2506 #endif 2507 2507 } … … 2553 2553 { 2554 2554 #ifndef SING_NDEBUG 2555 if( __DEBUG__)2555 if( OPT__DEBUG ) 2556 2556 { 2557 2557 Print("CDivisorEnumerator::MoveNext::est LS: q is divisible by LS[%d] !:((, diviser is: ", 1 + Current().label()); … … 2582 2582 2583 2583 #ifndef SING_NDEBUG 2584 if( __DEBUG__) { Verify(); syz_checker.Verify(); }2584 if( OPT__DEBUG ) { Verify(); syz_checker.Verify(); } 2585 2585 #endif 2586 2586 … … 2607 2607 p_Test(multiplier, r); 2608 2608 2609 if (UNLIKELY( __DEBUG__&& (syzterm != NULL) ))2609 if (UNLIKELY( OPT__DEBUG && (syzterm != NULL) )) 2610 2610 { 2611 2611 const poly m = L->m[c]; assume( m != NULL ); assume( pNext(m) == NULL ); … … 2623 2623 2624 2624 #ifndef SING_NDEBUG 2625 if( __DEBUG__) { Verify(); syz_checker.Verify(); }2625 if( OPT__DEBUG ) { Verify(); syz_checker.Verify(); } 2626 2626 #endif 2627 2627 2628 const BOOLEAN to_check = (syz_checker.IsNonempty()); // __TAILREDSYZ__&&2628 const BOOLEAN to_check = (syz_checker.IsNonempty()); // OPT__TAILREDSYZ && 2629 2629 2630 2630 // const poly q = p_One(r); 2631 2631 const poly q = p_New(r); pNext(q) = NULL; 2632 2632 2633 if( UNLIKELY( __DEBUG__) )2633 if( UNLIKELY(OPT__DEBUG) ) 2634 2634 p_SetCoeff0(q, 0, r); // for printing q 2635 2635 … … 2657 2657 { 2658 2658 #ifndef SING_NDEBUG 2659 if( __DEBUG__)2659 if( OPT__DEBUG ) 2660 2660 { 2661 2661 Print("_FindReducer::Test SYZTERM: q == syzterm !:((, syzterm is: "); … … 2671 2671 { 2672 2672 #ifndef SING_NDEBUG 2673 if( __DEBUG__)2673 if( OPT__DEBUG ) 2674 2674 { 2675 2675 PrintS("_FindReducer::Test LS: q is divisible by LS[?] !:((: "); … … 2694 2694 2695 2695 #ifndef SING_NDEBUG 2696 if( __DEBUG__) { Verify(); syz_checker.Verify(); }2696 if( OPT__DEBUG ) { Verify(); syz_checker.Verify(); } 2697 2697 #endif 2698 2698 p_Test(multiplier, r); … … 2760 2760 if (p_ExpVectorEqual(syzterm, q, r)) 2761 2761 { 2762 if( __DEBUG__)2762 if( OPT__DEBUG ) 2763 2763 { 2764 2764 Print("_FindReducer::Test SYZTERM: q == syzterm !:((, syzterm is: "); … … 2772 2772 if( to_check && syz_checker.IsDivisible(q) ) 2773 2773 { 2774 if( __DEBUG__)2774 if( OPT__DEBUG ) 2775 2775 { 2776 2776 PrintS("_FindReducer::Test LS: q is divisible by LS[?] !:((: "); … … 2791 2791 2792 2792 #ifndef SING_NDEBUG 2793 if( __DEBUG__) { Verify(); syz_checker.Verify(); }2793 if( OPT__DEBUG ) { Verify(); syz_checker.Verify(); } 2794 2794 #endif 2795 2795 … … 2806 2806 2807 2807 #ifndef SING_NDEBUG 2808 if( __DEBUG__) { Verify(); syz_checker.Verify(); }2808 if( OPT__DEBUG ) { Verify(); syz_checker.Verify(); } 2809 2809 #endif 2810 2810 … … 2828 2828 assume( c >= 0 && c < IDELEMS(L) ); 2829 2829 2830 if (UNLIKELY( __DEBUG__&& (syzterm != NULL) ))2830 if (UNLIKELY( OPT__DEBUG && (syzterm != NULL) )) 2831 2831 { 2832 2832 const poly m = L->m[c]; … … 2844 2844 2845 2845 #ifndef SING_NDEBUG 2846 if( __DEBUG__) { Verify(); syz_checker.Verify(); }2847 #endif 2848 2849 const BOOLEAN to_check = (syz_checker.IsNonempty()); // __TAILREDSYZ__&&2846 if( OPT__DEBUG ) { Verify(); syz_checker.Verify(); } 2847 #endif 2848 2849 const BOOLEAN to_check = (syz_checker.IsNonempty()); // OPT__TAILREDSYZ && 2850 2850 2851 2851 const poly q = p_New(r); pNext(q) = NULL; 2852 2852 2853 if( UNLIKELY( __DEBUG__) )2853 if( UNLIKELY(OPT__DEBUG) ) 2854 2854 p_SetCoeff0(q, 0, r); // ONLY for printing q 2855 2855 … … 2870 2870 { 2871 2871 #ifndef SING_NDEBUG 2872 if( __DEBUG__)2872 if( OPT__DEBUG ) 2873 2873 { 2874 2874 Print("_FindReducer::Test SYZTERM: q == syzterm !:((, syzterm is: "); … … 2884 2884 { 2885 2885 #ifndef SING_NDEBUG 2886 if( __DEBUG__)2886 if( OPT__DEBUG ) 2887 2887 { 2888 2888 PrintS("_FindReducer::Test LS: q is divisible by LS[?] !:((: "); … … 2904 2904 2905 2905 #ifndef SING_NDEBUG 2906 if( __DEBUG__) { Verify(); syz_checker.Verify(); }2906 if( OPT__DEBUG ) { Verify(); syz_checker.Verify(); } 2907 2907 #endif 2908 2908 … … 2937 2937 const TReducers& reducers = it->second; 2938 2938 2939 const BOOLEAN to_check = (syz_checker.IsNonempty()); // __TAILREDSYZ__&&2939 const BOOLEAN to_check = (syz_checker.IsNonempty()); // OPT__TAILREDSYZ && 2940 2940 2941 2941 const poly q = p_New(r); pNext(q) = NULL; 2942 2942 2943 if( __DEBUG__)2943 if( OPT__DEBUG ) 2944 2944 p_SetCoeff0(q, 0, r); // for printing q 2945 2945 … … 2973 2973 if (p_ExpVectorEqual(syzterm, q, r)) 2974 2974 { 2975 if( __DEBUG__)2975 if( OPT__DEBUG ) 2976 2976 { 2977 2977 Print("_FindReducer::Test SYZTERM: q == syzterm !:((, syzterm is: "); … … 2985 2985 if( to_check && syz_checker.IsDivisible(q) ) 2986 2986 { 2987 if( __DEBUG__)2987 if( OPT__DEBUG ) 2988 2988 { 2989 2989 PrintS("_FindReducer::Test LS: q is divisible by LS[?] !:((: "); … … 3001 3001 3002 3002 #ifndef SING_NDEBUG 3003 if( __DEBUG__) { Verify(); syz_checker.Verify(); }3003 if( OPT__DEBUG ) { Verify(); syz_checker.Verify(); } 3004 3004 #endif 3005 3005 … … 3019 3019 assume( L != NULL ); 3020 3020 3021 if( LIKELY( __TAILREDSYZ__ && !__HYBRIDNF__&& (L != NULL) )) // TODO: not hybrid!?3021 if( LIKELY( OPT__TAILREDSYZ && !OPT__HYBRIDNF && (L != NULL) )) // TODO: not hybrid!? 3022 3022 { 3023 3023 const int l = IDELEMS(L); … … 3048 3048 const ring& R = m_rBaseRing; 3049 3049 3050 assume( __TAILREDSYZ__ && !__HYBRIDNF__);3050 assume( OPT__TAILREDSYZ && !OPT__HYBRIDNF ); 3051 3051 3052 3052 for (unsigned int j = m_N; j > 0; j--) -
Singular/dyn_modules/syzextra/syzextra.h
r10478c r73ba50 192 192 193 193 SchreyerSyzygyComputationFlags(const SchreyerSyzygyComputationFlags& attr): 194 __DEBUG__(attr.__DEBUG__),195 __LEAD2SYZ__(attr.__LEAD2SYZ__), __TAILREDSYZ__(attr.__TAILREDSYZ__),196 __HYBRIDNF__(attr.__HYBRIDNF__), __IGNORETAILS__(attr.__IGNORETAILS__),197 __SYZNUMBER__(attr.__SYZNUMBER__), __TREEOUTPUT__(attr.__TREEOUTPUT__),198 __SYZCHECK__(attr.__SYZCHECK__), __PROT__(attr.__PROT__),199 __NOCACHING__(attr.__NOCACHING__),194 OPT__DEBUG(attr.OPT__DEBUG), 195 OPT__LEAD2SYZ(attr.OPT__LEAD2SYZ), OPT__TAILREDSYZ(attr.OPT__TAILREDSYZ), 196 OPT__HYBRIDNF(attr.OPT__HYBRIDNF), OPT__IGNORETAILS(attr.OPT__IGNORETAILS), 197 OPT__SYZNUMBER(attr.OPT__SYZNUMBER), OPT__TREEOUTPUT(attr.OPT__TREEOUTPUT), 198 OPT__SYZCHECK(attr.OPT__SYZCHECK), OPT__PROT(attr.OPT__PROT), 199 OPT__NOCACHING(attr.OPT__NOCACHING), 200 200 m_rBaseRing(attr.m_rBaseRing) 201 201 {} 202 202 203 203 /// output all the intermediate states 204 const int __DEBUG__; // DebugOutput;204 const int OPT__DEBUG; // DebugOutput; 205 205 206 206 /// ? 207 const int __LEAD2SYZ__; // TwoLeadingSyzygyTerms;207 const int OPT__LEAD2SYZ; // TwoLeadingSyzygyTerms; 208 208 209 209 /// Reduce syzygy tails wrt the leading syzygy terms 210 const int __TAILREDSYZ__; // TailReducedSyzygies;210 const int OPT__TAILREDSYZ; // TailReducedSyzygies; 211 211 212 212 /// Use the usual NF's S-poly reduction while dropping lower order terms 213 213 /// 2 means - smart selection! 214 const int __HYBRIDNF__; // UseHybridNF214 const int OPT__HYBRIDNF; // UseHybridNF 215 215 216 216 217 217 /// ignore tails and compute the pure Schreyer frame 218 const int __IGNORETAILS__; // @IGNORETAILS218 const int OPT__IGNORETAILS; // @IGNORETAILS 219 219 220 220 /// Syzygy level (within a resolution) 221 mutable int __SYZNUMBER__;221 mutable int OPT__SYZNUMBER; 222 222 223 223 inline void nextSyzygyLayer() const 224 224 { 225 __SYZNUMBER__++;225 OPT__SYZNUMBER++; 226 226 } 227 227 228 228 /// output lifting tree 229 const int __TREEOUTPUT__;229 const int OPT__TREEOUTPUT; 230 230 231 231 /// CheckSyzygyProperty: TODO 232 const int __SYZCHECK__;232 const int OPT__SYZCHECK; 233 233 234 234 /// TEST_OPT_PROT 235 const bool __PROT__;235 const bool OPT__PROT; 236 236 237 237 /// no caching/stores/lookups 238 const int __NOCACHING__;238 const int OPT__NOCACHING; 239 239 240 240 /// global base ring … … 411 411 m_spoly_bucket(NULL) 412 412 { 413 if( UNLIKELY( __PROT__) ) memset( &m_stat, 0, sizeof(m_stat) );413 if( UNLIKELY(OPT__PROT) ) memset( &m_stat, 0, sizeof(m_stat) ); 414 414 } 415 415 … … 424 424 m_spoly_bucket(NULL) 425 425 { 426 if( UNLIKELY( __PROT__) ) memset( &m_stat, 0, sizeof(m_stat) );426 if( UNLIKELY(OPT__PROT) ) memset( &m_stat, 0, sizeof(m_stat) ); 427 427 428 if( LIKELY( __TAILREDSYZ__ && !__IGNORETAILS__) )428 if( LIKELY(OPT__TAILREDSYZ && !OPT__IGNORETAILS) ) 429 429 { 430 430 if (syzLeads != NULL) … … 453 453 m_syzLeads = m_syzTails = NULL; // m_LS ? 454 454 455 if ( UNLIKELY( __PROT__) )455 if ( UNLIKELY(OPT__PROT) ) 456 456 PrintStats(); 457 457 }
Note: See TracChangeset
for help on using the changeset viewer.