Changeset 8907a4 in git
- Timestamp:
- Jan 12, 2015, 2:33:50 PM (9 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 37c2b35026800c66eeabc04e5cdb28d10ddb012b
- Parents:
- 237b18fd2b55f9e94a90732997e9dfe365995f97eb3c5f137de23b81a3905cbe0c556cc5a7f069e1
- Location:
- Singular
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/normaliz.lib
r237b18f r8907a4 1 1 //// Singular library normaliz.lib 2 2 3 version="version normaliz.lib 4. 0.0.0 Jun_2013"; // $Id$3 version="version normaliz.lib 4.1.0.0 Jan_2015 "; // $Id$ 4 4 category="Commutative Algebra"; 5 5 info=" 6 LIBRARY: normaliz.lib Provides an interface for the use of Normaliz 2. 77 within SINGULAR.8 AUTHORS: 9 6 LIBRARY: normaliz.lib Provides an interface for the use of Normaliz 2.8 or 7 newer within SINGULAR. 8 AUTHORS: Winfried Bruns, Winfried.Bruns@Uni-Osnabrueck.de 9 Christof Soeger, Christof.Soeger@Uni-Osnabrueck.de 10 10 11 11 OVERVIEW: 12 The library normaliz.lib provides an interface for the use of Normaliz 2.7 13 within SINGULAR. The exchange of data is via files. 12 @texinfo 13 The library normaliz.lib provides an interface for the use of Normaliz 2.8 or 14 newer within SINGULAR. The exchange of data is via files. 14 15 In addition to the top level 15 16 functions that aim at objects of type ideal or ring, several other auxiliary 16 17 functions allow the user to apply Normaliz to data of type intmat. Therefore 17 18 SINGULAR can be used as a comfortable environment for the work with Normaliz. 18 @* Please see the @code{Normaliz 2.7Documentation.pdf} (included in the Normaliz19 @* Please see the @code{Normaliz.pdf} (included in the Normaliz 19 20 distribution) for a more extensive documentation of Normaliz. 20 @code{nmz_sing.pdf} describes this library version 2.2, but most points are 21 still valid. 22 23 @*Singular and Normaliz exchange data via files. These files are automatically 21 22 Normaliz allows the use of a grading. In the Singular functions that access 23 Normaliz the parameter grading is an intvec that assigns a (not necessarily 24 positive) degree to every variable of the ambient polynomial ring. 25 But it must give positive degrees to the generators given to function. 26 27 Singular and Normaliz exchange data via files. These files are automatically 24 28 created and erased behind the scenes. As long as one wants to use only the 25 29 ring-theoretic functions there is no need for file management. 26 27 30 @*Note that the numerical invariants computed by Normaliz can be 28 31 accessed in this \"automatic file mode\". 29 30 32 @*However, if Singular is used as a frontend for Normaliz or the user 31 33 wants to inspect data not automatically returned to Singular, then … … 34 36 Deletion of the files is left to the user. 35 37 36 @*Use of this library requires the program Normaliz to be installed.38 Use of this library requires the program Normaliz to be installed. 37 39 You can download it from 38 40 @uref{http://www.mathematik.uni-osnabrueck.de/normaliz/}. Please make sure 39 41 that the executables are in the search path or use setNmzExecPath 40 42 (@ref{setNmzExecPath}). 41 42 KEYWORDS: integral closure; normalization 43 @end texinfo 44 45 KEYWORDS: integral closure; normalization; toric ring 43 46 44 47 PROCEDURES: … … 50 53 elements of I 51 54 normalToricRingFromBinomials(ideal I) computes the normalization of the 52 polynomial ring modulo the unique minimal prime 53 ideal of the binomial ideal I 54 ehrhartRing(ideal I) computes the monomials representing the lattice 55 points of the polytop generated leading monomials 56 of the elements of I 57 intclMonIdeal(ideal I) the exponent vectors of the leading monomials of 58 the elements of I are considered as generators of 59 a monomial ideal whose Rees algebra is computed 60 55 polynomial ring modulo the unique minimal binomial 56 prime ideal of the binomial ideal I 57 ehrhartRing(ideal I) considers the exponent vectors of the elements of I 58 as points of a lattice polytope and computes the 59 integral cloure of the polytopal algebra 60 intclMonIdeal(ideal I) Computes the integral closure of the Rees algebra 61 of the ideal generated by the leading monomials of 62 the elements of I 61 63 torusInvariants(intmat T) computes the ring of invariants of a torus action 62 64 finiteDiagInvariants(intmat C) computes the ring of invariants of a finite … … 70 72 intersectionValRingIdeals(intmat V) computes ideals of monomial valuations 71 73 72 showNuminvs() prints the numerical invariants 73 exportNuminvs() exports the numerical invariants 74 showNuminvs() prints the numerical invariants found by Normaliz 75 exportNuminvs() exports the numerical invariants found by Normaliz 74 76 75 77 setNmzOption(string s, int onoff) sets the option s to onoff … … 237 239 desString("nmz_data_path",nmz_data_path_name); 238 240 nmz_data_path=appendSlash(nmz_data_path); 239 }example 241 } 242 example 240 243 { "EXAMPLE:";echo = 2; 241 244 setNmzDataPath("examples/"); … … 395 398 { 396 399 f=getNmzFile()+"."+suffixes[i]; 397 if (fileExists(f)) { dummy=system("sh","rm "+f+ "&> /dev/null"); } 400 if (fileExists(f)) 401 { 402 dummy=system("sh","rm "+f+ "&> /dev/null"); 403 } 398 404 } 399 405 } … … 580 586 for (int k=1; k+1<=size(#); k=k+2) { 581 587 //get data from the parameter list 582 sgr = #[k]; 583 num_rows = nrows(sgr); 584 num_cols = ncols(sgr); 585 n_mode = #[k+1]; 586 587 write(outf,num_rows); 588 write(outf,num_cols); 589 590 for(i=1;i<=nrows(sgr);i++) 591 { 592 s=""; 593 for(j=1;j<=num_cols;j++) 594 { 595 s=s+string(sgr[i,j])+" "; 596 } 597 write(outf,s); 598 } 599 write(outf,n_mode); 600 write(outf,""); 588 n_mode = #[k+1]; 589 if (n_mode != -1) { //skip -1 mode 590 sgr = #[k]; 591 num_rows = nrows(sgr); 592 num_cols = ncols(sgr); 593 594 write(outf,num_rows); 595 write(outf,num_cols); 596 597 for(i=1;i<=nrows(sgr);i++) 598 { 599 s=""; 600 for(j=1;j<=num_cols;j++) 601 { 602 s=s+string(sgr[i,j])+" "; 603 } 604 write(outf,s); 605 } 606 if (n_mode == 20) { 607 write(outf,"grading"); 608 } else { 609 write(outf,n_mode); 610 } 611 write(outf,""); 612 } 601 613 } 602 614 close(outf); 615 } 616 617 618 static proc prepareGrading(list #) 619 { 620 if (size(#)==0) { 621 return(0,-1); // mode -1 specifies discard the matrix 622 } 623 if (size(#)>1) { 624 print(#); 625 ERROR("To many parameters!"); 626 } 627 intmat g = intmat(#[1],1,size(#[1])); 628 return (g,20); 603 629 } 604 630 … … 611 637 mode. See the Normaliz documentation for more information. 612 638 613 It is also possible to give more than one pair of matrix and mode. In 614 this case all matrices and modes are written. This can be used to 615 combine modes 4,5,6. 639 It is also possible to give more than one pair of matrix and mode. In 640 this case all matrices and modes are written. This can be used to 641 combine modes 4,5,6. 642 Use mode=20 to specify a grading. 616 643 NOTE: Needs an explicit filename set. The filename is created from the 617 644 current filename. … … 677 704 (n_cols,p)=getInt(s,p); 678 705 if (n_rows <= 0 || n_cols <= 0) { 679 680 681 } 682 706 intmat empty; 707 return(empty); 708 } 709 intmat nmz_gen[n_rows][n_cols]; 683 710 for(i=1;i<=n_rows;i++) 684 711 { … … 696 723 intmat sgrnormal=normaliz(sgr,0); 697 724 readNmzData("cst"); 698 readNmzData("typ");699 725 } 700 726 … … 714 740 list nmz_options= 715 741 list("supp",0,"-s",0), 716 list("triang",0,"- v",0),717 list("volume",0,"- V",0),742 list("triang",0,"-tT",0), 743 list("volume",0,"-v",0), 718 744 list("hvect",0,"-p",0), 719 list("hvect_l",0,"-P",0),720 745 list("height1",0,"-1",0), 721 746 list("normal",0,"-n",1), 722 747 list("normal_l",0,"-N",1), 723 748 list("hilb",0,"-h",1), 724 list("hilb_l",0,"-H",1),725 749 list("dual",0,"-d",1), 726 750 list("control",0,"-c",2), … … 739 763 The Normaliz options are accessible via the following names: 740 764 @* @code{-s: supp} 741 @* @code{- v: triang}742 @* @code{- V: volume}765 @* @code{-t: triang} 766 @* @code{-v: volume} 743 767 @* @code{-p: hvect} 744 @* @code{-P: hvect_l}745 768 @* @code{-1: height1} 746 769 @* @code{-n: normal} 747 770 @* @code{-N: normal_l} 748 771 @* @code{-h: hilb} 749 @* @code{-H: hilb_l}750 772 @* @code{-d: dual} 751 773 @* @code{-a: allf} … … 788 810 { 789 811 run_options=run_options+nmz_options[i][3]; 790 791 792 793 812 if (nmz_options[i][1]=="threads") { 813 run_options=run_options+string(nmz_options[i][2]); 814 } 815 run_options=run_options+" "; 794 816 if(nmz_options[i][4]!=2) 795 817 { … … 818 840 819 841 820 static proc runNormaliz(intmat sgr, defnmz_mode, list #)842 static proc runNormaliz(intmat sgr, int nmz_mode, list #) 821 843 { 822 844 if(!queryInt("nmz_files_keep_switch")) … … 876 898 877 899 It is also possible to give more than one pair of matrix and mode. In 878 this case all matrices and modes are used. This can be used to 879 combine modes 4,5,6. 900 this case all matrices and modes are used. This can be used to 901 combine modes 4,5,6. 902 Use nmz_mode=20 to specify a grading. 880 903 NOTE: You will find procedures for many applications of Normaliz in this 881 904 library, so the explicit call of this procedure may not be necessary. 882 905 SEE ALSO: intclToricRing, normalToricRing, ehrhartRing, intclMonIdeal, 883 906 torusInvariants, diagInvariants, finiteDiagInvariants, intersectionValRings, 884 907 intersectionValRingIdeals 885 908 EXAMPLE: example normaliz; shows an example 886 909 " … … 935 958 name_inv="h_vector"; 936 959 } 937 if(name_inv!="hilbert_polynomial") 960 if(name_inv!="hilbert_polynomial" 961 && name_inv!="hilbert_quasipolynomial") 938 962 { 939 963 for(i=1;i<=v_length;i++) … … 961 985 (sw,p)=nextWord(s,p); 962 986 name_inv=s[sw..p-1]; 963 (dummy_int,p)=getInt(s,p); 964 num_invs=num_invs+list(list(name_inv,dummy_int,"int")); 987 if (name_inv!="hilbert_quasipolynomial_denom") { 988 (dummy_int,p)=getInt(s,p); 989 num_invs=num_invs+list(list(name_inv,dummy_int,"int")); 990 } 965 991 } 966 992 if(type_inv=="boolean") … … 1000 1026 { "EXAMPLE:"; echo=2; 1001 1027 ring R=0,(x,y,z,t),dp; 1002 ideal I=x ^2,y^2,z^3;1028 ideal I=x3,x2y,y3; 1003 1029 list l=intclMonIdeal(I); 1004 1030 showNuminvs(); … … 1029 1055 { "EXAMPLE:"; echo=2; 1030 1056 ring R=0,(x,y,z,t),dp; 1031 ideal I=x ^2,y^2,z^3;1057 ideal I=x3,x2y,y3; 1032 1058 list l=intclMonIdeal(I); 1033 1059 exportNuminvs(); … … 1038 1064 nmz_index; 1039 1065 nmz_number_support_hyperplanes; 1040 nmz_homogeneous; 1066 nmz_size_triangulation; 1067 nmz_sum_dets; 1068 nmz_graded; 1069 nmz_degree_1_elements; 1070 nmz_grading; 1071 nmz_grading_denom; 1072 nmz_multiplicity; 1073 nmz_multiplicity_denom; 1074 nmz_hilbert_series_num; 1075 nmz_hilbert_series_denom; 1041 1076 nmz_primary; 1042 nmz_ideal_multiplicity;1043 1077 } 1044 1078 … … 1137 1171 if(expo_vecs[i,ncols(expo_vecs)]==d) 1138 1172 { 1139 1140 1173 m=1; 1141 1174 for(j=1;j<=ncols(expo_vecs)-1;j++) … … 1146 1179 } 1147 1180 } 1148 1149 1181 mons=simplify(mons,2); // get rid of starting 0 1182 return(mons); 1150 1183 } 1151 1184 … … 1155 1188 RETURN: Returns the intmat whose rows represent the exponents of the 1156 1189 (non-zero) elements of I which have to be binomials. 1157 1190 The length of each row is nvars(basering). 1158 1191 SEE ALSO: mons2intmat, intmat2mons 1159 1192 EXAMPLE: example binomials2intmat; shows an example" 1160 1193 { 1161 int i,j,k; 1162 intmat expo_vecs[size(I)][nvars(basering)]; 1163 intvec expo_v; 1164 1165 k=0; 1166 poly f; 1167 1168 for(i=1; i<=ncols(I); i++) 1169 { 1170 if( I[i] != 0 ) 1171 { 1172 k++; 1173 f = I[i]; 1174 if (leadcoef(f) != 1) {f = -f}; //works in all characteristics 1175 if (size(f)!=2 || leadcoef(f)!=1 || leadcoef(f[2])!=-1) 1176 { 1177 ERROR(string("normalToricRing: binomial ideal expected: generator ",i,": ",I[i])); 1178 } 1179 expo_v = leadexp(f)-leadexp(f[2]); 1180 for(j=1;j<=nvars(basering);j++) 1181 { 1182 expo_vecs[k,j]=expo_v[j]; 1183 } 1184 } 1185 } 1186 return(expo_vecs); 1194 int i,j,k; 1195 intmat expo_vecs[size(I)][nvars(basering)]; 1196 intvec expo_v; 1197 1198 k=0; 1199 poly f; 1200 1201 for(i=1; i<=ncols(I); i++) 1202 { 1203 if( I[i] != 0 ) 1204 { 1205 k++; 1206 f = I[i]; 1207 if (leadcoef(f) != 1) {f = -f}; //works in all characteristics 1208 if (size(f)!=2 || leadcoef(f)!=1 || leadcoef(f[2])!=-1) 1209 { 1210 ERROR(string("normalToricRing: binomial ideal expected: generator ",i,": ",I[i])); 1211 } 1212 1213 expo_v = leadexp(f)-leadexp(f[2]); 1214 for(j=1;j<=nvars(basering);j++) 1215 { 1216 expo_vecs[k,j]=expo_v[j]; 1217 } 1218 } 1219 } 1220 return(expo_vecs); 1187 1221 } 1188 1222 example … … 1196 1230 // integral closure of rings and ideals 1197 1231 1198 static proc runIntclToricRing(ideal I, int nmz_mode )1232 static proc runIntclToricRing(ideal I, int nmz_mode, list #) 1199 1233 { 1200 1234 intmat expo_vecs=mons2intmat(I); 1201 1235 1202 1236 string dummy=collectNmzOptions(); // only to set GenGen 1203 1204 return( intmat2mons( runNormaliz(expo_vecs,nmz_mode) ) ); 1205 } 1206 1207 proc intclToricRing(ideal I) 1237 return( intmat2mons( runNormaliz(expo_vecs,nmz_mode, prepareGrading(#)) ) ); 1238 } 1239 1240 proc intclToricRing(ideal I, list #) 1208 1241 "USAGE: intclToricRing(ideal I); 1209 RETURN: The toric ring S is the subalgebra of the basering generated by the 1210 leading monomials of the elements of I. The function computes the 1211 integral closure T of S in the basering and returns an ideal listing 1242 intclToricRing(ideal I, intvec grading); 1243 RETURN: The toric ring S is the subalgebra of the basering generated by 1244 the leading monomials of the elements of I (considered as a list 1245 of polynomials). The function computes the integral 1246 closure T of S in the basering and returns an ideal listing 1212 1247 the algebra generators of T over the coefficient field. 1213 1248 @* The function returns the input ideal I if one of the options 1214 @code{supp}, @code{triang}, or @code{hvect} has been activated. 1249 @code{supp}, @code{triang}, @code{volume}, or @code{hseries} 1250 has been activated. 1215 1251 However, in this case some numerical invariants are computed, and 1216 1252 some other data may be contained in files that you can read into … … 1222 1258 " 1223 1259 { 1224 return(runIntclToricRing(I,0 ));1260 return(runIntclToricRing(I,0,#)); 1225 1261 } 1226 1262 example … … 1229 1265 ideal I=x3,x2y,y3; 1230 1266 intclToricRing(I); 1231 } 1232 1233 proc normalToricRing(ideal I) 1267 showNuminvs(); 1268 //now the same example with another grading 1269 intvec grading = 2,3,1; 1270 intclToricRing(I,grading); 1271 showNuminvs(); 1272 1273 } 1274 1275 proc normalToricRing(ideal I, list #) 1234 1276 "USAGE: normalToricRing(ideal I); 1277 normalToricRing(ideal I, intvec grading); 1235 1278 RETURN: The toric ring S is the subalgebra of the basering generated by the 1236 leading monomials of the elements of I. The function computes the 1279 leading monomials of the elements of I (considered as a list of 1280 polynomials). The function computes the 1237 1281 normalisation T of S and returns an ideal listing the algebra 1238 1282 generators of T over the coefficient field. 1239 1283 @* The function returns the input ideal I if one of the options 1240 @code{supp}, @code{triang}, or @code{hvect} has been activated. 1284 @code{supp}, @code{triang}, @code{volume}, or @code{hseries} 1285 has been activated. 1241 1286 However, in this case some numerical invariants are computed, and 1242 1287 some other data may be contained in files that you can read into … … 1248 1293 " 1249 1294 { 1250 return(runIntclToricRing(I,1 ));1295 return(runIntclToricRing(I,1,#)); 1251 1296 } 1252 1297 example … … 1258 1303 1259 1304 1260 proc normalToricRingFromBinomials(ideal I )1305 proc normalToricRingFromBinomials(ideal I, list #) 1261 1306 "USAGE: normalToricRingFromBinomials(ideal I); 1262 RETURN: 1307 normalToricRingFromBinomials(ideal I, intvec grading); 1308 RETURN: @texinfo 1263 1309 @tex 1264 1310 The ideal $I$ is generated by binomials of type $X^a-X^b$ (multiindex notation) … … 1278 1324 generators of the normalization of $K[N]$. 1279 1325 @end tex 1326 @end texinfo 1280 1327 @* The function returns the input ideal I if one of the options 1281 @code{supp}, @code{triang}, or @code{hvect} has been activated. 1328 @code{supp}, @code{triang}, @code{volume}, or @code{hseries} 1329 has been activated. 1282 1330 However, in this case some numerical invariants are computed, and 1283 1331 some other data may be contained in files that you can read into 1284 Singular .1332 Singular (see @ref{showNuminvs}, @ref{exportNuminvs}). 1285 1333 SEE ALSO: intclToricRing, normalToricRing, ehrhartRing, intclMonIdeal 1286 1334 EXAMPLE: example normalToricRing; shows an example 1287 1335 " 1288 1336 { 1289 1290 1291 intmat result = runNormaliz(expo_vecs,10);1292 1293 1294 1295 1296 1297 1337 intmat expo_vecs = binomials2intmat(I); 1338 string dummy=collectNmzOptions(); // only to set GenGen 1339 intmat result = runNormaliz(expo_vecs,10,prepareGrading(#)); 1340 1341 list baseringlist = ringlist(basering); 1342 ring S = (baseringlist[1]),(x(1..ncols(result))),dp; 1343 ideal I = intmat2mons(result); 1344 export(I); 1345 return (S); 1298 1346 } 1299 1347 example … … 1306 1354 } 1307 1355 1308 static proc runIntclMonIdeal(ideal I, int nmz_mode )1356 static proc runIntclMonIdeal(ideal I, int nmz_mode, list #) 1309 1357 { 1310 1358 intmat expo_vecs=mons2intmat(I); … … 1324 1372 1325 1373 //adjust size of input matrix 1326 if (!last_comp) { // remove last component 1327 intmat tmp[nrows(expo_vecs)][ncols(expo_vecs)-1] = expo_vecs[1..nrows(expo_vecs),1..(ncols(expo_vecs)-1)]; 1328 expo_vecs = tmp; 1329 } 1330 intmat nmz_data=runNormaliz(expo_vecs,nmz_mode); 1374 if (!last_comp) { // remove last component 1375 intmat tmp[nrows(expo_vecs)][ncols(expo_vecs)-1] 1376 = expo_vecs[1..nrows(expo_vecs),1..(ncols(expo_vecs)-1)]; 1377 expo_vecs = tmp; 1378 } 1379 intmat nmz_data=runNormaliz(expo_vecs,nmz_mode,prepareGrading(#)); 1331 1380 1332 1381 if(last_comp) … … 1346 1395 "USAGE: ehrhartRing(ideal I); 1347 1396 RETURN: The exponent vectors of the leading monomials of the elements of I 1348 are considered as vertices of a lattice polytope P.1397 are considered as points of a lattice polytope P. 1349 1398 The Ehrhart ring of a (lattice) polytope P is the monoid algebra 1350 1399 defined by the monoid of lattice points in the cone over the … … 1355 1404 treated as the auxiliary variable of the Ehrhart ring. The 1356 1405 function returns two ideals, the first containing the monomials 1357 representing the lattice points of the polytope, the second1406 representing all the lattice points of the polytope, the second 1358 1407 containing the algebra generators of the Ehrhart ring over the 1359 1408 coefficient field. 1360 1409 @* (ii) If the last ring variable is used by the monomials, the list 1361 1410 returned contains only one ideal, namely the monomials … … 1363 1412 @* 1364 1413 @* The function returns the a list containing the input ideal I if one 1365 of the options @code{supp}, @code{triang}, or @code{hvect} has been1366 1414 of the options @code{supp}, @code{triang}, @code{volume}, or 1415 @code{hseries} has been activated. 1367 1416 However, in this case some numerical invariants are computed, and 1368 1417 some other data may be contained in files that you can read into 1369 Singular .1418 Singular (see @ref{showNuminvs}, @ref{exportNuminvs}). 1370 1419 NOTE: A mathematical remark: the Ehrhart ring depends on the list of 1371 1420 monomials given, and not only on the ideal they generate! … … 1383 1432 } 1384 1433 1385 proc intclMonIdeal(ideal I )1434 proc intclMonIdeal(ideal I, list #) 1386 1435 "USAGE: intclMonIdeal(ideal I); 1436 intclMonIdeal(ideal I, intvec grading); 1387 1437 RETURN: The exponent vectors of the leading monomials of the elements of I 1388 1438 are considered as generators of a monomial ideal for which the … … 1400 1450 closure of the ideal. 1401 1451 @* The function returns the a list containing the input ideal I if one 1402 of the options @code{supp}, @code{triang}, or @code{hvect} has been1403 1452 of the options @code{supp}, @code{triang}, @code{volume}, or 1453 @code{hseries} has been activated. 1404 1454 However, in this case some numerical invariants are computed, and 1405 1455 some other data may be contained in files that you can read into … … 1409 1459 " 1410 1460 { 1411 return(runIntclMonIdeal(I,3 ));1461 return(runIntclMonIdeal(I,3,#)); 1412 1462 } 1413 1463 example … … 1422 1472 // torus invariants and valuation rings and ideals 1423 1473 1424 proc torusInvariants(intmat E )1474 proc torusInvariants(intmat E, list #) 1425 1475 "USAGE: torusInvariants(intmat A); 1426 RETURN: 1476 torusInvariants(intmat A, intvec grading); 1477 RETURN: @texinfo 1427 1478 Returns an ideal representing the list of monomials generating the ring of 1428 1479 invariants as an algebra over the coefficient field. … … 1430 1481 $R^T$. 1431 1482 @end tex 1432 @*The function returns the ideal given by the input matrix A if one of 1433 the options @code{supp}, @code{triang}, or @code{hvect} has been 1434 activated. 1435 However, in this case some numerical invariants are computed, and 1436 some other data may be contained in files that you can read into 1437 Singular. 1438 BACKGROUND: 1483 @* The function returns the ideal given by the input matrix A if one of 1484 the options @code{supp}, @code{triang}, @code{volume}, or 1485 @code{hseries} has been activated. 1486 However, in this case some numerical invariants are computed, and 1487 some other data may be contained in files that you can read into 1488 Singular (see @ref{showNuminvs}, @ref{exportNuminvs}). 1489 @end texinfo 1490 BACKGROUND: @texinfo 1439 1491 @tex 1440 1492 Let $T = (K^*)^r$ be the $r$-dimensional torus acting on the polynomial ring … … 1447 1499 $A=(a_{i,j})$. 1448 1500 @end tex 1501 @end texinfo 1449 1502 SEE ALSO: diagInvariants, finiteDiagInvariants, intersectionValRings, 1450 1503 intersectionValRingIdeals … … 1459 1512 string dummy=collectNmzOptions(); // only to set GenGen 1460 1513 1461 return( intmat2mons( runNormaliz(E,5 ) ) );1514 return( intmat2mons( runNormaliz(E,5,prepareGrading(#)) ) ); 1462 1515 } 1463 1516 example … … 1468 1521 } 1469 1522 1470 proc finiteDiagInvariants(intmat C )1523 proc finiteDiagInvariants(intmat C, list #) 1471 1524 "USAGE: finiteDiagInvariants(intmat U); 1472 RETURN: 1525 finiteDiagInvariants(intmat U, intvec grading); 1526 RETURN: @texinfo 1473 1527 @tex 1474 1528 This function computes the ring of invariants of a finite abelian group $G$ … … 1485 1539 {$R^G=\{f\in R : g_i f = f$ for all $i=1,\ldots,w\}$}. 1486 1540 @end tex 1487 @*The function returns the ideal given by the input matrix C if one of 1488 the options @code{supp}, @code{triang}, or @code{hvect} has been 1489 activated. 1490 However, in this case some numerical invariants are computed, and 1491 some other data may be contained in files that you can read into 1492 Singular. 1541 @end texinfo 1542 @* The function returns the ideal given by the input matrix C if one of 1543 the options @code{supp}, @code{triang}, @code{volume}, or 1544 @code{hseries} has been activated. 1545 However, in this case some numerical invariants are computed, and 1546 some other data may be contained in files that you can read into 1547 Singular (see @ref{showNuminvs}, @ref{exportNuminvs}). 1493 1548 NOTE: 1494 1549 SEE ALSO: torusInvariants, diagInvariants, intersectionValRings, 1495 intersectionValRingIdeals ,showNuminvs,exportNuminvs1550 intersectionValRingIdeals 1496 1551 EXAMPLE: example finiteDiagInvariants; shows an example 1497 1552 " … … 1504 1559 string dummy=collectNmzOptions(); // only to set GenGen 1505 1560 1506 return( intmat2mons( runNormaliz(C,6 ) ) );1561 return( intmat2mons( runNormaliz(C,6,prepareGrading(#)) ) ); 1507 1562 } 1508 1563 example … … 1513 1568 } 1514 1569 1515 proc diagInvariants(intmat E, intmat C )1570 proc diagInvariants(intmat E, intmat C, list #) 1516 1571 "USAGE: diagInvariants(intmat A, intmat U); 1517 RETURN: 1572 diagInvariants(intmat A, intmat U, intvec grading); 1573 RETURN: @texinfo 1518 1574 @tex 1519 1575 This function computes the ring of invariants of a diagonalizable group … … 1525 1581 monomial ideal listing the algebra generators of the subalgebra of invariants. 1526 1582 @end tex 1527 @*The function returns the ideal given by the input matrix A if one of 1528 the options @code{supp}, @code{triang}, or @code{hvect} has been 1529 activated. 1530 However, in this case some numerical invariants are computed, and 1531 some other data may be contained in files that you can read into 1532 Singular. 1533 SEE ALSO: torusInvariants, finiteDiagInvariants, intersectionValRings, intersectionValRingIdeals,showNuminvs,exportNuminvs 1583 @end texinfo 1584 @* The function returns the ideal given by the input matrix A if one of 1585 the options @code{supp}, @code{triang}, @code{volume}, or 1586 @code{hseries} has been activated. 1587 However, in this case some numerical invariants are computed, and 1588 some other data may be contained in files that you can read into 1589 Singular (see @ref{showNuminvs}, @ref{exportNuminvs}). 1590 SEE ALSO: torusInvariants, finiteDiagInvariants, intersectionValRings, intersectionValRingIdeals 1534 1591 EXAMPLE: example diagInvariants; shows an example 1535 1592 " … … 1542 1599 string dummy=collectNmzOptions(); // only to set GenGen 1543 1600 1544 return( intmat2mons( runNormaliz(E,5,C,6 ) ) );1601 return( intmat2mons( runNormaliz(E,5,C,6,prepareGrading(#)) ) ); 1545 1602 } 1546 1603 example … … 1552 1609 } 1553 1610 1554 proc intersectionValRings(intmat V )1555 "USAGE: intersectionValRings(intmat V );1611 proc intersectionValRings(intmat V, list #) 1612 "USAGE: intersectionValRings(intmat V, intvec grading); 1556 1613 RETURN: The function returns a monomial ideal, to be considered as the list 1557 1614 of monomials generating @math{S} as an algebra over the coefficient 1558 1615 field. 1559 BACKGROUND: 1616 BACKGROUND: @texinfo 1560 1617 @tex 1561 1618 A discrete monomial valuation $v$ on $R = K[X_1 ,\ldots,X_n]$ is determined by … … 1565 1622 its input. 1566 1623 @end tex 1567 @*The function returns the ideal given by the input matrix V if one of 1568 the options @code{supp}, @code{triang}, or @code{hvect} has been 1569 activated. 1570 However, in this case some numerical invariants are computed, and 1571 some other data may be contained in files that you can read into 1572 Singular. 1573 SEE ALSO: torusInvariants, diagInvariants, finiteDiagInvariants, intersectionValRingIdeals,showNuminvs,exportNuminvs 1624 @end texinfo 1625 @* The function returns the ideal given by the input matrix V if one of 1626 the options @code{supp}, @code{triang}, @code{volume}, or 1627 @code{hseries} has been activated. 1628 However, in this case some numerical invariants are computed, and 1629 some other data may be contained in files that you can read into 1630 Singular (see @ref{showNuminvs}, @ref{exportNuminvs}). 1631 SEE ALSO: torusInvariants, diagInvariants, finiteDiagInvariants, intersectionValRingIdeals 1574 1632 EXAMPLE: example intersectionValRings; shows an example 1575 1633 " … … 1601 1659 /* if(!GenGen) // return V 1602 1660 { 1603 runNormaliz(V1,4 );1661 runNormaliz(V1,4,prepareGrading(#)); 1604 1662 return(V); 1605 1663 } 1606 1664 */ 1607 return(intmat2mons(runNormaliz(V1,4 )));1665 return(intmat2mons(runNormaliz(V1,4,prepareGrading(#)))); 1608 1666 } 1609 1667 example … … 1614 1672 } 1615 1673 1616 proc intersectionValRingIdeals(intmat V )1674 proc intersectionValRingIdeals(intmat V, list #) 1617 1675 "USAGE: intersectionValRingIdeals(intmat V); 1676 intersectionValRingIdeals(intmat V, intvec grading); 1618 1677 RETURN: The function returns two ideals, both to be considered as lists of 1619 monomials which generate an algebra over the coefficient field. The1678 monomials. The 1620 1679 first is the system of monomial generators of @math{S}, the second 1621 1680 the system of generators of @math{M}. … … 1626 1685 some other data may be contained in files that you can read into 1627 1686 Singular (see @ref{showNuminvs}, @ref{exportNuminvs}). 1628 BACKGROUND: 1687 BACKGROUND: @texinfo 1629 1688 @tex 1630 1689 A discrete monomial valuation $v$ on $R = K[X_1 ,\ldots,X_n]$ is determined by … … 1639 1698 The numbers $w_i$ form the $(n+1)$th column of the input matrix. 1640 1699 @end tex 1700 @end texinfo 1641 1701 NOTE: The function also gives an error message if the matrix V has the 1642 1702 wrong number of columns. … … 1671 1731 string dummy=collectNmzOptions(); // only to set GenGen 1672 1732 1673 intmat nmz_data=runNormaliz(V1,4 );1733 intmat nmz_data=runNormaliz(V1,4,prepareGrading(#)); 1674 1734 1675 1735 ideal I1=intmat2monsSel(nmz_data,0); -
Singular/LIB/primdec.lib
reb3c5f1 r8907a4 3935 3935 ideal F=imap(R,F); 3936 3936 3937 string nR1="ring @S1="+string(p)+",("+varstr(R)+","+parstr(R)+",@y(1..m)),dp;"; 3938 execute(nR1); 3939 list lR=ringlist(@S1)[2]; 3940 lR=lR[(size(lR)-m+1)..(size(lR))]; 3941 3942 string nR="ring @S="+string(p)+",("+string(lR)+","+varstr(R)+","+parstr(R)+"),dp;"; 3937 string nR="ring @S="+string(p)+",(@y(1..m),"+varstr(R)+","+parstr(R)+"),dp;"; 3943 3938 execute(nR); 3944 3939 -
Singular/emacs.cc
reb3c5f1 r8907a4 9 9 10 10 11 #include <kernel/mod2.h> 12 #include <omalloc/omalloc.h> 13 #include <resources/feResource.h> 14 #include <Singular/feOpt.h> 15 11 16 #ifdef __CYGWIN__ 12 17 #define BOOLEAN boolean 13 18 #endif 14 #include <kernel/mod2.h>15 16 19 17 20 #include <stdio.h> … … 30 33 #endif 31 34 32 #include <omalloc/omalloc.h>33 #include <resources/feResource.h>34 #include <Singular/feOpt.h>35 35 36 36 #if !defined(TSINGULAR) && !defined(ESINGULAR) … … 63 63 } 64 64 #else 65 void error(c har* fmt, ...)65 void error(const char* fmt, ...) 66 66 { 67 67 char buf[4096]; -
Singular/ipshell.cc
reb3c5f1 r8907a4 1219 1219 //Print("branchTo: %s\n",h->Name()); 1220 1220 iiCurrProc=(idhdl)h->data; 1221 err=iiAllStart(IDPROC(iiCurrProc),IDPROC(iiCurrProc)->data.s.body,BT_proc,IDPROC(iiCurrProc)->data.s.body_lineno-(iiCurrArgs==NULL)); 1221 procinfo * pi=IDPROC(iiCurrProc); 1222 if( pi->data.s.body==NULL ) 1223 { 1224 iiGetLibProcBuffer(pi); 1225 if (pi->data.s.body==NULL) return TRUE; 1226 } 1227 err=iiAllStart(pi,pi->data.s.body,BT_proc,pi->data.s.body_lineno-(iiCurrArgs==NULL)); 1222 1228 exitBuffer(BT_proc); 1223 1229 if (iiCurrArgs!=NULL)
Note: See TracChangeset
for help on using the changeset viewer.