Changeset 4eba3ad in git for dyn_modules/syzextra/mod_main.cc
- Timestamp:
- Apr 28, 2014, 8:49:00 PM (9 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- c7d29b194535c9015230fc587b2ae178c075ef3e
- Parents:
- 92992c08c2f387188f53d5f874a342fb60dccc06
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-04-28 20:49:00+02:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-05-07 04:41:46+02:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dyn_modules/syzextra/mod_main.cc
r92992c r4eba3ad 506 506 507 507 508 508 509 static BOOLEAN _ComputeLeadingSyzygyTerms(leftv res, leftv h) 509 510 { 511 const SchreyerSyzygyComputationFlags attributes(currRingHdl); 512 513 const BOOLEAN __DEBUG__ = attributes.__DEBUG__; 514 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; 515 const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__; 516 // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; 517 // const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; 518 510 519 const ring r = currRing; 511 520 NoReturn(res); … … 518 527 519 528 assume( h != NULL ); 520 521 #ifndef NDEBUG522 const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)TRUE)));523 #else524 const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)FALSE)));525 #endif526 529 527 530 if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD) … … 533 536 if( __DEBUG__ ) 534 537 { 535 PrintS("ComputeLeadingSyzygyTerms::Input: \n"); 536 537 const BOOLEAN __LEAD2SYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"LEAD2SYZ",INT_CMD, (void*)0))); 538 const BOOLEAN __TAILREDSYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"TAILREDSYZ",INT_CMD, (void*)0))); 539 const BOOLEAN __SYZCHECK__ = (BOOLEAN)((long)(atGet(currRingHdl,"SYZCHECK",INT_CMD, (void*)0))); 540 541 542 Print("\nSYZCHECK: \t%d", __SYZCHECK__); 543 Print(", DEBUG: \t%d", __DEBUG__); 544 Print(", LEAD2SYZ: \t%d", __LEAD2SYZ__); 545 Print(", TAILREDSYZ: \t%d\n", __TAILREDSYZ__); 546 538 PrintS("ComputeLeadingSyzygyTerms::Input: \n"); 547 539 dPrint(id, r, r, 1); 548 549 assume( !__LEAD2SYZ__ );550 540 } 541 542 assume( !__LEAD2SYZ__ ); 551 543 552 544 h = h->Next(); assume (h == NULL); 553 545 554 const ideal newid = ComputeLeadingSyzygyTerms(id, r );546 const ideal newid = ComputeLeadingSyzygyTerms(id, r, attributes); 555 547 556 548 res->data = newid; res->rtyp = MODUL_CMD; … … 567 559 static BOOLEAN _Sort_c_ds(leftv res, leftv h) 568 560 { 561 const SchreyerSyzygyComputationFlags attributes(currRingHdl); 562 563 const BOOLEAN __DEBUG__ = attributes.__DEBUG__; 564 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; 565 // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__; 566 // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; 567 // const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; 568 569 569 NoReturn(res); 570 570 … … 579 579 580 580 assume( h != NULL ); 581 582 #ifndef NDEBUG583 const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)FALSE)));584 #else585 const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)FALSE)));586 #endif587 581 588 582 if( (h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD) … … 598 592 { 599 593 PrintS("Sort_c_ds::Input: \n"); 600 601 const BOOLEAN __LEAD2SYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"LEAD2SYZ",INT_CMD, (void*)0)));602 const BOOLEAN __TAILREDSYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"TAILREDSYZ",INT_CMD, (void*)0)));603 const BOOLEAN __SYZCHECK__ = (BOOLEAN)((long)(atGet(currRingHdl,"SYZCHECK",INT_CMD, (void*)0)));604 605 Print("\nSYZCHECK: \t%d", __SYZCHECK__);606 Print(", DEBUG: \t%d", __DEBUG__);607 Print(", LEAD2SYZ: \t%d", __LEAD2SYZ__);608 Print(", TAILREDSYZ: \t%d\n", __TAILREDSYZ__);609 610 594 dPrint(id, r, r, 1); 611 595 } … … 637 621 static BOOLEAN _Compute2LeadingSyzygyTerms(leftv res, leftv h) 638 622 { 623 const SchreyerSyzygyComputationFlags attributes(currRingHdl); 624 625 const BOOLEAN __DEBUG__ = attributes.__DEBUG__; 626 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; 627 const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__; 628 // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; 629 // const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; 630 639 631 const ring r = currRing; 640 632 NoReturn(res); … … 648 640 assume( h != NULL ); 649 641 650 #ifndef NDEBUG 651 const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)TRUE))); 652 #else 653 const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)FALSE))); 654 #endif 655 656 const BOOLEAN __LEAD2SYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"LEAD2SYZ",INT_CMD, (void*)0))); 657 658 assume( __LEAD2SYZ__ ); 642 assume( __LEAD2SYZ__ ); // ??? 659 643 660 644 if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD) … … 672 656 h = h->Next(); assume (h == NULL); 673 657 674 res->data = Compute2LeadingSyzygyTerms(id, r );658 res->data = Compute2LeadingSyzygyTerms(id, r, attributes); 675 659 res->rtyp = MODUL_CMD; 676 660 … … 687 671 static BOOLEAN _FindReducer(leftv res, leftv h) 688 672 { 673 const SchreyerSyzygyComputationFlags attributes(currRingHdl); 674 675 const BOOLEAN __DEBUG__ = attributes.__DEBUG__; 676 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; 677 // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__; 678 // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; 679 const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; 680 689 681 const char* usage = "`FindReducer(<poly/vector>, <vector/0>, <ideal/module>[,<module>])` expected"; 690 682 const ring r = currRing; … … 692 684 NoReturn(res); 693 685 694 695 #ifndef NDEBUG696 const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)TRUE)));697 #else698 const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)FALSE)));699 #endif700 701 const BOOLEAN __TAILREDSYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"TAILREDSYZ",INT_CMD, (void*)0)));702 686 703 687 if ((h==NULL) || (h->Typ()!=VECTOR_CMD && h->Typ() !=POLY_CMD) || (h->Data() == NULL)) … … 766 750 767 751 res->rtyp = VECTOR_CMD; 768 res->data = FindReducer(product, syzterm, L, LS, r );752 res->data = FindReducer(product, syzterm, L, LS, r, attributes); 769 753 770 754 if( __DEBUG__ ) … … 781 765 static BOOLEAN _SchreyerSyzygyNF(leftv res, leftv h) 782 766 { 767 const SchreyerSyzygyComputationFlags attributes(currRingHdl); 768 769 const BOOLEAN __DEBUG__ = attributes.__DEBUG__; 770 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; 771 // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__; 772 const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; 773 const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; 774 783 775 const char* usage = "`SchreyerSyzygyNF(<vector>, <vector>, <ideal/module>, <ideal/module>[,<module>])` expected"; 784 776 const ring r = currRing; … … 786 778 NoReturn(res); 787 779 788 #ifndef NDEBUG 789 const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)TRUE))); 790 #else 791 const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)FALSE))); 792 #endif 793 794 const BOOLEAN __TAILREDSYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"TAILREDSYZ",INT_CMD, (void*)0))); 795 // const BOOLEAN __LEAD2SYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"LEAD2SYZ",INT_CMD, (void*)0))); 796 const BOOLEAN __SYZCHECK__ = (BOOLEAN)((long)(atGet(currRingHdl,"SYZCHECK",INT_CMD, (void*)0))); 797 798 const BOOLEAN __HYBRIDNF__ = (BOOLEAN)((long)(atGet(currRingHdl,"HYBRIDNF",INT_CMD, (void*)0))); 799 800 assume( __HYBRIDNF__ ); 780 assume( __HYBRIDNF__ ); // ??? 801 781 802 782 if ((h==NULL) || (h->Typ() != VECTOR_CMD) || (h->Data() == NULL)) … … 872 852 873 853 res->rtyp = VECTOR_CMD; 874 res->data = SchreyerSyzygyNF(syz_lead, syz_2, L, T, LS, r );854 res->data = SchreyerSyzygyNF(syz_lead, syz_2, L, T, LS, r, attributes); 875 855 876 856 if( __DEBUG__ ) … … 890 870 static BOOLEAN _ReduceTerm(leftv res, leftv h) 891 871 { 872 const SchreyerSyzygyComputationFlags attributes(currRingHdl); 873 874 const BOOLEAN __DEBUG__ = attributes.__DEBUG__; 875 const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; 876 // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__; 877 // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; 878 const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; 879 892 880 const char* usage = "`ReduceTerm(<poly>, <poly/vector>, <vector/0>, <ideal/module>, <ideal/module>[,<module>])` expected"; 893 881 const ring r = currRing; 894 882 895 883 NoReturn(res); 896 897 #ifndef NDEBUG898 const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)TRUE)));899 #else900 const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)FALSE)));901 #endif902 903 const BOOLEAN __TAILREDSYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"TAILREDSYZ",INT_CMD, (void*)0)));904 // const BOOLEAN __LEAD2SYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"LEAD2SYZ",INT_CMD, (void*)0)));905 const BOOLEAN __SYZCHECK__ = (BOOLEAN)((long)(atGet(currRingHdl,"SYZCHECK",INT_CMD, (void*)0)));906 884 907 885 if ((h==NULL) || (h->Typ() !=POLY_CMD) || (h->Data() == NULL)) … … 1014 992 1015 993 res->rtyp = VECTOR_CMD; 1016 res->data = ReduceTerm(multiplier, term4reduction, syztermCheck, L, T, LS, r );994 res->data = ReduceTerm(multiplier, term4reduction, syztermCheck, L, T, LS, r, attributes); 1017 995 1018 996 … … 1034 1012 static BOOLEAN _TraverseTail(leftv res, leftv h) 1035 1013 { 1014 const SchreyerSyzygyComputationFlags attributes(currRingHdl); 1015 1016 const BOOLEAN __DEBUG__ = attributes.__DEBUG__; 1017 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; 1018 // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__; 1019 // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; 1020 const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; 1021 1036 1022 const char* usage = "`TraverseTail(<poly>, <poly/vector>, <ideal/module>, <ideal/module>[,<module>])` expected"; 1037 1023 const ring r = currRing; 1038 1024 1039 1025 NoReturn(res); 1040 1041 #ifndef NDEBUG1042 const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)TRUE)));1043 #else1044 const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)FALSE)));1045 #endif1046 1047 const BOOLEAN __TAILREDSYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"TAILREDSYZ",INT_CMD, (void*)1)));1048 1026 1049 1027 if ((h==NULL) || (h->Typ() !=POLY_CMD) || (h->Data() == NULL)) … … 1121 1099 1122 1100 res->rtyp = VECTOR_CMD; 1123 res->data = TraverseTail(multiplier, tail, L, T, LS, r );1101 res->data = TraverseTail(multiplier, tail, L, T, LS, r, attributes); 1124 1102 1125 1103 … … 1139 1117 static BOOLEAN _ComputeSyzygy(leftv res, leftv h) 1140 1118 { 1119 const SchreyerSyzygyComputationFlags attributes(currRingHdl); 1120 1121 const BOOLEAN __DEBUG__ = attributes.__DEBUG__; 1122 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; 1123 // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__; 1124 // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; 1125 // const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; 1126 1141 1127 const char* usage = "`ComputeSyzygy(<ideal/module>, <ideal/module>])` expected"; 1142 1128 const ring r = currRing; … … 1144 1130 NoReturn(res); 1145 1131 1146 #ifndef NDEBUG1147 const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)TRUE)));1148 #else1149 const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)FALSE)));1150 #endif1151 1152 1132 if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) 1153 1133 { … … 1183 1163 ideal LL, TT; 1184 1164 1185 ComputeSyzygy(L, T, LL, TT, r );1165 ComputeSyzygy(L, T, LL, TT, r, attributes); 1186 1166 1187 1167 lists l = (lists)omAllocBin(slists_bin); l->Init(2);
Note: See TracChangeset
for help on using the changeset viewer.