Changeset 350269 in git
 Timestamp:
 Dec 12, 2014, 6:50:12 PM (9 years ago)
 Branches:
 (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
 Children:
 11d9d00209c06444540d1707f2976c99061746a96e7a34ced596a7ef94c83c0dc1f13330d700a46e
 Parents:
 b5640c55a48dd41370dad551f636b332efdb52f7
 gitauthor:
 Oleksandr Motsak <motsak@mathematik.unikl.de>20141212 18:50:12+01:00
 gitcommitter:
 Oleksandr Motsak <motsak@mathematik.unikl.de>20141212 18:53:27+01:00
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Singular/LIB/schreyer.lib
rb5640c r350269 49 49 "; 50 50 51 52 51 static proc prepareSyz( module I, list # ) 53 52 { … … 79 78 } 80 79 81 // DetailedPrint(I);80 // Syzextra::DetailedPrint(I); 82 81 83 82 return(I); … … 93 92 { 94 93 v = J[i]; 95 if( leadcomp(v) > c )94 if( Syzextra::leadcomp(v) > c ) 96 95 { 97 96 II[i] = v; … … 118 117 vv = 0; 119 118 120 while( leadcomp(v) <= c )119 while( Syzextra::leadcomp(v) <= c ) 121 120 { 122 121 vv = vv + lead(v); … … 144 143 "Sinit::Input"; 145 144 type(M); 146 // DetailedPrint(M);145 // Syzextra::DetailedPrint(M); 147 146 attrib(M); 148 147 } … … 157 156 } 158 157 159 def S = MakeInducedSchreyerOrdering(1); // 1 puts history terms to the back158 def S = Syzextra::MakeInducedSchreyerOrdering(1); // 1 puts history terms to the back 160 159 // TODO: NOTE: +1 causes trouble to Singular interpreter!!!??? 161 160 setring S; // a new ring with a Schreyer ordering … … 165 164 "Sinit::StartingISRing"; 166 165 basering; 167 // DetailedPrint(basering);166 // Syzextra::DetailedPrint(basering); 168 167 } 169 168 … … 190 189 attrib(M); 191 190 attrib(M, "isHomog"); 192 // DetailedPrint(M);191 // Syzextra::DetailedPrint(M); 193 192 } 194 193 … … 200 199 transpose( transpose(M) * transpose(MRES) ); 201 200 "ERROR: transpose( transpose(M) * transpose(MRES) ) != 0!!!"; 202 m2_end(666);201 Syzextra::m2_end(666); 203 202 } 204 203 } … … 215 214 { 216 215 "Sinit::MRES"; 217 DetailedPrint(MRES);216 Syzextra::DetailedPrint(MRES); 218 217 attrib(MRES, "isHomog"); 219 218 attrib(S); … … 232 231 { 233 232 "Sstep::NextInducedRing"; 234 DetailedPrint(basering);233 Syzextra::DetailedPrint(basering); 235 234 236 235 attrib(basering, "InducionLeads"); 237 236 attrib(basering, "InducionStart"); 238 237 239 GetInducedData();238 Syzextra::GetInducedData(); 240 239 } 241 240 … … 246 245 def L = lead(M); 247 246 intvec @V = deg(M[1..ncols(M)]); @W; @V; @W = @V; attrib(L, "isHomog", @W); 248 SetInducedReferrence(L, @RANK, 0);247 Syzextra::SetInducedReferrence(L, @RANK, 0); 249 248 */ 250 249 … … 255 254 256 255 // General setting: 257 // SetInducedReferrence(MRES, 0, 0); // limit: 0!256 // Syzextra::SetInducedReferrence(MRES, 0, 0); // limit: 0! 258 257 int @l = size(RES); 259 258 … … 287 286 deg(M[1..ncols(M)]); // no use of @W :(? 288 287 @RANK; 289 DetailedPrint(MRES);288 Syzextra::DetailedPrint(MRES); 290 289 attrib(MRES, "isHomog"); @W; 291 290 deg(MRES[1..ncols(MRES)]); … … 294 293 295 294 296 SetInducedReferrence(L, limit, 0);295 Syzextra::SetInducedReferrence(L, limit, 0); 297 296 298 297 def K = prepareSyz(M, @RANK); 299 298 // K; 300 299 301 // attrib(K, "isHomog", @V); DetailedPrint(K, 1000);300 // attrib(K, "isHomog", @V); Syzextra::DetailedPrint(K, 1000); 302 301 303 302 // pause(); 304 303 305 K = idPrepare(K, @RANK); // std(K); // ?304 K = Syzextra::idPrepare(K, @RANK); // std(K); // ? 306 305 K = simplify(K, 2); 307 306 … … 310 309 module N = separateSyzGB(K, @RANK)[2]; // 1^st syz. module: vectors which start in lower part (comp >= @RANK) 311 310 312 // "N_0: "; N; DetailedPrint(N, 10);311 // "N_0: "; N; Syzextra::DetailedPrint(N, 10); 313 312 314 313 // basering; print(@V); type(N); … … 328 327 MRES; 329 328 330 "N: "; N; DetailedPrint(N, 10);331 332 "K:"; K; DetailedPrint(K, 10);329 "N: "; N; Syzextra::DetailedPrint(N, 10); 330 331 "K:"; K; Syzextra::DetailedPrint(K, 10); 333 332 334 333 "RANKS: ", @RANK; … … 339 338 "transpose(N) * transpose(MRES): "; 340 339 transpose(N) * transpose(MRES); 341 DetailedPrint(module(_), 2);342 m2_end(666);340 Syzextra::DetailedPrint(module(_), 2); 341 Syzextra::m2_end(666); 343 342 } 344 343 } … … 357 356 { 358 357 "Sstep::NextSyzOutput: "; 359 DetailedPrint(N);358 Syzextra::DetailedPrint(N); 360 359 attrib(N, "isHomog"); 361 360 } … … 371 370 " 372 371 { 373 def data = GetInducedData();372 def data = Syzextra::GetInducedData(); 374 373 375 374 if( (!defined(RES))  (!defined(MRES))  (typeof(data) != "list")  (size(data) != 2) ) … … 505 504 if( size(M) > 0 ) 506 505 { 507 S ort_c_ds(@N);506 Syzextra::Sort_c_ds(@N); 508 507 509 508 if( @KERCHECK ) … … 527 526 528 527 "ERROR: MySort: wrong sorting in 'MySort': @N != @M!!!"; 529 m2_end(666);528 Syzextra::m2_end(666); 530 529 } 531 530 } … … 647 646 648 647 "ERROR: wrong sorting (in SSnit): @N != M!!!"; 649 m2_end(666);648 Syzextra::m2_end(666); 650 649 } 651 650 … … 659 658 660 659 "ERROR: wrong sorting (in SSnit): @LEAD != LEAD!!!"; 661 m2_end(666);660 Syzextra::m2_end(666); 662 661 } 663 662 … … 666 665 M = @N; 667 666 668 def TAIL = Tail(M);667 def TAIL = Syzextra::Tail(M); 669 668 670 669 int @RANK = nrows(M); int @SIZE = ncols(M); … … 681 680 @l[3] = list(list("C", @z), list("lp", @wdeg)); 682 681 kill @z, @m, @wdeg; // since these vars are ring independent! 683 def S = ring(@l); //  MakeInducedSchreyerOrdering(1);682 def S = ring(@l); //  Syzextra::MakeInducedSchreyerOrdering(1); 684 683 kill @l; 685 684 setring S; // ring with an easy divisibility test ("C, lex") // or not!??? … … 688 687 "SSinit::NewRing(C,lex)?"; 689 688 basering; 690 DetailedPrint(basering);689 Syzextra::DetailedPrint(basering); 691 690 } 692 691 } else … … 749 748 transpose( transpose(M) * transpose(MRES) ); 750 749 "ERROR: transpose( transpose(M) * transpose(MRES) ) != 0!!!"; 751 m2_end(666);750 Syzextra::m2_end(666); 752 751 } 753 752 } … … 800 799 "SSinit::MRES"; 801 800 MRES; 802 // DetailedPrint(MRES);801 // Syzextra::DetailedPrint(MRES); 803 802 attrib(MRES, "isHomog"); 804 803 attrib(S); … … 875 874 } 876 875 877 module SS = ComputeLeadingSyzygyTerms(L);876 module SS = Syzextra::ComputeLeadingSyzygyTerms(L); 878 877 879 878 if( @KERCHECK ) … … 893 892 { 894 893 a = L[i]; 895 c = leadcomp(a);894 c = Syzextra::leadcomp(a); 896 895 r = int(c); 897 896 898 aa = leadmonomial(a);897 aa = Syzextra::leadmonomial(a); 899 898 900 899 M = 0; … … 904 903 b = L[j]; 905 904 906 if( leadcomp(b) == c )905 if( Syzextra::leadcomp(b) == c ) 907 906 { 908 bb = leadmonomial(b);907 bb = Syzextra::leadmonomial(b); 909 908 910 909 M[j] = (lcm(aa, bb) / aa); … … 930 929 931 930 "basering: "; basering; 932 // DetailedPrint(basering);931 // Syzextra::DetailedPrint(basering); 933 932 934 933 "S: "; S; 935 // DetailedPrint(_, 1);934 // Syzextra::DetailedPrint(_, 1); 936 935 "SS: "; SS; 937 // DetailedPrint(_, 1);936 // Syzextra::DetailedPrint(_, 1); 938 937 939 938 "DIFF: "; 940 939 module(matrix(S)  matrix(SS)); 941 // DetailedPrint(_, 2);940 // Syzextra::DetailedPrint(_, 2); 942 941 print(matrix(S)  matrix(SS)); 943 m2_end(666);942 Syzextra::m2_end(666); 944 943 } 945 944 } … … 994 993 } 995 994 996 module SS = Compute2LeadingSyzygyTerms(L);995 module SS = Syzextra::Compute2LeadingSyzygyTerms(L); 997 996 998 997 if( @DEBUG ) … … 1009 1008 transpose( transpose(SS) * transpose(L) ); 1010 1009 "ERROR: transpose( transpose(SS) * transpose(L) ) != 0!!!"; 1011 m2_end(666);1010 Syzextra::m2_end(666); 1012 1011 } 1013 1012 } … … 1038 1037 a = L[i]; 1039 1038 // "a: ", a; 1040 c = leadcomp(a);1039 c = Syzextra::leadcomp(a); 1041 1040 r = int(c); 1042 1041 1043 aa = leadmonomial(a);1042 aa = Syzextra::leadmonomial(a); 1044 1043 1045 1044 M = 0; … … 1050 1049 // "b: ", b; 1051 1050 1052 if( leadcomp(b) == c )1051 if( Syzextra::leadcomp(b) == c ) 1053 1052 { 1054 bb = leadmonomial(b);1053 bb = Syzextra::leadmonomial(b); 1055 1054 @lcm = lcm(aa, bb); 1056 1055 … … 1093 1092 transpose( transpose(S) * transpose(L) ); 1094 1093 "ERROR: transpose( transpose(S) * transpose(L) ) != 0!!!"; 1095 m2_end(666);1094 Syzextra::m2_end(666); 1096 1095 } 1097 1096 } … … 1102 1101 "ERROR: SSCompute2LeadingSyzygyTerms: size(S) != size(SS)"; 1103 1102 1104 "basering: "; basering; // DetailedPrint(basering);1103 "basering: "; basering; // Syzextra::DetailedPrint(basering); 1105 1104 1106 1105 "S: "; S; 1107 // DetailedPrint(S, 2);1106 // Syzextra::DetailedPrint(S, 2); 1108 1107 "SS: "; SS; 1109 // DetailedPrint(SS, 2);1110 m2_end(666);1108 // Syzextra::DetailedPrint(SS, 2); 1109 Syzextra::m2_end(666); 1111 1110 } 1112 1111 … … 1118 1117 1119 1118 "basering: "; basering; 1120 // DetailedPrint(basering);1119 // Syzextra::DetailedPrint(basering); 1121 1120 1122 1121 "lead(S ): "; lead(S ); 1123 // DetailedPrint(_, 2);1122 // Syzextra::DetailedPrint(_, 2); 1124 1123 "lead(SS): "; lead(SS); 1125 // DetailedPrint(_, 2);1124 // Syzextra::DetailedPrint(_, 2); 1126 1125 1127 1126 "DIFF: "; 1128 1127 print( matrix(lead(S))  matrix(lead(SS)) ); 1129 1128 module(matrix(lead(S))  matrix(lead(SS))); 1130 // DetailedPrint(_ , 4);1131 m2_end(666);1129 // Syzextra::DetailedPrint(_ , 4); 1130 Syzextra::m2_end(666); 1132 1131 } 1133 1132 … … 1135 1134 if( @TAILREDSYZ ) 1136 1135 { 1137 if( size(module(matrix( Tail(S))  matrix(Tail(SS)))) > 0 )1136 if( size(module(matrix( Syzextra::Tail(S))  matrix( Syzextra::Tail(SS)))) > 0 ) 1138 1137 { 1139 1138 "ERROR: SSCompute2LeadingSyzygyTerms: Tail(S) != Tail(SS) "; 1140 1139 1141 1140 "basering: "; basering; 1142 // DetailedPrint(basering);1143 1144 "Tail(S ): "; Tail(S );1145 // DetailedPrint(_, 2);1146 "Tail(SS): "; Tail(SS);1147 // DetailedPrint(_, 2);1141 // Syzextra::DetailedPrint(basering); 1142 1143 "Tail(S ): "; Syzextra::Tail(S ); 1144 // Syzextra::DetailedPrint(_, 2); 1145 "Tail(SS): "; Syzextra::Tail(SS); 1146 // Syzextra::DetailedPrint(_, 2); 1148 1147 1149 1148 "DIFF: "; 1150 module( matrix( Tail(S))  matrix(Tail(SS)) );1151 // DetailedPrint(_, 4);1152 print( matrix( Tail(S))  matrix(Tail(SS)) );1153 m2_end(666);1149 module( matrix( Syzextra::Tail(S))  matrix( Syzextra::Tail(SS)) ); 1150 // Syzextra::DetailedPrint(_, 4); 1151 print( matrix( Syzextra::Tail(S))  matrix( Syzextra::Tail(SS)) ); 1152 Syzextra::m2_end(666); 1154 1153 } 1155 1154 } … … 1157 1156 } 1158 1157 1159 module S2 = Tail(SS);1158 module S2 = Syzextra::Tail(SS); 1160 1159 SS = lead(SS); // (C,lp) on base ring! 1161 1160 … … 1168 1167 type(S2); 1169 1168 L; 1170 m2_end(666);1169 Syzextra::m2_end(666); 1171 1170 } 1172 1171 } … … 1229 1228 if( @DEBUG && (syzterm != 0) ) 1230 1229 { 1231 def @@c = leadcomp(syzterm); int @@r = int(@@c);1232 def @@product = leadmonomial(syzterm) * L[@@r];1230 def @@c = Syzextra::leadcomp(syzterm); int @@r = int(@@c); 1231 def @@product = Syzextra::leadmonomial(syzterm) * L[@@r]; 1233 1232 1234 1233 if( @@product != product) … … 1236 1235 "product: ", product, ", @@product: ", @@product; 1237 1236 "ERROR: 'syzterm' results in wrong product !!!???"; 1238 m2_end(666);1237 Syzextra::m2_end(666); 1239 1238 } 1240 1239 } … … 1242 1241 if( typeof(#[1]) == "module" ) 1243 1242 { 1244 vector my = FindReducer(product, syzterm, L/*, T*/, #[1]);1243 vector my = Syzextra::FindReducer(product, syzterm, L/*, T*/, #[1]); 1245 1244 } else 1246 1245 { 1247 vector my = FindReducer(product, syzterm, L/*, T*/);1246 vector my = Syzextra::FindReducer(product, syzterm, L/*, T*/); 1248 1247 } 1249 1248 … … 1251 1250 if( @KERCHECK ) 1252 1251 { 1253 bigint c = leadcomp(product); int r = int(c);1252 bigint c = Syzextra::leadcomp(product); int r = int(c); 1254 1253 1255 1254 def a, b, bb; … … 1262 1261 a = L[k]; 1263 1262 // with the same mod. component 1264 if( leadcomp(a) == c )1263 if( Syzextra::leadcomp(a) == c ) 1265 1264 { 1266 b =  ( leadmonomial(product) /leadmonomial(L[k]));1265 b =  ( Syzextra::leadmonomial(product) / Syzextra::leadmonomial(L[k])); 1267 1266 1268 1267 // which divides the product: looking for the 1st appropriate one! … … 1302 1301 if( my != nf ) 1303 1302 { 1304 "ERROR in FindReducer => ", my, " != nf: ", nf;1305 m2_end(666);1303 "ERROR in Syzextra::FindReducer => ", my, " != nf: ", nf; 1304 Syzextra::m2_end(666); 1306 1305 } 1307 1306 } … … 1361 1360 if( @SYZCHECK && (syzterm != 0) ) 1362 1361 { 1363 def @@c = leadcomp(syzterm); int @@r = int(@@c);1364 poly @@m = leadmonomial(syzterm); def @@t = L[@@r];1362 def @@c = Syzextra::leadcomp(syzterm); int @@r = int(@@c); 1363 poly @@m = Syzextra::leadmonomial(syzterm); def @@t = L[@@r]; 1365 1364 1366 1365 if( (@@m != m)  (@@t != t)) … … 1369 1368 "@@m: ", @@m, ", @@t: ", @@t; 1370 1369 "ERROR: 'syzterm' results in wrong m * t !!!"; 1371 m2_end(666);1370 Syzextra::m2_end(666); 1372 1371 } 1373 1372 } … … 1375 1374 if( typeof(#[1]) == "module" ) 1376 1375 { 1377 vector ss = ReduceTerm(m, t, syzterm, L, T, #[1]);1376 vector ss = Syzextra::ReduceTerm(m, t, syzterm, L, T, #[1]); 1378 1377 } else 1379 1378 { 1380 vector ss = ReduceTerm(m, t, syzterm, L, T);1379 vector ss = Syzextra::ReduceTerm(m, t, syzterm, L, T); 1381 1380 } 1382 1381 … … 1395 1394 if( size(s) != 0 ) 1396 1395 { 1397 poly @b = leadmonomial(s);1398 1399 def @c = leadcomp(s); int k = int(@c);1396 poly @b = Syzextra::leadmonomial(s); 1397 1398 def @c = Syzextra::leadcomp(s); int k = int(@c); 1400 1399 1401 1400 if( @TREEOUTPUT ){ "\CHILD{", (s), "}{", ( @b*L[k]), "}"; } … … 1407 1406 if( s != ss ) 1408 1407 { 1409 "ERROR in ReduceTerm => old: ", s, " != ker: ", ss;1408 "ERROR in Syzextra::ReduceTerm => old: ", s, " != ker: ", ss; 1410 1409 "m: ", m; 1411 1410 "t: ", t; 1412 1411 "syzterm: ", syzterm; 1413 1412 L; T; #; 1414 m2_end(666);1413 Syzextra::m2_end(666); 1415 1414 } 1416 1415 } … … 1460 1459 if( typeof(#[1]) == "module" ) 1461 1460 { 1462 vector ss = TraverseTail(m, @tail, L, T, #[1]);1461 vector ss = Syzextra::TraverseTail(m, @tail, L, T, #[1]); 1463 1462 } else 1464 1463 { 1465 vector ss = TraverseTail(m, @tail, L, T);1464 vector ss = Syzextra::TraverseTail(m, @tail, L, T); 1466 1465 } 1467 1466 … … 1483 1482 if( s != ss ) 1484 1483 { 1485 "ERROR in TraverseTail => old: ", s, " != ker: ", ss;1484 "ERROR in Syzextra::TraverseTail => old: ", s, " != ker: ", ss; 1486 1485 "m: ", m; 1487 1486 "@tail: ", @tail; 1488 1487 L; T; #; 1489 m2_end(666);1488 Syzextra::m2_end(666); 1490 1489 } 1491 1490 } … … 1536 1535 if( typeof(#[1]) == "module" ) 1537 1536 { 1538 def my = SchreyerSyzygyNF(syz_lead, syz_2, L, T, #[1]);1537 def my = Syzextra::SchreyerSyzygyNF(syz_lead, syz_2, L, T, #[1]); 1539 1538 } else 1540 1539 { 1541 def my = SchreyerSyzygyNF(syz_lead, syz_2, L, T);1540 def my = Syzextra::SchreyerSyzygyNF(syz_lead, syz_2, L, T); 1542 1541 } 1543 1542 … … 1546 1545 int @TREEOUTPUT = attrib(basering, "TREEOUTPUT"); 1547 1546 1548 def spoly = leadmonomial(syz_lead) * T[int(leadcomp(syz_lead))]1549 + leadmonomial(syz_2) * T[int(leadcomp(syz_2))];1547 def spoly = Syzextra::leadmonomial(syz_lead) * T[int( Syzextra::leadcomp(syz_lead))] 1548 + Syzextra::leadmonomial(syz_2) * T[int( Syzextra::leadcomp(syz_2))]; 1550 1549 1551 1550 vector @tail = syz_2; … … 1555 1554 while (size(spoly) > 0) 1556 1555 { 1557 syz_2 = SSFindReducer(lead(spoly), 0, L, #); spoly = Tail(spoly);1556 syz_2 = SSFindReducer(lead(spoly), 0, L, #); spoly = Syzextra::Tail(spoly); 1558 1557 1559 1558 if( size(syz_2) != 0) 1560 1559 { 1561 @b = leadmonomial(syz_2);1562 k = int( leadcomp(syz_2));1560 @b = Syzextra::leadmonomial(syz_2); 1561 k = int( Syzextra::leadcomp(syz_2)); 1563 1562 1564 1563 if( @TREEOUTPUT ){ "\CHILD{", (syz_2), "}{", ( lead(spoly)), "}"; } … … 1572 1571 if( my != @tail ) 1573 1572 { 1574 "ERROR in SchreyerSyzygyNF => old: ", @tail, " != ker: ", my;1573 "ERROR in Syzextra::SchreyerSyzygyNF => old: ", @tail, " != ker: ", my; 1575 1574 1576 1575 "syzygy_lead: ", syz_lead; … … 1578 1577 1579 1578 L; T; #; 1580 m2_end(666);1579 Syzextra::m2_end(666); 1581 1580 } 1582 1581 } … … 1598 1597 static proc SSComputeSyzygy(def L, def T) 1599 1598 { 1600 // rtimer, "***TIMESNAP0 for ComputeSyzygy(L,T): on level: [",attrib(basering,"SYZNUMBER"),"] :: t: ", timer, ", r: ", rtimer;1599 // rtimer, "***TIMESNAP0 for Syzextra::ComputeSyzygy(L,T): on level: [",attrib(basering,"SYZNUMBER"),"] :: t: ", timer, ", r: ", rtimer; 1601 1600 int @DEBUG = attrib(basering, "DEBUG"); 1602 1601 int @KERCHECK = attrib(basering, "KERCHECK"); … … 1607 1606 "SSComputeSyzygy::Input"; 1608 1607 "basering: ", basering; attrib(basering); 1609 // DetailedPrint(basering);1608 // Syzextra::DetailedPrint(basering); 1610 1609 1611 1610 // "iCompShift: ", iCompShift; … … 1616 1615 1617 1616 // option(prot); 1618 // rtimer, "***TIME for ComputeSyzygy(L,T): on level: [",attrib(basering,"SYZNUMBER"),"] :: t: ", timer, ", r: ", rtimer;1619 list @res= ComputeSyzygy(L,T);1620 // rtimer, "***TIME for ComputeSyzygy(L,T): on level: [",attrib(basering,"SYZNUMBER"),"] :: t: ", timer, ", r: ", rtimer;1617 // rtimer, "***TIME for Syzextra::ComputeSyzygy(L,T): on level: [",attrib(basering,"SYZNUMBER"),"] :: t: ", timer, ", r: ", rtimer; 1618 list @res= Syzextra::ComputeSyzygy(L,T); 1619 // rtimer, "***TIME for Syzextra::ComputeSyzygy(L,T): on level: [",attrib(basering,"SYZNUMBER"),"] :: t: ", timer, ", r: ", rtimer; 1621 1620 // option(noprot); // TODO: restore! 1622 1621 … … 1660 1659 type(LL); 1661 1660 type(@LL); 1662 m2_end(666);1661 Syzextra::m2_end(666); 1663 1662 } 1664 1663 … … 1671 1670 type(LL); 1672 1671 type(@LL); 1673 m2_end(666);1672 Syzextra::m2_end(666); 1674 1673 } 1675 1674 … … 1697 1696 if( !@IGNORETAILS ) 1698 1697 { 1699 c = leadcomp(a); r = int(c); aa =leadmonomial(a);1698 c = Syzextra::leadcomp(a); r = int(c); aa = Syzextra::leadmonomial(a); 1700 1699 1701 1700 if( @TREEOUTPUT ){ "\ROOT{", (lead(a)), "}"; } … … 1709 1708 if( @LEAD2SYZ ) // with the 2nd syz. term: 1710 1709 { 1711 a2 = LL2[k]; c = leadcomp(a2); r = int(c); aa =leadmonomial(a2);1710 a2 = LL2[k]; c = Syzextra::leadcomp(a2); r = int(c); aa = Syzextra::leadmonomial(a2); 1712 1711 1713 1712 if( @TREEOUTPUT ){ "\CHILD{", (lead(a2)), "}{", ( aa*L[r]), "}"; } … … 1736 1735 { 1737 1736 "ERROR in SSComputeSyzygy: could not find the 2nd syzygy term during the hybrid NF!!!"; 1738 m2_end(666);1737 Syzextra::m2_end(666); 1739 1738 } 1740 1739 } … … 1768 1767 // transpose( transpose(N) * transpose(MRES) ); 1769 1768 1770 m2_end(666);1769 Syzextra::m2_end(666); 1771 1770 } 1772 1771 … … 1785 1784 type(TT); 1786 1785 type(@TT); 1787 m2_end(666);1786 Syzextra::m2_end(666); 1788 1787 } 1789 1788 … … 1798 1797 type(LL); 1799 1798 type(@LL); 1800 m2_end(666);1799 Syzextra::m2_end(666); 1801 1800 } 1802 1801 … … 1819 1818 } 1820 1819 1821 // rtimer, "***TIMESNAP1 for ComputeSyzygy(L,T): on level: [",attrib(basering,"SYZNUMBER"),"] :: t: ", timer, ", r: ", rtimer;1820 // rtimer, "***TIMESNAP1 for Syzextra::ComputeSyzygy(L,T): on level: [",attrib(basering,"SYZNUMBER"),"] :: t: ", timer, ", r: ", rtimer; 1822 1821 return (@SYZ, @LL, @TT); 1823 1822 } … … 1841 1840 def L = lead(M); 1842 1841 intvec @V = deg(M[1..ncols(M)]); @W; @V; @W = @V; attrib(L, "isHomog", @W); 1843 SetInducedReferrence(L, @RANK, 0);1842 Syzextra::SetInducedReferrence(L, @RANK, 0); 1844 1843 */ 1845 1844 … … 1850 1849 1851 1850 // General setting: 1852 // SetInducedReferrence(MRES, 0, 0); // limit: 0!1851 // Syzextra::SetInducedReferrence(MRES, 0, 0); // limit: 0! 1853 1852 int @l = size(RES); 1854 1853 … … 1883 1882 @V; 1884 1883 @RANK; 1885 // DetailedPrint(MRES);1884 // Syzextra::DetailedPrint(MRES); 1886 1885 attrib(MRES, "isHomog"); 1887 1886 } … … 1907 1906 "MRES", MRES; 1908 1907 1909 "N: "; N; // DetailedPrint(N, 2);1910 1911 "LL:"; LL; // DetailedPrint(LL, 1);1912 "TT:"; TT; // DetailedPrint(TT, 10);1908 "N: "; N; // Syzextra::DetailedPrint(N, 2); 1909 1910 "LL:"; LL; // Syzextra::DetailedPrint(LL, 1); 1911 "TT:"; TT; // Syzextra::DetailedPrint(TT, 10); 1913 1912 1914 1913 "RANKS: ", @RANK; … … 1919 1918 "transpose(N) * transpose(MRES): "; 1920 1919 transpose(N) * transpose(MRES); 1921 // DetailedPrint(module(_), 2);1922 m2_end(666);1920 // Syzextra::DetailedPrint(module(_), 2); 1921 Syzextra::m2_end(666); 1923 1922 } 1924 1923 } … … 1947 1946 "SSstep::NextSyzOutput: "; 1948 1947 N; 1949 // DetailedPrint(N);1948 // Syzextra::DetailedPrint(N); 1950 1949 attrib(N); 1951 1950 } … … 1969 1968 1970 1969 /// TODO! 1971 // def data = GetInducedData();1970 // def data = Syzextra::GetInducedData(); 1972 1971 1973 1972 if( (!defined(RES))  (!defined(MRES)) ) /*  (typeof(data) != "list")  (size(data) != 2) */ … … 2183 2182 } 2184 2183 2185 static proc loadme()2184 static proc mod_init() 2186 2185 { 2187 2186 int @DEBUG = 0; // !system("with", "ndebug"); // "om_ndebug?: ", system("with", "om_ndebug"); 2188 2187 2189 if( @DEBUG ) { listvar( Syzextra); listvar(Schreyer); listvar(Top); }2190 2191 if( !defined(S chreyer::ComputeResolution) )2192 { 2193 load("syzextra.so");2194 2188 if( @DEBUG ) { listvar(Top); } 2189 2190 if( !defined(SRES) ) 2191 { 2192 load("syzextra.so"); 2193 2195 2194 if( @DEBUG ){ listvar(Syzextra); } 2196 2195 2197 // exportto(Top, Syzextra::ClearContent); // exportto(Top, Syzextra::ClearDenominators); exportto(Schreyer, Syzextra::noop); 2198 // exportto(Schreyer, Syzextra::leadrawexp); // exportto(Schreyer, Syzextra::ISUpdateComponents); 2199 // exportto(Schreyer, Syzextra::GetAMData);// exportto(Schreyer, Syzextra::SetSyzComp); 2200 // exportto(Schreyer, Syzextra::MakeSyzCompOrdering); // exportto(Schreyer, Syzextra::reduce_syz);// exportto(Schreyer, Syzextra::p_Content); 2201 exportto(Schreyer, Syzextra::DetailedPrint); 2202 exportto(Schreyer, Syzextra::m2_end); 2203 exportto(Schreyer, Syzextra::leadmonomial); 2204 exportto(Schreyer, Syzextra::leadcomp); 2205 exportto(Schreyer, Syzextra::SetInducedReferrence); 2206 exportto(Schreyer, Syzextra::GetInducedData); 2207 exportto(Schreyer, Syzextra::MakeInducedSchreyerOrdering); 2208 exportto(Schreyer, Syzextra::idPrepare); 2209 2210 exportto(Schreyer, Syzextra::ProfilerStart); exportto(Schreyer, Syzextra::ProfilerStop); 2211 exportto(Schreyer, Syzextra::NumberStatsInit); exportto(Schreyer, Syzextra::NumberStatsPrint); 2212 2213 exportto(Schreyer, Syzextra::Tail); 2214 exportto(Schreyer, Syzextra::ComputeLeadingSyzygyTerms); 2215 exportto(Schreyer, Syzextra::Compute2LeadingSyzygyTerms); 2216 exportto(Schreyer, Syzextra::Sort_c_ds); 2217 2218 exportto(Schreyer, Syzextra::FindReducer); 2219 2220 exportto(Schreyer, Syzextra::ReduceTerm); 2221 exportto(Schreyer, Syzextra::TraverseTail); 2222 2223 exportto(Schreyer, Syzextra::SchreyerSyzygyNF); 2224 exportto(Schreyer, Syzextra::ComputeSyzygy); 2225 exportto(Schreyer, Syzextra::ComputeResolution); 2196 // exportto(Top, Syzextra::ClearContent); // exportto(Top, Syzextra::ClearDenominators); exportto(Schreyer, Syzextra::noop); 2197 // exportto(Schreyer, Syzextra::leadrawexp); // exportto(Schreyer, Syzextra::ISUpdateComponents); 2198 // exportto(Schreyer, Syzextra::GetAMData);// exportto(Schreyer, Syzextra::SetSyzComp); 2199 // exportto(Schreyer, Syzextra::MakeSyzCompOrdering); // exportto(Schreyer, Syzextra::reduce_syz);// exportto(Schreyer, Syzextra::p_Content); 2200 2201 // exportto(Schreyer, Syzextra::DetailedPrint); 2202 // exportto(Schreyer, Syzextra::m2_end); 2203 // exportto(Schreyer, Syzextra::leadmonomial); 2204 // exportto(Schreyer, Syzextra::leadcomp); 2205 // exportto(Schreyer, Syzextra::SetInducedReferrence); 2206 // exportto(Schreyer, Syzextra::GetInducedData); 2207 // exportto(Schreyer, Syzextra::MakeInducedSchreyerOrdering); 2208 // exportto(Schreyer, Syzextra::idPrepare); 2209 // exportto(Schreyer, Syzextra::ProfilerStart); exportto(Schreyer, Syzextra::ProfilerStop); 2210 // exportto(Schreyer, Syzextra::NumberStatsInit); exportto(Schreyer, Syzextra::NumberStatsPrint); 2211 // exportto(Schreyer, Syzextra::Tail); 2212 // exportto(Schreyer, Syzextra::ComputeLeadingSyzygyTerms); 2213 // exportto(Schreyer, Syzextra::Compute2LeadingSyzygyTerms); 2214 // exportto(Schreyer, Syzextra::Sort_c_ds); 2215 // exportto(Schreyer, Syzextra::FindReducer); 2216 // exportto(Schreyer, Syzextra::ReduceTerm); 2217 // exportto(Schreyer, Syzextra::TraverseTail); 2218 // exportto(Schreyer, Syzextra::SchreyerSyzygyNF); 2219 // exportto(Schreyer, Syzextra::ComputeSyzygy); 2220 // exportto(Schreyer, Syzextra::ComputeResolution); 2226 2221 2227 2222 // TODO: SSres  return SRESOLUTION? … … 2234 2229 system("install","SRES","list", SRES_list, 1); // will never work :((( 2235 2230 2236 // exportto(Top, DetailedPrint); 2237 // exportto(Top, s_res); // GetInducedData); 2231 // exportto(Top, s_res); // Syzextra::GetInducedData); 2238 2232 2239 2233 if( @DEBUG ) { listvar(Top); listvar(Schreyer); } 2240 2234 } 2241 2242 mod_assure_load();2243 }2244 2245 2246 2247 static proc mod_assure_load()2248 {2249 if( !defined(Schreyer::ComputeResolution) )2250 {2251 "ERROR: Sorry but you seems to be missing the necessary dynamic module (syzextra.so)!";2252 // $2253 // m2_end(666); // :(2254 }2255 }2256 2257 static proc mod_init()2258 {2259 loadme();2260 2235 } 2261 2236 … … 2372 2347 2373 2348 "ERROR: There were some wrong betti numbers... "; 2374 // m2_end(666);2349 // Syzextra::m2_end(666); 2375 2350 } else 2376 2351 { … … 2471 2446 { 2472 2447 "ERROR: nonsquare M!!!"; 2473 m2_end(666);2448 Syzextra::m2_end(666); 2474 2449 } 2475 2450 … … 2481 2456 "MRES': "; M; print(M); 2482 2457 2483 m2_end(666);2458 Syzextra::m2_end(666); 2484 2459 } 2485 2460 // "MRES': "; M; print(M); … … 2488 2463 { 2489 2464 "ERROR: wrong starting zero module!!!"; 2490 m2_end(666);2465 Syzextra::m2_end(666); 2491 2466 } 2492 2467 … … 2521 2496 2522 2497 option(redSB); option(redTail); 2523 if(@PROFILE){ ProfilerStart(@prof);}2498 if(@PROFILE){ Syzextra::ProfilerStart(@prof);} 2524 2499 timer=0;rtimer=0;def R=SSres(I,0);@m=rtimer; 2525 if(@PROFILE){ ProfilerStop();}2500 if(@PROFILE){ Syzextra::ProfilerStop();} 2526 2501 setring R;module M;list @l=list();@l[size(RES)1]=list();r=nrows(RES[1]);for(i=2;i<=size(RES);i++){M=RES[i];rr=nrows(M);if((r>0)&&(size(M)>0)&&(r<rr)){M=transpose(M);M=M[(r+1)..ncols(M)];M=transpose(M);RES[i]=M;};r=rr;@l[i1] = M;};resolution RR=@l;RR=minres(RR);def S=betti(RR,1);@t=rtimer; 2527 // DetailedPrint(RR,0);2502 // Syzextra::DetailedPrint(RR,0); 2528 2503 SCheck(R); 2529 2504 StopAddResTest(RR, S, @t,@m); … … 2545 2520 " 2546 2521 { 2547 int @prot = (find(option(),"prot") != 0) && (defined( NumberStatsInit)) && (defined(NumberStatsPrint));2522 int @prot = (find(option(),"prot") != 0) && (defined( Syzextra::NumberStatsInit)) && (defined( Syzextra::NumberStatsPrint)); 2548 2523 def @save = basering; 2549 2524 … … 2559 2534 2560 2535 int @l = size(RES); 2561 if(@prot){ NumberStatsInit(); }2562 def rsltn = ComputeResolution(RES[@l], LRES[@l], TRES[@l], l);2563 if(@prot){ NumberStatsPrint("Number statistic for s_res withComputeResolution"); }2536 if(@prot){ Syzextra::NumberStatsInit(); } 2537 def rsltn = Syzextra::ComputeResolution(RES[@l], LRES[@l], TRES[@l], l); 2538 if(@prot){ Syzextra::NumberStatsPrint("Number statistic for s_res with Syzextra::ComputeResolution"); } 2564 2539 2565 2540 if( !@RINGCHANGE ) … … 2581 2556 print(betti(rs, 1)); //minimal betties 2582 2557 print(minres(rs)); 2583 kill rs; 2584 2585 def rs = s_res_bm(M); 2586 print(rs); 2587 print(betti(rs, 0)); // nonminimal betties 2588 print(SRES_list(rs)); 2589 print(betti(rs, 1)); //minimal betties 2590 print(minres(rs)); 2591 2592 } 2593 2594 proc s_res_bm(def I) 2595 { 2596 int @prot = (find(option(),"prot") != 0) && (defined(NumberStatsInit)) && (defined(NumberStatsPrint)); 2558 } 2559 2560 static proc s_res_bm(def I) 2561 { 2562 int @prot = (find(option(),"prot") != 0) && (defined( Syzextra::NumberStatsInit)) && (defined( Syzextra::NumberStatsPrint)); 2597 2563 def @save = basering; 2598 2564 … … 2604 2570 } 2605 2571 int t,tt,sum; 2606 sum = 0;2607 2572 2608 2573 t=rtimer;def R=SSinit(I);tt=rtimer; 2609 2574 2610 "%% Setup(SSinit) TIME:", tt  t; 2611 sum = sum +(ttt);2575 "%% Setup(SSinit) TIME:", tt  t; // if(@prot){ } ? 2576 int sum = (ttt); 2612 2577 2613 2578 if( @RINGCHANGE ){ setring R; } … … 2623 2588 while ( 1 ) 2624 2589 { 2625 if(@prot){ NumberStatsInit(); }2590 if(@prot){ Syzextra::NumberStatsInit(); } 2626 2591 2627 2592 // SSstep(): … … 2629 2594 2630 2595 @l = @l + 1; 2631 if(@prot){ NumberStatsPrint("Number statistic for SSComputeSyzygy["+string(@l2)+"]"); }2632 "%% SSstep[",@l2, "] TIME:", tt  t; 2596 if(@prot){ Syzextra::NumberStatsPrint("Number statistic for SSComputeSyzygy["+string(@l2)+"]"); } 2597 "%% SSstep[",@l2, "] TIME:", tt  t; // if(@prot){ } ? 2633 2598 sum = sum + (ttt); 2634 2599 … … 2639 2604 } 2640 2605 2641 "%% Whole Resolution (with "+string(@l)+"syzygies) TIME:", sum; 2606 "%% Whole Resolution (with "+string(@l)+"syzygies) TIME:", sum; // if(@prot){ } ? 2642 2607 resolution rsltn = list(RES[2..size(RES)]); 2643 2644 print(rsltn);2645 "Nonminimal betties: ";2646 print(betti(rsltn, 0), "betti");2647 "Minimal betties: ";2648 print(betti(rsltn, 1), "betti");2649 2608 2650 2609 if( !@RINGCHANGE ) … … 2663 2622 int @l = size(RES); // def M = RES[@l]; 2664 2623 module N, LL, TT; (N, LL, TT) = SSComputeSyzygy(LRES[@l], TRES[@l]); 2665 SSYZ ret; ret.r = R; ret.szg = N; // Schreyer:: ComputeResolution(RES[2], LRES[2], TRES[2], 0);2624 SSYZ ret; ret.r = R; ret.szg = N; // Schreyer:: Syzextra::ComputeResolution(RES[2], LRES[2], TRES[2], 0); 2666 2625 return (ret); 2667 2626 } … … 2685 2644 2686 2645 option(redSB); option(redTail); 2687 if(@PROFILE){ ProfilerStart(@prof);}2688 timer=0;rtimer=0;def R=SSinit(I);setring R;def RR= ComputeResolution(RES[2], LRES[2], TRES[2], 0);2646 if(@PROFILE){ Syzextra::ProfilerStart(@prof);} 2647 timer=0;rtimer=0;def R=SSinit(I);setring R;def RR= Syzextra::ComputeResolution(RES[2], LRES[2], TRES[2], 0); 2689 2648 @m=rtimer; 2690 if(@PROFILE){ ProfilerStop();}2649 if(@PROFILE){ Syzextra::ProfilerStop();} 2691 2650 RR=minres(RR); def S=betti(RR,1);@t=rtimer; 2692 // DetailedPrint(RR,0); print(RR); print(S, "betti");2651 // Syzextra::DetailedPrint(RR,0); print(RR); print(S, "betti"); 2693 2652 SCheck(R); 2694 2653 StopAddResTest(RR, S, @t,@m); … … 2786 2745 static proc testSimple(list #) 2787 2746 { 2788 mod_assure_load();2789 2790 2747 def DEBUG = 0; 2791 2748 if(size(#) > 0) { DEBUG = #[1]; }
Note: See TracChangeset
for help on using the changeset viewer.