Changeset f6c459 in git
- Timestamp:
- May 5, 2014, 5:52:53 PM (10 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- fe35f2639131fac3e627cc45a86e0395522c0853
- Parents:
- d353e4f49eb4e1747ded689e6bdea5765a057c75
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-05-05 17:52:53+02:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-05-07 04:41:44+02:00
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/schreyer.lib
rd353e4f rf6c459 486 486 /* static */ 487 487 proc MySort(def M) 488 " 489 Sorts the given ideal or module wrt >_{(c, ds)} (.<.<.<.<) 490 NOTE: inplace?? 491 " 488 492 { 489 493 if( typeof( attrib(basering, "DEBUG") ) == "int" ) … … 500 504 } else 501 505 { 502 int @KERCHECK = @DEBUG; // TODO: @SYZCHECK:(506 int @KERCHECK = @DEBUG; 503 507 } 504 508 … … 550 554 551 555 552 /* static */proc SSinit(def M)556 static proc SSinit(def M) 553 557 { 554 558 if( (typeof(M) != "module") && (typeof(M) != "ideal") ) … … 574 578 } 575 579 576 int @KERCHECK = @ SYZCHECK;580 int @KERCHECK = @DEBUG; 577 581 578 582 if( typeof( attrib(SSinit, "KERCHECK") ) == "int" ) … … 608 612 def LEAD = lead(@N); 609 613 610 if( @ SYZCHECK )614 if( @KERCHECK ) 611 615 { 612 616 def @LEAD = lead(M); … … 618 622 @LEAD = @LEAD[iv_ds]; 619 623 620 // 0^th syz. property621 624 if( size(module( matrix(@N) - matrix(M) )) > 0 ) 622 625 { … … 631 634 } 632 635 633 // 0^th syz. property634 636 if( size(module( matrix(@LEAD) - matrix(LEAD) )) > 0 ) 635 637 { … … 647 649 648 650 M = @N; 649 650 651 652 651 653 652 def TAIL = Tail(M); … … 829 828 } else 830 829 { 831 int @KERCHECK = @ SYZCHECK;830 int @KERCHECK = @DEBUG; 832 831 } 833 832 … … 892 891 "ERROR: SSComputeLeadingSyzygyTerms: S != SS "; 893 892 894 "basering: "; 895 DetailedPrint(basering);893 "basering: "; basering; 894 // DetailedPrint(basering); 896 895 897 896 "S: "; S; 898 DetailedPrint(S, 1);897 // DetailedPrint(_, 1); 899 898 "SS: "; SS; 900 DetailedPrint(SS, 1);899 // DetailedPrint(_, 1); 901 900 902 901 "DIFF: "; 902 module(matrix(S) - matrix(SS)); 903 // DetailedPrint(_, 2); 903 904 print(matrix(S) - matrix(SS)); 904 DetailedPrint(module(matrix(S) - matrix(SS)), 2);905 905 $ 906 906 } … … 948 948 } else 949 949 { 950 int @KERCHECK = @SYZCHECK; 951 } 952 953 int @TAILREDSYZ = 1; 954 if( typeof( attrib(basering, "TAILREDSYZ") ) == "int" ) 955 { 956 @TAILREDSYZ = attrib(basering, "TAILREDSYZ"); 957 } 958 959 950 int @KERCHECK = @DEBUG; 951 } 952 960 953 if( @DEBUG ) 961 954 { … … 986 979 if( @KERCHECK ) 987 980 { 981 int @TAILREDSYZ = 1; 982 if( typeof( attrib(basering, "TAILREDSYZ") ) == "int" ) 983 { 984 @TAILREDSYZ = attrib(basering, "TAILREDSYZ"); 985 } 988 986 989 987 int i, j, r; … … 1085 1083 1086 1084 /// TODO: save shortcut (syz: |-.->) LM(LM(m) * "t") -> syz? 1087 proc SSFindReducer(def product, def syzterm, def L /*, def T*/, list #)1085 proc SSFindReducer(def product, def syzterm, def L, list #) 1088 1086 { 1089 1087 if( typeof( attrib(basering, "DEBUG") ) == "int" ) … … 1093 1091 { 1094 1092 int @DEBUG = !system("with", "ndebug"); 1093 } 1094 1095 if( typeof( attrib(basering, "SYZCHECK") ) == "int" ) 1096 { 1097 int @SYZCHECK = attrib(basering, "SYZCHECK"); 1098 } else 1099 { 1100 int @SYZCHECK = @DEBUG; 1101 } 1102 1103 if( typeof( attrib(basering, "KERCHECK") ) == "int" ) 1104 { 1105 int @KERCHECK = attrib(basering, "KERCHECK"); 1106 } else 1107 { 1108 int @KERCHECK = @DEBUG; 1095 1109 } 1096 1110 … … 1111 1125 1112 1126 1113 if( typeof( attrib(basering, "SYZCHECK") ) == "int" ) 1114 { 1115 int @SYZCHECK = attrib(basering, "SYZCHECK"); 1116 } else 1117 { 1118 int @SYZCHECK = @DEBUG; 1119 } 1120 1121 if( @SYZCHECK && (syzterm != 0) ) 1127 if( @DEBUG && (syzterm != 0) ) 1122 1128 { 1123 1129 def @@c = leadcomp(syzterm); int @@r = int(@@c); … … 1141 1147 1142 1148 1143 if( @ SYZCHECK )1149 if( @KERCHECK ) 1144 1150 { 1145 1151 bigint c = leadcomp(product); int r = int(c); … … 1207 1213 } 1208 1214 1209 1210 1211 1212 1213 1215 /// TODO: save shortcut (syz: |-.->) LM(m) * "t" -> ? 1214 1216 proc SSReduceTerm(poly m, def t, def syzterm, def L, def T, list #) … … 1239 1241 } 1240 1242 1241 1243 if( typeof( attrib(basering, "KERCHECK") ) == "int" ) 1244 { 1245 int @KERCHECK = attrib(basering, "KERCHECK"); 1246 } else 1247 { 1248 int @KERCHECK = @DEBUG; 1249 } 1250 1242 1251 if( typeof( attrib(basering, "SYZCHECK") ) == "int" ) 1243 1252 { … … 1299 1308 int @DEBUG = !system("with", "ndebug"); 1300 1309 } 1310 1311 if( typeof( attrib(basering, "KERCHECK") ) == "int" ) 1312 { 1313 int @KERCHECK = attrib(basering, "KERCHECK"); 1314 } else 1315 { 1316 int @KERCHECK = @DEBUG; 1317 } 1318 1301 1319 1302 1320 if( @DEBUG ) … … 1451 1469 } else 1452 1470 { 1453 a2 = SSFindReducer( aa * L[r], a, L /*, T*/, LS);1471 a2 = SSFindReducer( aa * L[r], a, L, LS); 1454 1472 } 1455 1473 … … 1949 1967 proc TestSSres(def M) 1950 1968 { 1951 "-------------------------------------"; 1952 "options: ", attrib(SSinit, "LEAD2SYZ"), attrib(SSinit, "TAILREDSYZ"), attrib(SSinit, "HYBRIDNF"), ": "; 1969 "/ ----------------------------------- : ", "options: ", attrib(SSinit, "LEAD2SYZ"), attrib(SSinit, "TAILREDSYZ"), attrib(SSinit, "HYBRIDNF"), "..."; 1953 1970 int t = timer; 1954 1971 def S = SSres(M, 0); … … 1971 1988 proc TestSSresAttribs(def M) 1972 1989 { 1990 // M = groebner(M); "groebner: "; M; ""; 1991 1973 1992 1974 1993 // the following 2 setups are bad for AGR@101n3d002s004%1:((( 1975 // attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 0); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M); 1976 // attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 0); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M); 1994 1995 ////////// attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 0); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M); 1996 ////////// attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 0); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M); 1977 1997 1978 1998 attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M); … … 1992 2012 attrib(SSinit, "DEBUG", 0); 1993 2013 attrib(SSinit, "SYZCHECK", 1); 1994 attrib(SSinit, "KERCHECK", 0);2014 attrib(SSinit, "KERCHECK", 1); 1995 2015 1996 2016 ring r; r; ideal M = maxideal(1); M; … … 2011 2031 TestSSresAttribs(M); 2012 2032 kill r; 2013 2014 2033 2015 2034 ring AGR = (101), (a, b, c, d), dp; AGR; … … 2019 2038 TestSSresAttribs(M); 2020 2039 2021 2022 2040 // medium: AGR@101n3d004s009%1; 2023 idealM = a*b+7*a*c-16*b*c-27*a*d+37*b*d-2*c*d, d^3, c*d^2, b*d^2, a*d^2, c^2*d, b*c*d, a*c*d, b^2*d, a^2*d, c^3, b*c^2, a*c^2, b^2*c, a^2*c, b^3, a^3;2041 M = a*b+7*a*c-16*b*c-27*a*d+37*b*d-2*c*d, d^3, c*d^2, b*d^2, a*d^2, c^2*d, b*c*d, a*c*d, b^2*d, a^2*d, c^3, b*c^2, a*c^2, b^2*c, a^2*c, b^3, a^3; 2024 2042 M; 2025 2043 TestSSresAttribs(M); -
dyn_modules/syzextra/mod_main.cc
rd353e4f rf6c459 1101 1101 static BOOLEAN FindReducer(leftv res, leftv h) 1102 1102 { 1103 const char* usage = "`FindReducer(<poly/vector>, <vector/0>, <ideal/module>[,<module>])` expected"; 1103 1104 const ring r = currRing; 1104 1105 … … 1113 1114 1114 1115 const BOOLEAN __TAILREDSYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"TAILREDSYZ",INT_CMD, (void*)0))); 1115 const BOOLEAN __LEAD2SYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"LEAD2SYZ",INT_CMD, (void*)0)));1116 const BOOLEAN __SYZCHECK__ = (BOOLEAN)((long)(atGet(currRingHdl,"SYZCHECK",INT_CMD, (void*)0)));1117 1116 1118 1117 if ((h==NULL) || (h->Typ()!=VECTOR_CMD && h->Typ() !=POLY_CMD) || (h->Data() == NULL)) 1119 1118 { 1120 WerrorS( "`FindReducer(<poly/vector>, <vector>, <ideal/module>[,<module>])` expected");1119 WerrorS(usage); 1121 1120 return TRUE; 1122 1121 } 1123 1122 1124 const poly product = (poly) h->Data(); h = h->Next(); 1125 1126 assume (product != NULL); 1127 1128 1129 if ((h==NULL) || (h->Typ()!=VECTOR_CMD)) 1130 { 1131 WerrorS("`FindReducer(<poly/vector>, <vector>, <ideal/module>[,<module>])` expected"); 1123 const poly product = (poly) h->Data(); assume (product != NULL); 1124 1125 1126 h = h->Next(); 1127 if ((h==NULL) || !((h->Typ()==VECTOR_CMD) || (h->Data() == NULL)) ) 1128 { 1129 WerrorS(usage); 1132 1130 return TRUE; 1133 1131 } … … 1143 1141 if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) 1144 1142 { 1145 WerrorS( "`FindReducer(<poly/vector>, <vector>, <ideal/module>[,<module>])` expected");1143 WerrorS(usage); 1146 1144 return TRUE; 1147 1145 } … … 1156 1154 if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) 1157 1155 { 1158 WerrorS( "`FindReducer(<poly/vector>, <vector>, <ideal/module>[,<module>])` expected");1156 WerrorS(usage); 1159 1157 return TRUE; 1160 1158 } … … 1743 1741 iLazyReduce = (int)((long)(h->Data())); 1744 1742 1745 res->data = (void *)kNFLength(M, currQuotient, v, iSyzComp, iLazyReduce); 1743 res->data = (void *)kNFLength(M, currQuotient, v, iSyzComp, iLazyReduce); // NOTE: currRing :( 1746 1744 return FALSE; 1747 1745 } … … 1861 1859 1862 1860 NoReturn(res); 1863 return false;1861 return FALSE; 1864 1862 } 1865 1863
Note: See TracChangeset
for help on using the changeset viewer.