Changeset 82716e in git
- Timestamp:
- May 14, 1998, 8:45:19 PM (25 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 68e324ca946be87c2ab75edd4cc0fd161e1f6ead
- Parents:
- 30c91fe3835d6ff4504cc9ddeeb5866465754c2a
- Location:
- Singular/LIB
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/all.lib
r30c91f r82716e 1 // $Id: all.lib,v 1.1 0 1998-05-14 18:26:51Singular Exp $1 // $Id: all.lib,v 1.11 1998-05-14 18:44:54 Singular Exp $ 2 2 /////////////////////////////////////////////////////////////////////////////// 3 3 4 version="$Id: all.lib,v 1.1 0 1998-05-14 18:26:51Singular Exp $";4 version="$Id: all.lib,v 1.11 1998-05-14 18:44:54 Singular Exp $"; 5 5 info=" 6 6 LIBRARY: all.lib Load all libraries 7 8 classify.lib PROCEDURES FOR THE ARNOLD-CLASSIFIER OF SINGULARITIES 7 8 classify.lib PROCEDURES FOR THE ARNOLD-CLASSIFIER OF SINGULARITIES 9 9 deform.lib PROCEDURES FOR COMPUTING MINIVERSAL DEFORMATION 10 10 elim.lib PROCEDURES FOR ELIMINATION, SATURATION AND BLOWING UP … … 15 15 graphics.lib PROCEDURES TO DRAW WITH MATHEMATICA 16 16 hnoether.lib PROCEDURES FOR THE HAMBURGER-NOETHER-DEVELOPMENT 17 homolog.lib PROCEDURES FOR HOMOLOGICAL ALGEBRA 17 homolog.lib PROCEDURES FOR HOMOLOGICAL ALGEBRA 18 18 inout.lib PROCEDURES FOR MANIPULATING IN- AND OUTPUT 19 19 invar.lib PROCEDURES FOR COMPUTING INVARIANTS OF (C,+)-ACTIONS 20 20 matrix.lib PROCEDURES FOR MATRIX OPERATIONS 21 21 normal.lib PROCEDURES FOR COMPUTING THE NORMALIZATION 22 poly.lib PROCEDURES FOR MANIPULATING POLYS, IDEALS, MODULES 22 poly.lib PROCEDURES FOR MANIPULATING POLYS, IDEALS, MODULES 23 23 presolve.lib PROCEDURES FOR PRE-SOLVING POLYNOMIAL EQUATIONS 24 24 primdec.lib PROCEDURES FOR PRIMARY DECOMPOSITION -
Singular/LIB/classify.lib
r30c91f r82716e 1 // $Id: classify.lib,v 1.2 4 1998-05-14 12:49:29 krueger Exp $2 /////////////////////////////////////////////////////////////////////////////// 3 4 version = "$Id: classify.lib,v 1.24 1998-05-14 12:49:29 krueger Exp $";1 // $Id: classify.lib,v 1.25 1998-05-14 18:44:55 Singular Exp $ 2 /////////////////////////////////////////////////////////////////////////////// 3 4 version = "$Id: classify.lib,v 1.25 1998-05-14 18:44:55 Singular Exp $"; 5 5 info=" 6 LIBRARY: classify.lib PROCEDURES FOR THE ARNOLD-CLASSIFIER OF SINGULARITIES 6 LIBRARY: classify.lib PROCEDURES FOR THE ARNOLD-CLASSIFIER OF SINGULARITIES 7 7 8 8 A library for classifying isolated hypersurface singularities w.r.t. right … … 13 13 basicinvariants(f); computes Milnor number, determinacy-bound and corank of f 14 14 classify(f); normal form of poly f determined with Arnold's method 15 corank(f); computes the corank of f (i.e. of the Hessian of f) 16 Hcode(v); coding of intvec v acoording to the number repetitions 17 init_debug([n]); print trace and debugging information depending on int n 18 internalfunctions(); display names of internal procedures of this library 15 corank(f); computes the corank of f (i.e. of the Hessian of f) 16 Hcode(v); coding of intvec v acoording to the number repetitions 17 init_debug([n]); print trace and debugging information depending on int n 18 internalfunctions(); display names of internal procedures of this library 19 19 milnorcode(f[,e]); Hilbert poly of [e-th] Milnor algebra coded with Hcode 20 20 morsesplit(f); residual part of f after applying the splitting lemma … … 54 54 "USAGE: classify(f); f=poly 55 55 COMPUTE: normal form and singularity type of f with respect to right 56 equivalence, as given in the book \"Singularities of 56 equivalence, as given in the book \"Singularities of 57 57 differentiables maps, Volume I\" by V.I. Arnold, S.M. Gusein-Zade, 58 58 A.N. Varchenko … … 63 63 Updates can be found under: 64 64 URL=http://www.mathematik.uni-kl.de/~krueger/Singular/ 65 NOTE: type init_debug(n); (0 <= n <= 10) in order to get intermediate 65 NOTE: type init_debug(n); (0 <= n <= 10) in order to get intermediate 66 66 information, higher values of n give more information. 67 67 The proc creates several global objects with names all starting 68 with @, hence there should be no name conflicts 68 with @, hence there should be no name conflicts 69 69 EXAMPLE: example classify; shows an example" 70 70 { … … 74 74 string s2; 75 75 list v; 76 def ring_ext = basering; 76 def ring_ext = basering; 77 77 78 78 init_debug(); // initialize trace/debug mode … … 96 96 97 97 //---------------- collect results and create return-value -------------------- 98 if( s2=="error!" || s2=="NoClass") { 98 if( s2=="error!" || s2=="NoClass") { 99 99 setring ring_ext; 100 100 return(f_in); … … 125 125 static 126 126 proc Klassifiziere (poly f) 127 { 127 { 128 128 //--------------------------- initialisation ---------------------------------- 129 129 string s1; … … 131 131 list v, cstn; 132 132 map PhiG; 133 def ring_top = basering; 133 def ring_top = basering; 134 134 135 135 n = nvars(basering); // Zahl der Variablen des aktuellen Rings. 136 136 PhiG = ring_top, maxideal(1); 137 137 cstn[4] = PhiG; 138 if( defined(@ringdisplay) == 0) { 138 if( defined(@ringdisplay) == 0) { 139 139 string @ringdisplay; // Define always 'ringdisplay' to be 140 140 export @ringdisplay; // able to run 'Show(f)' … … 147 147 148 148 //---------------------- compute basciinvariants ------------------------------ 149 if(jet(f,0) != 0 ) { 149 if(jet(f,0) != 0 ) { 150 150 cstn[1] = corank(f); cstn[2]=-1; cstn[3]=1; 151 151 return(printresult(1, f, "a unit", cstn, -1)); … … 162 162 cstn[3] = K; 163 163 164 if( Mu == 0) { 164 if( Mu == 0) { 165 165 cstn[1]=1; cstn[3]=1; 166 166 return(printresult(1, f, "A[0]", cstn, 0)); } … … 175 175 v = HKclass(milnorcode(f)); 176 176 if(v[2]>0) { debug_log(0, "Guessing type via Milnorcode: ", v[1]);} 177 else { 177 else { 178 178 debug_log(0, "Hilbert polynomial not recognised. Milnor code = ", 179 179 milnorcode(f)); … … 183 183 184 184 //------------ step 1, classification according to corank(f) ------------------ 185 if(corank_f == 0) { 185 if(corank_f == 0) { 186 186 return(printresult(2, f, "A["+string(Mu)+"]", cstn, 0)); } 187 if(corank_f == 1) { 187 if(corank_f == 1) { 188 188 return(printresult(2, f, "A["+string(Mu)+"]", cstn, 0)); } 189 189 cstn[4] = 0; … … 204 204 string s1; 205 205 list v_res, v_class, v, iv; 206 206 207 207 corank = cstn[1]; 208 208 K = cstn[3]; … … 211 211 //-------------------- apply morsesplit if n>corank --------------------------- 212 212 if( n > corank) { 213 debug_log(0, 213 debug_log(0, 214 214 "I have to apply the splitting lemma. This will take some time....:-)"); 215 215 v_res = Morse(f, K, corank, 0); … … 223 223 if(defined(RingB) != 0 ) { kill RingB; } 224 224 ring ring_rest=char(basering),(x(1..corank)),(c,ds); 225 225 226 226 map MapReduce=ring_top,maxideal(1); 227 227 poly G = MapReduce(g); 228 228 map PhiG=ring_top,maxideal(1);// Konstruiere Id auf r 229 229 PhiG = MapReduce(PhiG); 230 230 231 231 execute("ring RingB="+charstr(basering)+",("+A_Z("x",corank)+"),(c,ds);"); 232 232 export RingB; 233 233 setring ring_rest; 234 234 } 235 else { 235 else { 236 236 ring ring_rest=char(basering),(x(1..corank)),(c,ds); 237 237 map PhiG=ring_top,maxideal(1); 238 238 poly G = PhiG(f); 239 239 } 240 240 241 241 //--------------------- step 1 of Arnold now finished ------------------------- 242 242 map phi = ring_rest,maxideal(1); … … 263 263 static 264 264 proc Funktion3 (poly f, list cstn) 265 { 265 { 266 266 //---------------------------- initialisation --------------------------------- 267 267 poly f3 = jet(f, 3); … … 282 282 if( Mult == 1) { return(printresult(5,f,"D["+string(Mu)+"]", cstn, 0)); } 283 283 if( Mult == 2) { return(Funktion6(f, cstn));} // series E,J 284 debug_log(0, "dimension 1 und deg != 1, 2 => error, ", 284 debug_log(0, "dimension 1 und deg != 1, 2 => error, ", 285 285 "this should never occur"); 286 286 return(printresult(3, f, "error!", cstn, -1)); … … 351 351 if(Dim==0) { return(printresult(11,f,"J["+string(k)+",0]",cstn,k-1)); } 352 352 Mult = mult(Jf); 353 if( Dim ==1 && Mult==1) { 353 if( Dim ==1 && Mult==1) { 354 354 return(printresult(12,f,"J["+string(k)+","+string(Mu - 6*k +2)+"]", 355 355 cstn, k-1)); … … 373 373 static 374 374 proc Funktion13 (poly f, list cstn) 375 { 375 { 376 376 //---------------------------- initialisation --------------------------------- 377 377 poly f4; … … 391 391 Mult = mult(Jf); 392 392 if( Dim == 1) { 393 if( Mult == 1 ) { 394 return(printresult(15, f, 393 if( Mult == 1 ) { 394 return(printresult(15, f, 395 395 "X[1,"+string(Mu-9)+"] = T[2,4,"+string(Mu-5)+"]", cstn, 1)); 396 396 } … … 403 403 } 404 404 if( Mult == 3 ) { return(Funktion25(f, cstn)); } 405 } 405 } 406 406 // Should never reach this line 407 407 return(printresult(13, f, "error!", cstn, -1)); … … 441 441 JetId = x(1)^3*x(2) + x(2)^(3*p+2); // check jet x3y,y3k+2 : Z[6p+5] 442 442 fk = jet(f, 3*(3*p+2), weight(JetId)); 443 if( Coeff(fk, x(2), x(2)^(3*p+2)) != 0) { 443 if( Coeff(fk, x(2), x(2)^(3*p+2)) != 0) { 444 444 return(printresult(19,f, "Z["+string(6*p+5)+"]", cstn, p)); 445 445 } … … 447 447 JetId = x(1)^3*x(2)+x(1)*x(2)^(2*p+2); // check jet x3y,xy2k+2 : Z[6p+6] 448 448 fk = jet(f, 2*(3*p+2)+1, weight(JetId)); 449 if( Coeff(fk, x(1)*x(2), x(1)*x(2)^(2*p+2)) != 0) { 449 if( Coeff(fk, x(1)*x(2), x(1)*x(2)^(2*p+2)) != 0) { 450 450 return(printresult(20, f, "Z["+string(6*p+6)+"]", cstn, p)); 451 451 } … … 466 466 Mult = mult(Jf); 467 467 if(Dim==0) { return(printresult(23,f,"Z["+string(p-1)+",0]", cstn, p)); } 468 if( Mult == 1 ) { 469 return(printresult(24, f, "Z["+string(p-1)+","+string(Mu-3-6*p)+"]", 468 if( Mult == 1 ) { 469 return(printresult(24, f, "Z["+string(p-1)+","+string(Mu-3-6*p)+"]", 470 470 cstn, p)); 471 471 } … … 518 518 JetId = x(1)^4 + x(2)^(4*k+2); 519 519 fk = jet(f, 2*(4*k+2), weight(JetId)); 520 if( Coeff(fk, x(2), x(2)^(4*k+2)) != 0) { 520 if( Coeff(fk, x(2), x(2)^(4*k+2)) != 0) { 521 521 Jf = std(jacob(fk)); 522 522 Dim = dim(Jf); 523 523 if(Dim==0) {return(printresult(30,f,"W["+string(k)+",0]",cstn,3*k-1));} 524 if(Dim==1) { 525 return(printresult(32, f, 524 if(Dim==1) { 525 return(printresult(32, f, 526 526 "W#["+string(k)+","+string(Mu-12*k-2)+"]", cstn, 3*k-1)); 527 527 } … … 533 533 Jf = std(jacob(ft)); 534 534 Dim = dim(Jf); 535 if( Dim == 0 ) { 535 if( Dim == 0 ) { 536 536 return(printresult(31, f, "W["+string(k)+","+string(Mu-12*k-3)+"]", 537 537 cstn, 3*k-1)); … … 560 560 Mult = mult(Jf); 561 561 if(Dim==0) {return(printresult(37,f,"X["+string(k)+",0]",cstn,3*k-1));} 562 if(Dim==1) { 563 if(Mult==1) { 562 if(Dim==1) { 563 if(Mult==1) { 564 564 return(printresult(38, f,"X["+string(k)+","+string(Mu-12*k+3)+"]", 565 565 cstn, 3*k-1)); 566 566 } 567 if(Mult==2) { 567 if(Mult==2) { 568 568 ft = Teile(fk, x(1)^2); 569 569 Jf = std(jacob(ft)); … … 574 574 } 575 575 } 576 if(Mult!=3) { 576 if(Mult!=3) { 577 577 return(printresult(36, f, "error!", cstn, -1)); } 578 578 } … … 618 618 r = kr-k; 619 619 setring ring_top; 620 if( Typ == "E[6k]" ) { 621 return(printresult(42, f, "Z["+string(k)+","+string(12*k+6*r-1)+"]", 620 if( Typ == "E[6k]" ) { 621 return(printresult(42, f, "Z["+string(k)+","+string(12*k+6*r-1)+"]", 622 622 cstn, 3*k+r-2)); 623 623 } 624 if( Typ == "E[6k+1]" ) { 624 if( Typ == "E[6k+1]" ) { 625 625 return(printresult(43, f, "Z["+string(k)+","+string(12*k+6*r)+"]", 626 626 cstn, 3*k+r-2)); … … 645 645 static 646 646 proc Funktion50 (poly f, list cstn) 647 { 647 { 648 648 //---------------------------- initialisation --------------------------------- 649 649 poly f3; … … 655 655 if( f3 == 0 ) { return(printresult(104, f, "NoClass", cstn, -1)); } 656 656 657 // f3 ~ 657 // f3 ~ 658 658 Jf1 = jacob(f3); 659 659 Jf = std(Jf1); … … 662 662 Mu = cstn[2]; 663 663 664 if(Dim == 0) { 664 if(Dim == 0) { 665 665 return(printresult(51, f, "P[8] = T[3,3,3]", cstn, 1)); 666 666 } // x3 + y3 + z3 + axyz 667 if(Dim == 1) { 667 if(Dim == 1) { 668 668 if (Mult == 1) { 669 669 return(printresult(52, f,"P["+string(Mu)+"] = T[3,3,"+string(Mu-5)+"]", … … 725 725 M = J1; 726 726 J2 = minor(M, 2), S; 727 727 728 728 //------------------ determine coordinate named 'x' ----------------------- 729 729 S = sat(J2, maxideal(1))[1]; … … 741 741 debug_log(6, "f3,s1=", Show(f3)); 742 742 if( b1 != 0) { 743 VERT=ring_top,-1*b1*x(1), -1*b2*x(1)+x(2), -1*b3*x(1) + x(3); 743 VERT=ring_top,-1*b1*x(1), -1*b2*x(1)+x(2), -1*b3*x(1) + x(3); 744 744 kx=1; ky=2; kz=3; 745 745 } … … 765 765 //---------------- compute f_2 such that j3f = xf_2+f_3 ------------------- 766 766 debug_log(6, "1) x=", kx, " y=", ky, " z=", kz ); 767 matrix C = Coeffs(f3, x(kx)); 767 matrix C = Coeffs(f3, x(kx)); 768 768 fb=C[2,1]; // Coeff von x^1 769 769 fc=C[1,1]; // Coeff von x^0 … … 776 776 b = Coeff(Relation, x(kz), x(kz)); 777 777 B[rvar(x(ky))] = x(ky)-b*x(kz); 778 } 778 } 779 779 else { 780 780 Jfsyz = fb, diff(fb, x(kz)); … … 791 791 f3 = jet(f,3); 792 792 kill Mat; 793 } 793 } 794 794 else { ky,kz = swap(ky,kz); } 795 795 796 796 //------- compute tschirnhaus for 'z' and get f3=f_1(x,y,z)y^2+z^3 -------- 797 C = Coeffs(f3, x(kx)); 797 C = Coeffs(f3, x(kx)); 798 798 fb = C[2,1]; // Coeff von x^1 799 799 fc = C[1,1]; // Coeff von x^0 … … 804 804 cstn[4] = PhiG; 805 805 f3 = jet(f,3); 806 806 807 807 //------------------- compute f_1 and get f3=xy^2+z^3 --------------------- 808 808 fb = (f3 - 1*(Coeffs(f3, x(kz))[4,1])*x(kz)^3)/(x(ky)^2); … … 820 820 821 821 //--------------------- permutation of x,y,z ----------------------------- 822 if(Coeffs(f3, x(1))[4,1]!=0) { 822 if(Coeffs(f3, x(1))[4,1]!=0) { 823 823 kx=1; 824 824 if(Coeffs(f3, x(2))[3,1]==0) { ky=2; kz=3; } … … 826 826 } 827 827 else { 828 if(Coeffs(f3, x(2))[4,1]!=0) { 828 if(Coeffs(f3, x(2))[4,1]!=0) { 829 829 kx=2; 830 830 if(Coeffs(f3, x(3))[3,1]==0) { ky=3; kz=1; } 831 831 else { ky=1; kz=3; } 832 832 } 833 else { 833 else { 834 834 kx=3; 835 835 if(Coeffs(f3, x(1))[3,1]==0) { ky=1; kz=2; } … … 902 902 Mult = mult(JetId); 903 903 if(Dim==0) { return(printresult(64, f, "Q["+string(p)+",0]", cstn, p)); } 904 if(Dim==1) { 904 if(Dim==1) { 905 905 if(Mult == 1) { 906 906 return(printresult(65, f, "Q["+string(p)+","+string(Mu-(6*p+2))+"]", 907 907 cstn, p)); 908 908 } 909 if(Mult == 2) { 909 if(Mult == 2) { 910 910 fk = jet(fr, 3*w[1], w); 911 911 f_tmp = Coeffs(phi, x(1))[4,1] *x(1)^3+fk; … … 1013 1013 1014 1014 //------------ find coordinatechange for f3 ~ x3+xz2, if possible ------------ 1015 matrix C = coeffs(f3, x(kx)); 1015 matrix C = coeffs(f3, x(kx)); 1016 1016 if(size(C) == 3) { C = coeffs(f3, x(kz)); kx,kz=swap(kx, kz); } 1017 1017 if(C[1,1] == 0 && C[3,1] == 0) { Fall = 1; } … … 1023 1023 VERT=ring_top,x(kx),x(ky),x(kz); 1024 1024 } 1025 if(Fall == 2) { 1025 if(Fall == 2) { 1026 1026 v = tschirnhaus(f3/x(kz), x(kx)); 1027 1027 b1, VERT = [1..2]; 1028 1028 } 1029 if(Fall == 3) { 1029 if(Fall == 3) { 1030 1030 v = tschirnhaus(f3/x(kx), x(kx)); 1031 1031 b1, VERT = [1..2]; … … 1041 1041 1042 1042 //------------- if f3 ~ x3+xz2 then continue with classification ------------- 1043 C = coeffs(f3, x(1)); 1044 if( C[1,1] == 0 && C[2,1] != 0 && C[3,1] == 0 && C[4,1] != 0 ) { 1043 C = coeffs(f3, x(1)); 1044 if( C[1,1] == 0 && C[2,1] != 0 && C[3,1] == 0 && C[4,1] != 0 ) { 1045 1045 return(Funktion83(f, cstn)); 1046 1046 } … … 1155 1155 if ( Dim == 1 ) { 1156 1156 if ( Mult == 4 ) { 1157 if( fk - phi != 0) { // b!=0 und/oder b'!=0 1157 if( fk - phi != 0) { // b!=0 und/oder b'!=0 1158 1158 if( Coeff(fk,x(1)*x(2), x(1)^2*x(2)^k) == 0 ) { // b=0 und b'!=0 1159 1159 a = (fk - Coeff(fk, x(1), x(1)^3)*x(1)^3) / x(1); 1160 1160 v = Isomorphie_s82_z(f, a, k); 1161 } 1161 } 1162 1162 else { 1163 if( Coeff(fk,x(1)*x(2)*x(3), x(1)*x(2)^k*x(3)) == 0 ){ 1163 if( Coeff(fk,x(1)*x(2)*x(3), x(1)*x(2)^k*x(3)) == 0 ){ 1164 1164 // b!=0 und b'=0 1165 1165 a = subst(fk, x(3), 0); … … 1248 1248 b = Coeff(l2, x(ky), x(ky)); 1249 1249 if( b== 0) { ky, kz = swap(ky, kz); } 1250 1250 1251 1251 // Koordinaten-Transf. s.d. f=x2y 1252 1252 b = Coeff(l2, x(ky), x(ky)); … … 1260 1260 PhiG = VERT(PhiG); 1261 1261 cstn[4] = PhiG; 1262 } 1262 } 1263 1263 1264 1264 //------------------------------- step 98 --------------------------------- … … 1301 1301 Phi = ring_top, B; 1302 1302 v[1] = f; 1303 if ( EH(b) != 0) // pruefe ob der Koeff von x_i^hc 1303 if ( EH(b) != 0) // pruefe ob der Koeff von x_i^hc 1304 1304 { B[rvar(x)] = x -1*(cf[hc,1]/(hc*b)); 1305 1305 v[1] = Phi(f); … … 1341 1341 d = Coeff(fk, x(1)*x(2), x(1)*x(2)^3); 1342 1342 1343 if( (a != 0) && (b != 0) ) { 1343 if( (a != 0) && (b != 0) ) { 1344 1344 B = -int(Coeff(Matx[1,1], x(2), x(2))); 1345 1345 C = -int(Coeff(Maty[1,1], x(1), x(1))); … … 1402 1402 f = VERT(f); 1403 1403 PhiG = VERT(PhiG); 1404 } 1404 } 1405 1405 else { // "Weder b noch a sind 0"; 1406 1406 if(ct > 5) { v[1]=f; v[2]=PhiG; return(v); } … … 1408 1408 return(Isomorphie_s17(f, fk, k, ct+1, PhiG)); 1409 1409 } 1410 } 1410 } 1411 1411 else { // k >1 1412 1412 a = fk/x(2); … … 1468 1468 1469 1469 s = s +"' has 4-jet equal to zero. (F47), mu="+string(Mu); 1470 1470 1471 1471 s; // +" ("+SG_Typ+")"; 1472 1472 return(Show(f), tp, corank); … … 1576 1576 static 1577 1577 proc Morse(poly f, int K, int corank, int ShowPhi) 1578 { 1578 { 1579 1579 //---------------------------- initialisation --------------------------------- 1580 1580 poly fc, f2, a, P, Beta, fi; … … 1591 1591 1592 1592 def ring_top=basering; 1593 1593 1594 1594 debug_log(3, "Spalte folgendes Polynom mit Bestimmtheit: ", string(K)); 1595 1595 debug_log(3, Show(fi)); 1596 1596 1597 1597 for( j=1; j<=n ; j++) { Abb[j] = 0; } 1598 1598 1599 1599 RFlg = GetRf(fi, n); 1600 1600 debug_log(2, "Reihenfolge fuer Vertauschungen:", RFlg ); 1601 1601 PhiG=ring_top,maxideal(1); 1602 1602 1603 1603 //----------------- find quadratic term, if there is only one ----------------- 1604 1604 B = maxideal(1); … … 1626 1626 } 1627 1627 Phi =ring_top,B; 1628 fi = Phi(fi); 1628 fi = Phi(fi); 1629 1629 PhiG = Phi(PhiG); 1630 1630 } 1631 1631 if( ShowPhi > 1) { PhiG; } 1632 1632 1633 1633 //------------------------ compute spliting lemma ----------------------------- 1634 1634 fc = fi; … … 1647 1647 a = Coeff(jet(fc,2), x(RFlg[i]), x(RFlg[i])^2); 1648 1648 debug_log(6,"Koeffizient von x(" + string(RFlg[i]) + ")^2 ist:", a); 1649 if( (a != 0) || (i==n) ) { 1649 if( (a != 0) || (i==n) ) { 1650 1650 debug_log(6, "BREAK!!!!!!!!!!!!!!"); 1651 1651 break; … … 1661 1661 j = j + 1; 1662 1662 } // Ende while( (j<=n) || (i==n) ) 1663 1663 1664 1664 debug_log(6, "Moegliche Verschiebung fertig!"); 1665 1665 PhiG = Phi(PhiG); 1666 1666 if( ShowPhi > 1) { "NachVersch.:"; Phi; } 1667 1667 1668 1668 if( (j<=n) || (i==n)) { 1669 1669 P = Coeff(fc, x(RFlg[i]), x(RFlg[i])); … … 1693 1693 } // Ende if( (j<=n) || (i==n)) 1694 1694 } // Ende if( (f2 - subst(f2, x(RFlg[i]), 0)) != 0 ) 1695 1695 1696 1696 fi = fc; 1697 1697 i = i + 1; … … 1699 1699 } 1700 1700 debug_log(6, "Ende ---------------------------------------------------"); 1701 1701 1702 1702 //--------------------------- collect results --------------------------------- 1703 1703 if( ShowPhi > 0 ) { … … 1708 1708 "fi = " + Show(fi); 1709 1709 } 1710 1710 1711 1711 Rang = 0; 1712 1712 B = maxideal(1); … … 1724 1724 static 1725 1725 proc Coeff(poly f, list #) 1726 { 1726 { 1727 1727 //---------------------------- initialisation --------------------------------- 1728 1728 poly a, term; … … 1762 1762 for( i=1; i<=n; i=i+1) 1763 1763 { result = subst(f,x(i), 0) - f; 1764 if( result != 0 ) { B[rvar(x(i))] = x(Ctv); Ctv++; } 1764 if( result != 0 ) { B[rvar(x(i))] = x(Ctv); Ctv++; } 1765 1765 else { B[rvar(x(i))] = x(Ctn); Ctn--; } 1766 1766 } … … 1787 1787 // check basic condition on the basering. 1788 1788 if(checkring()) { return(f); } 1789 if( f==0 ) { 1789 if( f==0 ) { 1790 1790 "Normal form : 0"; 1791 1791 return(f); 1792 1792 } 1793 if( jet(f,0)!=0 ) { 1793 if( jet(f,0)!=0 ) { 1794 1794 "Normal form : 1"; 1795 1795 return(f); … … 1811 1811 return(); 1812 1812 } 1813 if(cnt==1) { 1813 if(cnt==1) { 1814 1814 debug_log(1,"Getting normal form from database."); 1815 1815 "normal form :",A_L(Typ); … … 1841 1841 ideal jf=std(jacob(f)^e); 1842 1842 intvec v=hilb(jf,2); 1843 1843 1844 1844 return(Hcode(v)); 1845 1845 } … … 1899 1899 static 1900 1900 proc Cubic (poly f) 1901 { 1901 { 1902 1902 //---------------------------- initialisation --------------------------------- 1903 1903 poly f3; … … 1915 1915 1916 1916 if(Dim == 0) { return("P[8]:smooth cubic"); } // x3 + y3 + z3 + axyz 1917 if(Dim == 1) { 1917 if(Dim == 1) { 1918 1918 if(Mult == 2) { 1919 1919 Jf2 = wedge(jacob(Jf1),3-Dim), Jf1; … … 1945 1945 proc parity (int e) 1946 1946 "USAGE: parity()" 1947 { 1947 { 1948 1948 int r = e/2; 1949 1949 if( 2*r == e ) { return(0); } … … 1959 1959 string SG_Typ = ""; 1960 1960 list v; 1961 1961 1962 1962 // if trace/debug mode not set, do it! 1963 1963 init_debug(); … … 1975 1975 static 1976 1976 proc HKclass3 (intvec sg, string SG_Typ, int cnt) 1977 { 1977 { 1978 1978 list v; 1979 1979 … … 1986 1986 static 1987 1987 proc HKclass3_teil_1 (intvec sg, string SG_Typ, int cnt) 1988 { 1988 { 1989 1989 int k, r, s; 1990 1990 list v; … … 1995 1995 if( parity(sg[2])) { // sg[2] ist ungerade 1996 1996 if(sg[2]<=sg[3]) { 1997 k = (sg[2]+1)/2; 1998 if(k>1) { 1997 k = (sg[2]+1)/2; 1998 if(k>1) { 1999 1999 cnt++; 2000 2000 SG_Typ=SG_Typ+" J[k,r]=J["+string(k)+","+string(sg[3]+1-2*k)+"]"; … … 2023 2023 static 2024 2024 proc HKclass5 (intvec sg, string SG_Typ, int cnt) 2025 { 2025 { 2026 2026 list v; 2027 2027 … … 2055 2055 r = sg[5] - sg[4]; 2056 2056 SG_Typ=SG_Typ +" X[k,r]=X["+string(k)+","+string(r)+"]"; cnt++; 2057 } 2057 } 2058 2058 if( (sg[3]==1) && (sg[4]==3) && (sg[5]>=sg[4])){ // Z[1,r] 2059 2059 r = sg[5] - sg[4]; … … 2067 2067 SG_Typ = SG_Typ + " Z[k,r,0]=Z["+string(k)+","+string(r)+",0]"; 2068 2068 } 2069 } 2069 } 2070 2070 else { // Z[k,12k+6r] 2071 2071 r = (sg[4] - 2*k)/2; cnt++; … … 2166 2166 } 2167 2167 if(sg[4]<sg[5]) { // Q[k,r] 2168 k = (sg[4]+2)/2; 2168 k = (sg[4]+2)/2; 2169 2169 if(k>=2) { 2170 2170 r=sg[5]+1-2*k; cnt++; … … 2216 2216 static 2217 2217 proc HKclass7 (intvec sg, string SG_Typ, int cnt) 2218 { 2218 { 2219 2219 list v; 2220 2220 … … 2267 2267 /////////////////////////////////////////////////////////////////////////////// 2268 2268 proc singularity(string typ, list #) 2269 "USAGE: singularity(t, l); t=string (name of singularity), 2269 "USAGE: singularity(t, l); t=string (name of singularity), 2270 2270 l=list of integers (index/indices of singularity) 2271 2271 COMPUTE: get the Singularity named by type t from the database. … … 2291 2291 if(len>=3) { s = #[3]; } 2292 2292 else { s = 0; } 2293 if( k<0 || r<0 || s<0) { 2293 if( k<0 || r<0 || s<0) { 2294 2294 "Initial condition failed: k>=0; r>=0; s>=0"; 2295 2295 "k="+string(k)+" r="+string(r)+" s="+string(s); … … 2301 2301 def ring_top=basering; 2302 2302 2303 if(len>=4) { a1 = #[4]; } 2303 if(len>=4) { a1 = #[4]; } 2304 2304 else { a1=1; } 2305 if(len>=5) { a2 = #[5]; } 2305 if(len>=5) { a2 = #[5]; } 2306 2306 else { a2=1; } 2307 if(len>=6) { a3 = #[6]; } 2307 if(len>=6) { a3 = #[6]; } 2308 2308 else { a3=1; } 2309 if(len>=7) { a4 = #[7]; } 2309 if(len>=7) { a4 = #[7]; } 2310 2310 else { a4=1; } 2311 2311 2312 debug_log(4, "Values: len=", string(len), " k=", string(k), " r=", 2312 debug_log(4, "Values: len=", string(len), " k=", string(k), " r=", 2313 2313 string(r)); 2314 2314 if(defined(RingNF) != 0 ) { kill RingNF; } … … 2340 2340 proc Singularitaet (string typ,int k,int r,int s,poly a,poly b,poly c,poly d) 2341 2341 { 2342 list v; 2342 list v; 2343 2343 string DBMPATH=system("getenv","DBMPATH"); 2344 2344 string DatabasePath, Database, S, Text, Tp; … … 2353 2353 link dbmLink=Database; 2354 2354 debug_log(2, "Opening Singalarity-database: ", newline, Database); 2355 Tp = read(dbmLink, typ); 2355 Tp = read(dbmLink, typ); 2356 2356 debug_log(2,"DBMread(", typ, ")=", Tp, "."); 2357 2357 if( Tp != "(null)" && Tp !="" ) { … … 2361 2361 execute S; 2362 2362 execute read(dbmLink, Key)+";"; 2363 debug_log(1, "Polynom f=", f, " crk=", crk, " Mu=", Mu, 2363 debug_log(1, "Polynom f=", f, " crk=", crk, " Mu=", Mu, 2364 2364 " MlnCd=", MlnCd); 2365 2365 v = f, crk, Mu, MlnCd; … … 2437 2437 EXAMPLE: example debug_log; shows an example 2438 2438 SEE ALSO: init_debug();" 2439 { 2439 { 2440 2440 int len = size(#); 2441 2441 // int printresult = printlevel - level +1; … … 2445 2445 // else { dbprint(printresult, #[1..len]); } 2446 2446 if( defined(@DeBug) == 0 ) { init_debug(); } 2447 if(@DeBug>=level) { 2447 if(@DeBug>=level) { 2448 2448 if(level>1) { "Debug:("+ string(level)+ "): ", #[1..len]; } 2449 2449 else { #[1..len]; } … … 2458 2458 proc init_debug(list #) 2459 2459 "USAGE: init_debug([level]); level=int 2460 COMPUTE: Set the global variable @DeBug to level. The variable @DeBug is 2461 used by the function debug_log(level, list of strings) to know 2462 when to print the list of strings. init_debug() reports only 2460 COMPUTE: Set the global variable @DeBug to level. The variable @DeBug is 2461 used by the function debug_log(level, list of strings) to know 2462 when to print the list of strings. init_debug() reports only 2463 2463 changes of @DeBug. 2464 2464 NOTE: The procedure init_debug(n); is usefull as trace-mode. n may 2465 2465 range from 0 to 10, higher values of n give more information. 2466 2466 EXAMPLE: example init_debug; shows an example" 2467 { 2467 { 2468 2468 int newDebug=0; 2469 2469 if( defined(@DeBug) != 0 ) { newDebug = @DeBug; } 2470 2470 2471 if( size(#) > 0 ) { 2471 if( size(#) > 0 ) { 2472 2472 newDebug=#[1]; 2473 2473 } … … 2479 2479 } 2480 2480 } 2481 if( defined(@DeBug) == 0) { 2481 if( defined(@DeBug) == 0) { 2482 2482 int @DeBug = newDebug; 2483 2483 export @DeBug; … … 2515 2515 RETURN: intvec: d, mu, c 2516 2516 EXAMPLE: example basicinvariants; shows an example" 2517 { 2517 { 2518 2518 intvec v; 2519 2519 ideal Jfs = std(jacob(f)); … … 2615 2615 proc GetRf (poly fi, int n) 2616 2616 "USAGE: GetRf();" 2617 { 2617 { 2618 2618 //---------------------------- initialisation --------------------------------- 2619 2619 int j, k, l1, l1w; … … 2643 2643 static 2644 2644 proc Show(poly g) 2645 { 2645 { 2646 2646 string s; 2647 2647 def ring_save=basering; … … 2721 2721 b = i - 12*k; 2722 2722 if( b == 1 ) { s3 = "k"; } 2723 else { 2723 else { 2724 2724 if(b==0) { s3 = "12k"+string(b-1); } 2725 2725 else { s3 = "12k+"+string(b-1); } … … 2742 2742 if(r==0) { s4 = string(0); } 2743 2743 if(k==0 && Typ=="Z[") { s3 = string(1); } 2744 if(Typ[2] == "#") { 2744 if(Typ[2] == "#") { 2745 2745 i = r+1; 2746 2746 r = i/2; 2747 2747 b = i - 2*r; 2748 if( b == 1 ) { s4 = "2r"; } 2748 if( b == 1 ) { s4 = "2r"; } 2749 2749 else { s4 = "2r-1"; } 2750 2750 } … … 2752 2752 } // es kommt mindestens zwei komma vor... 2753 2753 //----------------------- get third parameter ----------------------------- 2754 else { 2754 else { 2755 2755 debug_log(8, " Number of columns >=2"); 2756 2756 debug_log(2, "Y[k,r,s] / Z[k,r,s] / T[k,r,s]"); … … 2782 2782 the singularity given by its name. 2783 2783 EXAMPLE: example A_L; shows an example" 2784 { 2784 { 2785 2785 // if trace/debug mode not set, do it! 2786 2786 init_debug(); … … 2794 2794 return(quickclass(#[1])); 2795 2795 } 2796 2796 2797 2797 } 2798 2798 example 2799 2799 { "EXAMPLE:"; echo=2; 2800 ring r=0,(a,b,c),ds; 2800 ring r=0,(a,b,c),ds; 2801 2801 poly f=A_L("E[13]"); 2802 2802 f; … … 2809 2809 RETURN: Arnold's normal form of singularity with name s 2810 2810 EXAMPLE: example normalform; shows an example." 2811 { 2811 { 2812 2812 string Typ; 2813 2813 int k, r, s, crk; … … 2832 2832 example 2833 2833 { "EXAMPLE:"; echo=2; 2834 ring r=0,(a,b,c),ds; 2834 ring r=0,(a,b,c),ds; 2835 2835 normalform("E[13]"); 2836 2836 } 2837 2837 2838 2838 /////////////////////////////////////////////////////////////////////////////// 2839 proc swap 2839 proc swap 2840 2840 "USAGE: swap(a,b); 2841 2841 RETURN: b,a if b,a is the input (any type)" 2842 2842 { 2843 return(#[2],#[1]); 2843 return(#[2],#[1]); 2844 2844 } 2845 2845 example -
Singular/LIB/deform.lib
r30c91f r82716e 1 // $Id: deform.lib,v 1.1 0 1998-05-05 11:55:22 krueger Exp $1 // $Id: deform.lib,v 1.11 1998-05-14 18:44:57 Singular Exp $ 2 2 // author: Bernd Martin email: martin@math.tu-cottbus.de 3 //(bm, last modified 4/98) 4 /////////////////////////////////////////////////////////////////////////////// 5 version="$Id: deform.lib,v 1.1 0 1998-05-05 11:55:22 krueger Exp $";3 //(bm, last modified 4/98) 4 /////////////////////////////////////////////////////////////////////////////// 5 version="$Id: deform.lib,v 1.11 1998-05-14 18:44:57 Singular Exp $"; 6 6 info=" 7 7 LIBRARY: deform.lib PROCEDURES FOR COMPUTING MINIVERSAL DEFORMATION … … 10 10 versal(Fo[,d,any]) miniversal deformation of isolated singularity Fo 11 11 mod_versal(Mo,I,[,d,any]) miniversal deformation of module Mo modulo ideal I 12 lift_kbase(N,M); lifting N into standard kbase of M 12 lift_kbase(N,M); lifting N into standard kbase of M 13 13 lift_rel_kb(N,M[,kbM,p]) relative lifting N into a kbase of M 14 14 kill_rings([\"prefix\"]) kills the exported rings from above 15 15 16 16 SUB-PROCEDURES used by main procedure: 17 17 get_rings,compute_ext,get_inf_def,interact1, … … 33 33 COMUPTE: miniversal deformation of Fo up to degree d (default d=100), 34 34 CREATE: Rings (exported): 35 'my'Px = extending the basering Po by new variables given by \"A,B,..\" 35 'my'Px = extending the basering Po by new variables given by \"A,B,..\" 36 36 (deformation parameters), returns as basering, 37 37 the new variables come before the old ones, … … 40 40 'my'So = being the embedding-ring of the versal base space, 41 41 'my'Ox = Px/Js extending So/Js. (default my=\"\") 42 Matrices (in Px, exported): 42 Matrices (in Px, exported): 43 43 Js = giving the versal base space (obstructions), 44 44 Fs = giving the versal family of Fo, … … 48 48 Otherwise 'any' gives predefined strings: \"my\",\"param\",\"order\",\"out\" 49 49 (\"my\" prefix-string, \"param\" is a letter (e.g. \"A\") for the name of 50 first parameter or (e.g. \"A(\") for index parameter variables, \"order\" 50 first parameter or (e.g. \"A(\") for index parameter variables, \"order\" 51 51 ordering string for ring extension), \"out\" name of output-file). 52 52 NOTE: printlevel < 0 no output at all, 53 printlevel >=0,1,2,.. informs you, what is going on; 53 printlevel >=0,1,2,.. informs you, what is going on; 54 54 this proc uses 'execute'. 55 55 EXAMPLE:example versal; shows an example … … 62 62 int time = timer; 63 63 intvec @iv,@jv,@is_qh,@degr; 64 d_max = 100; 64 d_max = 100; 65 65 @my = ""; @param="A"; @order="ds"; @out="no"; 66 66 @size = size(#); 67 67 if( @size>0 ) { d_max = #[1]; } 68 if( @size>1 ) 69 { if(typeof(#[2])!="string") 68 if( @size>1 ) 69 { if(typeof(#[2])!="string") 70 70 { string @active; 71 71 @my,@param,@order,@out = interact1(); … … 86 86 int @rowR= size(Fo); 87 87 def Po = basering; 88 setring Po; 88 setring Po; 89 89 poly X_s = product(maxideal(1)); 90 90 //------- reproduce T12 ------------------------------------------------------ … … 106 106 @t2 = Ls[4]; // vdim of T2 107 107 kill Ls; 108 t1' = @t1; 109 if( @t1==0) { dbprint(p,"// rigit!"); return();} 110 if( @t2==0) { @smooth=1; dbprint(p,"// smooth base space");} 108 t1' = @t1; 109 if( @t1==0) { dbprint(p,"// rigit!"); return();} 110 if( @t2==0) { @smooth=1; dbprint(p,"// smooth base space");} 111 111 dbprint(p,"// ready: T1 and T2"); 112 112 @colR = ncols(Ro); … … 114 114 @degrees = homog_test(@is_qh,matrix(Fo),InfD); 115 115 @jv = 1..@t1; 116 if (@degrees!="") 116 if (@degrees!="") 117 117 { dbprint(p-1,"// T1 is quasi-homogeneous represented with weight-vector", 118 118 @degrees); 119 119 } 120 120 if (defined(@active)) 121 { "// matrix of infinitesimal deformations:";print(InfD); 121 { "// matrix of infinitesimal deformations:";print(InfD); 122 122 "// weights of infinitesimal deformations ( emty ='not qhomog'):"; 123 123 @degrees; 124 124 matrix dummy; 125 125 InfD,dummy,t1' = interact2(InfD,@jv);kill dummy; 126 } 126 } 127 127 //---- create new rings and objects ------------------------------------------ 128 128 get_rings(Fo,t1',1,@my,@order,@param); 129 129 setring `myPx`; 130 @jv=0; @jv[t1']=0; @jv=@jv+1; @jv[nvars(basering)]=0; 130 @jv=0; @jv[t1']=0; @jv=@jv+1; @jv[nvars(basering)]=0; 131 131 //weight-vector for calculating 132 132 //rel-jet with resp to def-para 133 ideal Io = imap(Po,Fo); 133 ideal Io = imap(Po,Fo); 134 134 ideal J,m_J,tid; attrib(J,"isSB",1); 135 135 matrix Fo = matrix(Io); //initial equations … … 139 139 matrix homFR= concat(homR,homF); 140 140 module hom' = std(homFR); 141 matrix Js[1][@t2]; 142 matrix F_R,Fs,Rs,Fn,Rn; 143 export Js,Fs,Rs; 144 matrix Mon[t1'][1]=maxideal(1); 141 matrix Js[1][@t2]; 142 matrix F_R,Fs,Rs,Fn,Rn; 143 export Js,Fs,Rs; 144 matrix Mon[t1'][1]=maxideal(1); 145 145 Fn = transpose(imap(Po,InfD)*Mon); //infinitesimal deformations 146 Fs = Fo + Fn; 146 Fs = Fo + Fn; 147 147 dbprint(p-1,"// infinitesimal deformation: Fs: ",Fs); 148 148 Rn = (-1)*lift(Fo,Fs*Ro); //infinit. relations … … 151 151 tid = 0 + ideal(F_R); 152 152 if (tid[1]==0) {d_max=1;} //finished ? 153 setring `myOx`; 153 setring `myOx`; 154 154 matrix Fs,Rs,Cup,Cup',F_R,homFR,New,Rn,Fn; 155 155 module hom'; 156 ideal null,tid; attrib(null,"isSB",1); 157 setring `myQx`; 158 poly X_s = imap(Po,X_s); 159 matrix Cup,Cup',MASS; 156 ideal null,tid; attrib(null,"isSB",1); 157 setring `myQx`; 158 poly X_s = imap(Po,X_s); 159 matrix Cup,Cup',MASS; 160 160 ideal tid,null; attrib(null,"isSB",1); 161 ideal J,m_J; attrib(J,"isSB",1); 161 ideal J,m_J; attrib(J,"isSB",1); 162 162 attrib(m_J,"isSB",1); 163 matrix PreO = imap(Po,PreO); 163 matrix PreO = imap(Po,PreO); 164 164 module PreO'= imap(Po,PreO'); attrib(PreO',"isSB",1); 165 165 module PreT = imap(Po,PreT); attrib(PreT,"isSB",1); … … 172 172 { 173 173 if( @t1==0) {break}; 174 dbprint(p,"// start computation in degree "+string(@d)+"."); 174 dbprint(p,"// start computation in degree "+string(@d)+"."); 175 175 dbprint(p-3,">>> TIME = "+string(timer-time)); 176 176 dbprint(p-3,"==> memory = "+string(kmemory())+"k"); … … 178 178 if (@smooth) { @noObstr=1;} 179 179 else 180 { Cup = jet(F_R,@d,@jv); 181 Cup = matrix(reduce(ideal(Cup),m_J),@colR,1); 182 Cup = jet(Cup,@d,@jv); 183 } 180 { Cup = jet(F_R,@d,@jv); 181 Cup = matrix(reduce(ideal(Cup),m_J),@colR,1); 182 Cup = jet(Cup,@d,@jv); 183 } 184 184 //------- express obstructions in kbase of T2 -------------------------------- 185 185 if ( @noObstr==0 ) … … 191 191 } 192 192 Cup = lift(PreO,Cup); 193 MASS = lift_rel_kb(Cup,PreT,kbT2,X_s); 194 dbprint(p-3,"// next MASSEY-products:",MASS-jet(MASS,@d-1,@jv)); 193 MASS = lift_rel_kb(Cup,PreT,kbT2,X_s); 194 dbprint(p-3,"// next MASSEY-products:",MASS-jet(MASS,@d-1,@jv)); 195 195 if (MASS==transpose(Js)) 196 { @noObstr=1;dbprint(p-1,"// no obstruction"); } 196 { @noObstr=1;dbprint(p-1,"// no obstruction"); } 197 197 else { @noObstr=0; } 198 198 } … … 204 204 setring `myPx`; 205 205 Js = imap(`myQx`,Js); 206 degBound = @d+1; 206 degBound = @d+1; 207 207 J = std(ideal(Js)); 208 208 m_J = std(J*ideal(Mon)); … … 210 210 //--------------- obtain new base-ring ---------------------------------------- 211 211 kill `myOx`; 212 qring `myOx` = J; 212 qring `myOx` = J; 213 213 matrix Fs,Rs,F_R,Cup,Cup',homFR,New,Rn,Fn; 214 214 module hom'; … … 217 217 //---------------- lift equations F and relations R --------------------------- 218 218 setring `myOx`; 219 Fs = fetch(`myPx`,Fs); 220 Rs = fetch(`myPx`,Rs); 221 F_R = Fs*Rs; 222 F_R = matrix(reduce(ideal(F_R),null)); 219 Fs = fetch(`myPx`,Fs); 220 Rs = fetch(`myPx`,Rs); 221 F_R = Fs*Rs; 222 F_R = matrix(reduce(ideal(F_R),null)); 223 223 tid = 0 + ideal(F_R); 224 if (tid[1]==0) { dbprint(p-1,"// finished"); break;} 225 Cup = (-1)*transpose(jet(F_R,@d,@jv)); 226 homFR = fetch(`myPx`,homFR); 224 if (tid[1]==0) { dbprint(p-1,"// finished"); break;} 225 Cup = (-1)*transpose(jet(F_R,@d,@jv)); 226 homFR = fetch(`myPx`,homFR); 227 227 hom' = fetch(`myPx`,hom'); attrib(hom',"isSB",1); 228 228 Cup' = simplify(reduce(Cup,hom'),10); … … 238 238 Rs = Rs+Rn; 239 239 F_R = Fs*Rs; 240 tid = 0+reduce(ideal(F_R),null); 240 tid = 0+reduce(ideal(F_R),null); 241 241 //---------------- fetch results into other rings ----------------------------- 242 242 setring `myPx`; … … 248 248 m_J = fetch(`myPx`,m_J); attrib(m_J,"isSB",1); 249 249 J = fetch(`myPx`,J); attrib(J,"isSB",1); 250 Js = fetch(`myPx`,Js); 251 tid = fetch(`myOx`,tid); 252 if (tid[1]==0) { dbprint(p-1,"// finished");break;} 250 Js = fetch(`myPx`,Js); 251 tid = fetch(`myOx`,tid); 252 if (tid[1]==0) { dbprint(p-1,"// finished");break;} 253 253 } 254 254 //--------- end loop and final output ---------------------------------------- … … 256 256 if (@out!="no") 257 257 { string out = @out+"_"+string(@d); 258 "// writing file "+out+" with matrix Js, matrix Fs, matrix Rs ready 258 "// writing file "+out+" with matrix Js, matrix Fs, matrix Rs ready 259 259 for reading in rings "+myPx+" or "+myQx; 260 260 write(out,"matrix Js[1][",@t2,"]=",Js,";matrix Fs[1][",@rowR,"]=",Fs, 261 261 ";matrix Rs[",@rowR,"][",@colR,"]=",Rs,";"); 262 } 262 } 263 263 dbprint(p-3,">>> TIME = "+string(timer-time)); 264 264 if (@is_qh != 0) … … 266 266 @degr = @degr[1..t1']; 267 267 dbprint(p-1,"// quasi-homogeneous weights of miniversal base",@degr); 268 } 268 } 269 269 dbprint(p-1, 270 270 "// ___ Equations of miniversal base space ___",Js, … … 277 277 " setring "+myPx+"; show("+myPx+");"," listvar(matrix);", 278 278 "// NOTE: rings "+myQx+", "+myPx+", "+mySo+" are alive!", 279 "// (use 'kill_rings(\""+@my+"\");' to remove)"); 279 "// (use 'kill_rings(\""+@my+"\");' to remove)"); 280 280 return(); 281 281 } … … 286 286 ring r1 = 0,(x,y,z,u,v),ds; 287 287 matrix m[2][4] = x,y,z,u,y,z,u,v; 288 ideal Fo = minor(m,2); 288 ideal Fo = minor(m,2); 289 289 // cone over rational normal curve of degree 4 290 290 versal(Fo); … … 305 305 proc mod_versal(matrix Mo, ideal I, list #) 306 306 " 307 USAGE: mod_versal(Mo,I[,d,any]); I=ideal, M=module, d=int, any =list 307 USAGE: mod_versal(Mo,I[,d,any]); I=ideal, M=module, d=int, any =list 308 308 COMUPTE: miniversal deformation of coker(Mo) over Qo=Po/Io, Po=basering; 309 309 CREATE: Ringsr (exported): … … 314 314 'my'Qx = Px/Io extending Qo (returns as basering), 315 315 'my'Ox = Px/(Io+Js) ring of the versal deformation of coker(Ms), 316 'my'So = embedding-ring of the versal base space. (default 'my'=\"\") 316 'my'So = embedding-ring of the versal base space. (default 'my'=\"\") 317 317 Matrices (in Qx, exported): 318 318 Js = giving the versal base space (obstructions), 319 319 Ms = giving the versal family of Mo, 320 Ls = giving the lifting of syzygies Lo=syz(Mo), 320 Ls = giving the lifting of syzygies Lo=syz(Mo), 321 321 If d is defined (!=0), it computes up to degree d. 322 322 If 'any' is defined and any[1] is no string, interactive version. 323 323 Otherwise 'any' gives predefined strings:\"my\",\"param\",\"order\",\"out\" 324 324 (\"my\" prefix-string, \"param\" is a letter (e.g. \"A\") for the name of 325 first parameter or (e.g. \"A(\") for index parameter variables, \"ord\" 325 first parameter or (e.g. \"A(\") for index parameter variables, \"ord\" 326 326 ordering string for ringextension), \"out\" name of output-file). 327 327 NOTE: printlevel < 0 no output at all, 328 printlevel >=0,1,2,.. informs you, what is going on, 328 printlevel >=0,1,2,.. informs you, what is going on, 329 329 this proc uses 'execute'. 330 330 EXAMPLE:example mod_versal; shows an example … … 337 337 int time = timer; 338 338 intvec @iv,@jv,@is_qh,@degr; 339 d_max = 100; 339 d_max = 100; 340 340 @my = ""; @param="A"; @order="ds"; @out="no"; 341 341 @size = size(#); 342 342 if( @size>0 ) { d_max = #[1]; } 343 if( @size>1 ) 344 { if(typeof(#[2])!="string") 343 if( @size>1 ) 344 { if(typeof(#[2])!="string") 345 345 { string @active; 346 346 @my,@param,@order,@out = interact1(); … … 352 352 if (@size>4) {@out = #[5];} 353 353 } 354 } 354 } 355 355 string myPx = @my+"Px"; 356 356 string myQx = @my+"Qx"; … … 363 363 //-------- compute Ext's ------------------------------------------------------ 364 364 I = std(I); 365 qring Qo = I; 365 qring Qo = I; 366 366 matrix Mo = fetch(Po,Mo); 367 list Lo = compute_ext(Mo,p); 367 list Lo = compute_ext(Mo,p); 368 368 f0,f1,f2,e1,e2,ok_ann=Lo[1]; 369 369 matrix Ls,kb1,lift1 = Lo[2],Lo[3],Lo[4]; … … 373 373 dbprint(p,"// ready: Ext1 and Ext2"); 374 374 //----- test: quasi-homogeneous, choice of inf. def.-------------------------- 375 @degrees = homog_test(@is_qh,Mo,kb1); 375 @degrees = homog_test(@is_qh,Mo,kb1); 376 376 e1' = e1; @jv = 1..e1; 377 if (@degrees != "") 377 if (@degrees != "") 378 378 { dbprint(p-1,"// Ext1 is quasi-homogeneous represented: "+@degrees); 379 379 } 380 380 if (defined(@active)) 381 381 { "// kbase of Ext1:"; 382 print(kb1); 382 print(kb1); 383 383 "// weights of kbase of Ext1 ( empty = 'not qhomog')";@degrees; 384 384 kb1,lift1,e1' = interact2(kb1,@jv,lift1); 385 } 385 } 386 386 //-------- get new rings and objects ------------------------------------------ 387 387 setring Po; … … 392 392 ideal Io = I_J; 393 393 matrix Mon[e1'][1] = maxideal(1); 394 matrix Ms = imap(Qo,Mo); 395 matrix Ls = imap(Qo,Ls); 396 matrix Js[1][e2]; 394 matrix Ms = imap(Qo,Mo); 395 matrix Ls = imap(Qo,Ls); 396 matrix Js[1][e2]; 397 397 setring `myQx`; 398 398 ideal J,I_J,tet,null; attrib(null,"isSB",1); 399 399 ideal m_J = fetch(`myPx`,m_J); attrib(m_J,"isSB",1); 400 400 @jv=0; @jv[e1] = 0; @jv = @jv+1; @jv[nvars(`myPx`)] = 0; 401 matrix Ms = imap(Qo,Mo); export(Ms); 401 matrix Ms = imap(Qo,Mo); export(Ms); 402 402 matrix Ls = imap(Qo,Ls); export(Ls); 403 403 matrix Js[e2][1]; export(Js); 404 matrix MASS; 404 matrix MASS; 405 405 matrix Mon = fetch(`myPx`,Mon); 406 406 matrix Mn,Ln,ML,Cup,Cup',Lift; … … 410 410 matrix D' = imap(Qo,D'); 411 411 module Do = imap(Qo,Do); attrib(Do,"isSB",1); 412 matrix kb2 = imap(Qo,kb2); 412 matrix kb2 = imap(Qo,kb2); 413 413 matrix kb1 = imap(Qo,kb1); 414 414 matrix lift1= imap(Qo,lift1); 415 415 poly X_s = imap(Po,X_s); 416 intvec intv = e1',e1,f0,f1,f2; 417 Ms,Ls= get_inf_def(Ms,Ls,kb1,lift1,X_s); 416 intvec intv = e1',e1,f0,f1,f2; 417 Ms,Ls= get_inf_def(Ms,Ls,kb1,lift1,X_s); 418 418 kill kb1,lift1; 419 419 dbprint(p-1,"// infinitesimal extension",Ms); 420 420 //----------- start the loop -------------------------------------------------- 421 421 for (@d=2;@d<=d_max;@d=@d+1) 422 { 422 { 423 423 dbprint(p-3,">>> time = "+string(timer-time)); 424 424 dbprint(p-3,"==> memory = "+string(memory(0)/1000)+ 425 425 ", allocated = "+string(memory(1)/1000)); 426 dbprint(p,"// start deg = "+string(@d)); 426 dbprint(p,"// start deg = "+string(@d)); 427 427 //-------- get obstruction ---------------------------------------------------- 428 428 Cup = matrix(ideal(Ms*Ls),f0*f2,1); … … 433 433 Cup' = reduce(Cup,Do); 434 434 tet = simplify(ideal(Cup'),10); 435 if (tet[1]!=0) 435 if (tet[1]!=0) 436 436 { dbprint(p-4,"// *"); 437 437 Cup = Cup-Cup'; … … 441 441 { MASS = lift_rel_kb(Cup,ex2,kb2,X_s);} 442 442 else 443 { MASS = reduce(Cup,ex2);} 443 { MASS = reduce(Cup,ex2);} 444 444 dbprint(p-3,"// next MATRIC-MASSEY-products", 445 445 MASS-jet(MASS,@d-1,@jv)); 446 446 if ( MASS==transpose(Js)) 447 447 { @noObstr = 1;dbprint(p-1,"//no obstruction"); } 448 else { @noObstr = 0; } 448 else { @noObstr = 0; } 449 449 //-------- obtain equations of base space ------------------------------------- 450 450 if (@noObstr == 0) … … 458 458 degBound=0; 459 459 I_J = Io,J; attrib(I_J,"isSB",1); 460 //-------- obtain new base ring ----------------------------------------------- 460 //-------- obtain new base ring ----------------------------------------------- 461 461 kill `myOx`; 462 qring `myOx` = I_J; 462 qring `myOx` = I_J; 463 463 ideal null,tet; attrib(null,"isSB",1); 464 464 matrix Ms = imap(`myQx`,Ms); 465 465 matrix Ls = imap(`myQx`,Ls); 466 466 matrix Mn,Ln,ML,Cup,Cup',Lift; 467 matrix C' = imap(Qo,C'); 467 matrix C' = imap(Qo,C'); 468 468 module Co = imap(Qo,Co); attrib(Co,"isSB",1); 469 469 module ex2 = imap(Qo,ex2); attrib(ex2,"isSB",1); 470 470 matrix kb2 = imap(Qo,kb2); 471 471 poly X_s = imap(Po,X_s); 472 } 472 } 473 473 //-------- get lifts ---------------------------------------------------------- 474 474 setring `myOx`; … … 477 477 Cup = jet(Cup,@d,@jv); 478 478 Cup'= reduce(Cup,Co); 479 tet = simplify(ideal(Cup'),10); 480 if (tet[1]!=0) 479 tet = simplify(ideal(Cup'),10); 480 if (tet[1]!=0) 481 481 { dbprint(p-4,"// #"); 482 482 Cup = Cup-Cup'; 483 483 } 484 Lift = lift(C',Cup); 484 Lift = lift(C',Cup); 485 485 Mn = matrix(ideal(Lift),f0,f1); 486 486 Ln = matrix(ideal(Lift[f0*f1+1..nrows(Lift),1]),f1,f2); … … 490 490 dbprint(p-3,"// next extension of syz(Mo)",Ln); 491 491 ML = reduce(ideal(Ms*Ls),null); 492 //--------- test: finished ---------------------------------------------------- 492 //--------- test: finished ---------------------------------------------------- 493 493 tet = simplify(ideal(ML),10); 494 494 if (tet[1]==0) { dbprint(p-1,"// finished in degree ",@d);} … … 496 496 setring `myPx`; 497 497 Ms = fetch(`myOx`,Ms); 498 Ls = fetch(`myOx`,Ls); 498 Ls = fetch(`myOx`,Ls); 499 499 setring `myQx`; 500 500 Ms = fetch(`myOx`,Ms); 501 Ls = fetch(`myOx`,Ls); 501 Ls = fetch(`myOx`,Ls); 502 502 ML = Ms*Ls; 503 ML = matrix(reduce(ideal(ML),null),f0,f2); 503 ML = matrix(reduce(ideal(ML),null),f0,f2); 504 504 tet = imap(`myOx`,tet); 505 505 if (tet[1]==0) { break;} 506 } 507 //------- end of loop, final output ------------------------------------------- 506 } 507 //------- end of loop, final output ------------------------------------------- 508 508 if (@out != "no") 509 509 { string out = @out+"_"+string(@d); 510 "// writing file '"+out+"' with matrix Js, matrix Ms, matrix Ls 510 "// writing file '"+out+"' with matrix Js, matrix Ms, matrix Ls 511 511 ready for reading in rings "+myPx+" or "+myQx; 512 512 write(out,"matrix Js[1][",e2,"]=",Js,";matrix Ms[",f0,"][",f1,"]=",Ms, … … 518 518 @degr = @degr[1..e1']; 519 519 dbprint(p-1,"// quasi-homogeneous weights of miniversal base",@degr); 520 } 520 } 521 521 dbprint(p-1,"// Result belongs to qring "+myQx, 522 522 "// Equations of total space of miniversal deformation are in Js", … … 540 540 mod_versal(Mo,Io); 541 541 printlevel = p; 542 kill Px,Qx,So; 543 } 544 //============================================================================= 542 kill Px,Qx,So; 543 } 544 //============================================================================= 545 545 /////////////////////////////////////////////////////////////////////////////// 546 546 proc kill_rings(list #) 547 547 "USAGE: kill_rings([string]); 548 Sub-procedure: kills exported rings of 'versal' and 548 Sub-procedure: kills exported rings of 'versal' and 549 549 'mod_versal' with prefix 'string' 550 550 " … … 574 574 Sub-procedure: obtain Ext1 and Ext2 and other objects used by mod_versal 575 575 " 576 { 576 { 577 577 int l,f0,f1,f2,f3,e1,e2,ok_ann; 578 578 module Co,Do,ima,ex1,ex2; 579 matrix M0,M1,M2,ker,kb1,lift1,kb2,A,B,C,D; 579 matrix M0,M1,M2,ker,kb1,lift1,kb2,A,B,C,D; 580 580 //------- resM --------------------------------------------------------------- 581 list resM = res(Mo,3); 581 list resM = res(Mo,3); 582 582 M0 = resM[1]; 583 583 M1 = resM[2]; … … 588 588 f3 = ncols(M2); 589 589 //------ compute Ext^2 ------------------------------------------------------ 590 B = kohom(M0,f3); 590 B = kohom(M0,f3); 591 591 A = kontrahom(M2,f0); 592 D = modulo(A,B); 593 Do = std(D); 592 D = modulo(A,B); 593 Do = std(D); 594 594 ima = kohom(M0,f2),kontrahom(M1,f0); 595 595 ex2 = modulo(D,ima); … … 603 603 } 604 604 if (ok_ann==0) 605 { e2 =nrows(ex2); 605 { e2 =nrows(ex2); 606 606 dbprint(p,"// Ann(Ext2) is maximal"); 607 607 } 608 608 //------ compute Ext^1 ------------------------------------------------------- 609 B = kohom(M0,f2); 609 B = kohom(M0,f2); 610 610 A = kontrahom(M1,f0); 611 611 ker = modulo(A,B); 612 ima = kohom(M0,f1),kontrahom(M0,f0); 612 ima = kohom(M0,f1),kontrahom(M0,f0); 613 613 ex1 = modulo(ker,ima); 614 614 ex1 = std(ex1); … … 621 621 //------ compute the liftings of Ext^1 --------------------------------------- 622 622 lift1 = A*kb1; 623 lift1 = lift(B,lift1); 623 lift1 = lift(B,lift1); 624 624 intvec iv = f0,f1,f2,e1,e2,ok_ann; 625 625 list L' = ex2,kb2,C,Co,D,Do; … … 629 629 proc get_rings(ideal Io,int e1,int switch, list #) 630 630 " 631 Sub-procedure: creating ring-extensions 632 " 633 { 634 def Po = basering; 631 Sub-procedure: creating ring-extensions 632 " 633 { 634 def Po = basering; 635 635 string my; 636 636 string my_ord = "ds"; 637 string my_var = "A"; 637 string my_var = "A"; 638 638 if (size(#)>2) 639 639 { … … 642 642 my_var = #[3]; 643 643 } 644 string my_Px = my+"Px"; 645 string my_Qx = my+"Qx"; 646 string my_Ox = my+"Ox"; 647 string my_So = my+"So"; 644 string my_Px = my+"Px"; 645 string my_Qx = my+"Qx"; 646 string my_Ox = my+"Ox"; 647 string my_So = my+"So"; 648 648 extendring(my_Px,e1,my_var,my_ord); 649 649 ideal Io = imap(Po,Io); attrib(Io,"isSB",1); … … 666 666 proc get_inf_def(list #) 667 667 " 668 Sub-procedure: compute infinitesimal family of a module and its syzygies 668 Sub-procedure: compute infinitesimal family of a module and its syzygies 669 669 from a kbase of Ext1 and its lifts 670 670 " … … 687 687 } 688 688 return(Ms,Ls); 689 } 689 } 690 690 ////////////////////////////////////////////////////////////////////////////// 691 691 proc lift_rel_kb (module N, module M, list #) … … 695 695 N, M modules of same rank, 696 696 M depending only on variables not in p and vdim(M) finite in this ring, 697 [ kbaseM the kbase of M in the subring given by variables not in p ] 697 [ kbaseM the kbase of M in the subring given by variables not in p ] 698 698 warning: check that these assumtions are fulfilled! 699 699 RETURN matrix A, whose j-th columnes present the coeff's of N[j] in kbaseM, … … 704 704 poly p = product(maxideal(1)); 705 705 M = std(M); 706 matrix A; 706 matrix A; 707 707 if (size(#)>0) { p=#[2]; module kbaseM=#[1];} 708 else 708 else 709 709 { if (vdim(M)<=0) { "// vdim(M) not finite";return(A);} 710 710 module kbaseM = kbase(M); … … 714 714 A = coeffs(N,kbaseM,p); 715 715 return(A); 716 } 716 } 717 717 example 718 718 { … … 736 736 print(kbase(std(M))*A); 737 737 print(reduce(N,std(M))); 738 } 738 } 739 739 /////////////////////////////////////////////////////////////////////////////// 740 740 proc lift_kbase (N, M) … … 769 769 proc interact1 () 770 770 " 771 Sub_procedure: asking for and reading your input-strings 771 Sub_procedure: asking for and reading your input-strings 772 772 " 773 773 { … … 775 775 string str,out,my_ord,my_var; 776 776 my_ord = "ds"; 777 my_var = "A"; 777 my_var = "A"; 778 778 "INPUT: name of output-file (ENTER = no output, do not use \"my\"!)"; 779 str = read(""); 780 if (size(str)>1) 779 str = read(""); 780 if (size(str)>1) 781 781 { out = str[1..size(str)-1];} 782 782 else 783 783 { out = "no";} 784 784 "INPUT: prefix-string of ring-extension (ENTER = '@')"; 785 str = read(""); 786 if ( size(str) > 1 ) 787 { my = str[1..size(str)-1]; } 788 "INPUT:parameter-string 785 str = read(""); 786 if ( size(str) > 1 ) 787 { my = str[1..size(str)-1]; } 788 "INPUT:parameter-string 789 789 (give a letter corresponding to first new variable followed by the next letters, 790 790 or 'T(' - a letter + '(' - getting a string of indexed variables) 791 791 (ENTER = A) :"; 792 str = read(""); 792 str = read(""); 793 793 if (size(str)>1) { my_var=str[1..size(str)-1]; } 794 794 "INPUT:order-string (local or weighted!) (ENTER = ds) :"; 795 str = read(""); 796 if (size(str)>1) { my_ord=str[1..size(str)-1]; } 795 str = read(""); 796 if (size(str)>1) { my_ord=str[1..size(str)-1]; } 797 797 if( find(my_ord,"s")+find(my_ord,"w") == 0 ) 798 798 { "// ordering must be an local! changed into 'ds'"; … … 816 816 if (size(str)>1) 817 817 { ">> Choose columnes of the matrix"; 818 ">> (Enter = all columnes)"; 818 ">> (Enter = all columnes)"; 819 819 "INPUT (number of columnes to use as integer-list 'i_1,i_2,.. ,i_t' ):"; 820 820 string columnes = read(""); … … 826 826 execute("l1= "+columnes[2*l-1]+";"); 827 827 B[l] = A[l1]; 828 if(flag) { C[l]=D[l1];} 828 if(flag) { C[l]=D[l1];} 829 829 } 830 830 A = matrix(B,nrows(A),size(B)); … … 836 836 proc negative_part(intvec iv) 837 837 " 838 RETURNS intvec of indices of jv having negative entries (or iv, if non) 838 RETURNS intvec of indices of jv having negative entries (or iv, if non) 839 839 " 840 840 { … … 842 842 int l,k; 843 843 for (l=1;l<=size(iv);l=l+1) 844 { if (iv[l]<0) 844 { if (iv[l]<0) 845 845 { k = k+1; 846 846 jv[k]=l; … … 865 865 matrix A = imap(br,A); 866 866 intmat degA[@r][@c]; 867 if (homog(ideal(A))) 867 if (homog(ideal(A))) 868 868 { for (i=1;i<=@r;i=i+1) 869 869 { for(j=1;j<=@c;j=j+1) … … 872 872 } 873 873 setring br; 874 kill nr; 874 kill nr; 875 875 return(degA); 876 876 } … … 878 878 proc homog_test(intvec w_vec, matrix Mo, matrix A) 879 879 " 880 Sub proc: return relative weight string of columnes of A with respect 881 to the given w_vec and to Mo, or \"\" if not qh 880 Sub proc: return relative weight string of columnes of A with respect 881 to the given w_vec and to Mo, or \"\" if not qh 882 882 NOTE: * means weight is not determined 883 883 " … … 888 888 int @r = nrows(A); 889 889 int @c = ncols(A); 890 A = concat(matrix(ideal(Mo),@r,1),A); 891 intmat a = find_ord(A,w_vec); 890 A = concat(matrix(ideal(Mo),@r,1),A); 891 intmat a = find_ord(A,w_vec); 892 892 intmat b[@r][@c]; 893 893 for (l=1;l<=@c;l=l+1) 894 { 894 { 895 895 for (k=1;k<=@r;k=k+1) 896 { if (A[k,l+1]!=0) 896 { if (A[k,l+1]!=0) 897 897 { b[k,l] = a[k,l+1]-a[k,1];} 898 898 } 899 899 tv = 0; 900 900 for (k=1;k<=@r;k=k+1) 901 { if (A[k,l+1]*A[k,1]!=0) 901 { if (A[k,l+1]*A[k,1]!=0) 902 902 {tv = tv,b[k,l];} 903 903 } 904 904 if (size(tv)>1) 905 { k = tv[2]; 905 { k = tv[2]; 906 906 tv = tv[2..size(tv)]; tv = tv -k; 907 if (tv==0) { @nv = @nv+string(-k)+",";} 907 if (tv==0) { @nv = @nv+string(-k)+",";} 908 908 else {return("");} 909 909 } … … 916 916 proc homog_t(intvec d_vec, matrix Fo, matrix A) 917 917 " 918 Sub-procedure: Computing relative (with respect to flatten(Fo)) weight_vec 918 Sub-procedure: Computing relative (with respect to flatten(Fo)) weight_vec 919 919 of columnes of A (return zero if Fo or A not qh) 920 920 " … … 934 934 dv = dv[2..size(dv)]; 935 935 dv = dv-l; 936 setring br; 936 setring br; 937 937 kill nr; 938 938 return(dv); -
Singular/LIB/factor.lib
r30c91f r82716e 1 // $Id: factor.lib,v 1. 5 1998-05-05 11:55:23 krueger Exp $1 // $Id: factor.lib,v 1.6 1998-05-14 18:44:59 Singular Exp $ 2 2 //(RS) 3 3 /////////////////////////////////////////////////////////////////////////////// 4 4 5 version="$Id: factor.lib,v 1. 5 1998-05-05 11:55:23 krueger Exp $";5 version="$Id: factor.lib,v 1.6 1998-05-14 18:44:59 Singular Exp $"; 6 6 info=" 7 7 LIBRARY: factor.lib PROCEDURES FOR CALLING THE REDUCE FACTORIZER … … 16 16 "USAGE: delete_dollar(s); s = string 17 17 RETURN: string, with '$' replaced by ' ' 18 EXAMPLE: example delete_dollar; shows an example 18 EXAMPLE: example delete_dollar; shows an example 19 19 " 20 20 { … … 43 43 NOTE: due to a limitation of REDUCE, multivariate polynomials can only 44 44 be factorized in characteristic 0 45 45 This proc runs under UNIX only 46 46 EXAMPLE: example reduce_factor; shows an example 47 47 " … … 69 69 system( "sh", "chmod 700 " + scriptname ); 70 70 system( "sh", scriptname ); 71 string resultstring = read( outname ); 71 string resultstring = read( outname ); 72 72 if ( resultstring <> "" ) 73 73 { -
Singular/LIB/fastsolv.lib
r30c91f r82716e 1 // 2 version="$Id: fastsolv.lib,v 1. 3 1998-05-05 11:55:24 krueger Exp $";1 // 2 version="$Id: fastsolv.lib,v 1.4 1998-05-14 18:44:59 Singular Exp $"; 3 3 info=""; 4 4 -
Singular/LIB/finvar.lib
r30c91f r82716e 1 // $Id: finvar.lib,v 1.1 0 1998-05-05 11:55:25 krueger Exp $1 // $Id: finvar.lib,v 1.11 1998-05-14 18:45:00 Singular Exp $ 2 2 // author: Agnes Eileen Heydtmann, email:agnes@math.uni-sb.de 3 // last change: 3.5.98 3 // last change: 3.5.98 4 4 ////////////////////////////////////////////////////////////////////////////// 5 version="$Id: finvar.lib,v 1.1 0 1998-05-05 11:55:25 krueger Exp $"5 version="$Id: finvar.lib,v 1.11 1998-05-14 18:45:00 Singular Exp $" 6 6 info=" 7 7 LIBRARY: finvar.lib LIBRARY TO CALCULATE INVARIANT RINGS & MORE … … 383 383 { if (#[size(#)-2]=="") 384 384 { "ERROR: <string> may not be empty"; 385 386 385 return(); 386 } 387 387 string newring=#[size(#)-2]; 388 388 g=size(#)-3; … … 926 926 { if (#[size(#)-1]=="") 927 927 { "ERROR: <string> may not be empty"; 928 929 928 return(); 929 } 930 930 string newring=#[size(#)-1]; 931 931 gen_num=size(#)-2; -
Singular/LIB/general.lib
r30c91f r82716e 1 // $Id: general.lib,v 1. 7 1998-05-05 11:55:27 krueger Exp $1 // $Id: general.lib,v 1.8 1998-05-14 18:45:03 Singular Exp $ 2 2 //system("random",787422842); 3 3 //(GMG, last modified 22.06.96) 4 4 /////////////////////////////////////////////////////////////////////////////// 5 5 6 version="$Id: general.lib,v 1. 7 1998-05-05 11:55:27 krueger Exp $";6 version="$Id: general.lib,v 1.8 1998-05-14 18:45:03 Singular Exp $"; 7 7 info=" 8 8 LIBRARY: general.lib PROCEDURES OF GENERAL TYPE … … 21 21 sort(ideal/module); sort generators according to monomial ordering 22 22 sum(vector/id/..[,v]); add components of vector/ideal/...[with indices v] 23 which(command); 23 which(command); searches for command and returns absolute 24 24 path, if found 25 25 (parameters in square brackets [] are optional) … … 200 200 killall(\"not\", \"type_name\"); 201 201 COMPUTE: killall(); kills all user-defined variables but not loaded procedures 202 killall(\"type_name\"); kills all user-defined variables, of type \"type_name\" 202 killall(\"type_name\"); kills all user-defined variables, of type \"type_name\" 203 203 killall(\"not\", \"type_name\"); kills all user-defined 204 204 variables, except those of type \"type_name\" and except loaded procedures … … 216 216 } 217 217 } 218 else 218 else 219 219 { 220 220 if( size(#)==1 ) … … 224 224 for ( joni=size(L); joni>0; joni-- ) 225 225 { 226 if( L[joni]=="LIB" or typeof(`L[joni]`)=="proc" ) 226 if( L[joni]=="LIB" or typeof(`L[joni]`)=="proc" ) 227 227 { kill `L[joni]`; } 228 228 } 229 229 } 230 else 230 else 231 231 { 232 232 for ( ; joni>2; joni-- ) … … 649 649 string fn = "/tmp/which_" + string(system("pid")); 650 650 string pn; 651 if( typeof(command) != "string") 652 { 653 651 if( typeof(command) != "string") 652 { 653 return (pn); 654 654 } 655 655 i = system("sh", "which " + command + " > " + fn); … … 665 665 i = system("sh", "rm " + fn); 666 666 if (rs == 0) {return (pn);} 667 else 667 else 668 668 { 669 669 print (command + " not found "); -
Singular/LIB/hnoether.lib
r30c91f r82716e 1 // $Id: hnoether.lib,v 1. 6 1998-05-05 11:55:27 krueger Exp $1 // $Id: hnoether.lib,v 1.7 1998-05-14 18:45:05 Singular Exp $ 2 2 // author: Martin Lamm, email: lamm@mathematik.uni-kl.de 3 3 // last change: 26.03.98 4 4 /////////////////////////////////////////////////////////////////////////////// 5 5 6 version="$Id: hnoether.lib,v 1. 6 1998-05-05 11:55:27 krueger Exp $";6 version="$Id: hnoether.lib,v 1.7 1998-05-14 18:45:05 Singular Exp $"; 7 7 info=" 8 8 LIBRARY: hnoether.lib PROCEDURES FOR THE HAMBURGER-NOETHER-DEVELOPMENT … … 91 91 } 92 92 /////////////////////////////////////////////////////////////////////////////// 93 proc T_Transform (poly f, int Q, int N) 93 proc T_Transform (poly f, int Q, int N) 94 94 "// returns f(y,xy^Q)/y^NQ 95 95 " … … 99 99 } 100 100 /////////////////////////////////////////////////////////////////////////////// 101 proc T1_Transform (poly f, number d, int M) 101 proc T1_Transform (poly f, number d, int M) 102 102 "// returns f(x,y+d*x^M) 103 103 " … … 116 116 int ggt=gcd(M,N); 117 117 M=M/ggt; N=N/ggt; 118 list ts=extgcd(M,N); 118 list ts=extgcd(M,N); 119 119 int tau,sigma=ts[2],-ts[3]; 120 120 if (sigma<0) { tau=-tau; sigma=-sigma;} … … 144 144 poly hilf; 145 145 // dividiere f so lange durch x, wie die Div. aufgeht: 146 for (hilf=f/x; hilf*x==f; hilf=f/x) {f=hilf;} 146 for (hilf=f/x; hilf*x==f; hilf=f/x) {f=hilf;} 147 147 for (hilf=f/y; hilf*y==f; hilf=f/y) {f=hilf;} // gleiches fuer y 148 148 return(list(T1(f),d)); … … 156 156 "{ 157 157 matrix mat = coeffs(coeffs(f,y)[J+1,1],x); 158 if (size(mat) <= I) { return(0);} 158 if (size(mat) <= I) { return(0);} 159 159 else { return(leadcoef(mat[I+1,1]));} 160 160 } … … 198 198 poly dif,g,l; 199 199 if (gcd_ok!=0) { 200 //-------------------- Berechne f/ggT(f,df/dx,df/dy) ------------------------ 200 //-------------------- Berechne f/ggT(f,df/dx,df/dy) ------------------------ 201 201 dif=diff(f,x); 202 202 if (dif==0) { g=f; } // zur Beschleunigung … … 322 322 if ((leadcoef(f)<-16001) or (leadcoef(f)>16001)) {verbrecher=lead(f);} 323 323 leitexp=leadexp(f); 324 if (( ((leitexp[1] % 32003) == 0) and (leitexp[1]<>0)) 324 if (( ((leitexp[1] % 32003) == 0) and (leitexp[1]<>0)) 325 325 or ( ((leitexp[2] % 32003) == 0) and (leitexp[2]<>0)) ) 326 326 {verbrecher=lead(f);} … … 445 445 string ringchar=charstr(basering); 446 446 map xytausch = basering,y,x; 447 if ((p!=0) and (ringchar != string(p))) { 447 if ((p!=0) and (ringchar != string(p))) { 448 448 // coefficient field is extension of Z/pZ 449 execute "int n_elements="+ringchar[1,size(ringchar)-2]+";"; 449 execute "int n_elements="+ringchar[1,size(ringchar)-2]+";"; 450 450 // number of elements of actual ring 451 451 number generat=par(1); // generator of the coefficient field of the ring … … 509 509 } 510 510 else { 511 if ((str=="s") and (testerg==1)) { 511 if ((str=="s") and (testerg==1)) { 512 512 "(*) attention: it could be that the factor is only one in char 32003!"; 513 513 f=polyhinueber(test_sqr); … … 612 612 delta = koeff(f,(M/ e)*p^l,(N/ e)*p^l*(eps-1)) / (-1*eps*c); 613 613 614 if ((ringchar != string(p)) and (delta != 0)) { 614 if ((ringchar != string(p)) and (delta != 0)) { 615 615 //- coeff. field is not Z/pZ => we`ve to correct delta by taking (p^l)th root- 616 616 if (delta == generat) {exponent=1;} … … 1204 1204 } 1205 1205 example 1206 { 1206 { 1207 1207 if (nameof(basering)=="HNEring") { 1208 1208 def rettering=HNEring; … … 1303 1303 } 1304 1304 if (size(#) != 0) { 1305 "// basering is now 'displayring' containing ideal 'HNE'"; 1305 "// basering is now 'displayring' containing ideal 'HNE'"; 1306 1306 keepring(displayring); 1307 1307 export(HNE); … … 1373 1373 //- finde alle Monome auf der Geraden durch A und C (unterhalb gibt's keine) - 1374 1374 hilf=jet(f,A[2]*C[1]-A[1]*C[2],intvec(A[2]-C[2],C[1]-A[1])); 1375 1375 1376 1376 H=leadexp(xytausch(hilf)); 1377 1377 D=H[2],H[1]; … … 1562 1562 } 1563 1563 else { 1564 execute "ring extdguenstig=("+charstr(basering)+"),(x,y),ls;"; 1564 execute "ring extdguenstig=("+charstr(basering)+"),(x,y),ls;"; 1565 1565 } 1566 1566 } … … 1753 1753 delta = koeff(f,(M/ e)*p^l,(N/ e)*p^l*(eps-1)) / (-1*eps*c); 1754 1754 1755 if ((charstr(basering) != string(p)) and (delta != 0)) { 1755 if ((charstr(basering) != string(p)) and (delta != 0)) { 1756 1756 //------ coefficient field is not Z/pZ => (p^l)th root is not identity ------- 1757 1757 delta=0; … … 1781 1781 "USAGE: reddevelop(f); f poly 1782 1782 RETURN: Hamburger-Noether development of f : 1783 A list of lists in the form of develop(f); each entry contains the 1783 A list of lists in the form of develop(f); each entry contains the 1784 1784 data for one of the branches of f. 1785 1785 For more details type 'help develop;' … … 1910 1910 } 1911 1911 else { 1912 if ((str=="s") and (testerg==1)) { 1912 if ((str=="s") and (testerg==1)) { 1913 1913 "(*)attention: it could be that the factor is only one in char 32003!"; 1914 1914 f=polyhinueber(test_sqr); … … 1976 1976 } 1977 1977 //---------------------- Test, ob f teilbar durch x oder y ------------------- 1978 if (subst(f,y,0)==0) { 1978 if (subst(f,y,0)==0) { 1979 1979 f=f/y; NullHNEy=1; } // y=0 is a solution 1980 if (subst(f,x,0)==0) { 1980 if (subst(f,x,0)==0) { 1981 1981 f=f/x; NullHNEx=1; } // x=0 is a solution 1982 1982 … … 2077 2077 } 2078 2078 example 2079 { 2079 { 2080 2080 if (nameof(basering)=="HNEring") { 2081 2081 def rettering=HNEring; … … 2283 2283 } 2284 2284 else { 2285 2286 2287 2288 2285 " Change of basering necessary!!"; 2286 if (defined(Protokoll)) { teiler,"is not properly factored!"; } 2287 if (needext==0) { poly zerlege=teiler; } 2288 needext=1; 2289 2289 } 2290 2290 } … … 2293 2293 else { deltais=ideal(delta); eis=e;} 2294 2294 if (defined(Protokoll)) {"roots of char. poly:";deltais; 2295 2295 "with multiplicities:",eis;} 2296 2296 if (needext==1) { 2297 2297 //--------------------- fuehre den Ringwechsel aus: -------------------------- 2298 2298 ringischanged=1; 2299 2299 if ((size(parstr(basering))>0) && string(minpoly)=="0") { 2300 2300 " ** We've had bad luck! The HNE cannot completely be calculated!"; 2301 2301 // HNE in transzendenter Erw. fehlgeschlagen 2302 2302 kill zerlege; 2303 2303 ringischanged=0; break; // weiter mit gefundenen Faktoren 2304 2304 } 2305 2305 if (parstr(basering)=="") { 2306 2307 2308 2309 2306 EXTHNEnumber++; 2307 splitring(zerlege,"EXTHNEring("+string(EXTHNEnumber)+")"); 2308 poly transf=0; 2309 poly transfproc=0; 2310 2310 } 2311 2311 else { 2312 2313 2314 2315 2312 if (defined(translist)) { kill translist; } // Vermeidung einer Warnung 2313 if (numberofRingchanges>1) { // ein Ringwechsel hat nicht gereicht 2314 list translist=splitring(zerlege,"",list(transf,transfproc)); 2315 poly transf=translist[1]; poly transfproc=translist[2]; 2316 2316 } 2317 2317 else { 2318 2319 2320 2318 if (defined(transfproc)) { // in dieser proc geschah schon Ringwechsel 2319 EXTHNEnumber++; 2320 list translist=splitring(zerlege,"EXTHNEring(" 2321 2321 +string(EXTHNEnumber)+")",list(a,transfproc)); 2322 2322 poly transf=translist[1]; 2323 2323 poly transfproc=translist[2]; 2324 2325 2326 2327 2324 } 2325 else { 2326 EXTHNEnumber++; 2327 list translist=splitring(zerlege,"EXTHNEring(" 2328 2328 +string(EXTHNEnumber)+")",a); 2329 2330 2331 2329 poly transf=translist[1]; 2330 poly transfproc=transf; 2331 }} 2332 2332 } 2333 2333 //---------------------------------------------------------------------------- … … 2395 2395 // aktualisiere Vektor mit den hqs 2396 2396 if (eis[j]>1) { 2397 2398 2397 transformiert=transformiert/y; 2398 if (subst(transformiert,y,0)==0) { 2399 2399 "THE TEST FOR SQUAREFREENESS WAS BAD!! The polynomial was NOT squarefree!!!";} 2400 2400 else { 2401 2401 //------ Spezialfall (###) eingetreten: Noch weitere Zweige vorhanden -------- 2402 2402 eis[j]=eis[j]-1; 2403 2403 } 2404 2404 } 2405 2405 } … … 2433 2433 //-------- Bereitstellung von Speicherplatz fuer eine neue Zeile: ------------ 2434 2434 HNEs=set_list(HNEs,intvec(hnezaehler,zeile+zl),ideal(0)); 2435 2435 2436 2436 M1=N1; N1=R1; R1=M1%N1; Q1=M1 / N1; 2437 2437 } -
Singular/LIB/inout.lib
r30c91f r82716e 1 // $Id: inout.lib,v 1. 5 1998-05-05 11:55:29 krueger Exp $1 // $Id: inout.lib,v 1.6 1998-05-14 18:45:07 Singular Exp $ 2 2 // system("random",787422842); 3 3 // (GMG/BM, last modified 22.06.96) 4 4 /////////////////////////////////////////////////////////////////////////////// 5 5 6 version="$Id: inout.lib,v 1. 5 1998-05-05 11:55:29 krueger Exp $";6 version="$Id: inout.lib,v 1.6 1998-05-14 18:45:07 Singular Exp $"; 7 7 info=" 8 8 LIBRARY: inout.lib PROCEDURES FOR MANIPULATING IN- AND OUTPUT … … 549 549 } 550 550 newvar = newvar[2,size(newvar)-1]; 551 551 552 552 execute "ring newP=("+newchar+"),("+newvar+"),("+neword+");"; 553 553 def id = imap(P,id); -
Singular/LIB/invar.lib
r30c91f r82716e 1 // $Id: invar.lib,v 1. 6 1998-05-05 11:55:30 krueger Exp $1 // $Id: invar.lib,v 1.7 1998-05-14 18:45:08 Singular Exp $ 2 2 /////////////////////////////////////////////////////// 3 3 // invar.lib … … 7 7 ////////////////////////////////////////////////////// 8 8 9 version="$Id: invar.lib,v 1. 6 1998-05-05 11:55:30 krueger Exp $";9 version="$Id: invar.lib,v 1.7 1998-05-14 18:45:08 Singular Exp $"; 10 10 info=" 11 11 LIBRARY: invar.lib PROCEDURES FOR COMPUTING INVARIANTS OF (C,+)-ACTIONS … … 21 21 // the ring of invariants is finitey generated) 22 22 // if choose<>0 it computes invariants up to degree choose 23 23 24 24 actionIsProper(matrix m) 25 25 // returns 1 if the action of the additive group defined by the … … 50 50 return(m); 51 51 } 52 example 52 example 53 53 { "EXAMPLE:"; echo = 2; 54 54 ring q=0,(x,y,z,u,v,w),dp; … … 64 64 proc der (matrix m, poly f) 65 65 "USAGE: der(m,f); m matrix, f poly 66 RETURN: poly= application of the vectorfield m befined by the matrix m 66 RETURN: poly= application of the vectorfield m befined by the matrix m 67 67 (m[i,1] are the coefficients of d/dx(i)) to f 68 NOTE: 68 NOTE: 69 69 EXAMPLE: example der; shows an example 70 70 " … … 73 73 return(mh[1,1]); 74 74 } 75 example 75 example 76 76 { "EXAMPLE:"; echo = 2; 77 77 ring q=0,(x,y,z,u,v,w),dp; … … 91 91 "USAGE: actionIsProper(m); m matrix 92 92 RETURN: int= 1 if is proper, 0 else 93 NOTE: 93 NOTE: 94 94 EXAMPLE: example actionIsProper; shows an example 95 95 " … … 120 120 delta=der(@m,delta); 121 121 } 122 id=id+ideal(inv); 122 id=id+ideal(inv); 123 123 } 124 124 i=inSubring(@t,id)[1]; … … 126 126 return(i); 127 127 } 128 example 128 example 129 129 { "EXAMPLE:"; echo = 2; 130 130 … … 149 149 proc reduction(poly p, ideal dom, list #) 150 150 "USAGE: reduction(p,dom,q); p poly, dom ideal, q (optional) monomial 151 RETURN: poly= (p-H(f1,...,fr))/q^a, if Lt(p)=H(Lt(f1),...,Lt(fr)) for 151 RETURN: poly= (p-H(f1,...,fr))/q^a, if Lt(p)=H(Lt(f1),...,Lt(fr)) for 152 152 some polynomial H in r variables over the base field, 153 153 a maximal such that q^a devides p-H(f1,...,fr), 154 154 dom =(f1,...,fr) 155 NOTE: 155 NOTE: 156 156 EXAMPLE: example reduction; shows an example 157 157 " … … 160 160 int z=size(dom); 161 161 def bsr=basering; 162 162 163 163 //arranges the monomial v for elimination 164 164 poly v=var(1); … … 170 170 //changes the basering bsr to bsr[@(0),...,@(z)] 171 171 execute "ring s="+charstr(basering)+",("+varstr(basering)+",@(0..z)),dp;"; 172 172 173 173 //costructes the ideal dom=(p-@(0),dom[1]-@(1),...,dom[z]-@(z)) 174 174 ideal dom=imap(bsr,dom); … … 178 178 } 179 179 dom=lead(imap(bsr,p))-@(0),dom; 180 180 181 181 //eliminates the variables of the basering bsr 182 182 //i.e. computes dom intersected with K[@(0),...,@(z)] … … 197 197 poly re=psi(h); 198 198 199 // devides by the maximal power of #[1] 199 // devides by the maximal power of #[1] 200 200 if (size(#)>0) 201 201 { … … 206 206 } 207 207 208 return(re); 208 return(re); 209 209 } 210 210 } … … 212 212 return(p); 213 213 } 214 example 214 example 215 215 { "EXAMPLE:"; echo = 2; 216 216 ring q=0,(x,y,z,u,v,w),dp; … … 224 224 225 225 proc completeReduction(poly p, ideal dom, list #) 226 "USAGE: completeReduction(p,dom,q); p poly, dom ideal, 226 "USAGE: completeReduction(p,dom,q); p poly, dom ideal, 227 227 q (optional) monomial 228 228 RETURN: poly= the polynomial p reduced with dom via the procedure 229 229 reduction as long as possible 230 NOTE: 230 NOTE: 231 231 EXAMPLE: example completeReduction; shows an example 232 232 " … … 241 241 return(p2); 242 242 } 243 example 243 example 244 244 { "EXAMPLE:"; echo = 2; 245 245 ring q=0,(x,y,z,u,v,w),dp; … … 256 256 0,string(h(@(0),...,@(size(dom)))) :if there is only a nonlinear relation 257 257 h(p,dom[1],...,dom[size(dom)])=0. 258 NOTE: 258 NOTE: 259 259 EXAMPLE: example inSubring; shows an example 260 260 " … … 303 303 return(l); 304 304 } 305 example 305 example 306 306 { "EXAMPLE:"; echo = 2; 307 307 ring q=0,(x,y,z,u,v,w),dp; … … 320 320 it is assumed that m(q) and h are invariant 321 321 the sum above is divided by h as much as possible 322 NOTE: 322 NOTE: 323 323 EXAMPLE: example localInvar; shows an example 324 324 " … … 339 339 return(inv); 340 340 } 341 while (dif!=0) 341 while (dif!=0) 342 342 { 343 343 inv=(a*inv)+(coeff*dif); … … 352 352 return(inv); 353 353 } 354 example 354 example 355 355 { "EXAMPLE:"; echo = 2; 356 356 ring q=0,(x,y,z),dp; … … 372 372 in the subring generated by id which are divisible by q 373 373 it is assumed that m(p) and q are invariant 374 the elements mentioned above are computed and divided by q 374 the elements mentioned above are computed and divided by q 375 375 as much as possible 376 376 the ideal karl contains all invariants computed yet 377 NOTE: 377 NOTE: 378 378 EXAMPLE: example furtherInvar; shows an example 379 379 " … … 394 394 setring @r; 395 395 map phi=r1,su; 396 setring r1; 396 setring r1; 397 397 // computes the kernel of phi 398 execute "ideal ker=preimage(@r,phi,null)"; 398 execute "ideal ker=preimage(@r,phi,null)"; 399 399 // defines the map psi : r1 ---> @r defined by y(i) ---> id[i] 400 400 setring @r; … … 437 437 } 438 438 } 439 439 440 440 } 441 441 setring @r; … … 443 443 return(l); 444 444 } 445 example 445 example 446 446 { "EXAMPLE:"; echo = 2; 447 447 ring r=0,(x,y,z,u),dp; … … 461 461 proc invariantRing(matrix m, poly p, poly q,list #) 462 462 "USAGE: invariantRing(m,p,q); m matrix, p,q poly 463 RETURN: ideal= the invariants of the vectorfield m=Sum m[i,1]*d/dx(i) 463 RETURN: ideal= the invariants of the vectorfield m=Sum m[i,1]*d/dx(i) 464 464 p,q variables with m(p)=q invariant 465 465 NOTE: … … 474 474 bou=#[1]; 475 475 } 476 int z; 476 int z; 477 477 ideal karl; 478 478 ideal k1=1; … … 496 496 while (size(k1)!=0) 497 497 { 498 // test if the new invariants are already in the ring generated 498 // test if the new invariants are already in the ring generated 499 499 // by the invariants we constructed already 500 500 it++; … … 512 512 karl=k2[2]; 513 513 k1=sortier(k1); 514 z=size(k1); 514 z=size(k1); 515 515 for (i=1;i<=z;i++) 516 516 { … … 541 541 return(karl); 542 542 } 543 example 543 example 544 544 { "EXAMPLE:"; echo = 2; 545 545 546 546 //Winkelmann: free action but Spec k[x(1),...,x(5)]---> Spec In- 547 547 //variantring is not surjective 548 548 549 549 ring rw=0,(x(1..5)),dp; 550 550 matrix m[5][1]; … … 554 554 ideal in=invariantRing(m,x(3),x(1),0); 555 555 in; 556 556 557 557 //Deveney/Finston: The ring of invariants is not finitely generated 558 558 559 559 ring rf=0,(x(1..7)),dp; 560 560 matrix m[7][1]; … … 565 565 ideal in=invariantRing(m,x(4),x(1),6); 566 566 in; 567 568 567 568 569 569 //Deveney/Finston:Proper Ga-action which is not locally trivial 570 570 //r[x(1),...,x(5)] is not flat over the ring of invariants 571 571 572 572 ring rd=0,(x(1..5)),dp; 573 573 matrix m[5][1]; … … 577 577 ideal in=invariantRing(m,x(3),x(1)); 578 578 in; 579 579 580 580 actionIsProper(m); 581 581 582 582 //computes the relations between the invariants 583 583 int z=size(in); … … 586 586 setring rd; 587 587 map phi=r1,in; 588 setring r1; 589 ideal ker=preimage(rd,phi,null); 588 setring r1; 589 ideal ker=preimage(rd,phi,null); 590 590 ker; 591 591 592 592 //the discriminant 593 593 594 594 ring r=0,(x(1..2),y(1..2),z,t),dp; 595 595 poly p=z+(1+x(1)*y(2)^2)*t+x(1)*y(1)*y(2)*t^2+(1/3)*x(1)*y(1)^2*t^3; 596 596 597 597 matrix m[5][5]; 598 598 m[1,1]=z; … … 621 621 m[5,4]=2*x(1)*y(1)*y(2); 622 622 m[5,5]=x(1)*y(1)^2; 623 623 624 624 poly disc=9*det(m)/(x(1)^2*y(1)^4); 625 625 626 626 LIB "invar.lib"; 627 627 matrix n[6][1]; … … 629 629 n[4,1]=y(1); 630 630 n[5,1]=1+x(1)*y(2)^2; 631 631 632 632 der(n,disc); 633 633 634 634 //x(1)^3*y(2)^6-6*x(1)^2*y(1)*y(2)^3*z+6*x(1)^2*y(2)^4+9*x(1)*y(1)^2*z^2-18*x(1)*y(1)*y(2)*z+9*x(1)*y(2)^2+4 635 636 635 636 637 637 //constructive approach to Weizenbcks theorem 638 638 639 639 int n=5; 640 640 641 641 ring w=0,(x(1..n)),wp(1..n); 642 642 643 643 // definition of the vectorfield m=sum m[i]*d/dx(i) 644 644 matrix m[n][1]; … … 650 650 ideal in=invariantRing(m,x(2),x(1),0); 651 651 in; 652 653 654 655 } 652 653 654 655 } -
Singular/LIB/makedbm.lib
r30c91f r82716e 1 // $Id: makedbm.lib,v 1. 7 1998-05-05 11:55:31 krueger Exp $1 // $Id: makedbm.lib,v 1.8 1998-05-14 18:45:09 Singular Exp $ 2 2 //========================================================================= 3 3 // … … 6 6 //============================================================================= 7 7 8 version="$Id: makedbm.lib,v 1. 7 1998-05-05 11:55:31 krueger Exp $";8 version="$Id: makedbm.lib,v 1.8 1998-05-14 18:45:09 Singular Exp $"; 9 9 info=" 10 10 LIBRARY: makedbm.lib some usefull tools needed by the Arnold-Classifier. … … 38 38 string s=""; 39 39 s=read(l); 40 while( s != "" ) 40 while( s != "" ) 41 41 { 42 42 s,"=",read(l,s); … … 237 237 238 238 proc read_sing_dbm 239 { 239 { 240 240 link l="DBM: NFlist"; 241 241 "A[k] = "+read(l, "A[k]"); -
Singular/LIB/matrix.lib
r30c91f r82716e 1 // $Id: matrix.lib,v 1. 6 1998-05-05 11:55:31 krueger Exp $1 // $Id: matrix.lib,v 1.7 1998-05-14 18:45:10 Singular Exp $ 2 2 // (GMG/BM, last modified 22.06.96) 3 3 /////////////////////////////////////////////////////////////////////////////// 4 4 5 version="$Id: matrix.lib,v 1. 6 1998-05-05 11:55:31 krueger Exp $";5 version="$Id: matrix.lib,v 1.7 1998-05-14 18:45:10 Singular Exp $"; 6 6 info=" 7 7 LIBRARY: matrix.lib PROCEDURES FOR MATRIX OPERATIONS … … 298 298 //---------------------------- trivial cases ---------------------------------- 299 299 int ii; 300 if( n <= 0 ) 301 { 302 if( typeof(A)=="matrix" ) 303 { 304 return (unitmat(nrows(A))); 300 if( n <= 0 ) 301 { 302 if( typeof(A)=="matrix" ) 303 { 304 return (unitmat(nrows(A))); 305 305 } 306 if( typeof(A)=="intmat" ) 307 { 306 if( typeof(A)=="intmat" ) 307 { 308 308 intmat B[nrows(A)][nrows(A)]; 309 309 for( ii=1; ii<=nrows(A); ii++ ) … … 311 311 B[ii,ii] = 1; 312 312 } 313 return (B); 313 return (B); 314 314 } 315 315 } -
Singular/LIB/normal.lib
r30c91f r82716e 6 6 /////////////////////////////////////////////////////////////////////////////// 7 7 8 version="$Id: normal.lib,v 1. 5 1998-05-05 11:55:32 krueger Exp $";8 version="$Id: normal.lib,v 1.6 1998-05-14 18:45:10 Singular Exp $"; 9 9 info=" 10 10 LIBRARY: normal.lib: PROCEDURE FOR NORMALIZATION (I) 11 11 12 12 normal(ideal I) 13 // computes a set of rings such that their product is the 14 // normalization of the reduced basering/I 13 // computes a set of rings such that their product is the 14 // normalization of the reduced basering/I 15 15 "; 16 16 17 LIB "sing.lib"; 17 LIB "sing.lib"; 18 18 LIB "primdec.lib"; 19 19 LIB "elim.lib"; … … 29 29 p = nonzero divisor of R 30 30 RETURN: 1 if R = R:J, 0 if not 31 EXAMPLE: example isR_HomJR; shows an example 31 EXAMPLE: example isR_HomJR; shows an example 32 32 " 33 33 { … … 46 46 n=1; 47 47 for (ii=1; ii<=size(f); ii++ ) 48 { 49 if ( reduce(f[ii],lp) != 0) 48 { 49 if ( reduce(f[ii],lp) != 0) 50 50 { n = 0; break; } 51 51 } … … 76 76 NOTE: This is useful when enlarging P but keeping the weights of the old 77 77 variables 78 EXAMPLE: example extraweight; shows an example 78 EXAMPLE: example extraweight; shows an example 79 79 " 80 80 { … … 92 92 os = osP[fi+1,find(osP,")",fi)-fi-1]; 93 93 if( find(os,",") ) 94 { 94 { 95 95 execute "nw = "+os+";"; 96 96 if( size(nw) > ii ) … … 105 105 { 106 106 execute "q = "+os+";"; 107 if( q > ii ) 108 { 107 if( q > ii ) 108 { 109 109 nw = 0; nw[q-ii] = 0; 110 110 nw = nw + 1; //creates an intvec 1,...,1 of length q-ii … … 118 118 } 119 119 //-------------- adjust weight vector to length = nvars(P) ------------------- 120 if( fo > 1 ) 120 if( fo > 1 ) 121 121 { // case when weights were found 122 rw = rw[2..size(rw)]; 123 if( size(rw) > nvars(P) ) 124 { 125 rw = rw[1..nvars(P)]; 126 } 127 if( size(rw) < nvars(P) ) 128 { 129 nw=0; nw[nvars(P)-size(rw)]=0; nw=nw+1; rw=rw,nw; 130 } 131 } 132 else 122 rw = rw[2..size(rw)]; 123 if( size(rw) > nvars(P) ) 124 { 125 rw = rw[1..nvars(P)]; 126 } 127 if( size(rw) < nvars(P) ) 128 { 129 nw=0; nw[nvars(P)-size(rw)]=0; nw=nw+1; rw=rw,nw; 130 } 131 } 132 else 133 133 { // case when no weights were found 134 rw[nvars(P)]= 0; rw=rw+1; 134 rw[nvars(P)]= 0; rw=rw+1; 135 135 } 136 136 return(rw); … … 162 162 R is the quotient ring of P modulo the standard basis SBid 163 163 RETURN: a list of two objects 164 _[1]: a polynomial ring, containing two ideals, 'endid' and 'endphi' 164 _[1]: a polynomial ring, containing two ideals, 'endid' and 'endphi' 165 165 s.t. _[1]/endid = Hom_R(J,J) and 166 166 endphi describes the canonical map R -> Hom_R(J,J) 167 167 _[2]: an integer which is 1 if phi is an isomorphism, 0 if not 168 EXAMPLE: example HomJJ; shows an example 168 EXAMPLE: example HomJJ; shows an example 169 169 " 170 170 { … … 185 185 186 186 //---- set attributes for special cases where algorithm can be simplified ----- 187 if( homo==1 ) 188 { 187 if( homo==1 ) 188 { 189 189 rw = extraweight(P); 190 190 } … … 218 218 219 219 //---------- computation of p*Hom(J,J) as R-ideal ----------------------------- 220 f = quotient(p*J,J); 221 if(y==1) 222 { 220 f = quotient(p*J,J); 221 if(y==1) 222 { 223 223 "the module Hom(rad(J),rad(J)) presented by the values on"; 224 224 "the non-zerodivisor"; … … 243 243 rf = interred(reduce(f,f2)); // represents p*Hom(J,J)/p*R = Hom(J,J)/R 244 244 if ( size(rf) == 0 ) 245 { 245 { 246 246 if ( homog(f) && find(ordstr(basering),"s")==0 ) 247 247 { 248 ring newR1 = char(P),(X(1..nvars(P))),(a(rw),dp); 248 ring newR1 = char(P),(X(1..nvars(P))),(a(rw),dp); 249 249 } 250 250 else 251 251 { 252 ring newR1 = char(P),(X(1..nvars(P))),dp; 252 ring newR1 = char(P),(X(1..nvars(P))),dp; 253 253 } 254 254 ideal endphi = maxideal(1); 255 ideal endid = fetch(P,id); 255 ideal endid = fetch(P,id); 256 256 attrib(endid,"isCohenMacaulay",isCo); 257 257 attrib(endid,"isPrim",isPr); … … 306 306 q = size(f); 307 307 syzf = syz(f); 308 308 309 309 if ( homo==1 ) 310 310 { … … 312 312 for ( ii=2; ii<=q; ii++ ) 313 313 { 314 rw = rw, deg(f[ii])-deg(f[1]); 315 rw1 = rw1, deg(f[ii])-deg(f[1]); 316 } 317 ring newR1 = char(R),(X(1..nvars(R)),T(1..q)),(a(rw1),dp); 314 rw = rw, deg(f[ii])-deg(f[1]); 315 rw1 = rw1, deg(f[ii])-deg(f[1]); 316 } 317 ring newR1 = char(R),(X(1..nvars(R)),T(1..q)),(a(rw1),dp); 318 318 } 319 319 else 320 320 { 321 ring newR1 = char(R),(X(1..nvars(R)),T(1..q)),dp; 321 ring newR1 = char(R),(X(1..nvars(R)),T(1..q)),dp; 322 322 } 323 323 … … 325 325 ideal SBid = psi1(SBid); 326 326 attrib(SBid,"isSB",1); 327 327 328 328 qring newR = std(SBid); 329 329 map psi = R,ideal(X(1..nvars(R))); … … 336 336 337 337 //---------- computation of Hom(J,J) as ring ---------------------------------- 338 // determine kernel of: R[T1,...,Tq] -> J:J >-> R[1/p]=R[t]/(t*p-1), 338 // determine kernel of: R[T1,...,Tq] -> J:J >-> R[1/p]=R[t]/(t*p-1), 339 339 // Ti -> fi/p -> t*fi (p=f1=f[1]), to get ring structure. This is of course 340 340 // the same as the kernel of R[T1,...,Tq] -> pJ:J >-> R, Ti -> fi. … … 344 344 pf = f[1]*f; 345 345 T = matrix(ideal(T(1..q)),1,q); 346 Lin = ideal(T*syzf); 346 Lin = ideal(T*syzf); 347 347 if(y==1) 348 348 { … … 379 379 else 380 380 { 381 ring newRing = char(R),(X(1..nvars(R)),T(2..q)),dp; 381 ring newRing = char(R),(X(1..nvars(R)),T(2..q)),dp; 382 382 } 383 383 … … 386 386 387 387 map phi = basering,maxideal(1); 388 list Le = elimpart(endid); 388 list Le = elimpart(endid); 389 389 //this proc and the next loop try to 390 390 q = size(Le[2]); //substitute as many variables as possible 391 rw1 = 0; 391 rw1 = 0; 392 392 rw1[nvars(basering)] = 0; 393 393 rw1 = rw1+1; … … 400 400 kill ps; 401 401 402 for( ii=1; ii<=size(rw1); ii++ ) 403 { 404 if( Le[4][ii]==0 ) 405 { 402 for( ii=1; ii<=size(rw1); ii++ ) 403 { 404 if( Le[4][ii]==0 ) 405 { 406 406 rw1[ii]=0; //look for substituted vars 407 407 } … … 409 409 Le=elimpart(endid); 410 410 q = q + size(Le[2]); 411 } 411 } 412 412 endphi = phi(endphi); 413 413 … … 417 417 418 418 if (homo==1 && nvars(newRing)-q >1 && size(endid) >0 ) 419 { 419 { 420 420 jj=1; 421 421 for( ii=2; ii<size(rw1); ii++) 422 { 422 { 423 423 jj++; 424 if( rw1[ii]==0 ) 425 { 424 if( rw1[ii]==0 ) 425 { 426 426 rw=rw[1..jj-1],rw[jj+1..size(rw)]; 427 jj=jj-1; 427 jj=jj-1; 428 428 } 429 429 } … … 435 435 else 436 436 { 437 ring lastRing = char(R),(T(1..nvars(newRing)-q)),dp; 438 } 439 440 ideal lastmap; 437 ring lastRing = char(R),(T(1..nvars(newRing)-q)),dp; 438 } 439 440 ideal lastmap; 441 441 q = 1; 442 442 for(ii=1; ii<=size(rw1); ii++ ) … … 444 444 if ( rw1[ii]==1 ) { lastmap[ii] = T(q); q=q+1; } 445 445 if ( rw1[ii]==0 ) { lastmap[ii] = 0; } 446 } 446 } 447 447 map phi = newRing,lastmap; 448 448 ideal endid = phi(endid); … … 495 495 list L = HomJJ(Li); 496 496 def end = L[1]; // defines ring L[1], containing ideals endid and endphi 497 setring end; // makes end the basering 497 setring end; // makes end the basering 498 498 end; 499 499 endid; // end/endid is isomorphic to End(r/id) as ring … … 501 501 psi; 502 502 503 ring r = 32003,(x,y,z),dp; 503 ring r = 32003,(x,y,z),dp; 504 504 ideal id = x2-xy-xz+yz; 505 505 ideal J =y-z,x-z; … … 508 508 list L = HomJJ(Li,0); 509 509 def end = L[1]; // defines ring L[1], containing ideals endid and endphi 510 setring end; // makes end the basering 510 setring end; // makes end the basering 511 511 end; 512 512 endid; // end/endid is isomorphic to End(r/id) as ring … … 534 534 if( typeof(attrib(id,"isEquidimensional"))=="int" ) 535 535 { 536 if(attrib(id,"isEquidimensional")==1) 536 if(attrib(id,"isEquidimensional")==1) 537 537 { 538 attrib(prim[1],"isEquidimensional",1); 538 attrib(prim[1],"isEquidimensional",1); 539 539 } 540 540 } … … 545 545 if( typeof(attrib(id,"isCompleteIntersection"))=="int" ) 546 546 { 547 if(attrib(id,"isCompleteIntersection")==1) 547 if(attrib(id,"isCompleteIntersection")==1) 548 548 { 549 attrib(prim[1],"isCompleteIntersection",1); 549 attrib(prim[1],"isCompleteIntersection",1); 550 550 } 551 551 } … … 554 554 attrib(prim[1],"isCompleteIntersection",0); 555 555 } 556 556 557 557 if( typeof(attrib(id,"isPrim"))=="int" ) 558 558 { … … 565 565 if( typeof(attrib(id,"isIsolatedSingularity"))=="int" ) 566 566 { 567 if(attrib(id,"isIsolatedSingularity")==1) 567 if(attrib(id,"isIsolatedSingularity")==1) 568 568 {attrib(prim[1],"isIsolatedSingularity",1); } 569 569 } 570 570 else 571 571 { 572 attrib(prim[1],"isIsolatedSingularity",0); 572 attrib(prim[1],"isIsolatedSingularity",0); 573 573 } 574 574 if( typeof(attrib(id,"isCohenMacaulay"))=="int" ) 575 575 { 576 if(attrib(id,"isCohenMacaulay")==1) 576 if(attrib(id,"isCohenMacaulay")==1) 577 577 { attrib(prim[1],"isCohenMacaulay",1); } 578 578 } 579 579 else 580 580 { 581 attrib(prim[1],"isCohenMacaulay",0); 581 attrib(prim[1],"isCohenMacaulay",0); 582 582 } 583 583 if( typeof(attrib(id,"isRegInCodim2"))=="int" ) … … 588 588 else 589 589 { 590 attrib(prim[1],"isRegInCodim2",0); 590 attrib(prim[1],"isRegInCodim2",0); 591 591 } 592 592 return(normalizationPrimes(prim[1],maxideal(1))); … … 622 622 if( typeof(attrib(id,"isEquidimensional"))=="int" ) 623 623 { 624 if(attrib(id,"isEquidimensional")==1) 624 if(attrib(id,"isEquidimensional")==1) 625 625 { 626 attrib(prim[i],"isEquidimensional",1); 626 attrib(prim[i],"isEquidimensional",1); 627 627 } 628 628 } … … 630 630 { 631 631 attrib(prim[i],"isEquidimensional",0); 632 } 632 } 633 633 if( typeof(attrib(id,"isIsolatedSingularity"))=="int" ) 634 634 { 635 if(attrib(id,"isIsolatedSingularity")==1) 635 if(attrib(id,"isIsolatedSingularity")==1) 636 636 {attrib(prim[i],"isIsolatedSingularity",1); } 637 637 } 638 638 else 639 639 { 640 attrib(prim[i],"isIsolatedSingularity",0); 640 attrib(prim[i],"isIsolatedSingularity",0); 641 641 } 642 642 643 643 keepresult=normalizationPrimes(prim[i],maxideal(1)); 644 644 for(j=1;j<=size(keepresult);j++) … … 695 695 ideal PP=fetch(BAS,ihp); 696 696 export PP; 697 export KK; 697 export KK; 698 698 result=newR7; 699 699 setring BAS; … … 866 866 // if((dim(SM[1]))==depth) 867 867 // { 868 // attrib(SM[2],"isCohenMacaulay",1); 868 // attrib(SM[2],"isCohenMacaulay",1); 869 869 // "it is CohenMacaulay"; 870 // } 870 // } 871 871 // } 872 872 873 873 //compute the singular locus+lower dimensional components 874 874 if(((attrib(SM[2],"isIsolatedSingularity")==0)||(homog(SM[2])==0)) … … 953 953 " "; 954 954 maxideal(1); 955 " "; 955 " "; 956 956 " "; 957 957 } … … 970 970 // export SB,MB; 971 971 // result=BAS; 972 // return(result); 972 // return(result); 973 973 // } 974 974 // timer-ti; … … 979 979 if(RR[2]==0) 980 980 { 981 def newR=RR[1]; 981 def newR=RR[1]; 982 982 setring newR; 983 983 map psi=BAS,endphi; … … 987 987 // timer-ti; 988 988 setring BAS; 989 return(tluser); 989 return(tluser); 990 990 } 991 991 MB=SM[2]; … … 999 999 setring BAS; 1000 1000 return(result); 1001 1001 1002 1002 } 1003 1003 else 1004 { 1004 { 1005 1005 ideal id=qAnn+SM[2]; 1006 1006 … … 1033 1033 } 1034 1034 } 1035 1035 1036 1036 //test for non-normality 1037 1037 //Hom(I,I)<>R … … 1059 1059 // export SB,MB; 1060 1060 // result=BAS; 1061 // return(result); 1061 // return(result); 1062 1062 // } 1063 1063 // timer-ti; … … 1065 1065 // list RR=SM[1],SM[2],JM[2],SL[1]; 1066 1066 // ti=timer; 1067 list RS; 1067 list RS; 1068 1068 // list RS=HomJJ(RR); 1069 1069 // timer-ti; … … 1075 1075 // list tluser=normalizationPrimes(SM); 1076 1076 // setring BAS; 1077 // return(tluser); 1077 // return(tluser); 1078 1078 // } 1079 1079 … … 1084 1084 } 1085 1085 // ti=timer; 1086 1086 1087 1087 1088 1088 if((attrib(JM[2],"isRad")==0)&&(attrib(SM[2],"isEquidimensional")==0)) … … 1090 1090 //J=radical(JM[2]); 1091 1091 J=radical(SM[2]+ideal(SL[1])); 1092 1092 1093 1093 // evtl. test auf J=SM[2]+ideal(SL[1]) dann schon normal 1094 1094 } … … 1110 1110 // timer-ti; 1111 1111 1112 JM=J,J; 1112 JM=J,J; 1113 1113 1114 1114 //evtl. fuer SL[1] anderen Nichtnullteiler aus J waehlen … … 1124 1124 // keepresult1=insert(keepresult1,keepresult2[lauf]); 1125 1125 // } 1126 // return(keepresult1); 1126 // return(keepresult1); 1127 1127 // } 1128 1128 RR=SM[1],SM[2],JM[2],SL[1]; … … 1147 1147 export KK; 1148 1148 setring BAS; 1149 // return(RS[1]); 1149 // return(RS[1]); 1150 1150 return(lastR); 1151 1151 } … … 1160 1160 // normalizationPrimes(endid); 1161 1161 setring BAS; 1162 return(tluser); 1162 return(tluser); 1163 1163 } 1164 1164 else … … 1169 1169 +ordstr(basering)+");"; 1170 1170 if(y==1) 1171 { 1171 { 1172 1172 "zero-divisor found"; 1173 1173 } … … 1187 1187 } 1188 1188 attrib(vid,"isCompleteIntersection",0); 1189 1189 1190 1190 keepresult1=normalizationPrimes(vid,ihp); 1191 1191 … … 1196 1196 execute "ring newR2="+charstr(basering)+",("+varstr(basering)+"),(" 1197 1197 +ordstr(basering)+");"; 1198 1198 1199 1199 ideal vid=fetch(BAS,new2); 1200 1200 ideal ihp=fetch(BAS,ihp); … … 1220 1220 keepresult1=insert(keepresult1,keepresult2[lauf]); 1221 1221 } 1222 return(keepresult1); 1223 } 1222 return(keepresult1); 1223 } 1224 1224 } 1225 1225 example … … 1278 1278 ideal i=zy2-zx3-x6; 1279 1279 1280 //Theo2 1280 //Theo2 1281 1281 ring r=32003,(x,y,z),wp(3,4,12); 1282 1282 ideal i=z*(y3-x4)+x8; … … 1348 1348 1349 1349 //dauert laenger 1350 //Horrocks: 1350 //Horrocks: 1351 1351 ring r=32003,(a,b,c,d,e,f),dp; 1352 1352 ideal i= … … 1385 1385 a4d-8000a3be+8001a3cf-2ae2f2; 1386 1386 1387 1387 1388 1388 ring r=32003,(b,s,t,u,v,w,x,y,z),dp; 1389 1389 -
Singular/LIB/poly.lib
r30c91f r82716e 1 // $Id: poly.lib,v 1.1 2 1998-05-05 11:55:33 krueger Exp $1 // $Id: poly.lib,v 1.13 1998-05-14 18:45:11 Singular Exp $ 2 2 //system("random",787422842); 3 3 //(GMG, last modified 22.06.96) … … 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 7 version="$Id: poly.lib,v 1.1 2 1998-05-05 11:55:33 krueger Exp $";7 version="$Id: poly.lib,v 1.13 1998-05-14 18:45:11 Singular Exp $"; 8 8 info=" 9 9 LIBRARY: poly.lib PROCEDURES FOR MANIPULATING POLYS, IDEALS, MODULES 10 10 11 11 cyclic(int); ideal of cyclic n-roots 12 katsura([i]); 12 katsura([i]); katsura [i] ideal 13 13 freerank(poly/...) rank of coker(input) if coker is free else -1 14 14 is_homog(poly/...); int, =1 resp. =0 if input is homogeneous resp. not … … 59 59 60 60 proc katsura 61 "USAGE: 61 "USAGE: katsura([n]); n integer 62 62 RETURN: katsura(n) : n-th katsura ideal of newly created and set ring 63 63 (32003, x(0..n), dp) 64 katsura() : katsura ideal of basering 64 katsura() : katsura ideal of basering 65 65 EXAMPLE: example katsura; shows examples 66 66 " … … 75 75 int n = nvars(basering) -1; 76 76 poly p; 77 77 78 78 p = -1; 79 79 for (i = -n; i <= n; i++) … … 82 82 } 83 83 s[1] = p; 84 84 85 85 for (i = 0; i < n; i++) 86 86 { … … 596 596 "USAGE: lcm(i); i ideal 597 597 RETURN: poly = lcm(i[1],...,i[size(i)]) 598 NOTE: 598 NOTE: 599 599 EXAMPLE: example lcm; shows an example 600 600 " … … 656 656 { 657 657 return(leadcoef(f)/leadcoef(cleardenom(f))); 658 } 658 } 659 659 example 660 660 { "EXAMPLE:"; echo = 2; -
Singular/LIB/presolve.lib
r30c91f r82716e 1 // $Id: presolve.lib,v 1. 4 1998-05-05 11:55:34 krueger Exp $1 // $Id: presolve.lib,v 1.5 1998-05-14 18:45:12 Singular Exp $ 2 2 //system("random",787422842); 3 3 //(GMG), last modified 97/10/07 by GMG 4 4 /////////////////////////////////////////////////////////////////////////////// 5 5 6 version="$Id: presolve.lib,v 1. 4 1998-05-05 11:55:34 krueger Exp $";6 version="$Id: presolve.lib,v 1.5 1998-05-14 18:45:12 Singular Exp $"; 7 7 info=" 8 8 LIBRARY: presolve.lib PROCEDURES FOR PRE-SOLVING POLYNOMIAL EQUATIONS … … 20 20 sortandmap(id,s1,s2); map to new basering with vars sorted w.r.t. complexity 21 21 sortvars(id[n1,p1..]); sort vars w.r.t. complexity in id [different blocks] 22 valvars(id[..]); valuation of vars w.r.t. to their complexity in id 22 valvars(id[..]); valuation of vars w.r.t. to their complexity in id 23 23 (parameters in square brackets [] are optional) 24 24 "; … … 43 43 { 44 44 for ( ii=1; ii<=s; ii=ii+1 ) 45 { 46 dpart[ii] = (jet(id[ii],d1-1)==0)*(id[ii]==jet(id[ii],d2))*id[ii]; 45 { 46 dpart[ii] = (jet(id[ii],d1-1)==0)*(id[ii]==jet(id[ii],d2))*id[ii]; 47 47 } 48 48 } 49 49 else 50 { 50 { 51 51 for ( ii=1; ii<=s; ii=ii+1 ) 52 { 52 { 53 53 dpart[ii]=(jet(id[ii],d1-1,#[1])==0)*(id[ii]==jet(id[ii],d2,#[1]))*id[ii]; 54 54 } … … 56 56 return(simplify(dpart,2)); 57 57 } 58 example 58 example 59 59 { "EXAMPLE:"; echo = 2; 60 60 ring r=0,(x,y,z),dp; … … 71 71 RETURN: list of of 5 objects: 72 72 [1]: (interreduced) ideal obtained from i by eliminating (sbstituting) 73 from the first n variables those which appear in a linear part 73 from the first n variables those which appear in a linear part 74 74 of i, by putting this part into triangular form 75 75 (default: n = nvars(basering)) … … 77 77 [3]: ideal, j-th element defines substitution of j-th var in [2] 78 78 [4]: ideal of variables of basering, eliminated ones are set to 0 79 [5]: ideal, describing the map from the basering to itself such that 79 [5]: ideal, describing the map from the basering to itself such that 80 80 [1] is the image of i 81 NOTE: the procedure does always interreduces the ideal i internally w.r.t. 81 NOTE: the procedure does always interreduces the ideal i internally w.r.t. 82 82 ordering dp 83 83 // bei ** spaeter eventuell verbessern … … 93 93 //--------------- replace ordering by dp-ordering if necessary ---------------- 94 94 o = "dp("+string(n)+")"; 95 fi = find(ordstr(P),o); 95 fi = find(ordstr(P),o); 96 96 if( fi == 0 or find(ordstr(P),"a") != 0 ) 97 97 { … … 102 102 ideal max,rest = maxideal(1),0; 103 103 if ( n < nvars(P) ) { rest = max[n+1..nvars(P)]; } 104 attrib(rest,"isSB",1); 104 attrib(rest,"isSB",1); 105 105 //-------------------- interreduce and find linear part ---------------------- 106 106 // interred does the only real work. Because of ordering dp the linear part is … … 110 110 // which do not contain elements not to be eliminated 111 111 112 ideal id = interred(i); 113 for ( ii=1; ii<=size(id); ii++ ) 114 { 112 ideal id = interred(i); 113 for ( ii=1; ii<=size(id); ii++ ) 114 { 115 115 if( deg(id[ii]) > 1) { break; } 116 116 k=ii; 117 117 } 118 if( k == 0 ) { ideal lin; } 118 if( k == 0 ) { ideal lin; } 119 119 else { ideal lin = id[1..k];} 120 120 if( k < size(id) ) { id = id[k+1..size(id)]; } … … 123 123 if ( n < nvars(P) ) 124 124 { 125 for ( ii=1; ii<=size(lin); ii++ ) 126 { 127 if ( reduce(lead(lin[ii]),rest) == 0 ) 128 { 125 for ( ii=1; ii<=size(lin); ii++ ) 126 { 127 if ( reduce(lead(lin[ii]),rest) == 0 ) 128 { 129 129 id=lin[ii],id; 130 lin[ii] = 0; 130 lin[ii] = 0; 131 131 } 132 132 } 133 133 } 134 134 lin = simplify(lin,2); 135 attrib(lin,"isSB",1); 135 attrib(lin,"isSB",1); 136 136 ideal eva = lead(lin); 137 attrib(eva,"isSB",1); 137 attrib(eva,"isSB",1); 138 138 ideal neva = reduce(maxideal(1),eva); 139 139 //------------------ go back to original ring end return ---------------------- … … 153 153 { 154 154 if( neva[ii] == 0 ) 155 { 155 { 156 156 phi[ii] = eva[k]-lin[k]; 157 157 k=k+1; … … 162 162 return(L); 163 163 } 164 example 164 example 165 165 { "EXAMPLE:"; echo = 2; 166 166 ring s=0,(x,y,z,t,u,v,w,a,b,c,d,f,e),ds; … … 173 173 174 174 proc elimpart (ideal i,list #) 175 "USAGE: elimpart(i[,n,e]); i=ideal, n,e=integers 176 consider 1-st n vars for elimination (better: substitution), 177 e =0: substitute from linear part of i (same as elimlinearpart) 178 e!=0: eliminate also by direct substitution 175 "USAGE: elimpart(i[,n,e]); i=ideal, n,e=integers 176 consider 1-st n vars for elimination (better: substitution), 177 e =0: substitute from linear part of i (same as elimlinearpart) 178 e!=0: eliminate also by direct substitution 179 179 (default: n = nvars(basering), e = 1) 180 180 RETURN: list of of 5 objects: 181 181 [1]: ideal obtained by substituting from the first n variables those 182 from i which appear in the linear part of i [or, if e!=0, which 182 from i which appear in the linear part of i [or, if e!=0, which 183 183 can be expressed directly in the remaining vars] 184 184 [2]: ideal, variables which have been substituted … … 188 188 itself onto k[..variables fom [4]..] and [1] is the image of i 189 189 The ideal i is generated by [1] and [3] in k[x(1..m)], the map [5] 190 maps [3] to 0, hence induceds an isomorhism 191 k[x(1..m)]/i -> k[..variables fom [4]..]/[1] 190 maps [3] to 0, hence induceds an isomorhism 191 k[x(1..m)]/i -> k[..variables fom [4]..]/[1] 192 192 NOTE: If the basering has ordering (c,dp), this is faster for big ideals, 193 since it avoids internal ring change and mapping 193 since it avoids internal ring change and mapping 194 194 EXAMPLE: example elimpart; shows an example 195 195 " … … 210 210 // first find terms lin1 of pure degree 1 in each poly of lin 211 211 // k1 = pure degree 1 part, k1+k2 = those polys of lin which contained a pure 212 // degree 1 part. 212 // degree 1 part. 213 213 // Then go to ring newP with ordering c,dp(n) and create a matrix with size(k1) 214 214 // colums and 2 rows, such that if [f1,f2] is a column of M then f1+f2 is one of 215 215 // the polys of lin containing a pure degree 1 part and f1 is this part 216 // interreduce this matrix (i.e. Gauss elimination on linear part, with rest 216 // interreduce this matrix (i.e. Gauss elimination on linear part, with rest 217 217 // transformed accordingly). 218 218 219 219 if ( e!=0 ) 220 220 { 221 int ii,kk; 221 int ii,kk; 222 222 ideal k1,k2; 223 223 int l = size(lin); … … 260 260 poly p; map phi; ideal max; 261 261 for ( ii=1; ii<=n; ii++ ) 262 { 262 { 263 263 for (kk=1; kk<=l; kk++ ) 264 264 { 265 p = kin[kk]/var(ii); 266 if ( deg(p) == 0 ) 265 p = kin[kk]/var(ii); 266 if ( deg(p) == 0 ) 267 267 { 268 268 eva = eva+var(ii); … … 287 287 lin[ii] = cleardenom(lin[ii]); 288 288 } 289 if( defined(newP) ) 289 if( defined(newP) ) 290 290 { 291 291 setring P; … … 306 306 return(L); 307 307 } 308 example 308 example 309 309 { "EXAMPLE:"; echo = 2; 310 310 ring s=0,(x,y,z,t,u,v,w,a,b,c,d,f,e),(c,ds); … … 318 318 319 319 proc elimpartanyr (ideal i, list #) 320 "USAGE: elimpartanyr(i[,p,e]); i=ideal, p=product of vars to be eliminated, 320 "USAGE: elimpartanyr(i[,p,e]); i=ideal, p=product of vars to be eliminated, 321 321 e=int (default: p=product of all vars, e=1) 322 322 RETURN: list of of 6 objects: 323 [1]: (interreduced) ideal obtained by substituting from i those vars 323 [1]: (interreduced) ideal obtained by substituting from i those vars 324 324 appearing in p which occur in the linear part of i [or which can 325 325 be expressed directly in the remaining variables, if e!=0] … … 332 332 333 333 The ideal i is generated by [1] and [3] in k[x(1..m)], the map [5] 334 maps [3] to 0, hence induceds an isomorhism 335 k[x(1..m)]/i -> k[..variables fom [4]..]/[1] 336 NOTE: the proc uses 'execute' to create a ring with ordering dp and vars 334 maps [3] to 0, hence induceds an isomorhism 335 k[x(1..m)]/i -> k[..variables fom [4]..]/[1] 336 NOTE: the proc uses 'execute' to create a ring with ordering dp and vars 337 337 placed correctly and then applies 'elimpart'; 338 338 EXAMPLE: example elimpartanyr; shows an example … … 340 340 { 341 341 def P = basering; 342 int j,n,e = 0,0,1; 342 int j,n,e = 0,0,1; 343 343 poly p = product(maxideal(1)); 344 344 if ( size(#)==1 ) { p=#[1]; } 345 345 if ( size(#)==2 ) { p=#[1]; e=#[2]; } 346 346 string a,b; 347 for ( j=1; j<=nvars(P); j++ ) 348 { 347 for ( j=1; j<=nvars(P); j++ ) 348 { 349 349 if (deg(p/var(j))>=0) { a = a+varstr(j)+","; n = n+1; } 350 350 else { b = b+varstr(j)+","; } … … 354 354 execute "ring gnir ="+charstr(P)+",("+a+b+"),dp;"; 355 355 ideal i = imap(P,i); 356 list L = elimpart(i,n,e)+list(n); 356 list L = elimpart(i,n,e)+list(n); 357 357 setring P; 358 358 list L = imap(gnir,L); 359 359 return(L); 360 360 } 361 example 361 example 362 362 { "EXAMPLE:"; echo = 2; 363 363 ring s=0,(e,f,x,y,z,t,u,v,w,a,b,c,d),dp; … … 369 369 } 370 370 /////////////////////////////////////////////////////////////////////////////// 371 371 372 372 proc fastelim (ideal i, poly p, list #) 373 "USAGE: fastelim(i,p[h,o,a,b,e,m]); i=ideal, p=product of variables to be 374 eliminated; h,o,a,b,e integers 373 "USAGE: fastelim(i,p[h,o,a,b,e,m]); i=ideal, p=product of variables to be 374 eliminated; h,o,a,b,e integers 375 375 (options for Hilbert-std, 'valvars', elimpart, minimizing) 376 376 - h !=0: use Hilbert-series driven std-basis computation … … 381 381 - m !=0: compute a minimal system of generators 382 382 replacing '!=' by '=' has the opposite meaning 383 default: h,o,a,b,e,m = 0,1,0,0,0,0 383 default: h,o,a,b,e,m = 0,1,0,0,0,0 384 384 RETURN: ideal obtained from i by eliminating those variables which occur in p 385 385 EXAMPLE: example fastelim; shows an example. … … 394 394 if ( size(#) == 5 ) { h=#[1]; o=#[2]; a=#[3]; b=#[4]; e=#[5]; } 395 395 if ( size(#) == 6 ) { h=#[1]; o=#[2]; a=#[3]; b=#[4]; e=#[5]; m=#[6]; } 396 list L = elimpartanyr(i,p,e); 396 list L = elimpartanyr(i,p,e); 397 397 poly q = product(L[2]); //product of vars which are already eliminated 398 398 if ( q==0 ) { q=1; } … … 401 401 if ( p==1 ) //ready if no vars are left 402 402 { //compute minbase if 3-rd argument !=0 403 if ( m != 0 ) { L[1]=minbase(L[1]); } 403 if ( m != 0 ) { L[1]=minbase(L[1]); } 404 404 return(L); 405 405 } … … 424 424 } 425 425 //----------------- h==0: eliminate remaining vars directly ------------------- 426 if ( h == 0 ) 426 if ( h == 0 ) 427 427 { 428 428 L[1] = eliminate(L[1],L[2]); 429 429 def r2 = r1; 430 } 431 else 430 } 431 else 432 432 //------- h!=0: homogenize and compute Hilbert-series using hilbvec ---------- 433 { 433 { 434 434 intvec hi = hilbvec(L[1]); // Hilbert-series of i 435 435 execute "ring r2=("+charstr(P)+"),("+varstr(basering)+",@homo),dp;"; … … 439 439 L[1] = eliminate(L[1],L[2],hi); 440 440 L[1]=subst(L[1],@homo,1); // dehomogenize by setting @homo=1 441 } 441 } 442 442 if ( m != 0 ) // compute minbase 443 { 444 if ( #[1] != 0 ) { L[1] = minbase(L[1]); } 443 { 444 if ( #[1] != 0 ) { L[1] = minbase(L[1]); } 445 445 } 446 446 def id = L[1]; … … 448 448 return(imap(r2,id)); 449 449 } 450 example 450 example 451 451 { "EXAMPLE:"; echo = 2; 452 452 ring s=31991,(e,f,x,y,z,t,u,v,w,a,b,c,d),dp; 453 453 ideal i = w2+f2-1, x2+t2+a2-1, y2+u2+b2-1, z2+v2+c2-1, 454 d2+e2-1, f4+2u, wa+tf, xy+tu+ab; 454 d2+e2-1, f4+2u, wa+tf, xy+tu+ab; 455 455 fastelim(i,xytua); //with valvars only 456 456 fastelim(i,xytua,1,1); //with hilb,valvars,minbase … … 460 460 461 461 proc faststd (@id,string @s1,string @s2, list #) 462 "USAGE: faststd(id,s1,s2[,\"hilb\",\"sort\",\"dec\",o,\"blocks\"]); 462 "USAGE: faststd(id,s1,s2[,\"hilb\",\"sort\",\"dec\",o,\"blocks\"]); 463 463 id=ideal/module, s1,s2=strings (names for new ring and maped id) 464 464 o = string (allowed ordstring:\"lp\",\"dp\",\"Dp\",\"ls\",\"ds\",\"Ds\") 465 465 \"hilb\",\"sort\",\"dec\",\"block\" options for Hilbert-std, sortandmap 466 COMPUTE: create a new ring (with \"best\" ordering of vars) and compute a 466 COMPUTE: create a new ring (with \"best\" ordering of vars) and compute a 467 467 std-basis of id (hopefully faster) 468 468 - If say, s1=\"R\" and s2=\"j\", the new basering has name R and the 469 std-basis of the image of id in R has name j 469 std-basis of the image of id in R has name j 470 470 - \"hilb\" : use Hilbert-series driven std-basis computation 471 471 - \"sort\" : use 'sortandmap' for a best ordering of vars … … 480 480 NOTE: This proc is only useful for hard problems where other methods fail. 481 481 \"hilb\" is useful for hard orderings (as \"lp\") or for characteristic 0, 482 it is correct for \"lp\",\"dp\",\"Dp\" (and for blockorderings combining 482 it is correct for \"lp\",\"dp\",\"Dp\" (and for blockorderings combining 483 483 these) but not for s-orderings or if the vars have different weights. 484 484 There seem to be only few cases in which \"dec\" is fast … … 490 490 string @o,@va,@c = ordstr(basering),"",""; 491 491 //-------------------- prepare ordering and set options ----------------------- 492 if ( @o[1]=="c" or @o[1]=="C") 492 if ( @o[1]=="c" or @o[1]=="C") 493 493 { @o = @o[3,2]; } 494 else 494 else 495 495 { @o = @o[1,2]; } 496 if( @o[1]!="d" and @o[1]!="D" and @o[1]!="l") 496 if( @o[1]!="d" and @o[1]!="D" and @o[1]!="l") 497 497 { @o="dp"; } 498 498 499 if (size(#) == 0 ) 499 if (size(#) == 0 ) 500 500 { @s = 1; } 501 501 for ( @ii=1; @ii<=size(#); @ii++ ) 502 502 { 503 if ( typeof(#[@ii]) != "string" ) 504 { 505 "// wrong syntax! type: help faststd"; 503 if ( typeof(#[@ii]) != "string" ) 504 { 505 "// wrong syntax! type: help faststd"; 506 506 return(); 507 507 } … … 516 516 } 517 517 } 518 if( voice==2 ) { "// choosen options, hilb sort dec block:",@h,@s,@n,@m; } 518 if( voice==2 ) { "// choosen options, hilb sort dec block:",@h,@s,@n,@m; } 519 519 520 520 //-------------------- nosort: create ring with new name ---------------------- 521 if ( @s==0 ) 522 { 521 if ( @s==0 ) 522 { 523 523 execute "ring "+@s1+"=("+charstr(@P)+"),("+varstr(@P)+"),("+@o+");"; 524 524 def @id = imap(@P,@id); … … 554 554 //------- hilb: homogenize and compute Hilbert-series using hilbvec ----------- 555 555 // this uses another standardbasis computation 556 if ( @h != 0 ) 557 { 556 if ( @h != 0 ) 557 { 558 558 execute "ring @Q=("+charstr(@P)+"),("+varstr(@P)+",@homo),("+@o+");"; 559 559 def @id = imap(@P,@id); 560 560 kill @P; 561 561 @id = homog(@id,@homo); // @homo = homogenizing var 562 if ( @s != 0 ) 562 if ( @s != 0 ) 563 563 { 564 564 bestorder(@id,@s1,@s2,@n,@o,@m,nvars(@Q)-1); … … 569 569 verbose(redefine); 570 570 } 571 intvec @hi; // encoding of Hilbert-series of i 572 @hi = hilbvec(@id); 571 intvec @hi; // encoding of Hilbert-series of i 572 @hi = hilbvec(@id); 573 573 //if ( @s!=0 ) { @hi = hilbvec(@id,"32003",ordstr(@Q)); } 574 //else { @hi = hilbvec(@id); } 574 //else { @hi = hilbvec(@id); } 575 575 //-------------------------- use Hilbert-driven std -------------------------- 576 576 @id = std(@id,@hi); … … 585 585 execute "ring @P=("+charstr(@Q)+"),("+@va+"),("+@o+");"; 586 586 def @id = imap(@Q,@id); 587 } 587 } 588 588 def `@s1` = @P; 589 589 def `@s2` = @id; … … 592 592 kill @P; 593 593 keepring(basering); 594 if( voice==2 ) { "// basering is now "+@s1+", std-basis has name "+@s2; } 594 if( voice==2 ) { "// basering is now "+@s1+", std-basis has name "+@s2; } 595 595 return(); 596 596 } 597 example 597 example 598 598 { "EXAMPLE:"; echo = 2; 599 599 ring s = 0,(e,f,x,y,z,t,u,v,w,a,b,c,d),(c,lp); … … 601 601 d2+e2-1, f4+2u, wa+tf, xy+tu+ab; 602 602 option(prot); timer=1; 603 int time = timer; 604 ideal j=std(i); 603 int time = timer; 604 ideal j=std(i); 605 605 timer-time; 606 606 show(R);dim(j),mult(j); 607 int time = timer; 607 int time = timer; 608 608 faststd(i,"R","i"); // use "best" ordering of vars 609 609 timer-time; … … 633 633 RETURN: ideal of variables occuring in id, if no second argument is present 634 634 list of 4 objects, if a second argument is given (of any type) 635 -[1]: ideal of variables occuring in id 636 -[2]: intvec of variables occuring in id 637 -[3]: ideal of variables not occuring in id 638 -[4]: intvec of variables not occuring in id 635 -[1]: ideal of variables occuring in id 636 -[2]: intvec of variables occuring in id 637 -[3]: ideal of variables not occuring in id 638 -[4]: intvec of variables not occuring in id 639 639 EXAMPLE: example findvars; shows an example 640 640 " … … 663 663 } 664 664 if ( size(f)>1 ) { f = f[2..size(f)]; } //intvec of found vars 665 if ( size(nf)>1 ) { nf = nf[2..size(nf)]; } //intvec of vars not found 665 if ( size(nf)>1 ) { nf = nf[2..size(nf)]; } //intvec of vars not found 666 666 if( size(#)==0 ) { return(found); } 667 667 if( size(#)!=0 ) { list L = found,f,notfound,nf; return(L); } 668 668 } 669 example 669 example 670 670 { "EXAMPLE:"; echo = 2; 671 671 ring s = 0,(e,f,x,y,t,u,v,w,a,d),dp; 672 ideal i = w2+f2-1, x2+t2+a2-1; 672 ideal i = w2+f2-1, x2+t2+a2-1; 673 673 findvars(i); 674 findvars(i,1); 674 findvars(i,1); 675 675 } 676 676 /////////////////////////////////////////////////////////////////////////////// … … 687 687 def @P = basering; 688 688 string @c,@o = "32003", "dp"; 689 if ( size(#) == 1 ) { @c = #[1]; } 689 if ( size(#) == 1 ) { @c = #[1]; } 690 690 if ( size(#) == 2 ) { @c = #[1]; @o = #[2]; } 691 691 string @si = typeof(@id)+" @i = "+string(@id)+";"; //** weg … … 694 694 execute @si; //** weg 695 695 //show(basering); 696 @i = std(@i); 696 @i = std(@i); 697 697 intvec @hi = hilb(@i,1); // intvec of 1-st Hilbert-series of id 698 698 return(@hi); 699 699 } 700 example 700 example 701 701 { "EXAMPLE:"; echo = 2; 702 702 ring s = 0,(e,f,x,y,z,t,u,v,w,a,b,c,d,H),dp; 703 703 ideal id = w2+f2-1, x2+t2+a2-1, y2+u2+b2-1, z2+v2+c2-1, 704 d2+e2-1, f4+2u, wa+tf, xy+tu+ab; 704 d2+e2-1, f4+2u, wa+tf, xy+tu+ab; 705 705 id = homog(id,H); 706 706 hilbvec(id); … … 716 716 return(degreepart(id,0,1)); 717 717 } 718 example 718 example 719 719 { "EXAMPLE:"; echo = 2; 720 720 ring r=0,(x,y,z),dp; … … 727 727 728 728 proc tolessvars (id ,list #) 729 "USAGE: tolessvars(id,[s1,s2]); id poly/ideal/vector/module/matrix, 729 "USAGE: tolessvars(id,[s1,s2]); id poly/ideal/vector/module/matrix, 730 730 s1,s2=strings (names of: new ring, new ordering) 731 731 CREATE: nothing, if id contains all vars of the basering. Else, create … … 735 735 The name of the new ring is by default R(n), where n is the number of 736 736 variables in the new ring. If, say, s1 = \"newR\" then the new ring has 737 name newR. In s2 a different ordering for the new ring may be given 737 name newR. In s2 a different ordering for the new ring may be given 738 738 as an allowed ordstring (default is \"dp\" resp. \"ds\", depending whether 739 739 the first block of the old ordering is a p- resp. an s-ordering). … … 741 741 the old ring (default) 742 742 RETURN: the original ideal id 743 NOTE: You must not type, say, 'ideal id=tolessvars(id);' since the ring 743 NOTE: You must not type, say, 'ideal id=tolessvars(id);' since the ring 744 744 to which 'id' would belong will only be defined by the r.h.s.. But you 745 may type 'def id=tolessvars(id);' or 'list id=tolessvars(id);' 745 may type 'def id=tolessvars(id);' or 'list id=tolessvars(id);' 746 746 since then 'id' does not a priory belong to a ring, its type will 747 747 be defined by the right hand side. Moreover, do not use a name which … … 760 760 newvar = string(L[1]); // string of new variables 761 761 n = size(L[1]); // number of new variables 762 if( n == 0 ) 762 if( n == 0 ) 763 763 { 764 764 dbprint( pr,"","// no variable occured in "+typeof(id)+", no change of ring!"); 765 765 return(id); 766 766 } 767 if( n == nvars(P) ) 768 { 767 if( n == nvars(P) ) 768 { 769 769 dbprint( pr,"","// all variables occured in "+typeof(id)+", no change of ring!"); 770 return(id); 770 return(id); 771 771 } 772 772 //----------------- prepare new ring, map to it and return -------------------- 773 773 s1 = "R("+string(n)+")"; 774 if ( size(#) == 0 ) 775 { 774 if ( size(#) == 0 ) 775 { 776 776 fp = find(s2,"p"); 777 777 fs = find(s2,"s"); 778 778 if( fs==0 or (fs>=fp && fp!=0) ) { s2="dp"; } 779 else { s2="ds"; } 779 else { s2="ds"; } 780 780 } 781 781 if ( size(#) ==1 ) { s1=#[1]; } … … 791 791 return(id); 792 792 } 793 example 793 example 794 794 { "EXAMPLE:"; echo = 2; 795 795 ring r = 0,(x,y,z),dp; 796 796 ideal i = y2-x3,x-3,y-2x; 797 def j = tolessvars(i); 797 def j = tolessvars(i); 798 798 show(basering); 799 799 j; … … 810 810 form (default) or if n=0 [non-reduced triangular form if n!=0] 811 811 ASSUME: monomial ordering is a global ordering (p-ordering) 812 NOTE: may be used to solve a system of linear equations 812 NOTE: may be used to solve a system of linear equations 813 813 see proc 'gauss_row' from 'matrix.lib' for a different method 814 WARNING: the result is very likely to be false for 'real' coefficients, use 814 WARNING: the result is very likely to be false for 'real' coefficients, use 815 815 char 0 instead! 816 816 EXAMPLE: example solvelinearpart; shows an example … … 819 819 intvec getoption = option(get); 820 820 option(redSB); 821 if ( size(#)!=0 ) 822 { 821 if ( size(#)!=0 ) 822 { 823 823 if(#[1]!=0) { option(noredSB); } 824 824 } 825 825 def lin = interred(degreepart(id,0,1)); 826 if ( size(#)!=0 ) 827 { 828 if(#[1]!=0) 829 { 826 if ( size(#)!=0 ) 827 { 828 if(#[1]!=0) 829 { 830 830 return(lin); 831 831 } … … 834 834 return(simplify(lin,1)); 835 835 } 836 example 836 example 837 837 { "EXAMPLE:"; echo = 2; 838 838 // Solve the system of linear equations: … … 848 848 ideal j= 2,1,0,3; 849 849 j = i-j; // difference of 1x4 matrices 850 // compute reduced triangular form, setting 850 // compute reduced triangular form, setting 851 851 solvelinearpart(j); // the RHS equal 0 gives the solutions! 852 852 solvelinearpart(j,1); ""; // triangular form, not reduced … … 861 861 14x + 10y + 6z - 7u - c, 862 862 7x + 4y + 3z - 3u - d; 863 solvelinearpart(i); 863 solvelinearpart(i); 864 864 } 865 865 /////////////////////////////////////////////////////////////////////////////// 866 866 867 867 proc sortandmap (@id,string @s1,string @s2, list #) 868 "USAGE: sortandmap(id,s1,s2[,n1,p1,n2,p2...,o1,m1,o2,m2...]); 868 "USAGE: sortandmap(id,s1,s2[,n1,p1,n2,p2...,o1,m1,o2,m2...]); 869 869 id=poly/ideal/vector/module 870 870 s1,s2=strings (names for new ring and maped id) 871 871 p1,p2,...= product of vars, n1,n2,...=integers 872 o1,o2,...= allowed ordstrings, m1,m2,...=integers 872 o1,o2,...= allowed ordstrings, m1,m2,...=integers 873 873 (default: p1=product of all vars, n1=0, o1=\"dp\",m1=0) 874 874 the last pi (containing the remaining vars) may be omitted 875 875 CREATE: a new ring and map id into it, the new ring has same char as basering 876 but with new ordering and vars sorted in the following manner: 876 but with new ordering and vars sorted in the following manner: 877 877 - each block of vars occuring in pi is sorted w.r.t its complexity in 878 id, ni controls the sorting in i-th block (= vars occuring in pi): 878 id, ni controls the sorting in i-th block (= vars occuring in pi): 879 879 ni=0 (resp.!=0) means that less (resp. more) complex vars come first 880 880 - If say, s1=\"R\" and s2=\"j\", the new basering has name R and the image 881 of id in R has name j 881 of id in R has name j 882 882 - oi and mi define the monomial ordering of the i-th block: 883 883 if mi =0, oi=ordstr(i-th block) 884 884 if mi!=0, the ordering of the i-th block itself is a blockordering, 885 each subblock having ordstr=oi, such that vars of same complexity 885 each subblock having ordstr=oi, such that vars of same complexity 886 886 are in one block 887 887 default: oi=\"dp\", mi=0 … … 889 889 RETURN: nothing 890 890 NOTE: We define a variable x to be more complex than y (with respect to id) 891 if val(x) > val(y) lexicographically, where val(x) denotes the 891 if val(x) > val(y) lexicographically, where val(x) denotes the 892 892 valuation vector of x: consider id as list of polynomials in x with 893 coefficients in the remaining variables. Then val(x) = 893 coefficients in the remaining variables. Then val(x) = 894 894 (maximal occuring power of x, # of monomials in leading coefficient, 895 895 # of monomials in coefficient of next smaller power of x,...) … … 903 903 //----------------- find o in # and split # into 2 lists --------------------- 904 904 # = # +list("dp",0); 905 for ( @ii=1; @ii<=size(#); @ii++) 906 { 907 if ( typeof(#[@ii])=="string" ) break; 905 for ( @ii=1; @ii<=size(#); @ii++) 906 { 907 if ( typeof(#[@ii])=="string" ) break; 908 908 } 909 909 if ( @ii==1 ) { list @L1 = list(); } … … 922 922 for ( @jj=1; @jj<=size(@v); @jj++ ) 923 923 { 924 @o = @o+@L2[@ii/2 -1]+"("+string(@v[@jj])+"),"; 924 @o = @o+@L2[@ii/2 -1]+"("+string(@v[@jj])+"),"; 925 925 } 926 926 } 927 else 928 { 929 @o = @o+@L2[@ii/2 -1]+"("+string(size(@l[@ii/2]))+"),"; 930 } 927 else 928 { 929 @o = @o+@L2[@ii/2 -1]+"("+string(size(@l[@ii/2]))+"),"; 930 } 931 931 } 932 932 @o=@o[1..size(@o)-1]; … … 935 935 def @id = imap(@P,@id); 936 936 execute "def "+ @s2+"=@id;"; 937 execute("export("+@s1+");"); 938 execute("export("+@s2+");"); 937 execute("export("+@s1+");"); 938 execute("export("+@s2+");"); 939 939 keepring(basering); 940 940 return(); 941 941 } 942 example 942 example 943 943 { "EXAMPLE:"; echo = 2; 944 944 ring s = 32003,(e,f,x,y,z,t,u,v,w,a,b,c,d),dp; … … 951 951 kill R_r; setring s; 952 952 sortandmap(i,"R_r","i",1,"lp",0); 953 show(R_r); 953 show(R_r); 954 954 kill R_r; setring s; 955 955 sortandmap(i,"R_r","i",1,abc,0,xyztuvw,0,"lp",0,"Dp",1); 956 show(R_r); 956 show(R_r); 957 957 kill R_r; 958 958 } … … 960 960 961 961 proc sortvars (id, list #) 962 "USAGE: sortvars(id[,n1,p1,n2,p2,...]); id=poly/ideal/vector/module, 962 "USAGE: sortvars(id[,n1,p1,n2,p2,...]); id=poly/ideal/vector/module, 963 963 p1,p2,...= product of vars, n1,n2,...=integers 964 964 (default: p1=product of all vars, n1=0) … … 967 967 RETURN: list of two elements, an ideal and a list: 968 968 [1]: ideal, variables of basering sorted w.r.t their complexity in id 969 ni controls the ordering in i-th block (= vars occuring in pi): 969 ni controls the ordering in i-th block (= vars occuring in pi): 970 970 ni=0 (resp.!=0) means that less (resp. more) complex vars come 971 first 971 first 972 972 [2]: a list with 4 elements for each pi: 973 ideal ai : vars of pi in correct order, 974 intvec vi: permutation vector describing the ordering in ai, 975 intmat Mi: valuation matrix of ai, the columns of Mi being the 973 ideal ai : vars of pi in correct order, 974 intvec vi: permutation vector describing the ordering in ai, 975 intmat Mi: valuation matrix of ai, the columns of Mi being the 976 976 valuation vectors of the vars in ai 977 intvec wi: 1-st,2-nd,...entry = size of 1-st,2-nd,... block of 977 intvec wi: 1-st,2-nd,...entry = size of 1-st,2-nd,... block of 978 978 identically columns of Mi (vars with same valuation) 979 979 NOTE: We define a variable x to be more complex than y (w.r.t. id) 980 if val(x) > val(y) lexicographically, where val(x) denotes the 980 if val(x) > val(y) lexicographically, where val(x) denotes the 981 981 valuation vector of x: consider id as list of polynomials in x with 982 coefficients in the remaining variables. Then val(x) = 982 coefficients in the remaining variables. Then val(x) = 983 983 (maximal occuring power of x, # of monomials in leading coefficient, 984 984 # of monomials in coefficient of next smaller power of x,...) … … 988 988 int ii,jj,n,s; 989 989 list L = valvars(id,#); 990 list L2, L3 = L[2], L[3]; 990 list L2, L3 = L[2], L[3]; 991 991 list K; intmat M; intvec v1,v2,w; 992 992 ideal i = sort(maxideal(1),L[1])[1]; … … 995 995 M = transpose(L3[2*ii]); 996 996 M = M[L2[ii],1..nrows(L3[2*ii])]; 997 w = 0; s = 0; 997 w = 0; s = 0; 998 998 for ( jj=1; jj<=nrows(M)-1; jj++ ) 999 999 { … … 1005 1005 K = K+sort(L3[2*ii-1],L2[ii])+list(transpose(M))+list(w); 1006 1006 } 1007 L = i,K; 1007 L = i,K; 1008 1008 return(L); 1009 1009 } 1010 example 1010 example 1011 1011 { "EXAMPLE:"; echo = 2; 1012 1012 ring r=0,(a,b,c,x,y,z),lp; … … 1022 1022 1023 1023 proc valvars (id, list #) 1024 "USAGE: valvars(id[,n1,p1,n2,p2,...]); id=poly/ideal/vector/module, 1024 "USAGE: valvars(id[,n1,p1,n2,p2,...]); id=poly/ideal/vector/module, 1025 1025 p1,p2,...= product of vars, n1,n2,...=integers 1026 ni controls the ordering of vars occuring in pi: 1026 ni controls the ordering of vars occuring in pi: 1027 1027 ni=0 (resp.!=0) means that less (resp. more) complex vars come first 1028 1028 (default: p1=product of all vars, n1=0) … … 1032 1032 [1]: intvec, say v, describing the permutation such that the permuted 1033 1033 ringvariables are ordered with respect to their complexity in id 1034 [2]: list of intvecs, i-th intvec, say v(i) describing prmutation 1034 [2]: list of intvecs, i-th intvec, say v(i) describing prmutation 1035 1035 of vars in a(i) such that v=v(1),v(2),... 1036 [3]: list of ideals and intmat's, say a(i) and M(i), where ideal a(i) 1036 [3]: list of ideals and intmat's, say a(i) and M(i), where ideal a(i) 1037 1037 = factors of pi, M(i) = valuation matrix of a(i), such that the 1038 j-th column of M(i) is the valuation vector of j-th generator of a(i) 1039 NOTE: Use proc 'sortvars' for the actual sorting of vars! 1038 j-th column of M(i) is the valuation vector of j-th generator of a(i) 1039 NOTE: Use proc 'sortvars' for the actual sorting of vars! 1040 1040 We define a variable x to be more complex than y (with respect to id) 1041 if val(x) > val(y) lexicographically, where val(x) denotes the 1041 if val(x) > val(y) lexicographically, where val(x) denotes the 1042 1042 valuation vector of x: consider id as list of polynomials in x with 1043 coefficients in the remaining variables. Then val(x) = 1043 coefficients in the remaining variables. Then val(x) = 1044 1044 (maximal occuring power of x, # of monomials in leading coefficient, 1045 1045 # of monomials in coefficient of next smaller power of x,...) … … 1060 1060 1061 1061 //---- for each pii in # create ideal a(ii) intvec v(ii) and list L(ii) ------- 1062 // a(ii) = ideal of vars in product, v(ii)[j]=k <=> a(ii)[j]=var(k) 1062 // a(ii) = ideal of vars in product, v(ii)[j]=k <=> a(ii)[j]=var(k) 1063 1063 1064 1064 v = 1..nvars(basering); … … 1074 1074 for ( jj=1; jj<=nvars(basering); jj++ ) 1075 1075 { 1076 if ( #[ii]/var(jj) != 0) 1077 { 1078 a(ii) = a(ii) + var(jj); 1076 if ( #[ii]/var(jj) != 0) 1077 { 1078 a(ii) = a(ii) + var(jj); 1079 1079 v(ii)=v(ii),jj; 1080 1080 m[jj]=0; … … 1083 1083 } 1084 1084 v(ii)=v(ii)[2..size(v(ii))]; 1085 } 1086 if ( size(m)!=0 ) 1087 { 1088 l = 2*(l/2)+2; 1089 ideal a(l) = simplify(m,2); 1085 } 1086 if ( size(m)!=0 ) 1087 { 1088 l = 2*(l/2)+2; 1089 ideal a(l) = simplify(m,2); 1090 1090 intvec v(l) = compress(v); 1091 1091 int n(l); … … 1093 1093 } 1094 1094 } 1095 else 1096 { 1097 l = 2; 1098 ideal a(2) = maxideal(1); 1099 intvec v(2) = v; 1100 int n(2); 1095 else 1096 { 1097 l = 2; 1098 ideal a(2) = maxideal(1); 1099 intvec v(2) = v; 1100 int n(2); 1101 1101 if ( size(#)==1 ) { n(2) = #[1]; } 1102 1102 } … … 1111 1111 { 1112 1112 C = coeffs(i,a(kk)[ii]); 1113 w = nrows(C); 1114 for ( jj=w[1]; jj>1; jj-- ) 1113 w = nrows(C); 1114 for ( jj=w[1]; jj>1; jj-- ) 1115 1115 { 1116 1116 s = size(C[jj,1..ncols(C)]); 1117 w[w[1]-jj+2] = sum(s); 1117 w[w[1]-jj+2] = sum(s); 1118 1118 } 1119 1119 L[ii]=w; … … 1121 1121 } 1122 1122 intmat M(kk)[size(a(kk))][n]; 1123 for ( ii=1; ii<=size(a(kk)); ii++ ) 1124 { 1125 if ( n==1 ) { w = L[ii]; M(kk)[ii,1] = w[1]; } 1126 else { M(kk)[ii,1..n] = L[ii]; } 1123 for ( ii=1; ii<=size(a(kk)); ii++ ) 1124 { 1125 if ( n==1 ) { w = L[ii]; M(kk)[ii,1] = w[1]; } 1126 else { M(kk)[ii,1..n] = L[ii]; } 1127 1127 } 1128 1128 LM[kk-1] = a(kk); … … 1133 1133 blockvec[kk/2] = vec; 1134 1134 vec = sort(v(kk),vec)[1]; 1135 varvec = varvec,vec; 1135 varvec = varvec,vec; 1136 1136 } 1137 1137 varvec = varvec[2..size(varvec)]; … … 1139 1139 return(result); 1140 1140 } 1141 example 1141 example 1142 1142 { "EXAMPLE:"; echo = 2; 1143 1143 ring r=0,(a,b,c,x,y,z),lp; … … 1164 1164 y,u,b,c,a,z,t,x,v,d,w,e,f,h 1165 1165 v0; 1166 14,9,12,11,10,8,7,6,5,4,3,2,1,13 1166 14,9,12,11,10,8,7,6,5,4,3,2,1,13 1167 1167 print(matrix(sort(maxideal(1),v0))); 1168 1168 h,v,e,w,d,x,t,z,a,c,b,u,y,f 1169 1169 v1;v2; 1170 9,12,11,10,8,7,6,5,4,3,2,1,13,14 1171 13,12,11,10,8,7,6,5,4,3,2,1,9,14 1170 9,12,11,10,8,7,6,5,4,3,2,1,13,14 1171 13,12,11,10,8,7,6,5,4,3,2,1,9,14 1172 1172 1173 1173 Ev. Gute Ordnung fuer i: … … 1178 1178 d=deg_x(i) := max{deg_x(i[k]) | k=1..size(i)} 1179 1179 size_x(i,deg_x(i)..0) := size(ad),...,size(a0) 1180 x>y <== 1181 1. deg_x(i)>deg_y(i) 1180 x>y <== 1181 1. deg_x(i)>deg_y(i) 1182 1182 2. "=" in 1. und size_x lexikographisch 1183 1183 -
Singular/LIB/primdec.lib
r30c91f r82716e 1 // $Id: primdec.lib,v 1.1 7 1998-05-13 15:02:35 obachmanExp $1 // $Id: primdec.lib,v 1.18 1998-05-14 18:45:13 Singular Exp $ 2 2 /////////////////////////////////////////////////////// 3 3 // primdec.lib … … 11 11 ////////////////////////////////////////////////////// 12 12 13 version="$Id: primdec.lib,v 1.1 7 1998-05-13 15:02:35 obachmanExp $";13 version="$Id: primdec.lib,v 1.18 1998-05-14 18:45:13 Singular Exp $"; 14 14 info=" 15 15 LIBRARY: primdec.lib: PROCEDURE FOR PRIMARY DECOMPOSITION (I) … … 213 213 ideal fac=tsil[2]; 214 214 poly f=tsil[3]; 215 215 216 216 ideal star=quotient(laedi,f); 217 217 action=1; … … 228 228 g=1; 229 229 verg=laedi; 230 230 231 231 for(j=1;j<=size(fac);j++) 232 232 { … … 237 237 } 238 238 verg=quotient(laedi,g); 239 239 240 240 if(specialIdealsEqual(verg,star)==1) 241 241 { … … 251 251 } 252 252 } 253 l=star,fac,f; 253 l=star,fac,f; 254 254 return(l); 255 255 } … … 259 259 { 260 260 poly keep=p; 261 261 262 262 int i; 263 263 poly q=act[1][1]^act[2][1]; … … 272 272 "ERROR IN FACTOR"; 273 273 basering; 274 274 275 275 act; 276 276 keep; 277 277 pause; 278 278 279 279 p; 280 280 q; … … 565 565 m=m-1; 566 566 } 567 //check whether i[m] =(c*var(n)+h)^e modulo prm for some 567 //check whether i[m] =(c*var(n)+h)^e modulo prm for some 568 568 //h in K[var(n+1),...,var(nvars(basering))], c in K 569 569 //if not (0) is returned, else var(n)+h is added to prm … … 788 788 { 789 789 attrib(l[2*i-1],"isSB",1); 790 790 791 791 if((size(ser)>0)&&(size(reduce(ser,l[2*i-1],1))==0)&&(deg(l[2*i-1][1])>0)) 792 792 { 793 793 "Achtung in split"; 794 794 795 795 l[2*i-1]=ideal(1); 796 796 l[2*i]=ideal(1); … … 857 857 return(primary); 858 858 } 859 860 j=interred(j); 859 860 j=interred(j); 861 861 attrib(j,"isSB",1); 862 862 if(vdim(j)==deg(j[1])) 863 { 863 { 864 864 act=factor(j[1]); 865 865 for(@k=1;@k<=size(act[1]);@k++) … … 879 879 primary[2*@k]=interred(@qh); 880 880 attrib( primary[2*@k-1],"isSB",1); 881 881 882 882 if((size(ser)>0)&&(size(reduce(ser,primary[2*@k-1],1))==0)) 883 883 { 884 884 primary[2*@k-1]=ideal(1); 885 primary[2*@k]=ideal(1); 885 primary[2*@k]=ideal(1); 886 886 } 887 887 } … … 957 957 } 958 958 else 959 { 959 { 960 960 primary[1]=j; 961 961 if((size(#)>0)&&(act[2][1]>1)) … … 976 976 if(size(#)==0) 977 977 { 978 978 979 979 primary=splitPrimary(primary,ser,@wr,act); 980 980 981 981 } 982 982 … … 1001 1001 } 1002 1002 } 1003 1003 1004 1004 @k=0; 1005 1005 ideal keep; … … 1027 1027 jmap2[zz]=primary[2*@k-1][@n]; 1028 1028 @qht[@n]=var(zz); 1029 1029 1030 1030 } 1031 1031 } … … 1039 1039 phi1=@P,jmap1; 1040 1040 phi=@P,jmap; 1041 1041 1042 1042 for(@n=1;@n<=nva;@n++) 1043 1043 { … … 1048 1048 1049 1049 @qh=phi(@qht); 1050 1050 1051 1051 if(npars(@P)>0) 1052 1052 { … … 1076 1076 kill @Phelp1; 1077 1077 @qh=clearSB(@qh); 1078 attrib(@qh,"isSB",1); 1078 attrib(@qh,"isSB",1); 1079 1079 ser1=phi1(ser); 1080 1080 @lh=zero_decomp (@qh,phi(ser1),@wr); 1081 1081 // @lh=zero_decomp (@qh,psi(ser),@wr); 1082 1083 1082 1083 1084 1084 kill lres0; 1085 1085 list lres0; … … 1681 1681 map phi=@P,qr[2]; 1682 1682 i=qr[1]; 1683 1683 1684 1684 execute "ring gnir = ("+charstr(basering)+"),("+varstr(basering)+"),(" 1685 1685 +ordstr(basering)+");"; … … 1929 1929 } 1930 1930 } 1931 1931 1932 1932 homo=homog(i); 1933 1933 1934 1934 if(homo==1) 1935 1935 { … … 1978 1978 option(redSB); 1979 1979 1980 ideal ser=fetch(@P,ser); 1980 ideal ser=fetch(@P,ser); 1981 1981 1982 1982 if(homo==1) … … 2032 2032 } 2033 2033 } 2034 2034 2035 2035 //---------------------------------------------------------------- 2036 2036 //j is the ring … … 2070 2070 return(primary); 2071 2071 } 2072 2072 2073 2073 //------------------------------------------------------------------ 2074 2074 //the zero-dimensional case … … 2124 2124 indep=maxIndependSet(@j); 2125 2125 } 2126 2126 2127 2127 ideal jkeep=@j; 2128 2128 … … 2148 2148 ideal jwork=std(imap(gnir,@j),@hilb); 2149 2149 } 2150 2150 2151 2151 } 2152 2152 else … … 2159 2159 di=dim(jwork); 2160 2160 keepdi=di; 2161 2161 2162 2162 setring gnir; 2163 2163 for(@m=1;@m<=size(indep);@m++) … … 2175 2175 attrib(@j,"isSB",1); 2176 2176 ideal ser=fetch(gnir,ser); 2177 2177 2178 2178 } 2179 2179 else … … 2192 2192 } 2193 2193 ideal ser=phi(ser); 2194 2195 } 2196 option(noredSB); 2194 2195 } 2196 option(noredSB); 2197 2197 if((deg(@j[1])==0)||(dim(@j)<jdim)) 2198 2198 { … … 2250 2250 } 2251 2251 //the primary decomposition of j*K(var(nnp+1),..,var(nva))[..the rest..] 2252 option(redSB); 2252 option(redSB); 2253 2253 list uprimary= zero_decomp(@j,ser,@wr); 2254 2254 option(noredSB); … … 2312 2312 //mentioned above is really computed 2313 2313 for(@n=@n3/2+1;@n<=@n2/2;@n++) 2314 { 2314 { 2315 2315 if(specialIdealsEqual(quprimary[2*@n-1],quprimary[2*@n])) 2316 2316 { … … 2327 2327 } 2328 2328 } 2329 2329 2330 2330 if(size(@h)>0) 2331 2331 { … … 2337 2337 if(@wr!=1) 2338 2338 { 2339 @q=minSat(jwork,@h)[2]; 2339 @q=minSat(jwork,@h)[2]; 2340 2340 } 2341 2341 else … … 2357 2357 } 2358 2358 jwork=std(jwork,@q); 2359 keepdi=dim(jwork); 2359 keepdi=dim(jwork); 2360 2360 if(keepdi<di) 2361 2361 { … … 2382 2382 { 2383 2383 keepdi=di-1; 2384 } 2384 } 2385 2385 //--------------------------------------------------------------- 2386 2386 //notice that j=sat(j,gh) intersected with (j,gh^n) … … 2413 2413 2414 2414 if(size(ser)>0) 2415 { 2416 ser=intersect(htest,ser); 2415 { 2416 ser=intersect(htest,ser); 2417 2417 } 2418 2418 else 2419 2419 { 2420 2420 ser=htest; 2421 } 2421 } 2422 2422 setring gnir; 2423 2423 ser=imap(@Phelp,ser); 2424 2424 } 2425 2425 if(size(reduce(ser,peek,1))!=0) 2426 { 2426 { 2427 2427 for(@m=1;@m<=size(restindep);@m++) 2428 2428 { 2429 2429 // if(restindep[@m][3]>=keepdi) 2430 // { 2430 // { 2431 2431 isat=0; 2432 2432 @n2=0; 2433 2433 option(redSB); 2434 2434 2435 2435 if(restindep[@m][1]==varstr(basering)) 2436 2436 //this is the good case, nothing to do, just to have the same notations … … 2459 2459 } 2460 2460 option(noredSB); 2461 2461 2462 2462 for (lauf=1;lauf<=size(@j);lauf++) 2463 2463 { … … 2508 2508 } 2509 2509 //the primary decomposition of j*K(var(nnp+1),..,var(nva))[..the rest..] 2510 2510 2511 2511 option(redSB); 2512 2512 list uprimary= zero_decomp(@j,ser,@wr); 2513 2513 option(noredSB); 2514 2515 2514 2515 2516 2516 //we need the intersection of the ideals in the list quprimary with the 2517 2517 //polynomialring, i.e. let q=(f1,...,fr) in the quotientring such an ideal … … 2548 2548 @n2=size(quprimary); 2549 2549 @n3=@n2; 2550 2550 2551 2551 for(@n1=1;@n1<=size(collectprimary)/2;@n1++) 2552 2552 { … … 2561 2561 } 2562 2562 } 2563 2564 2563 2564 2565 2565 //here the intersection with the polynomialring 2566 2566 //mentioned above is really computed … … 2601 2601 ser=imap(@Phelp,ser); 2602 2602 } 2603 2603 2604 2604 // } 2605 } 2605 } 2606 2606 if(size(reduce(ser,peek,1))!=0) 2607 2607 { … … 2623 2623 } 2624 2624 } 2625 2625 2626 2626 } 2627 2627 //------------------------------------------------------------ … … 2629 2629 //the final result: primary 2630 2630 //------------------------------------------------------------ 2631 2631 2632 2632 setring @P; 2633 2633 primary=imap(gnir,quprimary); … … 2666 2666 if(size(#)>0) 2667 2667 { 2668 il=#[1]; 2668 il=#[1]; 2669 2669 } 2670 2670 ideal re=1; … … 2673 2673 map phi=@P,qr[2]; 2674 2674 i=qr[1]; 2675 2675 2676 2676 list pr=facstd(i); 2677 2677 … … 2710 2710 int odim=dim(pr[1]); 2711 2711 int count=1; 2712 2712 2713 2713 for(j=2;j<=s;j++) 2714 2714 { … … 2751 2751 return(phi(j)); 2752 2752 } 2753 2753 2754 2754 2755 2755 /////////////////////////////////////////////////////////////////////////////// … … 2773 2773 return(ideal(0)); 2774 2774 } 2775 2775 2776 2776 def @P = basering; 2777 2777 list indep,allindep,restindep,fett,@mu; … … 2833 2833 2834 2834 return(ideal(@p)); 2835 } 2835 } 2836 2836 //------------------------------------------------------------------ 2837 2837 //the case of a complete intersection … … 2849 2849 if (jdim==0) 2850 2850 { 2851 @j1=finduni(@j); 2851 @j1=finduni(@j); 2852 2852 for(@k=1;@k<=size(@j1);@k++) 2853 2853 { … … 2864 2864 return(@j); 2865 2865 } 2866 2866 2867 2867 //------------------------------------------------------------------ 2868 2868 //search for a maximal independent set indep,i.e. … … 2873 2873 2874 2874 indep=maxIndependSet(@j); 2875 2875 2876 2876 di=dim(@j); 2877 2877 … … 3002 3002 { 3003 3003 fac=ideal(0); 3004 for(lauf=1;lauf<=ncols(@h);lauf++) 3004 for(lauf=1;lauf<=ncols(@h);lauf++) 3005 3005 { 3006 3006 if(deg(@h[lauf])>0) … … 3016 3016 } 3017 3017 3018 3018 3019 3019 @mu=mstd(quotient(@j+ideal(@q),rad)); 3020 3020 @j=@mu[1]; 3021 3021 attrib(@j,"isSB",1); 3022 3022 3023 3023 } 3024 3024 if((deg(rad[1])>0)&&(deg(collectrad[1])>0)) … … 3035 3035 3036 3036 te=simplify(reduce(te*rad,@j),2); 3037 3037 3038 3038 if((dim(@j)<di)||(size(te)==0)) 3039 3039 { … … 3049 3049 { 3050 3050 return(rad); 3051 } 3051 } 3052 3052 // rad=intersect(rad,radicalKL(@mu,rad,@wr)); 3053 3053 rad=intersect(rad,radicalKL(@mu,ideal(1),@wr)); … … 3072 3072 il=#[1]; 3073 3073 } 3074 3074 3075 3075 option(redSB); 3076 3076 list m=mstd(i); … … 3089 3089 return(quotient(I,J)); 3090 3090 } 3091 3091 3092 3092 for(l=1;l<=cod;l++) 3093 3093 { … … 3107 3107 if(il==1) 3108 3108 { 3109 3109 3110 3110 return(radI1); 3111 3111 } … … 3117 3117 return(radI1); 3118 3118 } 3119 return(intersect(radI1,radicalEHV(I2,re,il))); 3119 return(intersect(radI1,radicalEHV(I2,re,il))); 3120 3120 } 3121 3121 } … … 3145 3145 } 3146 3146 return(ann); 3147 } 3148 3147 } 3148 3149 3149 //computes all equidimensional parts of the ideal i 3150 3150 proc prepareAss(ideal i) … … 3163 3163 { 3164 3164 list re=mres(i,0); //fehler in sres 3165 } 3165 } 3166 3166 for(e=cod;e<=nvars(basering);e++) 3167 3167 { … … 3174 3174 } 3175 3175 return(er); 3176 } 3176 } 3177 3177 3178 3178 //computes the annihilator of Ext^n(R/i,R) with given resolution re … … 3192 3192 ideal ann=Ann(transpose(re[n])); 3193 3193 } 3194 return(ann); 3194 return(ann); 3195 3195 } 3196 3196 … … 3204 3204 re=intersect1(re,quotient(a,module(b[i]))); 3205 3205 } 3206 return(re); 3206 return(re); 3207 3207 } 3208 3208 … … 3210 3210 3211 3211 proc analyze(list pr) 3212 { 3212 { 3213 3213 int ii,jj; 3214 3214 for(ii=1;ii<=size(pr)/2;ii++) … … 3230 3230 } 3231 3231 } 3232 } 3232 } 3233 3233 } 3234 3234 … … 3237 3237 { 3238 3238 def r=basering; 3239 3239 3240 3240 int j,k; 3241 3241 map phi; 3242 3242 poly p; 3243 3243 3244 3244 ideal iwork=i; 3245 3245 ideal imap1=maxideal(1); 3246 3246 ideal imap2=maxideal(1); 3247 3247 3248 3248 3249 3249 for(j=1;j<=nvars(basering);j++) … … 3260 3260 iwork[k]=var(j); 3261 3261 imap1=maxideal(1); 3262 imap2[j]=-p; 3262 imap2[j]=-p; 3263 3263 break; 3264 3264 } … … 3268 3268 } 3269 3269 3270 3270 3271 3271 /////////////////////////////////////////////////////// 3272 3272 // ini_mod … … 3866 3866 } 3867 3867 } 3868 3868 dimSP=dim(SP); 3869 3869 for(j=size(m);j>=1; j--) 3870 3870 { … … 4063 4063 { 4064 4064 f=polys[k]; 4065 4065 degf=deg(f); 4066 4066 } 4067 4067 } … … 4273 4273 return(0); 4274 4274 } 4275 4276 4275 4276 4277 4277 proc quotient2(module a,module b) 4278 4278 { … … 4291 4291 setring @newP; 4292 4292 ideal re=imap(@newr,re); 4293 return(re); 4294 } 4295 //Im homogenen Fall system("LaScala",i) verwenden 4293 return(re); 4294 } 4295 //Im homogenen Fall system("LaScala",i) verwenden -
Singular/LIB/primitiv.lib
r30c91f r82716e 1 // $Id: primitiv.lib,v 1. 5 1998-05-05 11:55:35 krueger Exp $1 // $Id: primitiv.lib,v 1.6 1998-05-14 18:45:14 Singular Exp $ 2 2 // author: Martin Lamm, email: lamm@mathematik.uni-kl.de 3 3 // last change: 11.3.98 4 4 /////////////////////////////////////////////////////////////////////////////// 5 version="$Id: primitiv.lib,v 1. 5 1998-05-05 11:55:35 krueger Exp $";5 version="$Id: primitiv.lib,v 1.6 1998-05-14 18:45:14 Singular Exp $"; 6 6 info=" 7 7 LIBRARY: primitiv.lib PROCEDURES FOR FINDING A PRIMITIVE ELEMENT … … 172 172 else { if (find(varnames,"b")==0) { algname="b";} 173 173 else { if (find(varnames,"c")==0) 174 174 { algname="c";} 175 175 else { if (find(varnames,"o")==0) 176 176 { algname="o";} 177 177 else { 178 178 "** Sorry -- could not find a free name for the primitive element."; 179 179 "** Try e.g. a ring without 'a' or 'b' as variable."; 180 180 return(); 181 181 }} 182 182 } … … 245 245 ideal convid=maxideal(1); 246 246 convid[1]=nach_splt3_1(primit)[2]; 247 map convert=splt3,convid; 247 map convert=splt3,convid; 248 248 zwi=convert(zwi); 249 249 setring neuring;